Full Site Editing - Version 2.6

Version Description

  • Correct regressions to the Premium Content block. (https://github.com/Automattic/wp-calypso/pull/45777)
Download this release

Release Info

Developer kwight
Plugin Icon wp plugin Full Site Editing
Version 2.6
Comparing to
See all releases

Code changes from version 2.5 to 2.6

Files changed (31) hide show
  1. block-inserter-modifications/dist/contextual-tips.asset.php +1 -1
  2. block-inserter-modifications/dist/new-blocks-showcase.asset.php +1 -1
  3. common/dist/common.asset.php +1 -1
  4. common/dist/data-stores.asset.php +1 -1
  5. dotcom-fse/dist/dotcom-fse.asset.php +1 -1
  6. editor-gutenboarding-launch/dist/editor-gutenboarding-launch.asset.php +1 -1
  7. editor-site-launch/dist/editor-site-launch.asset.php +1 -1
  8. editor-site-launch/dist/editor-site-launch.js +1 -1
  9. event-countdown-block/dist/event-countdown-block.asset.php +1 -1
  10. full-site-editing-plugin.php +2 -2
  11. global-styles/dist/global-styles.asset.php +1 -1
  12. jetpack-timeline/dist/jetpack-timeline.asset.php +1 -1
  13. newspack-blocks/dist/blog-posts-block-editor.asset.php +1 -1
  14. newspack-blocks/dist/blog-posts-block-editor.js +1 -1
  15. newspack-blocks/dist/blog-posts-block-view.asset.php +1 -1
  16. newspack-blocks/dist/blog-posts-block-view.js +1 -1
  17. newspack-blocks/dist/carousel-block-editor.asset.php +1 -1
  18. newspack-blocks/dist/carousel-block-view.asset.php +1 -1
  19. posts-list-block/dist/posts-list-block.asset.php +1 -1
  20. premium-content/blocks/buttons/edit.js +37 -5
  21. premium-content/blocks/buttons/index.js +1 -1
  22. premium-content/blocks/container/edit.js +6 -8
  23. premium-content/blocks/logged-out-view/edit.js +31 -73
  24. premium-content/blocks/subscriber-view/edit.js +28 -49
  25. premium-content/dist/premium-content.asset.php +1 -1
  26. premium-content/dist/premium-content.js +3 -3
  27. premium-content/subscription-service/class-token-subscription-service.php +93 -26
  28. readme.txt +4 -1
  29. starter-page-templates/dist/starter-page-templates.asset.php +1 -1
  30. wpcom-block-editor-nav-sidebar/dist/wpcom-block-editor-nav-sidebar.asset.php +1 -1
  31. wpcom-block-editor-nux/dist/wpcom-block-editor-nux.asset.php +1 -1
block-inserter-modifications/dist/contextual-tips.asset.php CHANGED
@@ -1 +1 @@
1
- <?php return array('dependencies' => array('lodash', 'wp-block-editor', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-i18n', 'wp-plugins', 'wp-polyfill'), 'version' => 'd207b0e9b9f0f685b37eb8e68396c755');
1
+ <?php return array('dependencies' => array('lodash', 'wp-block-editor', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-i18n', 'wp-plugins', 'wp-polyfill'), 'version' => '3ae0322d84ac22e73d84af9eaca92422');
block-inserter-modifications/dist/new-blocks-showcase.asset.php CHANGED
@@ -1 +1 @@
1
- <?php return array('dependencies' => array('wp-blocks', 'wp-hooks', 'wp-i18n', 'wp-polyfill'), 'version' => '17c276b7d12d336093b98a2149002811');
1
+ <?php return array('dependencies' => array('wp-blocks', 'wp-hooks', 'wp-i18n', 'wp-polyfill'), 'version' => '8ab49b0d23657e78fd0e22e8c920fe8d');
common/dist/common.asset.php CHANGED
@@ -1 +1 @@
1
- <?php return array('dependencies' => array('wp-polyfill'), 'version' => 'dc619f414a4b79033366b2905800580f');
1
+ <?php return array('dependencies' => array('wp-polyfill'), 'version' => 'f3ae1d033b15871fbaa83621a8b0e9ed');
common/dist/data-stores.asset.php CHANGED
@@ -1 +1 @@
1
- <?php return array('dependencies' => array('react', 'wp-compose', 'wp-data', 'wp-data-controls', 'wp-polyfill'), 'version' => 'c7e3fd8ab048b2a21140d84bc7fac61c');
1
+ <?php return array('dependencies' => array('react', 'wp-compose', 'wp-data', 'wp-data-controls', 'wp-polyfill'), 'version' => '6852ca361243ec56a1ceab39db2a48f2');
dotcom-fse/dist/dotcom-fse.asset.php CHANGED
@@ -1 +1 @@
1
- <?php return array('dependencies' => array('lodash', 'react-dom', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-dom-ready', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-plugins', 'wp-polyfill', 'wp-server-side-render', 'wp-url'), 'version' => 'a90c0f1973eae4a1ea86922ad1470192');
1
+ <?php return array('dependencies' => array('lodash', 'react-dom', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-dom-ready', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-plugins', 'wp-polyfill', 'wp-server-side-render', 'wp-url'), 'version' => 'a2246322a2a22b088a6f92f3a712eb5d');
editor-gutenboarding-launch/dist/editor-gutenboarding-launch.asset.php CHANGED
@@ -1 +1 @@
1
- <?php return array('dependencies' => array('a8c-fse-common-data-stores', 'lodash', 'wp-data', 'wp-dom-ready', 'wp-editor', 'wp-hooks', 'wp-i18n', 'wp-polyfill'), 'version' => '3845fbbadd9a620f1b098e976b7ba6d3');
1
+ <?php return array('dependencies' => array('a8c-fse-common-data-stores', 'lodash', 'wp-data', 'wp-dom-ready', 'wp-editor', 'wp-hooks', 'wp-i18n', 'wp-polyfill'), 'version' => '362f78b8339b5f5478cd9c10adbc2ebc');
editor-site-launch/dist/editor-site-launch.asset.php CHANGED
@@ -1 +1 @@
1
- <?php return array('dependencies' => array('a8c-fse-common-data-stores', 'lodash', 'react', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-data-controls', 'wp-element', 'wp-i18n', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => '45de1ad34faaaa53411635aabd682ee7');
1
+ <?php return array('dependencies' => array('a8c-fse-common-data-stores', 'lodash', 'react', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-data-controls', 'wp-element', 'wp-i18n', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => '7f11dba146e588f08f17024192500dd6');
editor-site-launch/dist/editor-site-launch.js CHANGED
@@ -52,4 +52,4 @@ object-assign
52
  *
53
  * This source code is licensed under the MIT license found in the
54
  * LICENSE file in the root directory of this source tree.
55
- */var r="function"==typeof Symbol&&Symbol.for,i=r?Symbol.for("react.element"):60103,o=r?Symbol.for("react.portal"):60106,a=r?Symbol.for("react.fragment"):60107,c=r?Symbol.for("react.strict_mode"):60108,s=r?Symbol.for("react.profiler"):60114,l=r?Symbol.for("react.provider"):60109,u=r?Symbol.for("react.context"):60110,d=r?Symbol.for("react.async_mode"):60111,p=r?Symbol.for("react.concurrent_mode"):60111,m=r?Symbol.for("react.forward_ref"):60112,f=r?Symbol.for("react.suspense"):60113,h=r?Symbol.for("react.suspense_list"):60120,b=r?Symbol.for("react.memo"):60115,g=r?Symbol.for("react.lazy"):60116,v=r?Symbol.for("react.block"):60121,y=r?Symbol.for("react.fundamental"):60117,x=r?Symbol.for("react.responder"):60118,_=r?Symbol.for("react.scope"):60119;function w(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case i:switch(e=e.type){case d:case p:case a:case s:case c:case f:return e;default:switch(e=e&&e.$$typeof){case u:case m:case g:case b:case l:return e;default:return t}}case o:return t}}}function O(e){return w(e)===p}t.AsyncMode=d,t.ConcurrentMode=p,t.ContextConsumer=u,t.ContextProvider=l,t.Element=i,t.ForwardRef=m,t.Fragment=a,t.Lazy=g,t.Memo=b,t.Portal=o,t.Profiler=s,t.StrictMode=c,t.Suspense=f,t.isAsyncMode=function(e){return O(e)||w(e)===d},t.isConcurrentMode=O,t.isContextConsumer=function(e){return w(e)===u},t.isContextProvider=function(e){return w(e)===l},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===i},t.isForwardRef=function(e){return w(e)===m},t.isFragment=function(e){return w(e)===a},t.isLazy=function(e){return w(e)===g},t.isMemo=function(e){return w(e)===b},t.isPortal=function(e){return w(e)===o},t.isProfiler=function(e){return w(e)===s},t.isStrictMode=function(e){return w(e)===c},t.isSuspense=function(e){return w(e)===f},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===a||e===p||e===s||e===c||e===f||e===h||"object"==typeof e&&null!==e&&(e.$$typeof===g||e.$$typeof===b||e.$$typeof===l||e.$$typeof===u||e.$$typeof===m||e.$$typeof===y||e.$$typeof===x||e.$$typeof===_||e.$$typeof===v)},t.typeOf=w},function(e,t,n){},function(e,t,n){"use strict";var r=n(99);function i(){}function o(){}o.resetWarningCache=i,e.exports=function(){function e(e,t,n,i,o,a){if(a!==r){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:o,resetWarningCache:i};return n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){"use strict";n.r(t);n(61);var r="automattic/site",i="automattic/launch",o="automattic/onboard/plans",a=n(1),c=n(4),s=n(35),l=n(11),u=n.n(l),d=n(0),p=n.n(d),m=n(13),f=n(5),h=n(6);function b(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function g(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function v(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}var y=function(e){var t=e.icon,n=e.size,r=void 0===n?24:n,i=g(e,["icon","size"]);return Object(a.cloneElement)(t,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?v(Object(n),!0).forEach((function(t){b(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):v(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({width:r,height:r},i))},x=n(8),_=Object(a.createElement)(x.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},Object(a.createElement)(x.Path,{d:"M20 10c0-5.51-4.49-10-10-10C4.48 0 0 4.49 0 10c0 5.52 4.48 10 10 10 5.51 0 10-4.48 10-10zM7.78 15.37L4.37 6.22c.55-.02 1.17-.08 1.17-.08.5-.06.44-1.13-.06-1.11 0 0-1.45.11-2.37.11-.18 0-.37 0-.58-.01C4.12 2.69 6.87 1.11 10 1.11c2.33 0 4.45.87 6.05 2.34-.68-.11-1.65.39-1.65 1.58 0 .74.45 1.36.9 2.1.35.61.55 1.36.55 2.46 0 1.49-1.4 5-1.4 5l-3.03-8.37c.54-.02.82-.17.82-.17.5-.05.44-1.25-.06-1.22 0 0-1.44.12-2.38.12-.87 0-2.33-.12-2.33-.12-.5-.03-.56 1.2-.06 1.22l.92.08 1.26 3.41zM17.41 10c.24-.64.74-1.87.43-4.25.7 1.29 1.05 2.71 1.05 4.25 0 3.29-1.73 6.24-4.4 7.78.97-2.59 1.94-5.2 2.92-7.78zM6.1 18.09C3.12 16.65 1.11 13.53 1.11 10c0-1.3.23-2.48.72-3.59C3.25 10.3 4.67 14.2 6.1 18.09zm4.03-6.63l2.58 6.98c-.86.29-1.76.45-2.71.45-.79 0-1.57-.11-2.29-.33.81-2.38 1.62-4.74 2.42-7.1z"})),w=Object(a.createElement)(x.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(a.createElement)(x.Path,{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"})),O=n(7),E=n.n(O),k=n(10),S=n.n(k),j=(n(70),function(e){var t=e.children;return d.createElement("h1",{className:"onboarding-title"},t)}),C=function(e){var t=e.children;return d.createElement("h2",{className:"onboarding-subtitle"},t)},N=n(2),P=n(14),A=d.createContext(L()),T=function(){return d.useContext(A)};Object(P.createHigherOrderComponent)((function(e){return function(t){var n=T();return d.createElement(e,Object(N.a)({},n,t))}}),"withI18n");function L(e){var t,n,r=Object(f.createI18n)(e),i=null!==(n=null===(t=null==e?void 0:e[""])||void 0===t?void 0:t.localeSlug)&&void 0!==n?n:"en";return{__:r.__.bind(r),_n:r._n.bind(r),_nx:r._nx.bind(r),_x:r._x.bind(r),isRTL:r.isRTL.bind(r),i18nLocale:i}}n(71);var F=function(e){var t=e.className,n=e.children;return d.createElement("div",{className:E()("action-buttons",t)},n)},M=function(e){var t=e.className,n=e.children,r=Object(N.f)(e,["className","children"]),i=T().__;return d.createElement(h.Button,Object(N.a)({className:E()("action_buttons__button action-buttons__next",t),isPrimary:!0},r),n||i("Continue"))},D=(n(65),function(e){var t=e.className,n=e.children;return Object(a.createElement)("div",{className:E()("nux-launch-step",t)},n)});function R(){var e,t,n=Object(c.useSelect)((function(e){return e(r).getSite(window._currentSiteId)})),i=Object(c.useSelect)((function(e){return e(r).isLaunched(window._currentSiteId)}));return{isPaidPlan:n&&!(null===(e=n.plan)||void 0===e?void 0:e.is_free),launchStatus:i,currentDomainName:(null==n?void 0:n.URL)&&new URL(null==n?void 0:n.URL).hostname,selectedFeatures:null==n||null===(t=n.options)||void 0===t?void 0:t.selected_features}}var B=n(19),I=n.n(B),z=n(15),U=n.n(z),H=n(36),$=n.n(H),V=n(37);function q(){var e,t=Object(c.useSelect)((function(e){return e(i).getState()})).domainSearch,n=Object(m.useEntityProp)("root","site","title"),r=u()(n,1)[0],o=R().currentDomainName,a=t.trim()||r;a&&a!==Object(f.__)("Site Title","full-site-editing")||(a=null!==(e=null==o?void 0:o.split(".")[0])&&void 0!==e?e:"");return a}n(69);var G=function(e){var t=e.onNextStep,n=function(){var e=Object(c.useSelect)((function(e){return e(i).getSelectedDomain()})),t=Object(c.useDispatch)(i).setDomainSearch,n=Object(m.useEntityProp)("root","site","title"),r=u()(n,2),o=r[0],a=r[1],s=Object(c.useDispatch)("core").saveEditedEntityRecord;return{title:o,updateTitle:a,saveTitle:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:o;a(n.trim()),s("root","site"),!e&&t(n)}}}(),r=n.title,o=n.updateTitle,s=n.saveTitle,l=function(){s(),null==t||t()};return Object(a.createElement)(D,{className:"nux-launch-name-step"},Object(a.createElement)("div",{className:"nux-launch-step__header"},Object(a.createElement)("div",null,Object(a.createElement)(j,null,Object(f.__)("Name your site","full-site-editing")),Object(a.createElement)(C,null,Object(f.__)("Pick a name for your site.","full-site-editing"))),Object(a.createElement)(F,null,Object(a.createElement)(M,{onClick:l,disabled:!(null==r?void 0:r.trim())}))),Object(a.createElement)("div",{className:"nux-launch-step__body"},Object(a.createElement)("form",{onSubmit:l},Object(a.createElement)(h.TextControl,{id:"nux-launch-step__input",className:"nux-launch-step__input",onChange:o,onBlur:function(){return s()},value:r,spellCheck:!1,autoComplete:"off",placeholder:Object(f.__)("Enter site name","full-site-editing"),autoCorrect:"off","data-hj-whitelist":!0}),Object(a.createElement)("p",{className:"nux-launch-step__input-hint"},Object(a.createElement)(h.Tip,{size:18}),Object(a.createElement)("span",null,Object(f.__)("Don't worry, you can change it later.","full-site-editing"))))))},Y=n(12);function W(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}var K=function(e){var t=e.icon,n=e.size,r=void 0===n?24:n,i=g(e,["icon","size"]);return Object(a.cloneElement)(t,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?W(Object(n),!0).forEach((function(t){b(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):W(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({width:r,height:r},i))},X=Object(a.createElement)(x.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(a.createElement)(x.Path,{d:"M13.5 6C10.5 6 8 8.5 8 11.5c0 1.1.3 2.1.9 3l-3.4 3 1 1.1 3.4-2.9c1 .9 2.2 1.4 3.6 1.4 3 0 5.5-2.5 5.5-5.5C19 8.5 16.5 6 13.5 6zm0 9.5c-2.2 0-4-1.8-4-4s1.8-4 4-4 4 1.8 4 4-1.8 4-4 4z"})),Z=n(9),J=n.n(Z),Q=J()("calypso:analytics");n(38);"undefined"!=typeof window&&window.addEventListener("popstate",(function(){null}));n(25);var ee=n(20),te=J()("lib/load-script/callback-handler"),ne=new Map;function re(){return ne}function ie(e){return re().has(e)}function oe(e,t){var n=re();ie(e)?(te('Adding a callback for an existing script from "'.concat(e,'"')),n.get(e).add(t)):(te('Adding a callback for a new script from "'.concat(e,'"')),n.set(e,new Set([t])))}function ae(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=re(),r=n.get(e);if(r){var i='Executing callbacks for "'.concat(e,'"')+(null===t?" with success":' with error "'.concat(t,'"'));te(i),r.forEach((function(e){"function"==typeof e&&e(t)})),n.delete(e)}}function ce(){var e=this.getAttribute("src");te('Handling successful request for "'.concat(e,'"')),ae(e),this.onload=null}function se(){var e=this.getAttribute("src");te('Handling failed request for "'.concat(e,'"')),ae(e,new Error('Failed to load script "'.concat(e,'"'))),this.onerror=null}var le=J()("lib/load-script/dom-operations");J()("package/load-script");function ue(e,t){var n;if(!ie(e)&&(n=function(e){le('Creating script element for "'.concat(e,'"'));var t=document.createElement("script");return t.src=e,t.type="text/javascript",t.async=!0,t.onload=ce,t.onerror=se,t}(e),le("Attaching element to head"),document.head.appendChild(n)),"function"!=typeof t)return new Promise((function(t,n){oe(e,(function(e){null===e?t():n(e)}))}));oe(e,t)}var de,pe=["a8c_cookie_banner_ok","wcadmin_storeprofiler_create_jetpack_account","wcadmin_storeprofiler_connect_store","wcadmin_storeprofiler_login_jetpack_account","wcadmin_storeprofiler_payment_login","wcadmin_storeprofiler_payment_create_account"];Promise.resolve();function me(e){"undefined"!=typeof window&&(window._tkq=window._tkq||[],window._tkq.push(e))}"undefined"!=typeof document&&ue("//stats.wp.com/w.js?61");var fe=new ee.EventEmitter;function he(e,t){if(Q('Record event "%s" called with props %o',e,t=t||{}),e.startsWith("calypso_")||Object(Y.includes)(pe,e)){if(de){var n=de(t);t=Object(N.a)(Object(N.a)({},t),n)}t=Object(Y.omitBy)(t,Y.isUndefined),Q('Recording event "%s" with actual props %o',e,t),me(["recordEvent",e,t]),fe.emit("record-event",e,t)}else Q('- Event name must be prefixed by "calypso_" or added to `EVENT_NAME_EXCEPTIONS`')}var be="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto),ge=new Uint8Array(16);function ve(){if(!be)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return be(ge)}for(var ye=[],xe=0;xe<256;++xe)ye[xe]=(xe+256).toString(16).substr(1);var _e=function(e,t){var n=t||0,r=ye;return[r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]]].join("")};var we=function(e,t,n){var r=t&&n||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var i=(e=e||{}).random||(e.rng||ve)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,t)for(var o=0;o<16;++o)t[r+o]=i[o];return t||_e(i)};var Oe=Object(a.createElement)(x.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(a.createElement)(x.Path,{d:"M12 3.2c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8 0-4.8-4-8.8-8.8-8.8zm0 16c-4 0-7.2-3.3-7.2-7.2C4.8 8 8 4.8 12 4.8s7.2 3.3 7.2 7.2c0 4-3.2 7.2-7.2 7.2zM11 17h2v-6h-2v6zm0-8h2V7h-2v2z"})),Ee=(n(77),function(e){var t=e.children,n=e.className,r=e.id,i=e.position,o=void 0===i?"bottom center":i,a=e.noArrow,c=void 0===a||a,s=Object(d.useState)(!1),l=s[0],u=s[1];return p.a.createElement(h.Button,{icon:Oe,onClick:function(){u(!l)},className:"info-tooltip","data-testid":"info-tooltip"},l&&p.a.createElement(h.Popover,{id:r,className:E()("info-tooltip__content",n),onClose:function(){u(!1)},position:o,noArrow:c},t))}),ke=function(e){var t=e.domain,n=e.cost,r=e.railcarId,i=e.hstsRequired,o=void 0!==i&&i,c=e.isFree,s=void 0!==c&&c,l=e.isExistingSubdomain,u=void 0!==l&&l,m=e.isRecommended,h=void 0!==m&&m,b=e.onSelect,g=e.onRender,v=e.selected,y=T().__,x=Object(P.useViewportMatch)("small","<"),_=t.indexOf("."),w=t.slice(0,_),O=t.slice(_),k=Object(d.useState)(),S=k[0],j=k[1],C=Object(d.useState)(),N=C[0],A=C[1],L=we();Object(d.useEffect)((function(){t!==S&&N!==r&&r&&(g(),j(t),A(r))}),[t,S,N,r,g]);return p.a.createElement("label",{className:E()("domain-picker__suggestion-item",{"is-free":s,"is-selected":v})},p.a.createElement("input",{"aria-labelledby":L,className:"domain-picker__suggestion-radio-button",type:"radio",name:"domain-picker-suggestion-option",onChange:function(){N&&function(e){he("calypso_traintracks_interact",{railcar:e.railcarId,action:e.action})}({action:"domain_selected",railcarId:N}),b(t)},checked:v}),p.a.createElement("div",{className:"domain-picker__suggestion-item-name"},p.a.createElement("div",{className:"domain-picker__suggestion-item-name-inner"},p.a.createElement("span",{className:"domain-picker__domain-name"},w),p.a.createElement("span",{className:E()("domain-picker__domain-tld",{"with-margin":!o})},O),o&&p.a.createElement(Ee,{position:x?"bottom center":"middle right",noArrow:!1,className:"domain-picker__info-tooltip"},Object(a.createInterpolateElement)(y("All domains ending with <tld /> require an SSL certificate to host a website. When you host this domain at WordPress.com an SSL certificate is included. <learn_more_link>Learn more</learn_more_link>"),{tld:p.a.createElement("b",null,O),learn_more_link:p.a.createElement("a",{target:"_blank",rel:"noreferrer",href:"https://wordpress.com/support/https-ssl"})})),h&&p.a.createElement("div",{className:"domain-picker__badge is-recommended"},y("Recommended"))),u&&p.a.createElement("div",{className:"domain-picker__change-subdomain-tip"},y("You can change your free subdomain later under Domain Settings."))),p.a.createElement("div",{className:E()("domain-picker__price",{"is-paid":!s})},s?y("Free"):p.a.createElement(p.a.Fragment,null,p.a.createElement("span",{className:"domain-picker__price-inclusive"}," ",y("Included in plans")," "),p.a.createElement("span",{className:"domain-picker__price-cost"},Object(f.sprintf)(y("%s/year"),n)))))},Se=function(){return p.a.createElement("div",{className:"domain-picker__suggestion-item placeholder"},p.a.createElement("div",{className:"domain-picker__suggestion-item-name placeholder"}),p.a.createElement("div",{className:"domain-picker__price placeholder"}))};function je(e,t){return e===t}function Ce(e,t,n){var r=n&&n.equalityFn?n.equalityFn:je,i=Object(d.useState)(e),o=i[0],a=i[1],c=function(e,t,n){void 0===n&&(n={});var r=n.maxWait,i=Object(d.useRef)(null),o=Object(d.useRef)([]),a=n.leading,c=Object(d.useRef)(!1),s=Object(d.useRef)(null),l=Object(d.useRef)(!1),u=Object(d.useRef)(e);u.current=e;var p=Object(d.useCallback)((function(){clearTimeout(s.current),clearTimeout(i.current),i.current=null,o.current=[],s.current=null,c.current=!1}),[]);return Object(d.useEffect)((function(){return function(){l.current=!0}}),[]),[Object(d.useCallback)((function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(o.current=e,clearTimeout(s.current),!s.current&&a&&!c.current)return u.current.apply(u,e),void(c.current=!0);s.current=setTimeout((function(){p(),l.current||u.current.apply(u,e)}),t),r&&!i.current&&(i.current=setTimeout((function(){var e=o.current;p(),l.current||u.current.apply(null,e)}),r))}),[r,t,p,a]),p,function(){s.current&&(u.current.apply(null,o.current),p())}]}(Object(d.useCallback)((function(e){return a(e)}),[]),t,n),s=c[0],l=c[1],u=Object(d.useRef)(e);return Object(d.useEffect)((function(){r(u.current,e)||(s(e),u.current=e)}),[e,s,r]),[o,l]}var Ne="automattic/domains/suggestions";var Pe=Object(a.createElement)(x.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(a.createElement)(x.Path,{d:"M17 9.4L12 14 7 9.4l-1 1.2 6 5.4 6-5.4z"})),Ae=(n(76),function(e){var t=e.onSelect,n=e.selected,r=T().__,i=Object(a.useState)(!1),o=i[0],s=i[1],l=function(e){s(!1),t(e)},u=Object(c.useSelect)((function(e){return e(Ne).getCategories()}));return d.createElement("div",{className:E()("domain-categories",{"is-open":o})},d.createElement(h.Button,{className:"domain-categories__dropdown-button",onClick:function(){return s(!o)}},d.createElement("span",null,n||r("All Categories")),d.createElement(K,{icon:Pe,size:16})),d.createElement("ul",{className:"domain-categories__item-group"},d.createElement("li",{className:E()("domain-categories__item",{"is-selected":!n})},d.createElement(h.Button,{onClick:function(){return l()}},r("View all"))),u.map((function(e){var t=e.slug,r=e.title;return d.createElement("li",{key:t,className:E()("domain-categories__item",{"is-selected":t===n})},d.createElement(h.Button,{onClick:function(){return l(t)}},r))}))))}),Te=function(){return p.a.createElement("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 300 40",xmlSpace:"preserve",width:"300"},p.a.createElement("rect",{x:"0",width:"310",height:"50",rx:"10",fill:"#D8D8D8"}),p.a.createElement("rect",{x:"8",y:"8",width:"25",height:"25",rx:"5",fill:"#fff"}),p.a.createElement("rect",{x:"40",y:"8",width:"25",height:"25",rx:"5",fill:"#fff"}),p.a.createElement("rect",{x:"72",y:"8",width:"300",height:"25",rx:"5",fill:"#fff"}),p.a.createElement("text",{x:"80",y:"26",fill:"#999"},"https://"),p.a.createElement("text",{x:"133",y:"26",fill:"#515151"},"example.com"))},Le=(n(75),function(e){var t=e.groupItems,n=e.children;return t?p.a.createElement("div",{className:"domain-picker__suggestion-item-group"},n):p.a.createElement(p.a.Fragment,null,n)}),Fe=function(e){var t,n,r=e.header,i=e.showDomainCategories,o=e.onDomainSelect,a=e.onExistingSubdomainSelect,s=e.quantity,l=void 0===s?5:s,u=e.quantityExpanded,m=void 0===u?10:u,f=e.onDomainSearchBlur,b=e.analyticsFlowId,g=e.analyticsUiAlgo,v=e.initialDomainSearch,y=void 0===v?"":v,x=e.onSetDomainSearch,_=e.currentDomain,w=e.existingSubdomain,O=e.segregateFreeAndPaid,E=void 0!==O&&O,k=T().__,S=k("Search for a domain"),j=Object(d.useState)(!1),C=j[0],N=j[1],P=Object(d.useState)(y),A=P[0],L=P[1],F=Object(d.useState)(),M=F[0],D=F[1],R=Object(c.useSelect)((function(e){return e(Ne).getDomainSuggestionVendor()})),B=function(e,t,n,r){void 0===e&&(e=""),void 0===r&&(r="en");var i=Ce(e,300)[0];return Object(c.useSelect)((function(e){if(i&&!(i.length<2))return e(Ne).getDomainSuggestions(i,{include_wordpressdotcom:!0,include_dotblogsubdomain:!1,quantity:t+1,locale:r,category_slug:n})}),[i,n,t])}(A.trim(),m,M,T().i18nLocale),I=null==B?void 0:B.slice(w?1:0,C?m:l);Object(d.useEffect)((function(){N(!1)}),[A]);var z=Object(d.useState)(),U=z[0],H=z[1];Object(d.useEffect)((function(){var e;B&&H((void 0===(e="suggestion")&&(e="recommendation"),we().replace(/-/g,"")+"-"+e))}),[B,H]);var $=function(e,t,n,r){!function(e){he("calypso_traintracks_render",{railcar:e.railcarId,ui_algo:e.uiAlgo,ui_position:e.uiPosition,fetch_algo:e.fetchAlgo,rec_result:e.result,fetch_query:e.query})}({uiAlgo:"/"+b+"/"+g,fetchAlgo:"/domains/search/"+R+"/"+b+(M?"/"+M:""),query:A,railcarId:t,result:r?e+"#recommended":e,uiPosition:n})};return p.a.createElement("div",{className:"domain-picker"},r&&r,p.a.createElement("div",{className:"domain-picker__search"},p.a.createElement("div",{className:"domain-picker__search-icon"},p.a.createElement(K,{icon:X})),p.a.createElement(h.TextControl,{"data-hj-whitelist":!0,hideLabelFromVision:!0,label:S,placeholder:S,onChange:function(e){L(e),x(e)},onBlur:function(e){f&&f(e.currentTarget.value)},value:A})),(null===(t=A.trim())||void 0===t?void 0:t.length)>1?p.a.createElement("div",{className:"domain-picker__body"},i&&p.a.createElement("div",{className:"domain-picker__aside"},p.a.createElement(Ae,{selected:M,onSelect:D})),p.a.createElement("div",{className:"domain-picker__suggestion-sections"},p.a.createElement(p.a.Fragment,null,E&&p.a.createElement("p",{className:"domain-picker__suggestion-group-label"},k("Keep sub-domain")),p.a.createElement(Le,{groupItems:E},w&&p.a.createElement(ke,{key:w,domain:w,cost:"Free",isFree:!0,isExistingSubdomain:!0,railcarId:U?""+U+0:void 0,onRender:function(){return $(w,""+U+0,0,!1)},selected:_===w,onSelect:function(){null==a||a(w)}})),E&&p.a.createElement("p",{className:"domain-picker__suggestion-group-label"},k("Professional domains")),p.a.createElement(Le,{groupItems:E},null!==(n=null==I?void 0:I.map((function(e,t){var n=w?t+1:t,r=1===n;return p.a.createElement(ke,{key:e.domain_name,domain:e.domain_name,cost:e.cost,hstsRequired:e.hsts_required,isFree:e.is_free,isRecommended:r,railcarId:U?""+U+n:void 0,onRender:function(){return $(e.domain_name,""+U+n,n,r)},onSelect:function(){o(e)},selected:_===e.domain_name})})))&&void 0!==n?n:Object(Y.times)(l,(function(e){return p.a.createElement(Se,{key:e})})))),!C&&(null==B?void 0:B.length)&&(null==B?void 0:B.length)>l&&p.a.createElement("div",{className:"domain-picker__show-more"},p.a.createElement(h.Button,{onClick:function(){return N(!0)},isLink:!0},k("View more results"))))):p.a.createElement("div",{className:"domain-picker__empty-state"},p.a.createElement("p",{className:"domain-picker__empty-state--text"},k("A domain name is the site address people type in their browser to visit your site.")),p.a.createElement("div",null,p.a.createElement(Te,null))))},Me="gutenboarding",De=(n(74),function(e){var t=e.onNextStep,n=Object(c.useSelect)((function(e){return e(i).getState()})),r=n.plan,o=n.domain,s=R().currentDomainName,l=q(),u=Object(c.useDispatch)(i),d=u.setDomain,p=u.unsetDomain,m=u.setDomainSearch,h=u.unsetPlan,b=u.confirmDomainSelection;return Object(a.createElement)(D,{className:"nux-launch-domain-step"},Object(a.createElement)("div",{className:"nux-launch-step__header"},Object(a.createElement)("div",null,Object(a.createElement)(j,null,Object(f.__)("Choose a domain","full-site-editing")),Object(a.createElement)(C,null,Object(f.__)("Free for the first year with any paid plan.","full-site-editing"))),Object(a.createElement)(F,null,Object(a.createElement)(M,{onClick:function(){b(),null==t||t()},disabled:!l}))),Object(a.createElement)("div",{className:"nux-launch-step__body"},Object(a.createElement)(Fe,{analyticsFlowId:Me,initialDomainSearch:l,onSetDomainSearch:m,onDomainSearchBlur:function(e){he("calypso_newsite_domain_search_blur",{flow:Me,query:e,where:"editor_domain_modal"})},currentDomain:(null==o?void 0:o.domain_name)||s,existingSubdomain:s,onDomainSelect:function(e){b(),d(e),(null==r?void 0:r.isFree)&&h()},onExistingSubdomainSelect:function(){p()},analyticsUiAlgo:"editor_domain_modal",segregateFreeAndPaid:!0})))}),Re=n(39),Be=Object(a.createElement)(x.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(a.createElement)(x.Path,{d:"M9 18.6L3.5 13l1-1L9 16.4l9.5-9.9 1 1z"})),Ie=Object(a.createElement)(x.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(a.createElement)(x.Path,{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"})),ze=(n(81),p.a.createElement(K,{icon:Be,size:17})),Ue=p.a.createElement(K,{icon:Ie,size:17}),He=p.a.createElement("svg",{width:"8",viewBox:"0 0 8 4"},p.a.createElement("path",{d:"M0 0 L8 0 L4 4 L0 0",fill:"currentColor"}));var $e=function(e){var t=e.features,n=e.domain,r=e.isFree,i=void 0!==r&&r,o=e.isOpen,c=void 0!==o&&o,s=e.onPickDomain,l=e.disabledLabel,u=e.multiColumn,d=void 0!==u&&u,m=function(e,t,n){return{NO_DOMAIN:{FREE_PLAN:null,PAID_PLAN:{className:"plans-feature-list__domain-summary is-cta",icon:ze,domainMessage:p.a.createElement(p.a.Fragment,null,n("Pick a free domain (1 year)")," ",He)}},FREE_DOMAIN:{FREE_PLAN:null,PAID_PLAN:{className:"plans-feature-list__domain-summary is-cta",icon:ze,domainMessage:p.a.createElement(p.a.Fragment,null,n("Pick a free domain (1 year)")," ",He)}},PAID_DOMAIN:{FREE_PLAN:{className:"plans-feature-list__domain-summary is-free",icon:Ue,domainMessage:p.a.createElement("span",null,Object(a.createInterpolateElement)(n("<url /> is not included"),{url:p.a.createElement("span",{className:"plans-feature-list__item-url"},null==t?void 0:t.domain_name)}))},PAID_PLAN:{className:"plans-feature-list__domain-summary is-picked",icon:ze,domainMessage:p.a.createElement("span",null,Object(a.createInterpolateElement)(n("<url /> is included"),{url:p.a.createElement("span",{className:"plans-feature-list__item-url"},null==t?void 0:t.domain_name)}))}}}[t&&(t.is_free?"FREE_DOMAIN":"PAID_DOMAIN")||"NO_DOMAIN"][e?"FREE_PLAN":"PAID_PLAN"]}(i,n,T().__);return p.a.createElement("div",{className:"plans-feature-list",hidden:!c},p.a.createElement("ul",{className:E()("plans-feature-list__item-group",{"plans-feature-list__item-group--columns":d})},l?p.a.createElement("li",{className:"plans-feature-list__item plans-feature-list__item--disabled-message"},Ue," ",p.a.createElement("span",null,l)):m&&p.a.createElement("li",{className:"plans-feature-list__item"},p.a.createElement(h.Button,{className:m.className,onClick:s,isLink:!0},m.icon,m.domainMessage)),t.map((function(e,t){return p.a.createElement("li",{key:t,className:"plans-feature-list__item"},ze," ",p.a.createElement("span",null,e))}))))},Ve=d.createElement("svg",{width:"8",viewBox:"0 0 8 4"},d.createElement("path",{d:"M0 0 L8 0 L4 4 L0 0",fill:"currentColor"})),qe=function(e){var t=e.slug,n=e.name,r=e.price,i=e.isPopular,o=void 0!==i&&i,a=e.isFree,c=void 0!==a&&a,s=e.domain,l=e.features,u=e.onSelect,p=e.onPickDomainClick,m=e.onToggleExpandAll,f=e.allPlansExpanded,b=e.disabledLabel,g=T().__,v=d.useState(!1),y=v[0],x=v[1],_=Object(P.useViewportMatch)("mobile",">=");d.useEffect((function(){x(f)}),[f]);var w=f||_||o||y;return d.createElement("div",{className:E()("plan-item",{"is-popular":o,"is-open":w})},o&&d.createElement("span",{className:"plan-item__badge"},g("Popular")),d.createElement("div",{className:E()("plan-item__viewport",{"is-popular":o})},d.createElement("div",{className:"plan-item__details"},d.createElement("div",{tabIndex:0,role:"button",onClick:function(){return x((function(e){return!e}))},onKeyDown:function(e){return 32===e.keyCode&&x((function(e){return!e}))},className:"plan-item__summary"},d.createElement("div",{className:"plan-item__heading"},d.createElement("div",{className:"plan-item__name"},n)),d.createElement("div",{className:"plan-item__price"},d.createElement("div",{className:E()("plan-item__price-amount",{"is-loading":!r})},r||" ")),!w&&d.createElement("div",{className:"plan-item__dropdown-chevron"},Ve)),d.createElement("div",{hidden:!w},d.createElement("div",{className:"plan-item__price-note"},g(c?"free forever":"per month, billed yearly")),d.createElement("div",{className:"plan-item__actions"},d.createElement(h.Button,{className:"plan-item__select-button",onClick:function(){u(t)},isPrimary:!0,disabled:!!b},d.createElement("span",null,g("Choose")))),d.createElement($e,{features:l,domain:s,isFree:c,isOpen:w,onPickDomain:p,disabledLabel:b})))),o&&!_&&d.createElement(h.Button,{onClick:m,className:"plan-item__mobile-expand-all-plans",isLink:!0},g(f?"Collapse all plans":"Expand all plans")))},Ge="automattic/onboard/plans",Ye=(n(82),function(e){var t=e.selectedPlanSlug,n=e.onPlanSelect,r=e.onPickDomainClick,i=e.currentDomain,o=e.disabledPlans,a=Object(c.useSelect)((function(e){return e(Ge).getSupportedPlans()})),s=Object(c.useSelect)((function(e){return e(Ge).getPrices()})),l=Object(d.useState)(!1),u=l[0],m=l[1];return p.a.createElement("div",{className:"plans-table"},a.map((function(e){var a;return e&&p.a.createElement(qe,{allPlansExpanded:u,key:e.storeSlug,slug:e.storeSlug,domain:i,features:null!==(a=e.features)&&void 0!==a?a:[],isPopular:e.isPopular,isFree:e.isFree,price:s[e.storeSlug],name:null==e?void 0:e.title.toString(),isSelected:e.storeSlug===t,onSelect:n,onPickDomainClick:r,onToggleExpandAll:function(){return m((function(e){return!e}))},disabledLabel:null==o?void 0:o[e.storeSlug]})})))}),We=(n(80),p.a.createElement("svg",{width:"8",viewBox:"0 0 8 4"},p.a.createElement("path",{d:"M0 0 L8 0 L4 4 L0 0",fill:"currentColor"}))),Ke=function(e){var t=e.slug,n=e.name,r=e.description,i=e.price,o=e.features,a=e.domain,c=e.badge,s=e.isFree,l=void 0!==s&&s,u=e.isOpen,d=void 0!==u&&u,m=e.isPrimary,f=void 0!==m&&m,h=e.onSelect,b=e.onPickDomainClick,g=e.onToggle,v=e.disabledLabel,y=T().__,x=function(){!v&&(null==g||g(t,!d))};return p.a.createElement("div",{className:E()("plans-accordion-item",{"is-open":d,"is-primary":f,"has-badge":!!c,"is-disabled":!!v})},c&&p.a.createElement("div",{className:"plans-accordion-item__badge"},p.a.createElement("span",null,c)),p.a.createElement("div",{className:"plans-accordion-item__viewport"},p.a.createElement("div",{className:"plans-accordion-item__details"},p.a.createElement("div",{tabIndex:0,role:"button",onClick:x,onKeyDown:function(e){return 32===e.keyCode&&x()},className:"plans-accordion-item__header"},p.a.createElement("div",{className:"plans-accordion-item__heading"},p.a.createElement("div",{className:"plans-accordion-item__name"},n),p.a.createElement("div",{className:"plans-accordion-item__description"},r)),p.a.createElement("div",{className:"plans-accordion-item__price"},p.a.createElement("div",{className:E()("plans-accordion-item__price-amount",{"is-loading":!i})},i||"  ",i&&p.a.createElement("span",null,y("/mo"))),p.a.createElement("div",{className:"plans-accordion-item__price-note"},y(l?"free forever":"billed annually"))),p.a.createElement("div",{className:"plans-accordion-item__disabled-label"},v),!d&&p.a.createElement("div",{className:"plans-accordion-item__dropdown-chevron"},We)),p.a.createElement("div",{className:"plans-accordion-item__actions",hidden:!d},p.a.createElement(M,{onClick:function(){h(t)}},y("Select"))),p.a.createElement($e,{features:o,domain:a,isFree:l,isOpen:d,onPickDomain:b,multiColumn:!0}))))},Xe=(n(79),p.a.createElement(h.SVG,{viewBox:"0 0 24 24"},p.a.createElement(h.Path,{d:"M12 15.8c-3.7 0-6.8-3-6.8-6.8s3-6.8 6.8-6.8c3.7 0 6.8 3 6.8 6.8s-3.1 6.8-6.8 6.8zm0-12C9.1 3.8 6.8 6.1 6.8 9s2.4 5.2 5.2 5.2c2.9 0 5.2-2.4 5.2-5.2S14.9 3.8 12 3.8zM8 17.5h8V19H8zM10 20.5h4V22h-4z"}))),Ze=function(e){var t,n=e.selectedFeatures,r=void 0===n?[]:n,i=e.selectedPlanSlug,o=e.onPlanSelect,a=e.onPickDomainClick,s=e.currentDomain,l=e.disabledPlans,u=T().__,m=Object(c.useSelect)((function(e){return e(Ge).getSupportedPlans()})),f=Object(c.useSelect)((function(e){return e(Ge).getPrices()})),b=Object(c.useSelect)((function(e){return e(Ge).getDefaultPaidPlan()})),g=Object(c.useSelect)((function(e){return e("automattic/wpcom-features").getRecommendedPlanSlug(r)})),v=Object(c.useSelect)((function(e){return e(Ge).getPlanBySlug(g)})),y=v||b,x=u(v?"Recommended for you":"Popular"),_=m.filter((function(e){return e.storeSlug!==y.storeSlug})),w=[y.storeSlug],O=Object(d.useState)(w),E=O[0],k=O[1],S=E.length>=m.length,j=function(e,t){k(t?Object(N.h)(E,[e]):E.filter((function(t){return t!==e})))};return p.a.createElement("div",{className:"plans-accordion"},p.a.createElement("div",{className:"plans-accordion__plan-item-group"},y&&p.a.createElement(p.a.Fragment,null,v&&p.a.createElement("div",{className:"plans-accordion__recommend-hint"},p.a.createElement(K,{icon:Xe,size:16}),p.a.createElement("span",null,u("Based on the features you selected."))),p.a.createElement(Ke,{key:y.storeSlug,slug:y.storeSlug,name:null==y?void 0:y.title.toString(),description:null==y?void 0:y.description.toString(),features:null!==(t=y.features)&&void 0!==t?t:[],price:f[y.storeSlug],domain:s,badge:x,isFree:y.isFree,isOpen:!0,isPrimary:!0,isSelected:y.storeSlug===i,onSelect:o,onPickDomainClick:a}))),p.a.createElement("div",{className:"plans-accordion__actions"},p.a.createElement(h.Button,{className:"plans-accordion__toggle-all-button",onClick:function(){k(S?w:m.map((function(e){return e.storeSlug})))},isLink:!0},u(S?"Collapse all plans":"Show all plans"))),p.a.createElement("div",{className:"plans-accordion__plan-item-group"},_.map((function(e){var t;return p.a.createElement(Ke,{key:e.storeSlug,slug:e.storeSlug,name:null==e?void 0:e.title.toString(),description:null==e?void 0:e.description.toString(),features:null!==(t=e.features)&&void 0!==t?t:[],price:f[e.storeSlug],domain:s,isFree:e.isFree,isOpen:E.indexOf(e.storeSlug)>-1&&!(null==l?void 0:l[e.storeSlug]),isSelected:e.storeSlug===i,onSelect:o,onPickDomainClick:a,onToggle:j,disabledLabel:null==l?void 0:l[e.storeSlug]})}))))},Je=(n(83),p.a.createElement(K,{icon:Be,size:25})),Qe=function(e){var t=e.onSelect,n=Object(c.useSelect)((function(e){return e(Ge).getPlansDetails()})),r=Object(c.useSelect)((function(e){return e(Ge).getPrices()})),i=Object(c.useSelect)((function(e){return e(Ge).getSupportedPlans()})),o=T().__;return p.a.createElement("div",{className:"plans-details"},p.a.createElement("table",{className:"plans-details__table"},p.a.createElement("thead",null,p.a.createElement("tr",{className:"plans-details__header-row"},p.a.createElement("th",null,o("Feature")),i.map((function(e){return p.a.createElement("th",{key:e.storeSlug},e.title)})))),n.map((function(e){return p.a.createElement("tbody",{key:e.id},e.name&&p.a.createElement("tr",{className:"plans-details__header-row"},p.a.createElement("th",{colSpan:6},e.name)),e.features.map((function(e,t){return p.a.createElement("tr",{className:"plans-details__feature-row",key:t},p.a.createElement("th",null,e.name),e.data.map((function(t,n){return p.a.createElement("td",{key:n},"checkbox"===e.type&&(t?p.a.createElement(p.a.Fragment,null,p.a.createElement("span",{className:"hidden"},o("Available")),Je):p.a.createElement(p.a.Fragment,null,p.a.createElement("span",{className:"hidden"},o("Unavailable")," "))),"text"===e.type&&t)})))})))})),p.a.createElement("tbody",null,p.a.createElement("tr",{className:"plans-details__header-row"},p.a.createElement("th",{colSpan:6},o("Sign up"))),p.a.createElement("tr",{className:"plans-details__feature-row",key:"price"},p.a.createElement("th",null,o("Monthly subscription (billed yearly)")),i.map((function(e){return p.a.createElement("td",{key:e.storeSlug},r[e.storeSlug])}))),p.a.createElement("tr",{className:"plans-details__feature-row",key:"cta"},p.a.createElement("th",null),i.map((function(e){return p.a.createElement("td",{key:e.storeSlug},p.a.createElement(h.Button,{className:"plans-details__select-button",onClick:function(){t(e.storeSlug)},isPrimary:!0},p.a.createElement("span",null,o("Select"))))}))))))},et=(n(78),J()("plans-grid")),tt=function(e){var t,n,r=e.header,i=e.selectedFeatures,o=e.currentPlan,a=e.currentDomain,c=e.onPlanSelect,s=e.onPickDomainClick,l=e.disabledPlans,u=e.isExperimental,p=T().__;return u&&et("PlansGrid experimental version is active"),d.createElement("div",{className:"plans-grid"},r&&d.createElement("div",{className:"plans-grid__header"},r),d.createElement("div",{className:"plans-grid__table"},d.createElement("div",{className:"plans-grid__table-container"},u?d.createElement(Ze,{selectedFeatures:i,selectedPlanSlug:null!==(t=null==o?void 0:o.storeSlug)&&void 0!==t?t:"",onPlanSelect:c,currentDomain:a,onPickDomainClick:s,disabledPlans:l}):d.createElement(Ye,{selectedPlanSlug:null!==(n=null==o?void 0:o.storeSlug)&&void 0!==n?n:"",onPlanSelect:c,currentDomain:a,onPickDomainClick:s,disabledPlans:l}))),d.createElement("div",{className:"plans-grid__details"},d.createElement("div",{className:"plans-grid__details-heading"},d.createElement(j,null,p("Detailed comparison"))),d.createElement("div",{className:"plans-grid__details-container"},d.createElement(Qe,{onSelect:c}))))},nt=function(e){var t=e.onNextStep,n=Object(c.useSelect)((function(e){return e(i).getSelectedDomain()})),r=Object(c.useSelect)((function(e){return e(i).getLaunchStep()})),o=Object(c.useSelect)((function(e){return e(i).getState()})).isExperimental,s=Object(c.useDispatch)(i),l=s.updatePlan,u=s.setStep,d=R().selectedFeatures,p=n&&!n.is_free;return Object(a.createElement)(D,{className:"nux-launch-plan-step"},Object(a.createElement)("div",{className:"nux-launch-step__header"},Object(a.createElement)("div",null,Object(a.createElement)(j,null,Object(f.__)("Select a plan","full-site-editing")),Object(a.createElement)(C,null,Object(f.__)("Pick a plan that’s right for you. Switch plans as your needs change. There’s no risk, you can cancel for a full refund within 30 days.","full-site-editing")))),Object(a.createElement)("div",{className:"nux-launch-step__body"},Object(a.createElement)(tt,{currentDomain:n,onPlanSelect:function(e){l(e),null==t||t()},onPickDomainClick:function(){u(r.Domain)},disabledPlans:p?S()({},Re.Plans.PLAN_FREE,Object(f.__)("Not available with custom domain","full-site-editing")):void 0,isExperimental:o,selectedFeatures:d})))},rt=n(48),it=n.n(rt);var ot=function(){function e(e){this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.before=null}var t=e.prototype;return t.insert=function(e){if(this.ctr%(this.isSpeedy?65e3:1)==0){var t,n=function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t}(this);t=0===this.tags.length?this.before:this.tags[this.tags.length-1].nextSibling,this.container.insertBefore(n,t),this.tags.push(n)}var r=this.tags[this.tags.length-1];if(this.isSpeedy){var i=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}(r);try{var o=105===e.charCodeAt(1)&&64===e.charCodeAt(0);i.insertRule(e,o?0:i.cssRules.length)}catch(a){0}}else r.appendChild(document.createTextNode(e));this.ctr++},t.flush=function(){this.tags.forEach((function(e){return e.parentNode.removeChild(e)})),this.tags=[],this.ctr=0},e}();var at=function(e){function t(e,t,r){var i=t.trim().split(f);t=i;var o=i.length,a=e.length;switch(a){case 0:case 1:var c=0;for(e=0===a?"":e[0]+" ";c<o;++c)t[c]=n(e,t[c],r).trim();break;default:var s=c=0;for(t=[];c<o;++c)for(var l=0;l<a;++l)t[s++]=n(e[l]+" ",i[c],r).trim()}return t}function n(e,t,n){var r=t.charCodeAt(0);switch(33>r&&(r=(t=t.trim()).charCodeAt(0)),r){case 38:return t.replace(h,"$1"+e.trim());case 58:return e.trim()+t.replace(h,"$1"+e.trim());default:if(0<1*n&&0<t.indexOf("\f"))return t.replace(h,(58===e.charCodeAt(0)?"":"$1")+e.trim())}return e+t}function r(e,t,n,o){var a=e+";",c=2*t+3*n+4*o;if(944===c){e=a.indexOf(":",9)+1;var s=a.substring(e,a.length-1).trim();return s=a.substring(0,e).trim()+s+";",1===N||2===N&&i(s,1)?"-webkit-"+s+s:s}if(0===N||2===N&&!i(a,1))return a;switch(c){case 1015:return 97===a.charCodeAt(10)?"-webkit-"+a+a:a;case 951:return 116===a.charCodeAt(3)?"-webkit-"+a+a:a;case 963:return 110===a.charCodeAt(5)?"-webkit-"+a+a:a;case 1009:if(100!==a.charCodeAt(4))break;case 969:case 942:return"-webkit-"+a+a;case 978:return"-webkit-"+a+"-moz-"+a+a;case 1019:case 983:return"-webkit-"+a+"-moz-"+a+"-ms-"+a+a;case 883:if(45===a.charCodeAt(8))return"-webkit-"+a+a;if(0<a.indexOf("image-set(",11))return a.replace(k,"$1-webkit-$2")+a;break;case 932:if(45===a.charCodeAt(4))switch(a.charCodeAt(5)){case 103:return"-webkit-box-"+a.replace("-grow","")+"-webkit-"+a+"-ms-"+a.replace("grow","positive")+a;case 115:return"-webkit-"+a+"-ms-"+a.replace("shrink","negative")+a;case 98:return"-webkit-"+a+"-ms-"+a.replace("basis","preferred-size")+a}return"-webkit-"+a+"-ms-"+a+a;case 964:return"-webkit-"+a+"-ms-flex-"+a+a;case 1023:if(99!==a.charCodeAt(8))break;return"-webkit-box-pack"+(s=a.substring(a.indexOf(":",15)).replace("flex-","").replace("space-between","justify"))+"-webkit-"+a+"-ms-flex-pack"+s+a;case 1005:return p.test(a)?a.replace(d,":-webkit-")+a.replace(d,":-moz-")+a:a;case 1e3:switch(t=(s=a.substring(13).trim()).indexOf("-")+1,s.charCodeAt(0)+s.charCodeAt(t)){case 226:s=a.replace(y,"tb");break;case 232:s=a.replace(y,"tb-rl");break;case 220:s=a.replace(y,"lr");break;default:return a}return"-webkit-"+a+"-ms-"+s+a;case 1017:if(-1===a.indexOf("sticky",9))break;case 975:switch(t=(a=e).length-10,c=(s=(33===a.charCodeAt(t)?a.substring(0,t):a).substring(e.indexOf(":",7)+1).trim()).charCodeAt(0)+(0|s.charCodeAt(7))){case 203:if(111>s.charCodeAt(8))break;case 115:a=a.replace(s,"-webkit-"+s)+";"+a;break;case 207:case 102:a=a.replace(s,"-webkit-"+(102<c?"inline-":"")+"box")+";"+a.replace(s,"-webkit-"+s)+";"+a.replace(s,"-ms-"+s+"box")+";"+a}return a+";";case 938:if(45===a.charCodeAt(5))switch(a.charCodeAt(6)){case 105:return s=a.replace("-items",""),"-webkit-"+a+"-webkit-box-"+s+"-ms-flex-"+s+a;case 115:return"-webkit-"+a+"-ms-flex-item-"+a.replace(w,"")+a;default:return"-webkit-"+a+"-ms-flex-line-pack"+a.replace("align-content","").replace(w,"")+a}break;case 973:case 989:if(45!==a.charCodeAt(3)||122===a.charCodeAt(4))break;case 931:case 953:if(!0===E.test(e))return 115===(s=e.substring(e.indexOf(":")+1)).charCodeAt(0)?r(e.replace("stretch","fill-available"),t,n,o).replace(":fill-available",":stretch"):a.replace(s,"-webkit-"+s)+a.replace(s,"-moz-"+s.replace("fill-",""))+a;break;case 962:if(a="-webkit-"+a+(102===a.charCodeAt(5)?"-ms-"+a:"")+a,211===n+o&&105===a.charCodeAt(13)&&0<a.indexOf("transform",10))return a.substring(0,a.indexOf(";",27)+1).replace(m,"$1-webkit-$2")+a}return a}function i(e,t){var n=e.indexOf(1===t?":":"{"),r=e.substring(0,3!==t?n:10);return n=e.substring(n+1,e.length-1),L(2!==t?r:r.replace(O,"$1"),n,t)}function o(e,t){var n=r(t,t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2));return n!==t+";"?n.replace(_," or ($1)").substring(4):"("+t+")"}function a(e,t,n,r,i,o,a,c,l,u){for(var d,p=0,m=t;p<T;++p)switch(d=A[p].call(s,e,m,n,r,i,o,a,c,l,u)){case void 0:case!1:case!0:case null:break;default:m=d}if(m!==t)return m}function c(e){return void 0!==(e=e.prefix)&&(L=null,e?"function"!=typeof e?N=1:(N=2,L=e):N=0),c}function s(e,n){var c=e;if(33>c.charCodeAt(0)&&(c=c.trim()),c=[c],0<T){var s=a(-1,n,c,c,j,S,0,0,0,0);void 0!==s&&"string"==typeof s&&(n=s)}var d=function e(n,c,s,d,p){for(var m,f,h,y,_,w=0,O=0,E=0,k=0,A=0,L=0,M=h=m=0,D=0,R=0,B=0,I=0,z=s.length,U=z-1,H="",$="",V="",q="";D<z;){if(f=s.charCodeAt(D),D===U&&0!==O+k+E+w&&(0!==O&&(f=47===O?10:47),k=E=w=0,z++,U++),0===O+k+E+w){if(D===U&&(0<R&&(H=H.replace(u,"")),0<H.trim().length)){switch(f){case 32:case 9:case 59:case 13:case 10:break;default:H+=s.charAt(D)}f=59}switch(f){case 123:for(m=(H=H.trim()).charCodeAt(0),h=1,I=++D;D<z;){switch(f=s.charCodeAt(D)){case 123:h++;break;case 125:h--;break;case 47:switch(f=s.charCodeAt(D+1)){case 42:case 47:e:{for(M=D+1;M<U;++M)switch(s.charCodeAt(M)){case 47:if(42===f&&42===s.charCodeAt(M-1)&&D+2!==M){D=M+1;break e}break;case 10:if(47===f){D=M+1;break e}}D=M}}break;case 91:f++;case 40:f++;case 34:case 39:for(;D++<U&&s.charCodeAt(D)!==f;);}if(0===h)break;D++}switch(h=s.substring(I,D),0===m&&(m=(H=H.replace(l,"").trim()).charCodeAt(0)),m){case 64:switch(0<R&&(H=H.replace(u,"")),f=H.charCodeAt(1)){case 100:case 109:case 115:case 45:R=c;break;default:R=P}if(I=(h=e(c,R,h,f,p+1)).length,0<T&&(_=a(3,h,R=t(P,H,B),c,j,S,I,f,p,d),H=R.join(""),void 0!==_&&0===(I=(h=_.trim()).length)&&(f=0,h="")),0<I)switch(f){case 115:H=H.replace(x,o);case 100:case 109:case 45:h=H+"{"+h+"}";break;case 107:h=(H=H.replace(b,"$1 $2"))+"{"+h+"}",h=1===N||2===N&&i("@"+h,3)?"@-webkit-"+h+"@"+h:"@"+h;break;default:h=H+h,112===d&&($+=h,h="")}else h="";break;default:h=e(c,t(c,H,B),h,d,p+1)}V+=h,h=B=R=M=m=0,H="",f=s.charCodeAt(++D);break;case 125:case 59:if(1<(I=(H=(0<R?H.replace(u,""):H).trim()).length))switch(0===M&&(m=H.charCodeAt(0),45===m||96<m&&123>m)&&(I=(H=H.replace(" ",":")).length),0<T&&void 0!==(_=a(1,H,c,n,j,S,$.length,d,p,d))&&0===(I=(H=_.trim()).length)&&(H="\0\0"),m=H.charCodeAt(0),f=H.charCodeAt(1),m){case 0:break;case 64:if(105===f||99===f){q+=H+s.charAt(D);break}default:58!==H.charCodeAt(I-1)&&($+=r(H,m,f,H.charCodeAt(2)))}B=R=M=m=0,H="",f=s.charCodeAt(++D)}}switch(f){case 13:case 10:47===O?O=0:0===1+m&&107!==d&&0<H.length&&(R=1,H+="\0"),0<T*F&&a(0,H,c,n,j,S,$.length,d,p,d),S=1,j++;break;case 59:case 125:if(0===O+k+E+w){S++;break}default:switch(S++,y=s.charAt(D),f){case 9:case 32:if(0===k+w+O)switch(A){case 44:case 58:case 9:case 32:y="";break;default:32!==f&&(y=" ")}break;case 0:y="\\0";break;case 12:y="\\f";break;case 11:y="\\v";break;case 38:0===k+O+w&&(R=B=1,y="\f"+y);break;case 108:if(0===k+O+w+C&&0<M)switch(D-M){case 2:112===A&&58===s.charCodeAt(D-3)&&(C=A);case 8:111===L&&(C=L)}break;case 58:0===k+O+w&&(M=D);break;case 44:0===O+E+k+w&&(R=1,y+="\r");break;case 34:case 39:0===O&&(k=k===f?0:0===k?f:k);break;case 91:0===k+O+E&&w++;break;case 93:0===k+O+E&&w--;break;case 41:0===k+O+w&&E--;break;case 40:if(0===k+O+w){if(0===m)switch(2*A+3*L){case 533:break;default:m=1}E++}break;case 64:0===O+E+k+w+M+h&&(h=1);break;case 42:case 47:if(!(0<k+w+E))switch(O){case 0:switch(2*f+3*s.charCodeAt(D+1)){case 235:O=47;break;case 220:I=D,O=42}break;case 42:47===f&&42===A&&I+2!==D&&(33===s.charCodeAt(I+2)&&($+=s.substring(I,D+1)),y="",O=0)}}0===O&&(H+=y)}L=A,A=f,D++}if(0<(I=$.length)){if(R=c,0<T&&void 0!==(_=a(2,$,R,n,j,S,I,d,p,d))&&0===($=_).length)return q+$+V;if($=R.join(",")+"{"+$+"}",0!=N*C){switch(2!==N||i($,2)||(C=0),C){case 111:$=$.replace(v,":-moz-$1")+$;break;case 112:$=$.replace(g,"::-webkit-input-$1")+$.replace(g,"::-moz-$1")+$.replace(g,":-ms-input-$1")+$}C=0}}return q+$+V}(P,c,n,0,0);return 0<T&&(void 0!==(s=a(-2,d,c,c,j,S,d.length,0,0,0))&&(d=s)),"",C=0,S=j=1,d}var l=/^\0+/g,u=/[\0\r\f]/g,d=/: */g,p=/zoo|gra/,m=/([,: ])(transform)/g,f=/,\r+?/g,h=/([\t\r\n ])*\f?&/g,b=/@(k\w+)\s*(\S*)\s*/,g=/::(place)/g,v=/:(read-only)/g,y=/[svh]\w+-[tblr]{2}/,x=/\(\s*(.*)\s*\)/g,_=/([\s\S]*?);/g,w=/-self|flex-/g,O=/[^]*?(:[rp][el]a[\w-]+)[^]*/,E=/stretch|:\s*\w+\-(?:conte|avail)/,k=/([^-])(image-set\()/,S=1,j=1,C=0,N=1,P=[],A=[],T=0,L=null,F=0;return s.use=function e(t){switch(t){case void 0:case null:T=A.length=0;break;default:if("function"==typeof t)A[T++]=t;else if("object"==typeof t)for(var n=0,r=t.length;n<r;++n)e(t[n]);else F=0|!!t}return e},s.set=c,void 0!==e&&c(e),s},ct=function(e){var t=new WeakMap;return function(n){if(t.has(n))return t.get(n);var r=e(n);return t.set(n,r),r}},st="/*|*/";function lt(e){e&&ut.current.insert(e+"}")}var ut={current:null},dt=function(e,t,n,r,i,o,a,c,s,l){switch(e){case 1:switch(t.charCodeAt(0)){case 64:return ut.current.insert(t+";"),"";case 108:if(98===t.charCodeAt(2))return""}break;case 2:if(0===c)return t+st;break;case 3:switch(c){case 102:case 112:return ut.current.insert(n[0]+t),"";default:return t+(0===l?st:"")}case-2:t.split("/*|*/}").forEach(lt)}},pt=function(e){void 0===e&&(e={});var t,n=e.key||"css";void 0!==e.prefix&&(t={prefix:e.prefix});var r=new at(t);var i,o={};i=e.container||document.head;var a,c=document.querySelectorAll("style[data-emotion-"+n+"]");Array.prototype.forEach.call(c,(function(e){e.getAttribute("data-emotion-"+n).split(" ").forEach((function(e){o[e]=!0})),e.parentNode!==i&&i.appendChild(e)})),r.use(e.stylisPlugins)(dt),a=function(e,t,n,i){var o=t.name;ut.current=n,r(e,t.styles),i&&(s.inserted[o]=!0)};var s={key:n,sheet:new ot({key:n,container:i,nonce:e.nonce,speedy:e.speedy}),nonce:e.nonce,inserted:o,registered:{},insert:a};return s};function mt(e,t,n){var r="";return n.split(" ").forEach((function(n){void 0!==e[n]?t.push(e[n]):r+=n+" "})),r}var ft=function(e,t,n){var r=e.key+"-"+t.name;if(!1===n&&void 0===e.registered[r]&&(e.registered[r]=t.styles),void 0===e.inserted[t.name]){var i=t;do{e.insert("."+r,i,e.sheet,!0);i=i.next}while(void 0!==i)}};var ht=function(e){for(var t,n=e.length,r=n^n,i=0;n>=4;)t=1540483477*(65535&(t=255&e.charCodeAt(i)|(255&e.charCodeAt(++i))<<8|(255&e.charCodeAt(++i))<<16|(255&e.charCodeAt(++i))<<24))+((1540483477*(t>>>16)&65535)<<16),r=1540483477*(65535&r)+((1540483477*(r>>>16)&65535)<<16)^(t=1540483477*(65535&(t^=t>>>24))+((1540483477*(t>>>16)&65535)<<16)),n-=4,++i;switch(n){case 3:r^=(255&e.charCodeAt(i+2))<<16;case 2:r^=(255&e.charCodeAt(i+1))<<8;case 1:r=1540483477*(65535&(r^=255&e.charCodeAt(i)))+((1540483477*(r>>>16)&65535)<<16)}return r=1540483477*(65535&(r^=r>>>13))+((1540483477*(r>>>16)&65535)<<16),((r^=r>>>15)>>>0).toString(36)},bt={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};var gt=function(e){var t={};return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}},vt=/[A-Z]|^ms/g,yt=/_EMO_([^_]+?)_([^]*?)_EMO_/g,xt=function(e){return 45===e.charCodeAt(1)},_t=function(e){return null!=e&&"boolean"!=typeof e},wt=gt((function(e){return xt(e)?e:e.replace(vt,"-$&").toLowerCase()})),Ot=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(yt,(function(e,t,n){return kt={name:t,styles:n,next:kt},t}))}return 1===bt[e]||xt(e)||"number"!=typeof t||0===t?t:t+"px"};function Et(e,t,n,r){if(null==n)return"";if(void 0!==n.__emotion_styles)return n;switch(typeof n){case"boolean":return"";case"object":if(1===n.anim)return kt={name:n.name,styles:n.styles,next:kt},n.name;if(void 0!==n.styles){var i=n.next;if(void 0!==i)for(;void 0!==i;)kt={name:i.name,styles:i.styles,next:kt},i=i.next;return n.styles+";"}return function(e,t,n){var r="";if(Array.isArray(n))for(var i=0;i<n.length;i++)r+=Et(e,t,n[i],!1);else for(var o in n){var a=n[o];if("object"!=typeof a)null!=t&&void 0!==t[a]?r+=o+"{"+t[a]+"}":_t(a)&&(r+=wt(o)+":"+Ot(o,a)+";");else if(!Array.isArray(a)||"string"!=typeof a[0]||null!=t&&void 0!==t[a[0]]){var c=Et(e,t,a,!1);switch(o){case"animation":case"animationName":r+=wt(o)+":"+c+";";break;default:r+=o+"{"+c+"}"}}else for(var s=0;s<a.length;s++)_t(a[s])&&(r+=wt(o)+":"+Ot(o,a[s])+";")}return r}(e,t,n);case"function":if(void 0!==e){var o=kt,a=n(e);return kt=o,Et(e,t,a,r)}break;case"string":}if(null==t)return n;var c=t[n];return void 0===c||r?n:c}var kt,St=/label:\s*([^\s;\n{]+)\s*;/g;var jt=function(e,t,n){if(1===e.length&&"object"==typeof e[0]&&null!==e[0]&&void 0!==e[0].styles)return e[0];var r=!0,i="";kt=void 0;var o=e[0];null==o||void 0===o.raw?(r=!1,i+=Et(n,t,o,!1)):i+=o[0];for(var a=1;a<e.length;a++)i+=Et(n,t,e[a],46===i.charCodeAt(i.length-1)),r&&(i+=o[a]);St.lastIndex=0;for(var c,s="";null!==(c=St.exec(i));)s+="-"+c[1];return{name:ht(i)+s,styles:i,next:kt}};var Ct=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return jt(t)},Nt=Object(d.createContext)("undefined"!=typeof HTMLElement?pt():null),Pt=Object(d.createContext)({}),At=(Nt.Provider,function(e){return Object(d.forwardRef)((function(t,n){return Object(d.createElement)(Nt.Consumer,null,(function(r){return e(t,r,n)}))}))});Object.prototype.hasOwnProperty;d.Component;var Tt=function e(t){for(var n=t.length,r=0,i="";r<n;r++){var o=t[r];if(null!=o){var a=void 0;switch(typeof o){case"boolean":break;case"object":if(Array.isArray(o))a=e(o);else for(var c in a="",o)o[c]&&c&&(a&&(a+=" "),a+=c);break;default:a=o}a&&(i&&(i+=" "),i+=a)}}return i};function Lt(e,t,n){var r=[],i=mt(e,r,n);return r.length<2?n:i+t(r)}At((function(e,t){return Object(d.createElement)(Pt.Consumer,null,(function(n){var r=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var i=jt(n,t.registered);return ft(t,i,!1),t.key+"-"+i.name},i={css:r,cx:function(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];return Lt(t.registered,r,Tt(n))},theme:n},o=e.children(i);return!0,o}))})),n(24),n(49);function Ft(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}var Mt=function(e,t){return"function"==typeof t?t(e):function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ft(n,!0).forEach((function(t){S()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ft(n).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},e,{},t)},Dt=ct((function(e){return ct((function(t){return Mt(e,t)}))})),Rt=function(e){return Object(d.createElement)(Pt.Consumer,null,(function(t){return e.theme!==t&&(t=Dt(t)(e.theme)),Object(d.createElement)(Pt.Provider,{value:t},e.children)}))};var Bt=Object(a.createElement)(x.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(a.createElement)(x.Path,{d:"M9 18.6L3.5 13l1-1L9 16.4l9.5-9.9 1 1z"})),It="#F6F7F7",zt="#DCDCDE",Ut="#A7AAAD",Ht="#8E9196",$t="#646970",Vt="#2C3338",qt="#008A20",Gt="#FFF",Yt="#000",Wt={colors:{background:It,surface:Gt,primary:"#C9356E",primaryBorder:"#700F3B",primaryOver:"#AB235A",highlight:"#006088",highlightBorder:"#002C40",highlightOver:"#004E6E",success:qt,discount:qt,disabledPaymentButtons:It,disabledPaymentButtonsAccent:zt,disabledButtons:Ut,borderColor:Ut,borderColorLight:zt,borderColorDark:$t,upcomingStepBackground:zt,textColor:Vt,textColorLight:$t,textColorDark:Yt,error:"#D63638",warningBackground:"#F7EBEC",outline:"#5198D9",applePayButtonColor:Yt,applePayButtonRollOverColor:Vt,noticeBackground:Vt,defaultNoticeIconBackground:Ht,textColorOnDarkBackground:Gt,paypalGold:"#F0C443",paypalGoldHover:"#FFB900",modalBackground:"rgba( 255,255,255,0.9 )",disabledField:It,placeHolderTextColor:Ht},breakpoints:{desktopUp:"min-width: 960px",tabletUp:"min-width: 700px",bigPhoneUp:"min-width: 480px",smallPhoneUp:"min-width: 400px"},weights:{bold:"600",normal:"400"},fonts:{body:'-apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif'},fontSize:{small:"14px"}},Kt=n(3),Xt=n.n(Kt);function Zt(e){return e.filter((function(e){return e})).join(" ")}var Jt=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,Qt=gt((function(e){return Jt.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91})),en=function(e){return"theme"!==e&&"innerRef"!==e},tn=function(e){return"string"==typeof e&&e.charCodeAt(0)>96?Qt:en};function nn(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 rn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?nn(n,!0).forEach((function(t){S()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nn(n).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var on=function e(t,n){var r,i,o;void 0!==n&&(r=n.label,o=n.target,i=t.__emotion_forwardProp&&n.shouldForwardProp?function(e){return t.__emotion_forwardProp(e)&&n.shouldForwardProp(e)}:n.shouldForwardProp);var a=t.__emotion_real===t,c=a&&t.__emotion_base||t;"function"!=typeof i&&a&&(i=t.__emotion_forwardProp);var s=i||tn(c),l=!s("as");return function(){var u=arguments,p=a&&void 0!==t.__emotion_styles?t.__emotion_styles.slice(0):[];if(void 0!==r&&p.push("label:"+r+";"),null==u[0]||void 0===u[0].raw)p.push.apply(p,u);else{0,p.push(u[0][0]);for(var m=u.length,f=1;f<m;f++)p.push(u[f],u[0][f])}var h=At((function(e,t,n){return Object(d.createElement)(Pt.Consumer,null,(function(r){var a=l&&e.as||c,u="",m=[],f=e;if(null==e.theme){for(var h in f={},e)f[h]=e[h];f.theme=r}"string"==typeof e.className?u=mt(t.registered,m,e.className):null!=e.className&&(u=e.className+" ");var b=jt(p.concat(m),t.registered,f);ft(t,b,"string"==typeof a);u+=t.key+"-"+b.name,void 0!==o&&(u+=" "+o);var g=l&&void 0===i?tn(a):s,v={};for(var y in e)l&&"as"===y||g(y)&&(v[y]=e[y]);return v.className=u,v.ref=n||e.innerRef,Object(d.createElement)(a,v)}))}));return h.displayName=void 0!==r?r:"Styled("+("string"==typeof c?c:c.displayName||c.name||"Component")+")",h.defaultProps=t.defaultProps,h.__emotion_real=h,h.__emotion_base=c,h.__emotion_styles=p,h.__emotion_forwardProp=i,Object.defineProperty(h,"toString",{value:function(){return"."+o}}),h.withComponent=function(t,r){return e(t,void 0!==r?rn({},n||{},{},r):n).apply(void 0,p)},h}}.bind();["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"].forEach((function(e){on[e]=on(e)}));var an=on,cn=J()("composite-checkout:checkout-error-boundary"),sn=function(e){function t(t){var n=e.call(this,t)||this;return n.state={hasError:!1,currentError:null},n}return Object(N.c)(t,e),t.getDerivedStateFromError=function(e){return{currentError:e,hasError:!0}},t.prototype.componentDidCatch=function(e,t){if(this.props.onError){var n=e.message+"; Stack: "+e.stack+"; Component Stack: "+t.componentStack;cn("reporting the error",n),this.props.onError(n)}},t.prototype.render=function(){return this.state.hasError?p.a.createElement(ln,{errorMessage:this.props.errorMessage}):this.props.children},t}(p.a.Component);function ln(e){var t=e.errorMessage;return p.a.createElement(mn,null,t)}var un,dn,pn,mn=an.div(un||(un=Object(N.e)(["\n\tmargin: 2em;\n\ttext-align: center;\n"],["\n\tmargin: 2em;\n\ttext-align: center;\n"])));!function(e){e.LOADING="loading",e.READY="ready",e.SUBMITTING="submitting",e.VALIDATING="validating",e.COMPLETE="complete"}(dn||(dn={})),function(e){e.NOT_STARTED="not-started",e.PENDING="pending",e.AUTHORIZING="authorizing",e.COMPLETE="complete",e.REDIRECTING="redirecting",e.ERROR="error"}(pn||(pn={}));var fn={transactionStatus:pn.NOT_STARTED,previousTransactionStatus:pn.NOT_STARTED,transactionError:null,transactionLastResponse:null,transactionRedirectUrl:null,resetTransaction:bn,setTransactionError:bn,setTransactionComplete:bn,setTransactionPending:bn,setTransactionRedirecting:bn,setTransactionAuthorizing:bn},hn={allPaymentMethods:[],paymentMethodId:null,setPaymentMethodId:bn,showErrorMessage:bn,showInfoMessage:bn,showSuccessMessage:bn,onEvent:bn,formStatus:dn.LOADING,setFormStatus:bn,transactionStatusManager:fn,paymentProcessors:{}};function bn(){}var gn=Object(d.createContext)(hn);J()("composite-checkout:form-status");function vn(){var e=Object(d.useContext)(gn),t=e.formStatus,n=e.setFormStatus,r=Object(d.useMemo)((function(){return{setFormLoading:function(){return n(dn.LOADING)},setFormReady:function(){return n(dn.READY)},setFormSubmitting:function(){return n(dn.SUBMITTING)},setFormValidating:function(){return n(dn.VALIDATING)},setFormComplete:function(){return n(dn.COMPLETE)}}}),[n]);return Object(d.useMemo)((function(){return Object(N.a)(Object(N.a)({},r),{formStatus:t})}),[t,r])}an.div(yn||(yn=Object(N.e)(["\n\tbackground: ",";\n\twidth: 100%;\n\tbox-sizing: border-box;\n\tmargin-bottom: 0;\n\n\t@media ( "," ) {\n\t\tborder: 1px solid ",";\n\t\tmargin: 32px auto;\n\t\tbox-sizing: border-box;\n\t\tmax-width: 556px;\n\t}\n"],["\n\tbackground: ",";\n\twidth: 100%;\n\tbox-sizing: border-box;\n\tmargin-bottom: 0;\n\n\t@media ( "," ) {\n\t\tborder: 1px solid ",";\n\t\tmargin: 32px auto;\n\t\tbox-sizing: border-box;\n\t\tmax-width: 556px;\n\t}\n"])),(function(e){return e.theme.colors.surface}),(function(e){return e.theme.breakpoints.tabletUp}),(function(e){return e.theme.colors.borderColorLight})),an.div(xn||(xn=Object(N.e)(["\n\tpadding: 24px;\n\tborder-top: 1px solid ",";\n\n\t:first-of-type {\n\t\tborder-top: 0;\n\t}\n"],["\n\tpadding: 24px;\n\tborder-top: 1px solid ",";\n\n\t:first-of-type {\n\t\tborder-top: 0;\n\t}\n"])),(function(e){return e.theme.colors.borderColorLight}));var yn,xn,_n,wn,On,En,kn=function(){var e=Ct.apply(void 0,arguments),t="animation-"+e.name;return{name:t,styles:"@keyframes "+t+"{"+e.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}(_n||(_n=Object(N.e)(["\n 0% {\n opacity: 1;\n }\n\n 70% {\n \topacity: 0.5;\n }\n\n 100% {\n opacity: 1;\n }\n"],["\n 0% {\n opacity: 1;\n }\n\n 70% {\n \topacity: 0.5;\n }\n\n 100% {\n opacity: 1;\n }\n"]))),Sn=(an.h1(wn||(wn=Object(N.e)(["\n\tfont-size: 14px;\n\tcontent: '';\n\tfont-weight: ",";\n\tbackground: ",";\n\tcolor: ",";\n\twidth: 40%;\n\tmargin: 3px 0 0 35px;\n\tpadding: 0;\n\tposition: relative;\n\tanimation: "," 2s ease-in-out infinite;\n\theight: 20px;\n\n\t.rtl & {\n\t\tmargin: 3px 35px 0 0;\n\t}\n\n\t::before {\n\t\tcontent: '';\n\t\tdisplay: block;\n\t\tposition: absolute;\n\t\tleft: -35px;\n\t\ttop: -3px;\n\t\twidth: 27px;\n\t\theight: 27px;\n\t\tbackground: ",";\n\t\tborder-radius: 100%;\n\n\t\t.rtl & {\n\t\t\tright: -35px;\n\t\t\tleft: auto;\n\t\t}\n\t}\n"],["\n\tfont-size: 14px;\n\tcontent: '';\n\tfont-weight: ",";\n\tbackground: ",";\n\tcolor: ",";\n\twidth: 40%;\n\tmargin: 3px 0 0 35px;\n\tpadding: 0;\n\tposition: relative;\n\tanimation: "," 2s ease-in-out infinite;\n\theight: 20px;\n\n\t.rtl & {\n\t\tmargin: 3px 35px 0 0;\n\t}\n\n\t::before {\n\t\tcontent: '';\n\t\tdisplay: block;\n\t\tposition: absolute;\n\t\tleft: -35px;\n\t\ttop: -3px;\n\t\twidth: 27px;\n\t\theight: 27px;\n\t\tbackground: ",";\n\t\tborder-radius: 100%;\n\n\t\t.rtl & {\n\t\t\tright: -35px;\n\t\t\tleft: auto;\n\t\t}\n\t}\n"])),(function(e){return e.theme.weights.normal}),(function(e){return e.theme.colors.borderColorLight}),(function(e){return e.theme.colors.borderColorLight}),kn,(function(e){return e.theme.colors.borderColorLight})),an.p(On||(On=Object(N.e)(["\n\tfont-size: 14px;\n\theight: 16px;\n\tcontent: '';\n\tbackground: ",";\n\tcolor: ",";\n\tmargin: 8px 0 0 35px;\n\tpadding: 0;\n\tanimation: "," 2s ease-in-out infinite;\n\n\t.rtl & {\n\t\tmargin: 8px 35px 0 0;\n\t}\n"],["\n\tfont-size: 14px;\n\theight: 16px;\n\tcontent: '';\n\tbackground: ",";\n\tcolor: ",";\n\tmargin: 8px 0 0 35px;\n\tpadding: 0;\n\tanimation: "," 2s ease-in-out infinite;\n\n\t.rtl & {\n\t\tmargin: 8px 35px 0 0;\n\t}\n"])),(function(e){return e.theme.colors.borderColorLight}),(function(e){return e.theme.colors.borderColorLight}),kn),an.div(En||(En=Object(N.e)(["\n\tbackground: ",";\n\tcontent: '';\n\tborder-top: 1px solid ",";\n\tpadding: 24px;\n\n\t::before {\n\t\tcontent: '';\n\t\tdisplay: block;\n\t\tborder: 1px solid ",";\n\t\tborder-radius: 3px;\n\t\tfont-size: 14px;\n\t\twidth: 100%;\n\t\theight: 40px;\n\t}\n"],["\n\tbackground: ",";\n\tcontent: '';\n\tborder-top: 1px solid ",";\n\tpadding: 24px;\n\n\t::before {\n\t\tcontent: '';\n\t\tdisplay: block;\n\t\tborder: 1px solid ",";\n\t\tborder-radius: 3px;\n\t\tfont-size: 14px;\n\t\twidth: 100%;\n\t\theight: 40px;\n\t}\n"])),(function(e){return e.theme.colors.background}),(function(e){return e.theme.colors.borderColorLight}),(function(e){return e.theme.colors.borderColorLight})),J()("composite-checkout:payment-methods"));function jn(){var e=Object(d.useContext)(gn),t=e.paymentMethodId,n=e.setPaymentMethodId,r=Cn();if(!n)throw new Error("usePaymentMethod can only be used inside a CheckoutProvider");if(!t)return null;var i=r.find((function(e){return e.id===t}));return i||(Sn("No payment method found matching id '"+t+"' in",r),null)}function Cn(){var e=Object(d.useContext)(gn).allPaymentMethods;if(!e)throw new Error("useAllPaymentMethods cannot be used outside of CheckoutProvider");return e}var Nn,Pn=function(e){var t=e.className,n=e.buttonType,r=e.isBusy,i=e.children,o=e.fullWidth,a=Object(N.f)(e,["className","buttonType","isBusy","children","fullWidth"]),c=Zt(Object(N.h)(["checkout-button"],n?["is-status-"+n]:[],r?["is-busy"]:[],t?[t]:[]));return p.a.createElement(An,Object(N.a)({fullWidth:o,buttonType:n,className:c},a),i)},An=an("button")(Nn||(Nn=Object(N.e)(["\n\tdisplay: block;\n\twidth: ",";\n\tfont-size: 16px;\n\tborder-radius: ",";\n\tpadding: ",";\n\tborder: ",";\n\tbackground: ",";\n\tcolor: ",";\n\tfont-weight: ",";\n\ttext-decoration: ",";\n\n\t:hover {\n\t\tbackground: ",";\n\t\tborder-color: ",";\n\t\ttext-decoration: none;\n\t\tcolor: ",";\n\t\tcursor: ",";\n\t}\n\n\t:active {\n\t\tbackground: ",";\n\t\ttext-decoration: ",";\n\t\tcolor: ",";\n\t}\n\n\tsvg {\n\t\tmargin-bottom: -1px;\n\t\ttransform: translateY( 2px );\n\t\tfilter: ",";\n\t\topacity: ",";\n\t}\n\n\t&.is-busy {\n\t\tanimation: components-button__busy-animation 2500ms infinite linear;\n\t\tbackground-image: linear-gradient(\n\t\t\t-45deg,\n\t\t\t"," 28%,\n\t\t\t"," 28%,\n\t\t\t"," 72%,\n\t\t\t"," 72%\n\t\t);\n\t\tbackground-size: 200px;\n\t\topacity: 1;\n\t}\n\n\t@keyframes components-button__busy-animation {\n\t\t0% {\n\t\t\tbackground-position: 200px 0;\n\t\t}\n\t}\n"],["\n\tdisplay: block;\n\twidth: ",";\n\tfont-size: 16px;\n\tborder-radius: ",";\n\tpadding: ",";\n\tborder: ",";\n\tbackground: ",";\n\tcolor: ",";\n\tfont-weight: ",";\n\ttext-decoration: ",";\n\n\t:hover {\n\t\tbackground: ",";\n\t\tborder-color: ",";\n\t\ttext-decoration: none;\n\t\tcolor: ",";\n\t\tcursor: ",";\n\t}\n\n\t:active {\n\t\tbackground: ",";\n\t\ttext-decoration: ",";\n\t\tcolor: ",";\n\t}\n\n\tsvg {\n\t\tmargin-bottom: -1px;\n\t\ttransform: translateY( 2px );\n\t\tfilter: ",";\n\t\topacity: ",";\n\t}\n\n\t&.is-busy {\n\t\tanimation: components-button__busy-animation 2500ms infinite linear;\n\t\tbackground-image: linear-gradient(\n\t\t\t-45deg,\n\t\t\t"," 28%,\n\t\t\t"," 28%,\n\t\t\t"," 72%,\n\t\t\t"," 72%\n\t\t);\n\t\tbackground-size: 200px;\n\t\topacity: 1;\n\t}\n\n\t@keyframes components-button__busy-animation {\n\t\t0% {\n\t\t\tbackground-position: 200px 0;\n\t\t}\n\t}\n"])),(function(e){return e.fullWidth?"100%":"auto"}),(function(e){return"paypal"===e.buttonType?"50px":"2px"}),(function(e){return"text-button"===e.buttonType?"0":"10px 15px"}),(function(e){return!e.buttonType||e.disabled?"1px solid "+e.theme.colors.borderColor:"0"}),Fn,Ln,(function(e){var t=e.disabled,n=e.buttonType,r=e.theme;if(t||"text-button"===n)return r.weights.normal;return r.weights.bold}),Dn,Tn,(function(e){return e.buttonType?"inherit":e.theme.colors.borderColorDark}),Ln,(function(e){return e.disabled?"not-allowed":"pointer"}),Tn,Dn,Ln,(function(e){var t=e.buttonType;return"grayscale( "+("primary"===t||"paypal"===t?"0":"100")+" ) invert( 0 );"}),(function(e){var t=e.buttonType;return"primary"===t||"paypal"===t?"1":"0.5"}),Fn,Mn,Mn,Fn);function Tn(e){var t=e.disabled,n=e.buttonType,r=e.theme.colors;if(t)return r.disabledPaymentButtons;switch(n){case"paypal":return r.paypalGoldHover;case"primary":return r.primaryOver;case"secondary":return r.highlightOver;case"text-button":case"borderless":default:return"none"}}function Ln(e){var t=e.disabled,n=e.buttonType,r=e.theme.colors;if(t)return r.disabledButtons;switch(n){case"primary":case"secondary":return r.surface;case"text-button":return r.highlight;default:return r.textColor}}function Fn(e){var t=e.disabled,n=e.buttonType,r=e.theme.colors;if(t)return r.disabledPaymentButtons;switch(n){case"paypal":return r.paypalGold;case"primary":return r.primary;case"secondary":return r.highlight;default:return"none"}}function Mn(e){var t=e.disabled,n=e.buttonType,r=e.theme.colors;if(t)return r.disabledPaymentButtonsAccent;switch(n){case"paypal":return r.paypalGoldHover;case"primary":return r.primaryOver;case"secondary":return r.highlightOver;case"text-button":case"borderless":default:return"none"}}function Dn(e){return"text-button"===e.buttonType?"underline":"none"}function Rn(e){var t=e.className,n=e.id;return p.a.createElement(In,{width:"20",height:"20",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",className:t},p.a.createElement("mask",{id:n+"-check-icon-mask","mask-type":"alpha",maskUnits:"userSpaceOnUse",x:"2",y:"4",width:"16",height:"12"},p.a.createElement("path",{d:"M7.32916 13.2292L3.85416 9.75417L2.67083 10.9292L7.32916 15.5875L17.3292 5.58751L16.1542 4.41251L7.32916 13.2292Z"})),p.a.createElement("g",{mask:"url(#"+n+"-check-icon-mask)"},p.a.createElement("rect",{width:"20",height:"20"})))}Rn.propTypes={className:Xt.a.string,id:Xt.a.string};var Bn,In=an.svg(Bn||(Bn=Object(N.e)(["\n\tfill: #fff;\n"],["\n\tfill: #fff;\n"])));var zn=function(e){var t=e.value,n=e.onClick,r=e.ariaLabel,i=Object(N.f)(e,["value","onClick","ariaLabel"]);return p.a.createElement(Pn,Object(N.a)({onClick:n,buttonType:"primary","aria-label":r},i),t)},Un=Object(d.createContext)({items:[],total:{id:"title",type:"total",label:"Total",amount:{currency:"USD",value:0,displayValue:"0"}}});function Hn(){var e=Object(d.useContext)(Un),t=e.items,n=e.total;if(!t||!n)throw new Error("useLineItems can only be used inside a CheckoutProvider");return[t,n]}an.ul($n||($n=Object(N.e)(["\n\tmargin: 0;\n\tpadding: 0;\n"],["\n\tmargin: 0;\n\tpadding: 0;\n"]))),an.li(Vn||(Vn=Object(N.e)(["\n\tmargin: 0;\n\tpadding: 0;\n\tlist-style-type: none;\n"],["\n\tmargin: 0;\n\tpadding: 0;\n\tlist-style-type: none;\n"])));an.span(qn||(qn=Object(N.e)(["\n\tdisplay: flex;\n\tjustify-content: space-between;\n"],["\n\tdisplay: flex;\n\tjustify-content: space-between;\n"]))),an.span(Gn||(Gn=Object(N.e)(["\n\tfont-weight: ",";\n"],["\n\tfont-weight: ",";\n"])),(function(e){return e.theme.weights.bold}));an.div(Yn||(Yn=Object(N.e)(["\n\tcolor: ",";\n\tfont-weight: ",";\n\tpadding: 24px 20px;\n"],["\n\tcolor: ",";\n\tfont-weight: ",";\n\tpadding: 24px 20px;\n"])),(function(e){return e.theme.colors.textColor}),(function(e){return e.theme.weights.bold})),an.div(Wn||(Wn=Object(N.e)(["\n\tborder-top: 1px solid ",";\n\tpadding: 24px 20px;\n"],["\n\tborder-top: 1px solid ",";\n\tpadding: 24px 20px;\n"])),(function(e){return e.theme.colors.borderColorLight}));var $n,Vn,qn,Gn,Yn,Wn,Kn,Xn,Zn=an.div(Kn||(Kn=Object(N.e)(["\n\tdisplay: flex;\n\tjustify-content: space-between;\n"],["\n\tdisplay: flex;\n\tjustify-content: space-between;\n"])));an(Zn)(Xn||(Xn=Object(N.e)(["\n\tfont-weight: ",";\n"],["\n\tfont-weight: ",";\n"])),(function(e){return e.theme.weights.bold}));function Jn(e){var t=e.children,n=e.className;return p.a.createElement(Qn,{className:Zt([n,"order-review-section"])},t)}Jn.propTypes={className:Xt.a.string};var Qn=an.div(tr||(tr=Object(N.e)(["\n\tmargin-bottom: 16px;\n"],["\n\tmargin-bottom: 16px;\n"])));function er(e){var t=e.item,n=e.className,r="checkout-line-item-"+t.id;return p.a.createElement("div",{className:Zt([n,"checkout-line-item"])},p.a.createElement("span",{id:r},t.label),p.a.createElement("span",{"aria-labelledby":r},t.amount.displayValue))}er.propTypes={className:Xt.a.string,total:Xt.a.bool,isSummaryVisible:Xt.a.bool,item:Xt.a.shape({label:Xt.a.string,amount:Xt.a.shape({displayValue:Xt.a.string})})};var tr,nr,rr=an(er)(nr||(nr=Object(N.e)(["\n\tdisplay: flex;\n\twidth: 100%;\n\tjustify-content: space-between;\n\tfont-weight: ",";\n\tcolor: ",";\n\tfont-size: ",";\n\tpadding: ",";\n\tborder-bottom: ",";\n\n\t:first-of-type {\n\t\tpadding-top: 0;\n\t}\n"],["\n\tdisplay: flex;\n\twidth: 100%;\n\tjustify-content: space-between;\n\tfont-weight: ",";\n\tcolor: ",";\n\tfont-size: ",";\n\tpadding: ",";\n\tborder-bottom: ",";\n\n\t:first-of-type {\n\t\tpadding-top: 0;\n\t}\n"])),(function(e){var t=e.theme;return e.total?t.weights.bold:t.weights.normal}),(function(e){var t=e.theme;return e.total?t.colors.textColorDark:"inherit"}),(function(e){return e.total?"1.2em":"1em"}),(function(e){var t=e.total;return e.isSummaryVisible||t?0:"24px 0"}),(function(e){var t=e.theme,n=e.total;return e.isSummaryVisible||n?0:"1px solid "+t.colors.borderColorLight}));function ir(e){var t=e.total,n=e.className;return p.a.createElement("div",{className:Zt([n,"order-review-total"])},p.a.createElement(rr,{total:!0,item:t}))}function or(e){var t=e.items,n=e.className,r=e.isSummaryVisible;return p.a.createElement("div",{className:Zt([n,"order-review-line-items"])},t.map((function(e){return p.a.createElement(rr,{isSummaryVisible:r,key:e.id,item:e})})))}function ar(e){var t=e.className,n=Hn(),r=n[0],i=n[1];return p.a.createElement("div",{className:Zt([t,"checkout-review-order"])},p.a.createElement(Jn,null,p.a.createElement(or,{items:r})),p.a.createElement(Jn,null,p.a.createElement(ir,{total:i})))}function cr(e){var t=e.checked,n=e.name,r=e.value,i=e.onChange,o=e.children,a=e.label,c=e.disabled,s=e.id,l=e.ariaLabel,u=Object(d.useState)(!1),m=u[0],f=u[1];return p.a.createElement(sr,{disabled:c,isFocused:m,checked:t},p.a.createElement(lr,{type:"radio",name:n,id:s,disabled:c,value:r,checked:t,onChange:i,onFocus:function(){f(!0)},onBlur:function(){f(!1)},readOnly:!i,"aria-label":l}),p.a.createElement(ur,{checked:t,htmlFor:s,disabled:c},a),o&&p.a.createElement(hr,{checked:t},o))}or.propTypes={className:Xt.a.string,isSummaryVisible:Xt.a.bool,items:Xt.a.arrayOf(Xt.a.shape({label:Xt.a.string,amount:Xt.a.shape({displayValue:Xt.a.string})}))},ar.propTypes={className:Xt.a.string},cr.propTypes={name:Xt.a.string.isRequired,id:Xt.a.string.isRequired,label:Xt.a.node.isRequired,disabled:Xt.a.bool,checked:Xt.a.bool,value:Xt.a.string.isRequired,onChange:Xt.a.func,ariaLabel:Xt.a.string.isRequired};var sr=an.div(dr||(dr=Object(N.e)(["\n\tposition: relative;\n\tmargin-top: 8px;\n\tborder-radius: 3px;\n\tbox-sizing: border-box;\n\twidth: 100%;\n\toutline: ",";\n\n\t:first-of-type {\n\t\tmargin: 0;\n\t}\n\n\t::before {\n\t\tdisplay: block;\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\tposition: absolute;\n\t\ttop: 0;\n\t\tleft: 0;\n\t\tcontent: '';\n\t\tborder: "," solid ",";\n\t\tborder-radius: 3px;\n\t\tbox-sizing: border-box;\n\n\t\t.rtl & {\n\t\t\tright: 0;\n\t\t\tleft: auto;\n\t\t}\n\t}\n\n\t:hover::before {\n\t\tborder: 3px solid ",";\n\t}\n\n\t.payment-logos {\n\t\tdisplay: none;\n\n\t\t@media ( "," ) {\n\t\t\tdisplay: block;\n\t\t\tfilter: grayscale( "," );\n\t\t}\n\t}\n\n\t:hover .payment-logos {\n\t\t@media ( "," ) {\n\t\t\tfilter: grayscale( 0 );\n\t\t}\n\t}\n\n\tsvg {\n\t\tfilter: grayscale( "," );\n\t}\n\n\t:hover svg {\n\t\tfilter: grayscale( 0 );\n\t}\n\n\t",";\n"],["\n\tposition: relative;\n\tmargin-top: 8px;\n\tborder-radius: 3px;\n\tbox-sizing: border-box;\n\twidth: 100%;\n\toutline: ",";\n\n\t:first-of-type {\n\t\tmargin: 0;\n\t}\n\n\t::before {\n\t\tdisplay: block;\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\tposition: absolute;\n\t\ttop: 0;\n\t\tleft: 0;\n\t\tcontent: '';\n\t\tborder: "," solid ",";\n\t\tborder-radius: 3px;\n\t\tbox-sizing: border-box;\n\n\t\t.rtl & {\n\t\t\tright: 0;\n\t\t\tleft: auto;\n\t\t}\n\t}\n\n\t:hover::before {\n\t\tborder: 3px solid ",";\n\t}\n\n\t.payment-logos {\n\t\tdisplay: none;\n\n\t\t@media ( "," ) {\n\t\t\tdisplay: block;\n\t\t\tfilter: grayscale( "," );\n\t\t}\n\t}\n\n\t:hover .payment-logos {\n\t\t@media ( "," ) {\n\t\t\tfilter: grayscale( 0 );\n\t\t}\n\t}\n\n\tsvg {\n\t\tfilter: grayscale( "," );\n\t}\n\n\t:hover svg {\n\t\tfilter: grayscale( 0 );\n\t}\n\n\t",";\n"])),(function(e){var t=e.isFocused,n=e.theme;if(t)return n.colors.outline+" solid 2px";return"0"}),(function(e){return e.checked?"3px":"1px"}),(function(e){var t=e.checked,n=e.theme;return t?n.colors.highlight:n.colors.borderColor}),(function(e){return e.theme.colors.highlight}),(function(e){return e.theme.breakpoints.smallPhoneUp}),br,(function(e){return e.theme.breakpoints.smallPhoneUp}),br,(function(e){if(!e.disabled)return null;return"\n\t\t::before,\n\t\t:hover::before {\n\t\t\tborder: 1px solid lightgray;\n\t\t}\n\n\t\tsvg,\n\t\t:hover svg {\n\t\t\tfilter: grayscale( 100% );\n\t\t\topacity: 50%;\n\t\t}\n\t"}));var lr=an.input(pr||(pr=Object(N.e)(["\n\tposition: absolute;\n\topacity: 0 !important;\n\n\tclear: none;\n\tcursor: pointer;\n\tdisplay: inline-block;\n\tline-height: 0;\n\theight: 16px;\n\tmargin: 2px 0 0;\n\tfloat: left;\n\toutline: 0;\n\tpadding: 0;\n\ttext-align: center;\n\tvertical-align: middle;\n\twidth: 16px;\n\tmin-width: 16px;\n\tappearance: none;\n"],["\n\tposition: absolute;\n\topacity: 0 !important;\n\n\tclear: none;\n\tcursor: pointer;\n\tdisplay: inline-block;\n\tline-height: 0;\n\theight: 16px;\n\tmargin: 2px 0 0;\n\tfloat: left;\n\toutline: 0;\n\tpadding: 0;\n\ttext-align: center;\n\tvertical-align: middle;\n\twidth: 16px;\n\tmin-width: 16px;\n\tappearance: none;\n"]))),ur=an.label(mr||(mr=Object(N.e)(["\n\tposition: relative;\n\tpadding: 16px 14px 16px 40px;\n\tborder-radius: 3px;\n\tbox-sizing: border-box;\n\twidth: 100%;\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\tjustify-content: space-between;\n\talign-items: flex-start;\n\tfont-size: 14px;\n\n\t.rtl & {\n\t\tpadding: 16px 40px 16px 14px;\n\t}\n\n\t:hover {\n\t\tcursor: pointer;\n\t}\n\n\t::before {\n\t\tdisplay: block;\n\t\twidth: 16px;\n\t\theight: 16px;\n\t\tcontent: '';\n\t\tborder: 1px solid ",";\n\t\tborder-radius: 100%;\n\t\ttop: 19px;\n\t\tleft: 16px;\n\t\tposition: absolute;\n\t\tbackground: ",";\n\t\tbox-sizing: border-box;\n\t\tz-index: 2;\n\n\t\t.rtl & {\n\t\t\tright: 16px;\n\t\t\tleft: auto;\n\t\t}\n\t}\n\n\t::after {\n\t\tdisplay: block;\n\t\twidth: 8px;\n\t\theight: 8px;\n\t\tcontent: '';\n\t\tborder-radius: 100%;\n\t\ttop: 23px;\n\t\tleft: 20px;\n\t\tposition: absolute;\n\t\tbackground: ",";\n\t\tbox-sizing: border-box;\n\t\tz-index: 3;\n\n\t\t.rtl & {\n\t\t\tright: 20px;\n\t\t\tleft: auto;\n\t\t}\n\t}\n\n\t",";\n"],["\n\tposition: relative;\n\tpadding: 16px 14px 16px 40px;\n\tborder-radius: 3px;\n\tbox-sizing: border-box;\n\twidth: 100%;\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\tjustify-content: space-between;\n\talign-items: flex-start;\n\tfont-size: 14px;\n\n\t.rtl & {\n\t\tpadding: 16px 40px 16px 14px;\n\t}\n\n\t:hover {\n\t\tcursor: pointer;\n\t}\n\n\t::before {\n\t\tdisplay: block;\n\t\twidth: 16px;\n\t\theight: 16px;\n\t\tcontent: '';\n\t\tborder: 1px solid ",";\n\t\tborder-radius: 100%;\n\t\ttop: 19px;\n\t\tleft: 16px;\n\t\tposition: absolute;\n\t\tbackground: ",";\n\t\tbox-sizing: border-box;\n\t\tz-index: 2;\n\n\t\t.rtl & {\n\t\t\tright: 16px;\n\t\t\tleft: auto;\n\t\t}\n\t}\n\n\t::after {\n\t\tdisplay: block;\n\t\twidth: 8px;\n\t\theight: 8px;\n\t\tcontent: '';\n\t\tborder-radius: 100%;\n\t\ttop: 23px;\n\t\tleft: 20px;\n\t\tposition: absolute;\n\t\tbackground: ",";\n\t\tbox-sizing: border-box;\n\t\tz-index: 3;\n\n\t\t.rtl & {\n\t\t\tright: 20px;\n\t\t\tleft: auto;\n\t\t}\n\t}\n\n\t",";\n"])),(function(e){return e.theme.colors.borderColor}),(function(e){return e.theme.colors.surface}),(function(e){var t=e.checked,n=e.theme;return t?n.colors.highlight:n.colors.surface}),(function(e){if(!e.disabled)return null;return"\n\t\tcolor: lightgray;\n\t\tfont-style: italic;\n\n\t\t:hover {\n\t\t\tcursor: default;\n\t\t}\n\n\t\t::before {\n\t\t\tborder: 1px solid lightgray;\n\t\t\tbackground: lightgray;\n\t\t}\n\n\t\t::after {\n\t\t\tbackground: white;\n\t\t}\n\n\t\tspan {\n\t\t\tcolor: lightgray;\n\t\t}\n\t"}));var dr,pr,mr,fr,hr=an.div(fr||(fr=Object(N.e)(["\n\tdisplay: ",";\n"],["\n\tdisplay: ",";\n"])),(function(e){return e.checked?"block":"none"}));function br(e){return e.checked?0:"100%"}function gr(){var e=Object(d.useContext)(gn).onEvent;if(!e)throw new Error("useEvents can only be used inside a CheckoutProvider");return e}var vr=J()("composite-checkout:checkout-payment-methods");function yr(e){var t=e.summary,n=e.isComplete,r=e.className,i=T().__,o=gr(),a=Object(d.useCallback)((function(e){return o({type:"PAYMENT_METHOD_LOAD_ERROR",payload:e})}),[o]),c=jn(),s=function(){var e=Object(d.useContext)(gn),t=e.paymentMethodId,n=e.setPaymentMethodId;if(!n)throw new Error("usePaymentMethodId can only be used inside a CheckoutProvider");return[t,n]}()[1],l=function(e){vr("setting payment method to",e),o({type:"PAYMENT_METHOD_SELECT",payload:e}),s(e)},u=Cn();return t&&n&&c?(vr("rendering selected paymentMethod",c),p.a.createElement("div",{className:Zt([r,"checkout-payment-methods"])},p.a.createElement(sn,{errorMessage:i("There was a problem with this payment method."),onError:a},p.a.createElement(xr,{id:c.id,label:c.label,activeContent:c.activeContent,inactiveContent:c.inactiveContent,checked:!0,summary:!0,ariaLabel:c.getAriaLabel(i)})))):t?(vr("summary requested, but no complete paymentMethod is selected; isComplete:",n,"paymentMethod:",c),null):(vr("rendering paymentMethods",u),p.a.createElement("div",{className:Zt([r,"checkout-payment-methods"])},p.a.createElement(wr,null,u.map((function(e){return p.a.createElement(sn,{key:e.id,errorMessage:Object(f.sprintf)(i("There was a problem with the payment method: %s"),e.id),onError:a},p.a.createElement(xr,{id:e.id,label:e.label,activeContent:e.activeContent,inactiveContent:e.inactiveContent,checked:(null==c?void 0:c.id)===e.id,onClick:l,ariaLabel:e.getAriaLabel(i)}))})))))}function xr(e){var t=e.id,n=e.label,r=e.activeContent,i=e.inactiveContent,o=e.checked,a=e.onClick,c=e.ariaLabel,s=e.summary,l=vn().formStatus;return s?p.a.createElement(p.a.Fragment,null,i&&i):p.a.createElement(cr,{name:"paymentMethod",value:t,id:t,checked:o,disabled:l!==dn.READY,onChange:a?function(){return a(t)}:void 0,ariaLabel:c,label:n},r&&r)}yr.propTypes={summary:Xt.a.bool,isComplete:Xt.a.bool.isRequired,className:Xt.a.string},xr.propTypes={id:Xt.a.string.isRequired,onClick:Xt.a.func,checked:Xt.a.bool.isRequired,ariaLabel:Xt.a.string.isRequired,activeContent:Xt.a.node,label:Xt.a.node,inactiveContent:Xt.a.node,summary:Xt.a.bool};var _r,wr=an.div(_r||(_r=Object(N.e)(["\n\tmargin-bottom: 16px;\n"],["\n\tmargin-bottom: 16px;\n"])));J()("composite-checkout:checkout");var Or=function(e){var t=e.children,n=e.className;return p.a.createElement(jr,{className:Zt([n,"checkout__summary-area"])},t)},Er=an.div(zr||(zr=Object(N.e)(["\n\tbackground: ",";\n\tborder-bottom: 1px solid ",";\n\n\t@media ( "," ) {\n\t\tborder: 1px solid ",";\n\t\tborder-bottom: none 0;\n\t}\n\n\t@media ( "," ) {\n\t\tborder: 1px solid ",";\n\t}\n"],["\n\tbackground: ",";\n\tborder-bottom: 1px solid ",";\n\n\t@media ( "," ) {\n\t\tborder: 1px solid ",";\n\t\tborder-bottom: none 0;\n\t}\n\n\t@media ( "," ) {\n\t\tborder: 1px solid ",";\n\t}\n"])),(function(e){return e.theme.colors.surface}),(function(e){return e.theme.colors.borderColorLight}),(function(e){return e.theme.breakpoints.smallPhoneUp}),(function(e){return e.theme.colors.borderColorLight}),(function(e){return e.theme.breakpoints.desktopUp}),(function(e){return e.theme.colors.borderColorLight}));function kr(e){var t=e.errorMessage,n=e.editButtonText,r=e.editButtonAriaLabel,i=e.nextStepButtonText,o=e.validatingButtonText,a=e.nextStepButtonAriaLabel,c=e.validatingButtonAriaLabel,s=e.isStepActive,l=e.isStepComplete,u=e.className,d=e.stepNumber,m=e.stepId,f=e.titleContent,h=e.goToThisStep,b=e.goToNextStep,g=e.activeStepContent,v=e.formStatus,y=e.completeStepContent,x=e.onError,_=T().__;return p.a.createElement(sn,{errorMessage:t||_("There was an error with this step."),onError:x},p.a.createElement(Pr,{className:u},p.a.createElement(Ar,{id:m,stepNumber:d,title:f,isActive:s,isComplete:l,onEdit:v===dn.READY&&l&&h&&!s?h:void 0,editButtonText:n||_("Edit"),editButtonAriaLabel:r||_("Edit this step")}),p.a.createElement(ni,{isVisible:s,className:"checkout-steps__step-content"},g,b&&s&&p.a.createElement(zn,{onClick:b,value:v===dn.VALIDATING?o||_("Please wait…"):i||_("Continue"),ariaLabel:v===dn.VALIDATING?c||_("Please wait…"):a||_("Continue to next step"),buttonType:"primary",disabled:v!==dn.READY,isBusy:v===dn.VALIDATING})),l&&y?p.a.createElement(ri,{isVisible:!s,className:"checkout-steps__step-complete-content"},y):null))}kr.propTypes={errorMessage:Xt.a.string,onError:Xt.a.func,editButtonAriaLabel:Xt.a.string,editButtonText:Xt.a.string,nextStepButtonText:Xt.a.string,nextStepButtonAriaLabel:Xt.a.string,isStepActive:Xt.a.bool.isRequired,isStepComplete:Xt.a.bool.isRequired,className:Xt.a.string,stepNumber:Xt.a.number,stepId:Xt.a.string.isRequired,titleContent:Xt.a.node.isRequired,goToThisStep:Xt.a.func,goToNextStep:Xt.a.func,activeStepContent:Xt.a.node,formStatus:Xt.a.string,completeStepContent:Xt.a.node,validatingButtonText:Xt.a.string,validatingButtonAriaLabel:Xt.a.string};an.div(Ur||(Ur=Object(N.e)(["\n\t*:focus {\n\t\toutline: "," solid 2px;\n\t}\n"],["\n\t*:focus {\n\t\toutline: "," solid 2px;\n\t}\n"])),(function(e){return e.theme.colors.outline}));var Sr=an.div(Hr||(Hr=Object(N.e)(["\n\tdisplay: flex;\n\tflex-direction: column;\n\twidth: 100%;\n\n\t@media ( "," ) {\n\t\tmargin: 0 auto 32px;\n\t}\n\n\t@media ( "," ) {\n\t\talign-items: flex-start;\n\t\tflex-direction: row;\n\t\tjustify-content: center;\n\t\tmax-width: none;\n\t}\n"],["\n\tdisplay: flex;\n\tflex-direction: column;\n\twidth: 100%;\n\n\t@media ( "," ) {\n\t\tmargin: 0 auto 32px;\n\t}\n\n\t@media ( "," ) {\n\t\talign-items: flex-start;\n\t\tflex-direction: row;\n\t\tjustify-content: center;\n\t\tmax-width: none;\n\t}\n"])),(function(e){return e.theme.breakpoints.tabletUp}),(function(e){return e.theme.breakpoints.desktopUp})),jr=an.div($r||($r=Object(N.e)(["\n\tbox-sizing: border-box;\n\tmargin: 0 auto;\n\twidth: 100%;\n\n\t@media ( "," ) {\n\t\tmax-width: 556px;\n\t}\n\n\t@media ( "," ) {\n\t\tmargin-right: 0;\n\t\tmargin-left: 24px;\n\t\torder: 2;\n\t\twidth: 328px;\n\n\t\t.rtl & {\n\t\t\tmargin-right: 24px;\n\t\t\tmargin-left: 0;\n\t\t}\n\t}\n"],["\n\tbox-sizing: border-box;\n\tmargin: 0 auto;\n\twidth: 100%;\n\n\t@media ( "," ) {\n\t\tmax-width: 556px;\n\t}\n\n\t@media ( "," ) {\n\t\tmargin-right: 0;\n\t\tmargin-left: 24px;\n\t\torder: 2;\n\t\twidth: 328px;\n\n\t\t.rtl & {\n\t\t\tmargin-right: 24px;\n\t\t\tmargin-left: 0;\n\t\t}\n\t}\n"])),(function(e){return e.theme.breakpoints.tabletUp}),(function(e){return e.theme.breakpoints.desktopUp})),Cr=an.div(Vr||(Vr=Object(N.e)(["\n\tbackground: ",";\n\tbox-sizing: border-box;\n\tmargin: 0 auto;\n\twidth: 100%;\n\n\t&.checkout__step-wrapper--last-step {\n\t\tmargin-bottom: 100px;\n\t}\n\n\t@media ( "," ) {\n\t\tborder: 1px solid ",";\n\t}\n\n\t@media ( "," ) {\n\t\tmax-width: 556px;\n\t}\n\n\t@media ( "," ) {\n\t\tmargin: 0;\n\t\torder: 1;\n\t\twidth: 556px;\n\t}\n"],["\n\tbackground: ",";\n\tbox-sizing: border-box;\n\tmargin: 0 auto;\n\twidth: 100%;\n\n\t&.checkout__step-wrapper--last-step {\n\t\tmargin-bottom: 100px;\n\t}\n\n\t@media ( "," ) {\n\t\tborder: 1px solid ",";\n\t}\n\n\t@media ( "," ) {\n\t\tmax-width: 556px;\n\t}\n\n\t@media ( "," ) {\n\t\tmargin: 0;\n\t\torder: 1;\n\t\twidth: 556px;\n\t}\n"])),(function(e){return e.theme.colors.surface}),(function(e){return e.theme.breakpoints.smallPhoneUp}),(function(e){return e.theme.colors.borderColorLight}),(function(e){return e.theme.breakpoints.tabletUp}),(function(e){return e.theme.breakpoints.desktopUp})),Nr=an.div(qr||(qr=Object(N.e)(["\n\tbackground: ",";\n\tpadding: 24px;\n\tbottom: 0;\n\tleft: 0;\n\tbox-sizing: border-box;\n\twidth: 100%;\n\tz-index: 10;\n\tborder-top-width: 0;\n\tborder-top-style: solid;\n\tborder-top-color: ",";\n\n\t.checkout__step-wrapper--last-step & {\n\t\tborder-top-width: 1px;\n\t\tposition: fixed;\n\t}\n\n\t.rtl & {\n\t\tright: 0;\n\t\tleft: auto;\n\t}\n\n\t.checkout-button {\n\t\twidth: 100%;\n\n\t\t.checkout__step-wrapper--last-step & {\n\t\t\twidth: calc( 100% - 60px );\n\t\t}\n\t}\n\n\t@media ( "," ) {\n\t\t.checkout__step-wrapper--last-step & {\n\t\t\tposition: relative;\n\t\t\tborder: 0;\n\n\t\t\t.checkout-button {\n\t\t\t\twidth: 100%;\n\t\t\t}\n\t\t}\n\t}\n"],["\n\tbackground: ",";\n\tpadding: 24px;\n\tbottom: 0;\n\tleft: 0;\n\tbox-sizing: border-box;\n\twidth: 100%;\n\tz-index: 10;\n\tborder-top-width: 0;\n\tborder-top-style: solid;\n\tborder-top-color: ",";\n\n\t.checkout__step-wrapper--last-step & {\n\t\tborder-top-width: 1px;\n\t\tposition: fixed;\n\t}\n\n\t.rtl & {\n\t\tright: 0;\n\t\tleft: auto;\n\t}\n\n\t.checkout-button {\n\t\twidth: 100%;\n\n\t\t.checkout__step-wrapper--last-step & {\n\t\t\twidth: calc( 100% - 60px );\n\t\t}\n\t}\n\n\t@media ( "," ) {\n\t\t.checkout__step-wrapper--last-step & {\n\t\t\tposition: relative;\n\t\t\tborder: 0;\n\n\t\t\t.checkout-button {\n\t\t\t\twidth: 100%;\n\t\t\t}\n\t\t}\n\t}\n"])),(function(e){return e.theme.colors.background}),(function(e){return e.theme.colors.borderColorLight}),(function(e){return e.theme.breakpoints.tabletUp}));var Pr=an.div(Gr||(Gr=Object(N.e)(["\n\tposition: relative;\n\tborder-bottom: 1px solid ",";\n\tpadding: 16px;\n\n\t&.checkout-step {\n\t\tbackground: ",";\n\t}\n\n\t&.checkout-step.is-active,\n\t&.checkout-step.is-complete {\n\t\tbackground: ",";\n\t}\n\n\t@media ( "," ) {\n\t\tpadding: 24px;\n\t}\n"],["\n\tposition: relative;\n\tborder-bottom: 1px solid ",";\n\tpadding: 16px;\n\n\t&.checkout-step {\n\t\tbackground: ",";\n\t}\n\n\t&.checkout-step.is-active,\n\t&.checkout-step.is-complete {\n\t\tbackground: ",";\n\t}\n\n\t@media ( "," ) {\n\t\tpadding: 24px;\n\t}\n"])),(function(e){return e.theme.colors.borderColorLight}),(function(e){return e.theme.colors.background}),(function(e){return e.theme.colors.surface}),(function(e){return e.theme.breakpoints.tabletUp}));function Ar(e){var t=e.id,n=e.className,r=e.stepNumber,i=e.title,o=e.isActive,a=e.isComplete,c=e.onEdit,s=e.editButtonText,l=e.editButtonAriaLabel,u=T().__,d=!!c;return p.a.createElement(Fr,{isComplete:a,isActive:o,className:Zt([n,"checkout-step__header"])},p.a.createElement(Tr,{isComplete:a,isActive:o,id:t},r||null),p.a.createElement(Lr,{fullWidth:!d,isActive:o},i),d&&p.a.createElement(Ir,{className:"checkout-step__edit-button",buttonType:"text-button",onClick:c,"aria-label":l||u("Edit this step")},s||u("Edit")))}function Tr(e){var t=e.isComplete,n=e.isActive,r=e.className,i=e.children,o=e.id,a=!n&&t;return p.a.createElement(Mr,{className:Zt([r,"checkout-step__stepper"])},p.a.createElement(Dr,{isComplete:a},p.a.createElement(Rr,{isComplete:a,isActive:n},i),p.a.createElement(Br,null,p.a.createElement(Rn,{id:o}))))}Ar.propTypes={id:Xt.a.string,className:Xt.a.string,stepNumber:Xt.a.number,title:Xt.a.node.isRequired,isActive:Xt.a.bool,isComplete:Xt.a.bool,editButtonText:Xt.a.string,editButtonAriaLabel:Xt.a.string,onEdit:Xt.a.func},Tr.propTypes={id:Xt.a.string,className:Xt.a.string,isComplete:Xt.a.bool,isActive:Xt.a.bool};var Lr=an.span(Yr||(Yr=Object(N.e)(["\n\tcolor: ",";\n\tfont-weight: ",";\n\tmargin-right: ",";\n\tflex: ",";\n\n\t.rtl & {\n\t\tmargin-right: 0;\n\t\tmargin-left: ",";\n\t}\n"],["\n\tcolor: ",";\n\tfont-weight: ",";\n\tmargin-right: ",";\n\tflex: ",";\n\n\t.rtl & {\n\t\tmargin-right: 0;\n\t\tmargin-left: ",";\n\t}\n"])),(function(e){return e.isActive?e.theme.colors.textColorDark:e.theme.colors.textColor}),(function(e){return e.isActive?e.theme.weights.bold:e.theme.weights.normal}),(function(e){return e.fullWidth?"0":"8px"}),(function(e){return e.fullWidth?"1":"inherit"}),(function(e){return e.fullWidth?"0":"8px"})),Fr=an.h2(Wr||(Wr=Object(N.e)(["\n\tfont-size: 16px;\n\tdisplay: flex;\n\twidth: 100%;\n\talign-items: center;\n\tmargin: 0 0 ",";\n"],["\n\tfont-size: 16px;\n\tdisplay: flex;\n\twidth: 100%;\n\talign-items: center;\n\tmargin: 0 0 ",";\n"])),(function(e){return e.isComplete||e.isActive?"8px":"0"})),Mr=an.div(Kr||(Kr=Object(N.e)(["\n\tposition: relative;\n\twidth: 27px;\n\theight: 27px;\n\tmargin-right: 8px;\n\n\t.rtl & {\n\t\tmargin-right: 0;\n\t\tmargin-left: 8px;\n\t}\n"],["\n\tposition: relative;\n\twidth: 27px;\n\theight: 27px;\n\tmargin-right: 8px;\n\n\t.rtl & {\n\t\tmargin-right: 0;\n\t\tmargin-left: 8px;\n\t}\n"]))),Dr=an.div(Xr||(Xr=Object(N.e)(["\n\tposition: relative;\n\ttransform-origin: center center;\n\ttransition: transform 0.3s 0.1s ease-out;\n\ttransform-style: preserve-3d;\n\ttransform: ",";\n"],["\n\tposition: relative;\n\ttransform-origin: center center;\n\ttransition: transform 0.3s 0.1s ease-out;\n\ttransform-style: preserve-3d;\n\ttransform: ",";\n"])),(function(e){return e.isComplete?"rotateY(180deg)":"rotateY(0)"})),Rr=an.div(Zr||(Zr=Object(N.e)(["\n\tbackground: ",";\n\tfont-weight: normal;\n\twidth: 27px;\n\theight: 27px;\n\tline-height: 27px;\n\tbox-sizing: border-box;\n\ttext-align: center;\n\tborder-radius: 50%;\n\tcolor: ",";\n\tposition: absolute;\n\ttop: 0;\n\tleft: 0;\n\tbackface-visibility: hidden;\n\n\t.rtl & {\n\t\tright: 0;\n\t\tleft: auto;\n\t}\n\n\t// Reason: The IE media query needs to not have spaces within brackets otherwise ie11 doesn't read them\n\t// prettier-ignore\n\t@media all and (-ms-high-contrast:none), (-ms-high-contrast:active) {\n\t\tz-index: ",";\n\t}\n"],["\n\tbackground: ",";\n\tfont-weight: normal;\n\twidth: 27px;\n\theight: 27px;\n\tline-height: 27px;\n\tbox-sizing: border-box;\n\ttext-align: center;\n\tborder-radius: 50%;\n\tcolor: ",";\n\tposition: absolute;\n\ttop: 0;\n\tleft: 0;\n\tbackface-visibility: hidden;\n\n\t.rtl & {\n\t\tright: 0;\n\t\tleft: auto;\n\t}\n\n\t// Reason: The IE media query needs to not have spaces within brackets otherwise ie11 doesn't read them\n\t// prettier-ignore\n\t@media all and (-ms-high-contrast:none), (-ms-high-contrast:active) {\n\t\tz-index: ",";\n\t}\n"])),(function(e){var t=e.isComplete,n=e.isActive,r=e.theme;if(n)return r.colors.highlight;if(t)return r.colors.success;return r.colors.upcomingStepBackground}),(function(e){var t=e.isComplete,n=e.isActive,r=e.theme;if(t||n)return r.colors.surface;return r.colors.textColor}),(function(e){return e.isComplete?"0":"1"})),Br=an(Rr)(Jr||(Jr=Object(N.e)(["\n\tbackground: ",";\n\ttransform: rotateY( 180deg );\n\t// Reason: media query needs to not have spaces within brackets otherwise ie11 doesn't read them\n\t// prettier-ignore\n\t@media all and (-ms-high-contrast:none), (-ms-high-contrast:active) {\n\t\tbackface-visibility: visible;\n\t\tz-index: ",";\n\t}\n\n\tsvg {\n\t\tmargin-top: 4px;\n\t}\n"],["\n\tbackground: ",";\n\ttransform: rotateY( 180deg );\n\t// Reason: media query needs to not have spaces within brackets otherwise ie11 doesn't read them\n\t// prettier-ignore\n\t@media all and (-ms-high-contrast:none), (-ms-high-contrast:active) {\n\t\tbackface-visibility: visible;\n\t\tz-index: ",";\n\t}\n\n\tsvg {\n\t\tmargin-top: 4px;\n\t}\n"])),(function(e){return e.theme.colors.success}),(function(e){return e.isComplete?"1":"0"})),Ir=an(Pn)(Qr||(Qr=Object(N.e)(["\n\tfont-size: 14px;\n\tpadding-top: 1px;\n"],["\n\tfont-size: 14px;\n\tpadding-top: 1px;\n"])));var zr,Ur,Hr,$r,Vr,qr,Gr,Yr,Wr,Kr,Xr,Zr,Jr,Qr,ei,ti,ni=an.div(ei||(ei=Object(N.e)(["\n\tcolor: ",";\n\tdisplay: ",";\n\tpadding-left: 35px;\n\n\t.rtl & {\n\t\tpadding-right: 35px;\n\t\tpadding-left: 0;\n\t}\n"],["\n\tcolor: ",";\n\tdisplay: ",";\n\tpadding-left: 35px;\n\n\t.rtl & {\n\t\tpadding-right: 35px;\n\t\tpadding-left: 0;\n\t}\n"])),(function(e){return e.theme.colors.textColor}),(function(e){return e.isVisible?"block":"none"})),ri=an.div(ti||(ti=Object(N.e)(["\n\tcolor: ",";\n\tfont-size: 14px;\n\tdisplay: ",";\n\tpadding-left: 35px;\n\n\t.rtl & {\n\t\tpadding-right: 35px;\n\t\tpadding-left: 0;\n\t}\n"],["\n\tcolor: ",";\n\tfont-size: 14px;\n\tdisplay: ",";\n\tpadding-left: 35px;\n\n\t.rtl & {\n\t\tpadding-right: 35px;\n\t\tpadding-left: 0;\n\t}\n"])),(function(e){return e.theme.colors.textColorLight}),(function(e){return e.isVisible?"block":"none"}));n(97);var ii,oi,ai=Object(a.createElement)(y,{icon:Bt,size:17}),ci=function(e){var t=e.onNextStep,n=Object(c.useSelect)((function(e){return e(i).getSelectedDomain()})),r=Object(c.useSelect)((function(e){return e(i).getSelectedPlan()})),s=Object(c.useSelect)((function(e){return e(o).getPrices()})),l=Object(c.useSelect)((function(e){return e(i).getLaunchStep()})),d=Object(c.useSelect)((function(e){return e(i).isStepCompleted})),p=Object(c.useSelect)((function(e){return e(i).isFlowCompleted()})),b=Object(m.useEntityProp)("root","site","title"),g=u()(b,1)[0],v=R().currentDomainName,y=function(){var e,t=q();return null===(e=Object(c.useSelect)((function(e){if(t&&!(t.length<2))return e("automattic/domains/suggestions").getDomainSuggestions(t,{include_wordpressdotcom:!1,include_dotblogsubdomain:!1,quantity:1,locale:"en"})}),[t]))||void 0===e?void 0:e[0]}(),x=q(),_=Object(c.useDispatch)(i).setStep,w=Object(a.createElement)("div",{className:"nux-launch__summary-item"},Object(a.createElement)("p",null,Object(f.__)("Site","full-site-editing"),": ",g)),O=Object(a.createElement)("div",{className:"nux-launch__summary-item"},(null==n?void 0:n.domain_name)?Object(a.createElement)("p",null,Object(f.__)("Custom domain","full-site-editing"),": ",n.domain_name):Object(a.createElement)(a.Fragment,null,Object(a.createElement)("p",null,Object(f.__)("Free site address","full-site-editing"),": ",v),Object(a.createElement)(h.Tip,null,x?Object(a.createInterpolateElement)(Object(f.__)("A custom site address like <DomainName /> (<Link>now available!</Link>) is more unique and can help with your SEO ranking.","full-site-editing"),{DomainName:Object(a.createElement)("span",{className:E()("nux-launch__summary-item__domain-name",{"is-loading":!y})},(null==y?void 0:y.domain_name)||"loading-example.com"),Link:Object(a.createElement)(h.Button,{isLink:!0,onClick:function(){return _(l.Domain)}})}):Object(f.__)("A custom site address is more unique and can help with your SEO ranking.","full-site-editing")))),k=Object(a.createElement)("div",{className:"nux-launch__summary-item"},r&&!(null==r?void 0:r.isFree)?Object(a.createElement)(a.Fragment,null,Object(a.createElement)("p",{className:"nux-launch__summary-item__plan-name"},"WordPress.com ",r.title),Object(f.__)("Plan subscription","full-site-editing"),": ",s[r.storeSlug]," ",Object(f.__)("per month, billed yearly","full-site-editing")):Object(a.createElement)(a.Fragment,null,Object(a.createElement)("p",{className:"nux-launch__summary-item__plan-name"},"WordPress.com Free"),Object(a.createElement)("p",null,Object(f.__)("Plan subscription: Free forever","full-site-editing")),Object(a.createElement)(h.Tip,null,Object(a.createInterpolateElement)(Object(f.__)("<Link>Upgrade to Premium</Link> to get access to 13GB storage space, payment collection options, 24/7 Live Chat support, and more. Not sure? Give it a spin—we offer 30-day full-refunds, guaranteed.","full-site-editing"),{Link:Object(a.createElement)(h.Button,{isLink:!0,onClick:function(){return _(l.Plan)}})}))));return Object(a.createElement)(D,{className:"nux-launch-final-step"},Object(a.createElement)("div",{className:"nux-launch-step__header"},Object(a.createElement)("div",null,Object(a.createElement)(j,null,Object(f.__)("Launch your site","full-site-editing")),Object(a.createElement)(C,null,Object(f.__)("Your site will be made public and ready to share with others.","full-site-editing")))),Object(a.createElement)("div",{className:"nux-launch-step__body"},Object(a.createElement)(Rt,{theme:Wt},Object(a.createElement)(Sr,null,d(l.Plan)&&Object(a.createElement)(Or,null,Object(a.createElement)(Er,{className:"nux-launch__feature-list"},Object(a.createElement)("h3",{className:"nux-launch__feature-list-title"},Object(f.__)("Included in your plan","full-site-editing")),Object(a.createElement)("ul",{className:"nux-launch__feature-item-group"},null==r?void 0:r.features.map((function(e,t){return Object(a.createElement)("li",{key:t,className:"nux-launch__feature-item"},ai," ",e)}))),Object(a.createElement)("p",null,Object(f.__)("Questions?","full-site-editing")," ",Object(a.createElement)(h.Button,{isLink:!0,href:"https://wordpress.com/help/contact",target:"_blank"},Object(f.__)("Ask a Happiness Engineer","full-site-editing"))))),Object(a.createElement)(Cr,null,Object(a.createElement)(kr,{titleContent:Object(f.__)("Your site name","full-site-editing"),isStepComplete:d(l.Name),goToThisStep:function(){return _(l.Name)},completeStepContent:w,stepId:"name",formStatus:"ready"}),Object(a.createElement)(kr,{titleContent:Object(f.__)("Your domain","full-site-editing"),isStepComplete:d(l.Domain),goToThisStep:function(){return _(l.Domain)},completeStepContent:O,stepId:"domain",formStatus:"ready"}),Object(a.createElement)(kr,{titleContent:Object(f.__)("Your plan","full-site-editing"),isStepComplete:d(l.Plan),goToThisStep:function(){return _(l.Plan)},completeStepContent:k,stepId:"plan",formStatus:"ready"}),Object(a.createElement)(Nr,null,Object(a.createElement)(h.Button,{isPrimary:!0,disabled:!p,onClick:t,className:"nux-launch__submit-button"},Object(f.__)("Launch your site","full-site-editing"))))))))},si=(n(100),function(e){var t,n=e.onSubmit,r=Object(c.useSelect)((function(e){return e(i).getState()})).step,o=Object(c.useSelect)((function(e){return e(i).getLaunchStep()})),s=Object(c.useSelect)((function(e){return e(i).getLaunchSequence()})),l=Object(c.useSelect)((function(e){return e(i).getFirstIncompleteStep()})),u=Object(c.useDispatch)(i).setStep,p=(t={},S()(t,o.Name,G),S()(t,o.Domain,De),S()(t,o.Plan,nt),S()(t,o.Final,ci),t),m=s.indexOf(r),f=p[r];return d.useEffect((function(){l&&l!==o.Name&&u(l)}),[]),Object(a.createElement)("div",{className:"nux-launch"},Object(a.createElement)(f,{onPrevStep:function(){var e=m-1;e<0&&(e=0),u(s[e])},onNextStep:function(){var e=m+1;e>s.length-1&&(null==n||n()),u(s[e])}}))}),li=Object(a.createElement)(h.SVG,{viewBox:"0 0 24 24"},Object(a.createElement)(h.Circle,{cx:"12",cy:"12",r:"5"})),ui=function(e){var t=e.title,n=e.isCompleted,r=e.isCurrent,i=e.isDisabled,o=e.onClick;return Object(a.createElement)(h.Button,{className:E()("nux-launch-menu__item",{"is-current":r,"is-completed":n}),onClick:o,disabled:i,isLink:!0},Object(a.createElement)(y,{icon:n?Bt:li,size:16}),Object(a.createElement)("span",null,t))},di=(n(101),function(){var e,t=Object(c.useSelect)((function(e){return e(i).getState()})).step,n=Object(c.useSelect)((function(e){return e(i).getLaunchStep()})),r=Object(c.useSelect)((function(e){return e(i).getLaunchSequence()})),o=Object(c.useSelect)((function(e){return e(i).isStepCompleted})),s=Object(c.useSelect)((function(e){return e(i).isFlowStarted()})),l=(e={},S()(e,n.Name,Object(f.__)("Name your site","full-site-editing")),S()(e,n.Domain,Object(f.__)("Select a domain","full-site-editing")),S()(e,n.Plan,Object(f.__)("Select a plan","full-site-editing")),S()(e,n.Final,Object(f.__)("Launch your site","full-site-editing")),e),u=Object(c.useDispatch)(i).setStep;return Object(a.createElement)("div",{className:"nux-launch-menu"},Object(a.createElement)("h4",null,Object(f.__)("Site Launch Steps","full-site-editing")),Object(a.createElement)("div",{className:"nux-launch-menu__item-group"},r.map((function(e){return Object(a.createElement)(ui,{title:l[e],isCompleted:o(e),isCurrent:e===t,onClick:function(){return u(e)},isDisabled:e===n.Final&&!s})}))))}),pi=(n(102),function(){return Object(a.createElement)("div",{className:"nux-launch-sidebar"},Object(a.createElement)("h2",null,Object(f.__)("You're almost there!","full-site-editing")),Object(a.createElement)("h3",null,Object(f.__)("Complete the following steps to launch your site. Your site will remain private until you Launch.","full-site-editing")),Object(a.createElement)(di,null))}),mi=(n(103),function(e){var t=e.onClose,n=Object(c.useSelect)((function(e){return e(i).getState()})).step,r=Object(c.useDispatch)(i).launchSite,o=d.useState(!1),s=u()(o,2),l=s[0],p=s[1],b=function(){p(!0),r()};return R().isPaidPlan&&!l&&b(),Object(a.createElement)(h.Modal,{open:!0,className:E()("nux-launch-modal","step-".concat(n)),overlayClassName:"nux-launch-modal-overlay",bodyOpenClassName:"has-nux-launch-modal",onRequestClose:t,title:""},l?Object(a.createElement)("div",{className:"nux-launch-modal-body__launching"},Object(f.__)("Hooray! Your site will be ready shortly.","full-site-editing")):Object(a.createElement)(a.Fragment,null,Object(a.createElement)("div",{className:"nux-launch-modal-header"},Object(a.createElement)("div",{className:"nux-launch-modal-header__wp-logo"},Object(a.createElement)(y,{icon:_,size:36}))),Object(a.createElement)("div",{className:"nux-launch-modal-body"},Object(a.createElement)(m.EntityProvider,{kind:"root",type:"site"},Object(a.createElement)(si,{onSubmit:b}))),Object(a.createElement)("div",{className:"nux-launch-modal-aside"},Object(a.createElement)(h.Button,{isLink:!0,className:"nux-launch-modal__close-button",onClick:t,"aria-label":Object(f.__)("Close dialog","full-site-editing"),disabled:!t},Object(a.createElement)(y,{icon:w,size:24})),Object(a.createElement)(pi,null))))});ii="a8c-editor-site-launch",oi={render:function(){var e=Object(c.useSelect)((function(e){return e(i).getState()})).isSidebarOpen,t=Object(c.useDispatch)(i).closeSidebar;return function(){var e=R().launchStatus,t=Object(c.useSelect)((function(e){return e(i).getState()})),n=t.plan,a=t.domain,s=Object(c.useSelect)((function(e){return e(o).isPlanEcommerce(null==n?void 0:n.storeSlug)})),l=Object(c.useDispatch)(r),u=l.getCart,p=l.setCart;d.useEffect((function(){if(e){if(n&&!(null==n?void 0:n.isFree)){var t={product_id:n.productId,product_slug:n.storeSlug,extra:{source:"gutenboarding"}},r={meta:null==a?void 0:a.domain_name,product_id:null==a?void 0:a.product_id,extra:{privacy_available:null==a?void 0:a.supports_privacy,privacy:null==a?void 0:a.supports_privacy,source:"gutenboarding"}};return void function(){var e=$()(regeneratorRuntime.mark((function e(){var n,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,u(window._currentSiteId);case 2:return n=e.sent,e.next=5,p(window._currentSiteId,U()(U()({},n),{},{products:[].concat(I()(n.products),[t,r])}));case 5:i=Object(V.addQueryArgs)("https://wordpress.com/checkout/".concat(window._currentSiteId),U()({preLaunch:1},!s&&{redirect_to:"/home/".concat(window._currentSiteId)})),window.top.location.href=i;case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()()}window.top.location.href="https://wordpress.com/home/".concat(window._currentSiteId)}}),[e])}(),e?Object(a.createElement)(mi,{onClose:t}):null}},Object(s.registerPlugin)(ii,oi)}]));
52
  *
53
  * This source code is licensed under the MIT license found in the
54
  * LICENSE file in the root directory of this source tree.
55
+ */var r="function"==typeof Symbol&&Symbol.for,i=r?Symbol.for("react.element"):60103,o=r?Symbol.for("react.portal"):60106,a=r?Symbol.for("react.fragment"):60107,c=r?Symbol.for("react.strict_mode"):60108,s=r?Symbol.for("react.profiler"):60114,l=r?Symbol.for("react.provider"):60109,u=r?Symbol.for("react.context"):60110,d=r?Symbol.for("react.async_mode"):60111,p=r?Symbol.for("react.concurrent_mode"):60111,m=r?Symbol.for("react.forward_ref"):60112,f=r?Symbol.for("react.suspense"):60113,h=r?Symbol.for("react.suspense_list"):60120,b=r?Symbol.for("react.memo"):60115,g=r?Symbol.for("react.lazy"):60116,v=r?Symbol.for("react.block"):60121,y=r?Symbol.for("react.fundamental"):60117,x=r?Symbol.for("react.responder"):60118,_=r?Symbol.for("react.scope"):60119;function w(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case i:switch(e=e.type){case d:case p:case a:case s:case c:case f:return e;default:switch(e=e&&e.$$typeof){case u:case m:case g:case b:case l:return e;default:return t}}case o:return t}}}function O(e){return w(e)===p}t.AsyncMode=d,t.ConcurrentMode=p,t.ContextConsumer=u,t.ContextProvider=l,t.Element=i,t.ForwardRef=m,t.Fragment=a,t.Lazy=g,t.Memo=b,t.Portal=o,t.Profiler=s,t.StrictMode=c,t.Suspense=f,t.isAsyncMode=function(e){return O(e)||w(e)===d},t.isConcurrentMode=O,t.isContextConsumer=function(e){return w(e)===u},t.isContextProvider=function(e){return w(e)===l},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===i},t.isForwardRef=function(e){return w(e)===m},t.isFragment=function(e){return w(e)===a},t.isLazy=function(e){return w(e)===g},t.isMemo=function(e){return w(e)===b},t.isPortal=function(e){return w(e)===o},t.isProfiler=function(e){return w(e)===s},t.isStrictMode=function(e){return w(e)===c},t.isSuspense=function(e){return w(e)===f},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===a||e===p||e===s||e===c||e===f||e===h||"object"==typeof e&&null!==e&&(e.$$typeof===g||e.$$typeof===b||e.$$typeof===l||e.$$typeof===u||e.$$typeof===m||e.$$typeof===y||e.$$typeof===x||e.$$typeof===_||e.$$typeof===v)},t.typeOf=w},function(e,t,n){},function(e,t,n){"use strict";var r=n(99);function i(){}function o(){}o.resetWarningCache=i,e.exports=function(){function e(e,t,n,i,o,a){if(a!==r){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:o,resetWarningCache:i};return n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){"use strict";n.r(t);n(61);var r="automattic/site",i="automattic/launch",o="automattic/onboard/plans",a=n(1),c=n(4),s=n(35),l=n(11),u=n.n(l),d=n(0),p=n.n(d),m=n(13),f=n(5),h=n(6);function b(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function g(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function v(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}var y=function(e){var t=e.icon,n=e.size,r=void 0===n?24:n,i=g(e,["icon","size"]);return Object(a.cloneElement)(t,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?v(Object(n),!0).forEach((function(t){b(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):v(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({width:r,height:r},i))},x=n(8),_=Object(a.createElement)(x.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},Object(a.createElement)(x.Path,{d:"M20 10c0-5.51-4.49-10-10-10C4.48 0 0 4.49 0 10c0 5.52 4.48 10 10 10 5.51 0 10-4.48 10-10zM7.78 15.37L4.37 6.22c.55-.02 1.17-.08 1.17-.08.5-.06.44-1.13-.06-1.11 0 0-1.45.11-2.37.11-.18 0-.37 0-.58-.01C4.12 2.69 6.87 1.11 10 1.11c2.33 0 4.45.87 6.05 2.34-.68-.11-1.65.39-1.65 1.58 0 .74.45 1.36.9 2.1.35.61.55 1.36.55 2.46 0 1.49-1.4 5-1.4 5l-3.03-8.37c.54-.02.82-.17.82-.17.5-.05.44-1.25-.06-1.22 0 0-1.44.12-2.38.12-.87 0-2.33-.12-2.33-.12-.5-.03-.56 1.2-.06 1.22l.92.08 1.26 3.41zM17.41 10c.24-.64.74-1.87.43-4.25.7 1.29 1.05 2.71 1.05 4.25 0 3.29-1.73 6.24-4.4 7.78.97-2.59 1.94-5.2 2.92-7.78zM6.1 18.09C3.12 16.65 1.11 13.53 1.11 10c0-1.3.23-2.48.72-3.59C3.25 10.3 4.67 14.2 6.1 18.09zm4.03-6.63l2.58 6.98c-.86.29-1.76.45-2.71.45-.79 0-1.57-.11-2.29-.33.81-2.38 1.62-4.74 2.42-7.1z"})),w=Object(a.createElement)(x.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(a.createElement)(x.Path,{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"})),O=n(7),E=n.n(O),k=n(10),S=n.n(k),j=(n(70),function(e){var t=e.children;return d.createElement("h1",{className:"onboarding-title"},t)}),C=function(e){var t=e.children;return d.createElement("h2",{className:"onboarding-subtitle"},t)},N=n(2),P=n(14),A=d.createContext(L()),T=function(){return d.useContext(A)};Object(P.createHigherOrderComponent)((function(e){return function(t){var n=T();return d.createElement(e,Object(N.a)({},n,t))}}),"withI18n");function L(e){var t,n,r=Object(f.createI18n)(e),i=null!==(n=null===(t=null==e?void 0:e[""])||void 0===t?void 0:t.localeSlug)&&void 0!==n?n:"en";return{__:r.__.bind(r),_n:r._n.bind(r),_nx:r._nx.bind(r),_x:r._x.bind(r),isRTL:r.isRTL.bind(r),i18nLocale:i}}n(71);var F=function(e){var t=e.className,n=e.children;return d.createElement("div",{className:E()("action-buttons",t)},n)},M=function(e){var t=e.className,n=e.children,r=Object(N.f)(e,["className","children"]),i=T().__;return d.createElement(h.Button,Object(N.a)({className:E()("action_buttons__button action-buttons__next",t),isPrimary:!0},r),n||i("Continue"))},D=(n(65),function(e){var t=e.className,n=e.children;return Object(a.createElement)("div",{className:E()("nux-launch-step",t)},n)});function R(){var e,t,n=Object(c.useSelect)((function(e){return e(r).getSite(window._currentSiteId)})),i=Object(c.useSelect)((function(e){return e(r).isLaunched(window._currentSiteId)}));return{isPaidPlan:n&&!(null===(e=n.plan)||void 0===e?void 0:e.is_free),launchStatus:i,currentDomainName:(null==n?void 0:n.URL)&&new URL(null==n?void 0:n.URL).hostname,selectedFeatures:null==n||null===(t=n.options)||void 0===t?void 0:t.selected_features}}var B=n(19),I=n.n(B),z=n(15),U=n.n(z),H=n(36),$=n.n(H),V=n(37);function q(){var e,t=Object(c.useSelect)((function(e){return e(i).getState()})).domainSearch,n=Object(m.useEntityProp)("root","site","title"),r=u()(n,1)[0],o=R().currentDomainName,a=t.trim()||r;a&&a!==Object(f.__)("Site Title","full-site-editing")||(a=null!==(e=null==o?void 0:o.split(".")[0])&&void 0!==e?e:"");return a}n(69);var G=function(e){var t=e.onNextStep,n=function(){var e=Object(c.useSelect)((function(e){return e(i).getSelectedDomain()})),t=Object(c.useDispatch)(i).setDomainSearch,n=Object(m.useEntityProp)("root","site","title"),r=u()(n,2),o=r[0],a=r[1],s=Object(c.useDispatch)("core").saveEditedEntityRecord;return{title:o,updateTitle:a,saveTitle:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:o;a(n.trim()),s("root","site"),!e&&t(n)}}}(),r=n.title,o=n.updateTitle,s=n.saveTitle,l=function(){s(),null==t||t()};return Object(a.createElement)(D,{className:"nux-launch-name-step"},Object(a.createElement)("div",{className:"nux-launch-step__header"},Object(a.createElement)("div",null,Object(a.createElement)(j,null,Object(f.__)("Name your site","full-site-editing")),Object(a.createElement)(C,null,Object(f.__)("Pick a name for your site.","full-site-editing"))),Object(a.createElement)(F,null,Object(a.createElement)(M,{onClick:l,disabled:!(null==r?void 0:r.trim())}))),Object(a.createElement)("div",{className:"nux-launch-step__body"},Object(a.createElement)("form",{onSubmit:l},Object(a.createElement)(h.TextControl,{id:"nux-launch-step__input",className:"nux-launch-step__input",onChange:o,onBlur:function(){return s()},value:r,spellCheck:!1,autoComplete:"off",placeholder:Object(f.__)("Enter site name","full-site-editing"),autoCorrect:"off","data-hj-whitelist":!0}),Object(a.createElement)("p",{className:"nux-launch-step__input-hint"},Object(a.createElement)(h.Tip,{size:18}),Object(a.createElement)("span",null,Object(f.__)("Don't worry, you can change it later.","full-site-editing"))))))},Y=n(12);function W(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}var K=function(e){var t=e.icon,n=e.size,r=void 0===n?24:n,i=g(e,["icon","size"]);return Object(a.cloneElement)(t,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?W(Object(n),!0).forEach((function(t){b(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):W(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({width:r,height:r},i))},X=Object(a.createElement)(x.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(a.createElement)(x.Path,{d:"M13.5 6C10.5 6 8 8.5 8 11.5c0 1.1.3 2.1.9 3l-3.4 3 1 1.1 3.4-2.9c1 .9 2.2 1.4 3.6 1.4 3 0 5.5-2.5 5.5-5.5C19 8.5 16.5 6 13.5 6zm0 9.5c-2.2 0-4-1.8-4-4s1.8-4 4-4 4 1.8 4 4-1.8 4-4 4z"})),Z=n(9),J=n.n(Z),Q=J()("calypso:analytics");n(38);"undefined"!=typeof window&&window.addEventListener("popstate",(function(){null}));n(25);var ee=n(20),te=J()("lib/load-script/callback-handler"),ne=new Map;function re(){return ne}function ie(e){return re().has(e)}function oe(e,t){var n=re();ie(e)?(te('Adding a callback for an existing script from "'.concat(e,'"')),n.get(e).add(t)):(te('Adding a callback for a new script from "'.concat(e,'"')),n.set(e,new Set([t])))}function ae(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=re(),r=n.get(e);if(r){var i='Executing callbacks for "'.concat(e,'"')+(null===t?" with success":' with error "'.concat(t,'"'));te(i),r.forEach((function(e){"function"==typeof e&&e(t)})),n.delete(e)}}function ce(){var e=this.getAttribute("src");te('Handling successful request for "'.concat(e,'"')),ae(e),this.onload=null}function se(){var e=this.getAttribute("src");te('Handling failed request for "'.concat(e,'"')),ae(e,new Error('Failed to load script "'.concat(e,'"'))),this.onerror=null}var le=J()("lib/load-script/dom-operations");J()("package/load-script");function ue(e,t){var n;if(!ie(e)&&(n=function(e){le('Creating script element for "'.concat(e,'"'));var t=document.createElement("script");return t.src=e,t.type="text/javascript",t.async=!0,t.onload=ce,t.onerror=se,t}(e),le("Attaching element to head"),document.head.appendChild(n)),"function"!=typeof t)return new Promise((function(t,n){oe(e,(function(e){null===e?t():n(e)}))}));oe(e,t)}var de,pe=["a8c_cookie_banner_ok","wcadmin_storeprofiler_create_jetpack_account","wcadmin_storeprofiler_connect_store","wcadmin_storeprofiler_login_jetpack_account","wcadmin_storeprofiler_payment_login","wcadmin_storeprofiler_payment_create_account"];Promise.resolve();function me(e){"undefined"!=typeof window&&(window._tkq=window._tkq||[],window._tkq.push(e))}"undefined"!=typeof document&&ue("//stats.wp.com/w.js?61");var fe=new ee.EventEmitter;function he(e,t){if(Q('Record event "%s" called with props %o',e,t=t||{}),e.startsWith("calypso_")||Object(Y.includes)(pe,e)){if(de){var n=de(t);t=Object(N.a)(Object(N.a)({},t),n)}t=Object(Y.omitBy)(t,Y.isUndefined),Q('Recording event "%s" with actual props %o',e,t),me(["recordEvent",e,t]),fe.emit("record-event",e,t)}else Q('- Event name must be prefixed by "calypso_" or added to `EVENT_NAME_EXCEPTIONS`')}var be="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto),ge=new Uint8Array(16);function ve(){if(!be)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return be(ge)}for(var ye=[],xe=0;xe<256;++xe)ye[xe]=(xe+256).toString(16).substr(1);var _e=function(e,t){var n=t||0,r=ye;return[r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]]].join("")};var we=function(e,t,n){var r=t&&n||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var i=(e=e||{}).random||(e.rng||ve)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,t)for(var o=0;o<16;++o)t[r+o]=i[o];return t||_e(i)};var Oe=Object(a.createElement)(x.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(a.createElement)(x.Path,{d:"M12 3.2c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8 0-4.8-4-8.8-8.8-8.8zm0 16c-4 0-7.2-3.3-7.2-7.2C4.8 8 8 4.8 12 4.8s7.2 3.3 7.2 7.2c0 4-3.2 7.2-7.2 7.2zM11 17h2v-6h-2v6zm0-8h2V7h-2v2z"})),Ee=(n(77),function(e){var t=e.children,n=e.className,r=e.id,i=e.position,o=void 0===i?"bottom center":i,a=e.noArrow,c=void 0===a||a,s=Object(d.useState)(!1),l=s[0],u=s[1];return p.a.createElement(h.Button,{icon:Oe,onClick:function(){u(!l)},className:"info-tooltip","data-testid":"info-tooltip"},l&&p.a.createElement(h.Popover,{id:r,className:E()("info-tooltip__content",n),onClose:function(){u(!1)},position:o,noArrow:c},t))}),ke=function(e){var t=e.domain,n=e.cost,r=e.railcarId,i=e.hstsRequired,o=void 0!==i&&i,c=e.isFree,s=void 0!==c&&c,l=e.isExistingSubdomain,u=void 0!==l&&l,m=e.isRecommended,h=void 0!==m&&m,b=e.onSelect,g=e.onRender,v=e.selected,y=T().__,x=Object(P.useViewportMatch)("small","<"),_=t.indexOf("."),w=t.slice(0,_),O=t.slice(_),k=Object(d.useState)(),S=k[0],j=k[1],C=Object(d.useState)(),N=C[0],A=C[1],L=we();Object(d.useEffect)((function(){t!==S&&N!==r&&r&&(g(),j(t),A(r))}),[t,S,N,r,g]);return p.a.createElement("label",{className:E()("domain-picker__suggestion-item",{"is-free":s,"is-selected":v})},p.a.createElement("input",{"aria-labelledby":L,className:"domain-picker__suggestion-radio-button",type:"radio",name:"domain-picker-suggestion-option",onChange:function(){N&&function(e){he("calypso_traintracks_interact",{railcar:e.railcarId,action:e.action})}({action:"domain_selected",railcarId:N}),b(t)},checked:v}),p.a.createElement("div",{className:"domain-picker__suggestion-item-name"},p.a.createElement("div",{className:"domain-picker__suggestion-item-name-inner"},p.a.createElement("span",{className:"domain-picker__domain-name"},w),p.a.createElement("span",{className:E()("domain-picker__domain-tld",{"with-margin":!o})},O),o&&p.a.createElement(Ee,{position:x?"bottom center":"middle right",noArrow:!1,className:"domain-picker__info-tooltip"},Object(a.createInterpolateElement)(y("All domains ending with <tld /> require an SSL certificate to host a website. When you host this domain at WordPress.com an SSL certificate is included. <learn_more_link>Learn more</learn_more_link>"),{tld:p.a.createElement("b",null,O),learn_more_link:p.a.createElement("a",{target:"_blank",rel:"noreferrer",href:"https://wordpress.com/support/https-ssl"})})),h&&p.a.createElement("div",{className:"domain-picker__badge is-recommended"},y("Recommended"))),u&&p.a.createElement("div",{className:"domain-picker__change-subdomain-tip"},y("You can change your free subdomain later under Domain Settings."))),p.a.createElement("div",{className:E()("domain-picker__price",{"is-paid":!s})},s?y("Free"):p.a.createElement(p.a.Fragment,null,p.a.createElement("span",{className:"domain-picker__price-inclusive"}," ",y("Included in plans")," "),p.a.createElement("span",{className:"domain-picker__price-cost"},Object(f.sprintf)(y("%s/year"),n)))))},Se=function(){return p.a.createElement("div",{className:"domain-picker__suggestion-item placeholder"},p.a.createElement("div",{className:"domain-picker__suggestion-item-name placeholder"}),p.a.createElement("div",{className:"domain-picker__price placeholder"}))};function je(e,t){return e===t}function Ce(e,t,n){var r=n&&n.equalityFn?n.equalityFn:je,i=Object(d.useState)(e),o=i[0],a=i[1],c=function(e,t,n){void 0===n&&(n={});var r=n.maxWait,i=Object(d.useRef)(null),o=Object(d.useRef)([]),a=n.leading,c=Object(d.useRef)(!1),s=Object(d.useRef)(null),l=Object(d.useRef)(!1),u=Object(d.useRef)(e);u.current=e;var p=Object(d.useCallback)((function(){clearTimeout(s.current),clearTimeout(i.current),i.current=null,o.current=[],s.current=null,c.current=!1}),[]);return Object(d.useEffect)((function(){return function(){l.current=!0}}),[]),[Object(d.useCallback)((function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(o.current=e,clearTimeout(s.current),!s.current&&a&&!c.current)return u.current.apply(u,e),void(c.current=!0);s.current=setTimeout((function(){p(),l.current||u.current.apply(u,e)}),t),r&&!i.current&&(i.current=setTimeout((function(){var e=o.current;p(),l.current||u.current.apply(null,e)}),r))}),[r,t,p,a]),p,function(){s.current&&(u.current.apply(null,o.current),p())}]}(Object(d.useCallback)((function(e){return a(e)}),[]),t,n),s=c[0],l=c[1],u=Object(d.useRef)(e);return Object(d.useEffect)((function(){r(u.current,e)||(s(e),u.current=e)}),[e,s,r]),[o,l]}var Ne="automattic/domains/suggestions";var Pe=Object(a.createElement)(x.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(a.createElement)(x.Path,{d:"M17 9.4L12 14 7 9.4l-1 1.2 6 5.4 6-5.4z"})),Ae=(n(76),function(e){var t=e.onSelect,n=e.selected,r=T().__,i=Object(a.useState)(!1),o=i[0],s=i[1],l=function(e){s(!1),t(e)},u=Object(c.useSelect)((function(e){return e(Ne).getCategories()}));return d.createElement("div",{className:E()("domain-categories",{"is-open":o})},d.createElement(h.Button,{className:"domain-categories__dropdown-button",onClick:function(){return s(!o)}},d.createElement("span",null,n||r("All Categories")),d.createElement(K,{icon:Pe,size:16})),d.createElement("ul",{className:"domain-categories__item-group"},d.createElement("li",{className:E()("domain-categories__item",{"is-selected":!n})},d.createElement(h.Button,{onClick:function(){return l()}},r("View all"))),u.map((function(e){var t=e.slug,r=e.title;return d.createElement("li",{key:t,className:E()("domain-categories__item",{"is-selected":t===n})},d.createElement(h.Button,{onClick:function(){return l(t)}},r))}))))}),Te=function(){return p.a.createElement("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 300 40",xmlSpace:"preserve",width:"300"},p.a.createElement("rect",{x:"0",width:"310",height:"50",rx:"10",fill:"#D8D8D8"}),p.a.createElement("rect",{x:"8",y:"8",width:"25",height:"25",rx:"5",fill:"#fff"}),p.a.createElement("rect",{x:"40",y:"8",width:"25",height:"25",rx:"5",fill:"#fff"}),p.a.createElement("rect",{x:"72",y:"8",width:"300",height:"25",rx:"5",fill:"#fff"}),p.a.createElement("text",{x:"80",y:"26",fill:"#999"},"https://"),p.a.createElement("text",{x:"133",y:"26",fill:"#515151"},"example.com"))},Le=(n(75),function(e){var t=e.groupItems,n=e.children;return t?p.a.createElement("div",{className:"domain-picker__suggestion-item-group"},n):p.a.createElement(p.a.Fragment,null,n)}),Fe=function(e){var t,n,r=e.header,i=e.showDomainCategories,o=e.onDomainSelect,a=e.onExistingSubdomainSelect,s=e.quantity,l=void 0===s?5:s,u=e.quantityExpanded,m=void 0===u?10:u,f=e.onDomainSearchBlur,b=e.analyticsFlowId,g=e.analyticsUiAlgo,v=e.initialDomainSearch,y=void 0===v?"":v,x=e.onSetDomainSearch,_=e.currentDomain,w=e.existingSubdomain,O=e.segregateFreeAndPaid,E=void 0!==O&&O,k=T().__,S=k("Search for a domain"),j=Object(d.useState)(!1),C=j[0],N=j[1],P=Object(d.useState)(y),A=P[0],L=P[1],F=Object(d.useState)(),M=F[0],D=F[1],R=Object(c.useSelect)((function(e){return e(Ne).getDomainSuggestionVendor()})),B=function(e,t,n,r){void 0===e&&(e=""),void 0===r&&(r="en");var i=Ce(e,300)[0];return Object(c.useSelect)((function(e){if(i&&!(i.length<2))return e(Ne).getDomainSuggestions(i,{include_wordpressdotcom:!0,include_dotblogsubdomain:!1,quantity:t+1,locale:r,category_slug:n})}),[i,n,t])}(A.trim(),m,M,T().i18nLocale),I=null==B?void 0:B.slice(w?1:0,C?m:l);Object(d.useEffect)((function(){N(!1)}),[A]);var z=Object(d.useState)(),U=z[0],H=z[1];Object(d.useEffect)((function(){var e;B&&H((void 0===(e="suggestion")&&(e="recommendation"),we().replace(/-/g,"")+"-"+e))}),[B,H]);var $=function(e,t,n,r){!function(e){he("calypso_traintracks_render",{railcar:e.railcarId,ui_algo:e.uiAlgo,ui_position:e.uiPosition,fetch_algo:e.fetchAlgo,rec_result:e.result,fetch_query:e.query})}({uiAlgo:"/"+b+"/"+g,fetchAlgo:"/domains/search/"+R+"/"+b+(M?"/"+M:""),query:A,railcarId:t,result:r?e+"#recommended":e,uiPosition:n})};return p.a.createElement("div",{className:"domain-picker"},r&&r,p.a.createElement("div",{className:"domain-picker__search"},p.a.createElement("div",{className:"domain-picker__search-icon"},p.a.createElement(K,{icon:X})),p.a.createElement(h.TextControl,{"data-hj-whitelist":!0,hideLabelFromVision:!0,label:S,placeholder:S,onChange:function(e){L(e),x(e)},onBlur:function(e){f&&f(e.currentTarget.value)},value:A})),(null===(t=A.trim())||void 0===t?void 0:t.length)>1?p.a.createElement("div",{className:"domain-picker__body"},i&&p.a.createElement("div",{className:"domain-picker__aside"},p.a.createElement(Ae,{selected:M,onSelect:D})),p.a.createElement("div",{className:"domain-picker__suggestion-sections"},p.a.createElement(p.a.Fragment,null,E&&p.a.createElement("p",{className:"domain-picker__suggestion-group-label"},k("Keep sub-domain")),p.a.createElement(Le,{groupItems:E},w&&p.a.createElement(ke,{key:w,domain:w,cost:"Free",isFree:!0,isExistingSubdomain:!0,railcarId:U?""+U+0:void 0,onRender:function(){return $(w,""+U+0,0,!1)},selected:_===w,onSelect:function(){null==a||a(w)}})),E&&p.a.createElement("p",{className:"domain-picker__suggestion-group-label"},k("Professional domains")),p.a.createElement(Le,{groupItems:E},null!==(n=null==I?void 0:I.map((function(e,t){var n=w?t+1:t,r=1===n;return p.a.createElement(ke,{key:e.domain_name,domain:e.domain_name,cost:e.cost,hstsRequired:e.hsts_required,isFree:e.is_free,isRecommended:r,railcarId:U?""+U+n:void 0,onRender:function(){return $(e.domain_name,""+U+n,n,r)},onSelect:function(){o(e)},selected:_===e.domain_name})})))&&void 0!==n?n:Object(Y.times)(l,(function(e){return p.a.createElement(Se,{key:e})})))),!C&&(null==B?void 0:B.length)&&(null==B?void 0:B.length)>l&&p.a.createElement("div",{className:"domain-picker__show-more"},p.a.createElement(h.Button,{onClick:function(){return N(!0)},isLink:!0},k("View more results"))))):p.a.createElement("div",{className:"domain-picker__empty-state"},p.a.createElement("p",{className:"domain-picker__empty-state--text"},k("A domain name is the site address people type in their browser to visit your site.")),p.a.createElement("div",null,p.a.createElement(Te,null))))},Me="gutenboarding",De=(n(74),function(e){var t=e.onNextStep,n=Object(c.useSelect)((function(e){return e(i).getState()})),r=n.plan,o=n.domain,s=R().currentDomainName,l=q(),u=Object(c.useDispatch)(i),d=u.setDomain,p=u.unsetDomain,m=u.setDomainSearch,h=u.unsetPlan,b=u.confirmDomainSelection;return Object(a.createElement)(D,{className:"nux-launch-domain-step"},Object(a.createElement)("div",{className:"nux-launch-step__header"},Object(a.createElement)("div",null,Object(a.createElement)(j,null,Object(f.__)("Choose a domain","full-site-editing")),Object(a.createElement)(C,null,Object(f.__)("Free for the first year with any paid plan.","full-site-editing"))),Object(a.createElement)(F,null,Object(a.createElement)(M,{onClick:function(){b(),null==t||t()},disabled:!l}))),Object(a.createElement)("div",{className:"nux-launch-step__body"},Object(a.createElement)(Fe,{analyticsFlowId:Me,initialDomainSearch:l,onSetDomainSearch:m,onDomainSearchBlur:function(e){he("calypso_newsite_domain_search_blur",{flow:Me,query:e,where:"editor_domain_modal"})},currentDomain:(null==o?void 0:o.domain_name)||s,existingSubdomain:s,onDomainSelect:function(e){b(),d(e),(null==r?void 0:r.isFree)&&h()},onExistingSubdomainSelect:function(){p()},analyticsUiAlgo:"editor_domain_modal",segregateFreeAndPaid:!0})))}),Re=n(39),Be=Object(a.createElement)(x.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(a.createElement)(x.Path,{d:"M9 18.6L3.5 13l1-1L9 16.4l9.5-9.9 1 1z"})),Ie=Object(a.createElement)(x.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(a.createElement)(x.Path,{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"})),ze=(n(81),p.a.createElement(K,{icon:Be,size:17})),Ue=p.a.createElement(K,{icon:Ie,size:17}),He=p.a.createElement("svg",{width:"8",viewBox:"0 0 8 4"},p.a.createElement("path",{d:"M0 0 L8 0 L4 4 L0 0",fill:"currentColor"}));var $e=function(e){var t=e.features,n=e.domain,r=e.isFree,i=void 0!==r&&r,o=e.isOpen,c=void 0!==o&&o,s=e.onPickDomain,l=e.disabledLabel,u=e.multiColumn,d=void 0!==u&&u,m=function(e,t,n){return{NO_DOMAIN:{FREE_PLAN:null,PAID_PLAN:{className:"plans-feature-list__domain-summary is-cta",icon:ze,domainMessage:p.a.createElement(p.a.Fragment,null,n("Pick a free domain (1 year)")," ",He)}},FREE_DOMAIN:{FREE_PLAN:null,PAID_PLAN:{className:"plans-feature-list__domain-summary is-cta",icon:ze,domainMessage:p.a.createElement(p.a.Fragment,null,n("Pick a free domain (1 year)")," ",He)}},PAID_DOMAIN:{FREE_PLAN:{className:"plans-feature-list__domain-summary is-free",icon:Ue,domainMessage:p.a.createElement("span",null,Object(a.createInterpolateElement)(n("<url /> is not included"),{url:p.a.createElement("span",{className:"plans-feature-list__item-url"},null==t?void 0:t.domain_name)}))},PAID_PLAN:{className:"plans-feature-list__domain-summary is-picked",icon:ze,domainMessage:p.a.createElement("span",null,Object(a.createInterpolateElement)(n("<url /> is included"),{url:p.a.createElement("span",{className:"plans-feature-list__item-url"},null==t?void 0:t.domain_name)}))}}}[t&&(t.is_free?"FREE_DOMAIN":"PAID_DOMAIN")||"NO_DOMAIN"][e?"FREE_PLAN":"PAID_PLAN"]}(i,n,T().__);return p.a.createElement("div",{className:"plans-feature-list",hidden:!c},p.a.createElement("ul",{className:E()("plans-feature-list__item-group",{"plans-feature-list__item-group--columns":d})},l?p.a.createElement("li",{className:"plans-feature-list__item plans-feature-list__item--disabled-message"},Ue," ",p.a.createElement("span",null,l)):m&&p.a.createElement("li",{className:"plans-feature-list__item"},p.a.createElement(h.Button,{className:m.className,onClick:s,isLink:!0},m.icon,m.domainMessage)),t.map((function(e,t){return p.a.createElement("li",{key:t,className:"plans-feature-list__item"},ze," ",p.a.createElement("span",null,e))}))))},Ve=d.createElement("svg",{width:"8",viewBox:"0 0 8 4"},d.createElement("path",{d:"M0 0 L8 0 L4 4 L0 0",fill:"currentColor"})),qe=function(e){var t=e.slug,n=e.name,r=e.price,i=e.isPopular,o=void 0!==i&&i,a=e.isFree,c=void 0!==a&&a,s=e.domain,l=e.features,u=e.onSelect,p=e.onPickDomainClick,m=e.onToggleExpandAll,f=e.allPlansExpanded,b=e.disabledLabel,g=T().__,v=d.useState(!1),y=v[0],x=v[1],_=Object(P.useViewportMatch)("mobile",">=");d.useEffect((function(){x(f)}),[f]);var w=f||_||o||y;return d.createElement("div",{className:E()("plan-item",{"is-popular":o,"is-open":w})},o&&d.createElement("span",{className:"plan-item__badge"},g("Popular")),d.createElement("div",{className:E()("plan-item__viewport",{"is-popular":o})},d.createElement("div",{className:"plan-item__details"},d.createElement("div",{tabIndex:0,role:"button",onClick:function(){return x((function(e){return!e}))},onKeyDown:function(e){return 32===e.keyCode&&x((function(e){return!e}))},className:"plan-item__summary"},d.createElement("div",{className:"plan-item__heading"},d.createElement("div",{className:"plan-item__name"},n)),d.createElement("div",{className:"plan-item__price"},d.createElement("div",{className:E()("plan-item__price-amount",{"is-loading":!r})},r||" ")),!w&&d.createElement("div",{className:"plan-item__dropdown-chevron"},Ve)),d.createElement("div",{hidden:!w},d.createElement("div",{className:"plan-item__price-note"},g(c?"free forever":"per month, billed yearly")),d.createElement("div",{className:"plan-item__actions"},d.createElement(h.Button,{className:"plan-item__select-button",onClick:function(){u(t)},isPrimary:!0,disabled:!!b},d.createElement("span",null,g("Choose")))),d.createElement($e,{features:l,domain:s,isFree:c,isOpen:w,onPickDomain:p,disabledLabel:b})))),o&&!_&&d.createElement(h.Button,{onClick:m,className:"plan-item__mobile-expand-all-plans",isLink:!0},g(f?"Collapse all plans":"Expand all plans")))},Ge="automattic/onboard/plans",Ye=(n(82),function(e){var t=e.selectedPlanSlug,n=e.onPlanSelect,r=e.onPickDomainClick,i=e.currentDomain,o=e.disabledPlans,a=Object(c.useSelect)((function(e){return e(Ge).getSupportedPlans()})),s=Object(c.useSelect)((function(e){return e(Ge).getPrices()})),l=Object(d.useState)(!1),u=l[0],m=l[1];return p.a.createElement("div",{className:"plans-table"},a.map((function(e){var a;return e&&p.a.createElement(qe,{allPlansExpanded:u,key:e.storeSlug,slug:e.storeSlug,domain:i,features:null!==(a=e.features)&&void 0!==a?a:[],isPopular:e.isPopular,isFree:e.isFree,price:s[e.storeSlug],name:null==e?void 0:e.title.toString(),isSelected:e.storeSlug===t,onSelect:n,onPickDomainClick:r,onToggleExpandAll:function(){return m((function(e){return!e}))},disabledLabel:null==o?void 0:o[e.storeSlug]})})))}),We=(n(80),p.a.createElement("svg",{width:"8",viewBox:"0 0 8 4"},p.a.createElement("path",{d:"M0 0 L8 0 L4 4 L0 0",fill:"currentColor"}))),Ke=function(e){var t=e.slug,n=e.name,r=e.description,i=e.price,o=e.features,a=e.domain,c=e.badge,s=e.isFree,l=void 0!==s&&s,u=e.isOpen,d=void 0!==u&&u,m=e.isPrimary,f=void 0!==m&&m,h=e.onSelect,b=e.onPickDomainClick,g=e.onToggle,v=e.disabledLabel,y=T().__,x=function(){!v&&(null==g||g(t,!d))};return p.a.createElement("div",{className:E()("plans-accordion-item",{"is-open":d,"is-primary":f,"has-badge":!!c,"is-disabled":!!v})},c&&p.a.createElement("div",{className:"plans-accordion-item__badge"},p.a.createElement("span",null,c)),p.a.createElement("div",{className:"plans-accordion-item__viewport"},p.a.createElement("div",{className:"plans-accordion-item__details"},p.a.createElement("div",{tabIndex:0,role:"button",onClick:x,onKeyDown:function(e){return 32===e.keyCode&&x()},className:"plans-accordion-item__header"},p.a.createElement("div",{className:"plans-accordion-item__heading"},p.a.createElement("div",{className:"plans-accordion-item__name"},n),p.a.createElement("div",{className:"plans-accordion-item__description"},r)),p.a.createElement("div",{className:"plans-accordion-item__price"},p.a.createElement("div",{className:E()("plans-accordion-item__price-amount",{"is-loading":!i})},i||"  ",i&&p.a.createElement("span",null,y("/mo"))),p.a.createElement("div",{className:"plans-accordion-item__price-note"},y(l?"free forever":"billed annually"))),p.a.createElement("div",{className:"plans-accordion-item__disabled-label"},v),!d&&p.a.createElement("div",{className:"plans-accordion-item__dropdown-chevron"},We)),p.a.createElement("div",{className:"plans-accordion-item__actions",hidden:!d},p.a.createElement(M,{onClick:function(){h(t)}},y("Select"))),p.a.createElement($e,{features:o,domain:a,isFree:l,isOpen:d,onPickDomain:b,multiColumn:!0}))))},Xe=(n(79),p.a.createElement(h.SVG,{viewBox:"0 0 24 24"},p.a.createElement(h.Path,{d:"M12 15.8c-3.7 0-6.8-3-6.8-6.8s3-6.8 6.8-6.8c3.7 0 6.8 3 6.8 6.8s-3.1 6.8-6.8 6.8zm0-12C9.1 3.8 6.8 6.1 6.8 9s2.4 5.2 5.2 5.2c2.9 0 5.2-2.4 5.2-5.2S14.9 3.8 12 3.8zM8 17.5h8V19H8zM10 20.5h4V22h-4z"}))),Ze=function(e){var t,n=e.selectedFeatures,r=void 0===n?[]:n,i=e.selectedPlanSlug,o=e.onPlanSelect,a=e.onPickDomainClick,s=e.currentDomain,l=e.disabledPlans,u=T().__,m=Object(c.useSelect)((function(e){return e(Ge).getSupportedPlans()})),f=Object(c.useSelect)((function(e){return e(Ge).getPrices()})),b=Object(c.useSelect)((function(e){return e(Ge).getDefaultPaidPlan()})),g=Object(c.useSelect)((function(e){return e("automattic/wpcom-features").getRecommendedPlanSlug(r)})),v=Object(c.useSelect)((function(e){return e(Ge).getPlanBySlug(g)})),y=v||b,x=u(v?"Recommended for you":"Popular"),_=m.filter((function(e){return e.storeSlug!==y.storeSlug})),w=[y.storeSlug],O=Object(d.useState)(w),E=O[0],k=O[1],S=E.length>=m.length,j=function(e,t){k(t?Object(N.h)(E,[e]):E.filter((function(t){return t!==e})))};return p.a.createElement("div",{className:"plans-accordion"},p.a.createElement("div",{className:"plans-accordion__plan-item-group"},y&&p.a.createElement(p.a.Fragment,null,v&&p.a.createElement("div",{className:"plans-accordion__recommend-hint"},p.a.createElement(K,{icon:Xe,size:16}),p.a.createElement("span",null,u("Based on the features you selected."))),p.a.createElement(Ke,{key:y.storeSlug,slug:y.storeSlug,name:null==y?void 0:y.title.toString(),description:null==y?void 0:y.description.toString(),features:null!==(t=y.features)&&void 0!==t?t:[],price:f[y.storeSlug],domain:s,badge:x,isFree:y.isFree,isOpen:!0,isPrimary:!0,isSelected:y.storeSlug===i,onSelect:o,onPickDomainClick:a}))),p.a.createElement("div",{className:"plans-accordion__actions"},p.a.createElement(h.Button,{className:"plans-accordion__toggle-all-button",onClick:function(){k(S?w:m.map((function(e){return e.storeSlug})))},isLink:!0},u(S?"Collapse all plans":"Show all plans"))),p.a.createElement("div",{className:"plans-accordion__plan-item-group"},_.map((function(e){var t;return p.a.createElement(Ke,{key:e.storeSlug,slug:e.storeSlug,name:null==e?void 0:e.title.toString(),description:null==e?void 0:e.description.toString(),features:null!==(t=e.features)&&void 0!==t?t:[],price:f[e.storeSlug],domain:s,isFree:e.isFree,isOpen:E.indexOf(e.storeSlug)>-1&&!(null==l?void 0:l[e.storeSlug]),isSelected:e.storeSlug===i,onSelect:o,onPickDomainClick:a,onToggle:j,disabledLabel:null==l?void 0:l[e.storeSlug]})}))))},Je=(n(83),p.a.createElement(K,{icon:Be,size:25})),Qe=function(e){var t=e.onSelect,n=Object(c.useSelect)((function(e){return e(Ge).getPlansDetails()})),r=Object(c.useSelect)((function(e){return e(Ge).getPrices()})),i=Object(c.useSelect)((function(e){return e(Ge).getSupportedPlans()})),o=T().__;return p.a.createElement("div",{className:"plans-details"},p.a.createElement("table",{className:"plans-details__table"},p.a.createElement("thead",null,p.a.createElement("tr",{className:"plans-details__header-row"},p.a.createElement("th",null,o("Feature")),i.map((function(e){return p.a.createElement("th",{key:e.storeSlug},e.title)})))),n.map((function(e){return p.a.createElement("tbody",{key:e.id},e.name&&p.a.createElement("tr",{className:"plans-details__header-row"},p.a.createElement("th",{colSpan:6},e.name)),e.features.map((function(e,t){return p.a.createElement("tr",{className:"plans-details__feature-row",key:t},p.a.createElement("th",null,e.name),e.data.map((function(t,n){return p.a.createElement("td",{key:n},"checkbox"===e.type&&(t?p.a.createElement(p.a.Fragment,null,p.a.createElement("span",{className:"hidden"},o("Available")),Je):p.a.createElement(p.a.Fragment,null,p.a.createElement("span",{className:"hidden"},o("Unavailable")," "))),"text"===e.type&&t)})))})))})),p.a.createElement("tbody",null,p.a.createElement("tr",{className:"plans-details__header-row"},p.a.createElement("th",{colSpan:6},o("Sign up"))),p.a.createElement("tr",{className:"plans-details__feature-row",key:"price"},p.a.createElement("th",null,o("Monthly subscription (billed yearly)")),i.map((function(e){return p.a.createElement("td",{key:e.storeSlug},r[e.storeSlug])}))),p.a.createElement("tr",{className:"plans-details__feature-row",key:"cta"},p.a.createElement("th",null),i.map((function(e){return p.a.createElement("td",{key:e.storeSlug},p.a.createElement(h.Button,{className:"plans-details__select-button",onClick:function(){t(e.storeSlug)},isPrimary:!0},p.a.createElement("span",null,o("Select"))))}))))))},et=(n(78),J()("plans-grid")),tt=function(e){var t,n,r=e.header,i=e.selectedFeatures,o=e.currentPlan,a=e.currentDomain,c=e.onPlanSelect,s=e.onPickDomainClick,l=e.disabledPlans,u=e.isExperimental,p=T().__;return u&&et("PlansGrid experimental version is active"),d.createElement("div",{className:"plans-grid"},r&&d.createElement("div",{className:"plans-grid__header"},r),d.createElement("div",{className:"plans-grid__table"},d.createElement("div",{className:"plans-grid__table-container"},u?d.createElement(Ze,{selectedFeatures:i,selectedPlanSlug:null!==(t=null==o?void 0:o.storeSlug)&&void 0!==t?t:"",onPlanSelect:c,currentDomain:a,onPickDomainClick:s,disabledPlans:l}):d.createElement(Ye,{selectedPlanSlug:null!==(n=null==o?void 0:o.storeSlug)&&void 0!==n?n:"",onPlanSelect:c,currentDomain:a,onPickDomainClick:s,disabledPlans:l}))),d.createElement("div",{className:"plans-grid__details"},d.createElement("div",{className:"plans-grid__details-heading"},d.createElement(j,null,p("Detailed comparison"))),d.createElement("div",{className:"plans-grid__details-container"},d.createElement(Qe,{onSelect:c}))))},nt=function(e){var t=e.onNextStep,n=Object(c.useSelect)((function(e){return e(i).getSelectedDomain()})),r=Object(c.useSelect)((function(e){return e(i).getLaunchStep()})),o=Object(c.useSelect)((function(e){return e(i).getState()})).isExperimental,s=Object(c.useDispatch)(i),l=s.updatePlan,u=s.setStep,d=R().selectedFeatures,p=n&&!n.is_free;return Object(a.createElement)(D,{className:"nux-launch-plan-step"},Object(a.createElement)("div",{className:"nux-launch-step__header"},Object(a.createElement)("div",null,Object(a.createElement)(j,null,Object(f.__)("Select a plan","full-site-editing")),Object(a.createElement)(C,null,Object(f.__)("Pick a plan that’s right for you. Switch plans as your needs change. There’s no risk, you can cancel for a full refund within 30 days.","full-site-editing")))),Object(a.createElement)("div",{className:"nux-launch-step__body"},Object(a.createElement)(tt,{currentDomain:n,onPlanSelect:function(e){l(e),null==t||t()},onPickDomainClick:function(){u(r.Domain)},disabledPlans:p?S()({},Re.Plans.PLAN_FREE,Object(f.__)("Not available with custom domain","full-site-editing")):void 0,isExperimental:o,selectedFeatures:d})))},rt=n(48),it=n.n(rt);var ot=function(){function e(e){this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.before=null}var t=e.prototype;return t.insert=function(e){if(this.ctr%(this.isSpeedy?65e3:1)==0){var t,n=function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t}(this);t=0===this.tags.length?this.before:this.tags[this.tags.length-1].nextSibling,this.container.insertBefore(n,t),this.tags.push(n)}var r=this.tags[this.tags.length-1];if(this.isSpeedy){var i=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}(r);try{var o=105===e.charCodeAt(1)&&64===e.charCodeAt(0);i.insertRule(e,o?0:i.cssRules.length)}catch(a){0}}else r.appendChild(document.createTextNode(e));this.ctr++},t.flush=function(){this.tags.forEach((function(e){return e.parentNode.removeChild(e)})),this.tags=[],this.ctr=0},e}();var at=function(e){function t(e,r,s,l,p){for(var m,f,h,b,x,w=0,O=0,E=0,k=0,S=0,T=0,F=h=m=0,D=0,R=0,B=0,I=0,z=s.length,U=z-1,H="",$="",V="",q="";D<z;){if(f=s.charCodeAt(D),D===U&&0!==O+k+E+w&&(0!==O&&(f=47===O?10:47),k=E=w=0,z++,U++),0===O+k+E+w){if(D===U&&(0<R&&(H=H.replace(d,"")),0<H.trim().length)){switch(f){case 32:case 9:case 59:case 13:case 10:break;default:H+=s.charAt(D)}f=59}switch(f){case 123:for(m=(H=H.trim()).charCodeAt(0),h=1,I=++D;D<z;){switch(f=s.charCodeAt(D)){case 123:h++;break;case 125:h--;break;case 47:switch(f=s.charCodeAt(D+1)){case 42:case 47:e:{for(F=D+1;F<U;++F)switch(s.charCodeAt(F)){case 47:if(42===f&&42===s.charCodeAt(F-1)&&D+2!==F){D=F+1;break e}break;case 10:if(47===f){D=F+1;break e}}D=F}}break;case 91:f++;case 40:f++;case 34:case 39:for(;D++<U&&s.charCodeAt(D)!==f;);}if(0===h)break;D++}switch(h=s.substring(I,D),0===m&&(m=(H=H.replace(u,"").trim()).charCodeAt(0)),m){case 64:switch(0<R&&(H=H.replace(d,"")),f=H.charCodeAt(1)){case 100:case 109:case 115:case 45:R=r;break;default:R=A}if(I=(h=t(r,R,h,f,p+1)).length,0<L&&(x=c(3,h,R=n(A,H,B),r,C,j,I,f,p,l),H=R.join(""),void 0!==x&&0===(I=(h=x.trim()).length)&&(f=0,h="")),0<I)switch(f){case 115:H=H.replace(_,a);case 100:case 109:case 45:h=H+"{"+h+"}";break;case 107:h=(H=H.replace(g,"$1 $2"))+"{"+h+"}",h=1===P||2===P&&o("@"+h,3)?"@-webkit-"+h+"@"+h:"@"+h;break;default:h=H+h,112===l&&($+=h,h="")}else h="";break;default:h=t(r,n(r,H,B),h,l,p+1)}V+=h,h=B=R=F=m=0,H="",f=s.charCodeAt(++D);break;case 125:case 59:if(1<(I=(H=(0<R?H.replace(d,""):H).trim()).length))switch(0===F&&(m=H.charCodeAt(0),45===m||96<m&&123>m)&&(I=(H=H.replace(" ",":")).length),0<L&&void 0!==(x=c(1,H,r,e,C,j,$.length,l,p,l))&&0===(I=(H=x.trim()).length)&&(H="\0\0"),m=H.charCodeAt(0),f=H.charCodeAt(1),m){case 0:break;case 64:if(105===f||99===f){q+=H+s.charAt(D);break}default:58!==H.charCodeAt(I-1)&&($+=i(H,m,f,H.charCodeAt(2)))}B=R=F=m=0,H="",f=s.charCodeAt(++D)}}switch(f){case 13:case 10:47===O?O=0:0===1+m&&107!==l&&0<H.length&&(R=1,H+="\0"),0<L*M&&c(0,H,r,e,C,j,$.length,l,p,l),j=1,C++;break;case 59:case 125:if(0===O+k+E+w){j++;break}default:switch(j++,b=s.charAt(D),f){case 9:case 32:if(0===k+w+O)switch(S){case 44:case 58:case 9:case 32:b="";break;default:32!==f&&(b=" ")}break;case 0:b="\\0";break;case 12:b="\\f";break;case 11:b="\\v";break;case 38:0===k+O+w&&(R=B=1,b="\f"+b);break;case 108:if(0===k+O+w+N&&0<F)switch(D-F){case 2:112===S&&58===s.charCodeAt(D-3)&&(N=S);case 8:111===T&&(N=T)}break;case 58:0===k+O+w&&(F=D);break;case 44:0===O+E+k+w&&(R=1,b+="\r");break;case 34:case 39:0===O&&(k=k===f?0:0===k?f:k);break;case 91:0===k+O+E&&w++;break;case 93:0===k+O+E&&w--;break;case 41:0===k+O+w&&E--;break;case 40:if(0===k+O+w){if(0===m)switch(2*S+3*T){case 533:break;default:m=1}E++}break;case 64:0===O+E+k+w+F+h&&(h=1);break;case 42:case 47:if(!(0<k+w+E))switch(O){case 0:switch(2*f+3*s.charCodeAt(D+1)){case 235:O=47;break;case 220:I=D,O=42}break;case 42:47===f&&42===S&&I+2!==D&&(33===s.charCodeAt(I+2)&&($+=s.substring(I,D+1)),b="",O=0)}}0===O&&(H+=b)}T=S,S=f,D++}if(0<(I=$.length)){if(R=r,0<L&&(void 0!==(x=c(2,$,R,e,C,j,I,l,p,l))&&0===($=x).length))return q+$+V;if($=R.join(",")+"{"+$+"}",0!=P*N){switch(2!==P||o($,2)||(N=0),N){case 111:$=$.replace(y,":-moz-$1")+$;break;case 112:$=$.replace(v,"::-webkit-input-$1")+$.replace(v,"::-moz-$1")+$.replace(v,":-ms-input-$1")+$}N=0}}return q+$+V}function n(e,t,n){var i=t.trim().split(h);t=i;var o=i.length,a=e.length;switch(a){case 0:case 1:var c=0;for(e=0===a?"":e[0]+" ";c<o;++c)t[c]=r(e,t[c],n).trim();break;default:var s=c=0;for(t=[];c<o;++c)for(var l=0;l<a;++l)t[s++]=r(e[l]+" ",i[c],n).trim()}return t}function r(e,t,n){var r=t.charCodeAt(0);switch(33>r&&(r=(t=t.trim()).charCodeAt(0)),r){case 38:return t.replace(b,"$1"+e.trim());case 58:return e.trim()+t.replace(b,"$1"+e.trim());default:if(0<1*n&&0<t.indexOf("\f"))return t.replace(b,(58===e.charCodeAt(0)?"":"$1")+e.trim())}return e+t}function i(e,t,n,r){var a=e+";",c=2*t+3*n+4*r;if(944===c){e=a.indexOf(":",9)+1;var s=a.substring(e,a.length-1).trim();return s=a.substring(0,e).trim()+s+";",1===P||2===P&&o(s,1)?"-webkit-"+s+s:s}if(0===P||2===P&&!o(a,1))return a;switch(c){case 1015:return 97===a.charCodeAt(10)?"-webkit-"+a+a:a;case 951:return 116===a.charCodeAt(3)?"-webkit-"+a+a:a;case 963:return 110===a.charCodeAt(5)?"-webkit-"+a+a:a;case 1009:if(100!==a.charCodeAt(4))break;case 969:case 942:return"-webkit-"+a+a;case 978:return"-webkit-"+a+"-moz-"+a+a;case 1019:case 983:return"-webkit-"+a+"-moz-"+a+"-ms-"+a+a;case 883:if(45===a.charCodeAt(8))return"-webkit-"+a+a;if(0<a.indexOf("image-set(",11))return a.replace(S,"$1-webkit-$2")+a;break;case 932:if(45===a.charCodeAt(4))switch(a.charCodeAt(5)){case 103:return"-webkit-box-"+a.replace("-grow","")+"-webkit-"+a+"-ms-"+a.replace("grow","positive")+a;case 115:return"-webkit-"+a+"-ms-"+a.replace("shrink","negative")+a;case 98:return"-webkit-"+a+"-ms-"+a.replace("basis","preferred-size")+a}return"-webkit-"+a+"-ms-"+a+a;case 964:return"-webkit-"+a+"-ms-flex-"+a+a;case 1023:if(99!==a.charCodeAt(8))break;return"-webkit-box-pack"+(s=a.substring(a.indexOf(":",15)).replace("flex-","").replace("space-between","justify"))+"-webkit-"+a+"-ms-flex-pack"+s+a;case 1005:return m.test(a)?a.replace(p,":-webkit-")+a.replace(p,":-moz-")+a:a;case 1e3:switch(t=(s=a.substring(13).trim()).indexOf("-")+1,s.charCodeAt(0)+s.charCodeAt(t)){case 226:s=a.replace(x,"tb");break;case 232:s=a.replace(x,"tb-rl");break;case 220:s=a.replace(x,"lr");break;default:return a}return"-webkit-"+a+"-ms-"+s+a;case 1017:if(-1===a.indexOf("sticky",9))break;case 975:switch(t=(a=e).length-10,c=(s=(33===a.charCodeAt(t)?a.substring(0,t):a).substring(e.indexOf(":",7)+1).trim()).charCodeAt(0)+(0|s.charCodeAt(7))){case 203:if(111>s.charCodeAt(8))break;case 115:a=a.replace(s,"-webkit-"+s)+";"+a;break;case 207:case 102:a=a.replace(s,"-webkit-"+(102<c?"inline-":"")+"box")+";"+a.replace(s,"-webkit-"+s)+";"+a.replace(s,"-ms-"+s+"box")+";"+a}return a+";";case 938:if(45===a.charCodeAt(5))switch(a.charCodeAt(6)){case 105:return s=a.replace("-items",""),"-webkit-"+a+"-webkit-box-"+s+"-ms-flex-"+s+a;case 115:return"-webkit-"+a+"-ms-flex-item-"+a.replace(O,"")+a;default:return"-webkit-"+a+"-ms-flex-line-pack"+a.replace("align-content","").replace(O,"")+a}break;case 973:case 989:if(45!==a.charCodeAt(3)||122===a.charCodeAt(4))break;case 931:case 953:if(!0===k.test(e))return 115===(s=e.substring(e.indexOf(":")+1)).charCodeAt(0)?i(e.replace("stretch","fill-available"),t,n,r).replace(":fill-available",":stretch"):a.replace(s,"-webkit-"+s)+a.replace(s,"-moz-"+s.replace("fill-",""))+a;break;case 962:if(a="-webkit-"+a+(102===a.charCodeAt(5)?"-ms-"+a:"")+a,211===n+r&&105===a.charCodeAt(13)&&0<a.indexOf("transform",10))return a.substring(0,a.indexOf(";",27)+1).replace(f,"$1-webkit-$2")+a}return a}function o(e,t){var n=e.indexOf(1===t?":":"{"),r=e.substring(0,3!==t?n:10);return n=e.substring(n+1,e.length-1),F(2!==t?r:r.replace(E,"$1"),n,t)}function a(e,t){var n=i(t,t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2));return n!==t+";"?n.replace(w," or ($1)").substring(4):"("+t+")"}function c(e,t,n,r,i,o,a,c,s,u){for(var d,p=0,m=t;p<L;++p)switch(d=T[p].call(l,e,m,n,r,i,o,a,c,s,u)){case void 0:case!1:case!0:case null:break;default:m=d}if(m!==t)return m}function s(e){return void 0!==(e=e.prefix)&&(F=null,e?"function"!=typeof e?P=1:(P=2,F=e):P=0),s}function l(e,n){var r=e;if(33>r.charCodeAt(0)&&(r=r.trim()),r=[r],0<L){var i=c(-1,n,r,r,C,j,0,0,0,0);void 0!==i&&"string"==typeof i&&(n=i)}var o=t(A,r,n,0,0);return 0<L&&(void 0!==(i=c(-2,o,r,r,C,j,o.length,0,0,0))&&(o=i)),"",N=0,j=C=1,o}var u=/^\0+/g,d=/[\0\r\f]/g,p=/: */g,m=/zoo|gra/,f=/([,: ])(transform)/g,h=/,\r+?/g,b=/([\t\r\n ])*\f?&/g,g=/@(k\w+)\s*(\S*)\s*/,v=/::(place)/g,y=/:(read-only)/g,x=/[svh]\w+-[tblr]{2}/,_=/\(\s*(.*)\s*\)/g,w=/([\s\S]*?);/g,O=/-self|flex-/g,E=/[^]*?(:[rp][el]a[\w-]+)[^]*/,k=/stretch|:\s*\w+\-(?:conte|avail)/,S=/([^-])(image-set\()/,j=1,C=1,N=0,P=1,A=[],T=[],L=0,F=null,M=0;return l.use=function e(t){switch(t){case void 0:case null:L=T.length=0;break;default:if("function"==typeof t)T[L++]=t;else if("object"==typeof t)for(var n=0,r=t.length;n<r;++n)e(t[n]);else M=0|!!t}return e},l.set=s,void 0!==e&&s(e),l},ct=function(e){var t=new WeakMap;return function(n){if(t.has(n))return t.get(n);var r=e(n);return t.set(n,r),r}},st="/*|*/";function lt(e){e&&ut.current.insert(e+"}")}var ut={current:null},dt=function(e,t,n,r,i,o,a,c,s,l){switch(e){case 1:switch(t.charCodeAt(0)){case 64:return ut.current.insert(t+";"),"";case 108:if(98===t.charCodeAt(2))return""}break;case 2:if(0===c)return t+st;break;case 3:switch(c){case 102:case 112:return ut.current.insert(n[0]+t),"";default:return t+(0===l?st:"")}case-2:t.split("/*|*/}").forEach(lt)}},pt=function(e){void 0===e&&(e={});var t,n=e.key||"css";void 0!==e.prefix&&(t={prefix:e.prefix});var r=new at(t);var i,o={};i=e.container||document.head;var a,c=document.querySelectorAll("style[data-emotion-"+n+"]");Array.prototype.forEach.call(c,(function(e){e.getAttribute("data-emotion-"+n).split(" ").forEach((function(e){o[e]=!0})),e.parentNode!==i&&i.appendChild(e)})),r.use(e.stylisPlugins)(dt),a=function(e,t,n,i){var o=t.name;ut.current=n,r(e,t.styles),i&&(s.inserted[o]=!0)};var s={key:n,sheet:new ot({key:n,container:i,nonce:e.nonce,speedy:e.speedy}),nonce:e.nonce,inserted:o,registered:{},insert:a};return s};function mt(e,t,n){var r="";return n.split(" ").forEach((function(n){void 0!==e[n]?t.push(e[n]):r+=n+" "})),r}var ft=function(e,t,n){var r=e.key+"-"+t.name;if(!1===n&&void 0===e.registered[r]&&(e.registered[r]=t.styles),void 0===e.inserted[t.name]){var i=t;do{e.insert("."+r,i,e.sheet,!0);i=i.next}while(void 0!==i)}};var ht=function(e){for(var t,n=e.length,r=n^n,i=0;n>=4;)t=1540483477*(65535&(t=255&e.charCodeAt(i)|(255&e.charCodeAt(++i))<<8|(255&e.charCodeAt(++i))<<16|(255&e.charCodeAt(++i))<<24))+((1540483477*(t>>>16)&65535)<<16),r=1540483477*(65535&r)+((1540483477*(r>>>16)&65535)<<16)^(t=1540483477*(65535&(t^=t>>>24))+((1540483477*(t>>>16)&65535)<<16)),n-=4,++i;switch(n){case 3:r^=(255&e.charCodeAt(i+2))<<16;case 2:r^=(255&e.charCodeAt(i+1))<<8;case 1:r=1540483477*(65535&(r^=255&e.charCodeAt(i)))+((1540483477*(r>>>16)&65535)<<16)}return r=1540483477*(65535&(r^=r>>>13))+((1540483477*(r>>>16)&65535)<<16),((r^=r>>>15)>>>0).toString(36)},bt={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};var gt=function(e){var t={};return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}},vt=/[A-Z]|^ms/g,yt=/_EMO_([^_]+?)_([^]*?)_EMO_/g,xt=function(e){return 45===e.charCodeAt(1)},_t=function(e){return null!=e&&"boolean"!=typeof e},wt=gt((function(e){return xt(e)?e:e.replace(vt,"-$&").toLowerCase()})),Ot=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(yt,(function(e,t,n){return kt={name:t,styles:n,next:kt},t}))}return 1===bt[e]||xt(e)||"number"!=typeof t||0===t?t:t+"px"};function Et(e,t,n,r){if(null==n)return"";if(void 0!==n.__emotion_styles)return n;switch(typeof n){case"boolean":return"";case"object":if(1===n.anim)return kt={name:n.name,styles:n.styles,next:kt},n.name;if(void 0!==n.styles){var i=n.next;if(void 0!==i)for(;void 0!==i;)kt={name:i.name,styles:i.styles,next:kt},i=i.next;return n.styles+";"}return function(e,t,n){var r="";if(Array.isArray(n))for(var i=0;i<n.length;i++)r+=Et(e,t,n[i],!1);else for(var o in n){var a=n[o];if("object"!=typeof a)null!=t&&void 0!==t[a]?r+=o+"{"+t[a]+"}":_t(a)&&(r+=wt(o)+":"+Ot(o,a)+";");else if(!Array.isArray(a)||"string"!=typeof a[0]||null!=t&&void 0!==t[a[0]]){var c=Et(e,t,a,!1);switch(o){case"animation":case"animationName":r+=wt(o)+":"+c+";";break;default:r+=o+"{"+c+"}"}}else for(var s=0;s<a.length;s++)_t(a[s])&&(r+=wt(o)+":"+Ot(o,a[s])+";")}return r}(e,t,n);case"function":if(void 0!==e){var o=kt,a=n(e);return kt=o,Et(e,t,a,r)}break;case"string":}if(null==t)return n;var c=t[n];return void 0===c||r?n:c}var kt,St=/label:\s*([^\s;\n{]+)\s*;/g;var jt=function(e,t,n){if(1===e.length&&"object"==typeof e[0]&&null!==e[0]&&void 0!==e[0].styles)return e[0];var r=!0,i="";kt=void 0;var o=e[0];null==o||void 0===o.raw?(r=!1,i+=Et(n,t,o,!1)):i+=o[0];for(var a=1;a<e.length;a++)i+=Et(n,t,e[a],46===i.charCodeAt(i.length-1)),r&&(i+=o[a]);St.lastIndex=0;for(var c,s="";null!==(c=St.exec(i));)s+="-"+c[1];return{name:ht(i)+s,styles:i,next:kt}};var Ct=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return jt(t)},Nt=Object(d.createContext)("undefined"!=typeof HTMLElement?pt():null),Pt=Object(d.createContext)({}),At=(Nt.Provider,function(e){return Object(d.forwardRef)((function(t,n){return Object(d.createElement)(Nt.Consumer,null,(function(r){return e(t,r,n)}))}))});Object.prototype.hasOwnProperty;d.Component;var Tt=function e(t){for(var n=t.length,r=0,i="";r<n;r++){var o=t[r];if(null!=o){var a=void 0;switch(typeof o){case"boolean":break;case"object":if(Array.isArray(o))a=e(o);else for(var c in a="",o)o[c]&&c&&(a&&(a+=" "),a+=c);break;default:a=o}a&&(i&&(i+=" "),i+=a)}}return i};function Lt(e,t,n){var r=[],i=mt(e,r,n);return r.length<2?n:i+t(r)}At((function(e,t){return Object(d.createElement)(Pt.Consumer,null,(function(n){var r=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var i=jt(n,t.registered);return ft(t,i,!1),t.key+"-"+i.name},i={css:r,cx:function(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];return Lt(t.registered,r,Tt(n))},theme:n},o=e.children(i);return!0,o}))})),n(24),n(49);function Ft(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}var Mt=function(e,t){return"function"==typeof t?t(e):function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ft(n,!0).forEach((function(t){S()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ft(n).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},e,{},t)},Dt=ct((function(e){return ct((function(t){return Mt(e,t)}))})),Rt=function(e){return Object(d.createElement)(Pt.Consumer,null,(function(t){return e.theme!==t&&(t=Dt(t)(e.theme)),Object(d.createElement)(Pt.Provider,{value:t},e.children)}))};var Bt=Object(a.createElement)(x.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(a.createElement)(x.Path,{d:"M9 18.6L3.5 13l1-1L9 16.4l9.5-9.9 1 1z"})),It="#F6F7F7",zt="#DCDCDE",Ut="#A7AAAD",Ht="#8E9196",$t="#646970",Vt="#2C3338",qt="#008A20",Gt="#FFF",Yt="#000",Wt={colors:{background:It,surface:Gt,primary:"#C9356E",primaryBorder:"#700F3B",primaryOver:"#AB235A",highlight:"#006088",highlightBorder:"#002C40",highlightOver:"#004E6E",success:qt,discount:qt,disabledPaymentButtons:It,disabledPaymentButtonsAccent:zt,disabledButtons:Ut,borderColor:Ut,borderColorLight:zt,borderColorDark:$t,upcomingStepBackground:zt,textColor:Vt,textColorLight:$t,textColorDark:Yt,error:"#D63638",warningBackground:"#F7EBEC",outline:"#5198D9",applePayButtonColor:Yt,applePayButtonRollOverColor:Vt,noticeBackground:Vt,defaultNoticeIconBackground:Ht,textColorOnDarkBackground:Gt,paypalGold:"#F0C443",paypalGoldHover:"#FFB900",modalBackground:"rgba( 255,255,255,0.9 )",disabledField:It,placeHolderTextColor:Ht},breakpoints:{desktopUp:"min-width: 960px",tabletUp:"min-width: 700px",bigPhoneUp:"min-width: 480px",smallPhoneUp:"min-width: 400px"},weights:{bold:"600",normal:"400"},fonts:{body:'-apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif'},fontSize:{small:"14px"}},Kt=n(3),Xt=n.n(Kt);function Zt(e){return e.filter((function(e){return e})).join(" ")}var Jt=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,Qt=gt((function(e){return Jt.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91})),en=function(e){return"theme"!==e&&"innerRef"!==e},tn=function(e){return"string"==typeof e&&e.charCodeAt(0)>96?Qt:en};function nn(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 rn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?nn(n,!0).forEach((function(t){S()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nn(n).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var on=function e(t,n){var r,i,o;void 0!==n&&(r=n.label,o=n.target,i=t.__emotion_forwardProp&&n.shouldForwardProp?function(e){return t.__emotion_forwardProp(e)&&n.shouldForwardProp(e)}:n.shouldForwardProp);var a=t.__emotion_real===t,c=a&&t.__emotion_base||t;"function"!=typeof i&&a&&(i=t.__emotion_forwardProp);var s=i||tn(c),l=!s("as");return function(){var u=arguments,p=a&&void 0!==t.__emotion_styles?t.__emotion_styles.slice(0):[];if(void 0!==r&&p.push("label:"+r+";"),null==u[0]||void 0===u[0].raw)p.push.apply(p,u);else{0,p.push(u[0][0]);for(var m=u.length,f=1;f<m;f++)p.push(u[f],u[0][f])}var h=At((function(e,t,n){return Object(d.createElement)(Pt.Consumer,null,(function(r){var a=l&&e.as||c,u="",m=[],f=e;if(null==e.theme){for(var h in f={},e)f[h]=e[h];f.theme=r}"string"==typeof e.className?u=mt(t.registered,m,e.className):null!=e.className&&(u=e.className+" ");var b=jt(p.concat(m),t.registered,f);ft(t,b,"string"==typeof a);u+=t.key+"-"+b.name,void 0!==o&&(u+=" "+o);var g=l&&void 0===i?tn(a):s,v={};for(var y in e)l&&"as"===y||g(y)&&(v[y]=e[y]);return v.className=u,v.ref=n||e.innerRef,Object(d.createElement)(a,v)}))}));return h.displayName=void 0!==r?r:"Styled("+("string"==typeof c?c:c.displayName||c.name||"Component")+")",h.defaultProps=t.defaultProps,h.__emotion_real=h,h.__emotion_base=c,h.__emotion_styles=p,h.__emotion_forwardProp=i,Object.defineProperty(h,"toString",{value:function(){return"."+o}}),h.withComponent=function(t,r){return e(t,void 0!==r?rn({},n||{},{},r):n).apply(void 0,p)},h}}.bind();["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"].forEach((function(e){on[e]=on(e)}));var an=on,cn=J()("composite-checkout:checkout-error-boundary"),sn=function(e){function t(t){var n=e.call(this,t)||this;return n.state={hasError:!1,currentError:null},n}return Object(N.c)(t,e),t.getDerivedStateFromError=function(e){return{currentError:e,hasError:!0}},t.prototype.componentDidCatch=function(e,t){if(this.props.onError){var n=e.message+"; Stack: "+e.stack+"; Component Stack: "+t.componentStack;cn("reporting the error",n),this.props.onError(n)}},t.prototype.render=function(){return this.state.hasError?p.a.createElement(ln,{errorMessage:this.props.errorMessage}):this.props.children},t}(p.a.Component);function ln(e){var t=e.errorMessage;return p.a.createElement(mn,null,t)}var un,dn,pn,mn=an.div(un||(un=Object(N.e)(["\n\tmargin: 2em;\n\ttext-align: center;\n"],["\n\tmargin: 2em;\n\ttext-align: center;\n"])));!function(e){e.LOADING="loading",e.READY="ready",e.SUBMITTING="submitting",e.VALIDATING="validating",e.COMPLETE="complete"}(dn||(dn={})),function(e){e.NOT_STARTED="not-started",e.PENDING="pending",e.AUTHORIZING="authorizing",e.COMPLETE="complete",e.REDIRECTING="redirecting",e.ERROR="error"}(pn||(pn={}));var fn={transactionStatus:pn.NOT_STARTED,previousTransactionStatus:pn.NOT_STARTED,transactionError:null,transactionLastResponse:null,transactionRedirectUrl:null,resetTransaction:bn,setTransactionError:bn,setTransactionComplete:bn,setTransactionPending:bn,setTransactionRedirecting:bn,setTransactionAuthorizing:bn},hn={allPaymentMethods:[],paymentMethodId:null,setPaymentMethodId:bn,showErrorMessage:bn,showInfoMessage:bn,showSuccessMessage:bn,onEvent:bn,formStatus:dn.LOADING,setFormStatus:bn,transactionStatusManager:fn,paymentProcessors:{}};function bn(){}var gn=Object(d.createContext)(hn);J()("composite-checkout:form-status");function vn(){var e=Object(d.useContext)(gn),t=e.formStatus,n=e.setFormStatus,r=Object(d.useMemo)((function(){return{setFormLoading:function(){return n(dn.LOADING)},setFormReady:function(){return n(dn.READY)},setFormSubmitting:function(){return n(dn.SUBMITTING)},setFormValidating:function(){return n(dn.VALIDATING)},setFormComplete:function(){return n(dn.COMPLETE)}}}),[n]);return Object(d.useMemo)((function(){return Object(N.a)(Object(N.a)({},r),{formStatus:t})}),[t,r])}an.div(yn||(yn=Object(N.e)(["\n\tbackground: ",";\n\twidth: 100%;\n\tbox-sizing: border-box;\n\tmargin-bottom: 0;\n\n\t@media ( "," ) {\n\t\tborder: 1px solid ",";\n\t\tmargin: 32px auto;\n\t\tbox-sizing: border-box;\n\t\tmax-width: 556px;\n\t}\n"],["\n\tbackground: ",";\n\twidth: 100%;\n\tbox-sizing: border-box;\n\tmargin-bottom: 0;\n\n\t@media ( "," ) {\n\t\tborder: 1px solid ",";\n\t\tmargin: 32px auto;\n\t\tbox-sizing: border-box;\n\t\tmax-width: 556px;\n\t}\n"])),(function(e){return e.theme.colors.surface}),(function(e){return e.theme.breakpoints.tabletUp}),(function(e){return e.theme.colors.borderColorLight})),an.div(xn||(xn=Object(N.e)(["\n\tpadding: 24px;\n\tborder-top: 1px solid ",";\n\n\t:first-of-type {\n\t\tborder-top: 0;\n\t}\n"],["\n\tpadding: 24px;\n\tborder-top: 1px solid ",";\n\n\t:first-of-type {\n\t\tborder-top: 0;\n\t}\n"])),(function(e){return e.theme.colors.borderColorLight}));var yn,xn,_n,wn,On,En,kn=function(){var e=Ct.apply(void 0,arguments),t="animation-"+e.name;return{name:t,styles:"@keyframes "+t+"{"+e.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}(_n||(_n=Object(N.e)(["\n 0% {\n opacity: 1;\n }\n\n 70% {\n \topacity: 0.5;\n }\n\n 100% {\n opacity: 1;\n }\n"],["\n 0% {\n opacity: 1;\n }\n\n 70% {\n \topacity: 0.5;\n }\n\n 100% {\n opacity: 1;\n }\n"]))),Sn=(an.h1(wn||(wn=Object(N.e)(["\n\tfont-size: 14px;\n\tcontent: '';\n\tfont-weight: ",";\n\tbackground: ",";\n\tcolor: ",";\n\twidth: 40%;\n\tmargin: 3px 0 0 35px;\n\tpadding: 0;\n\tposition: relative;\n\tanimation: "," 2s ease-in-out infinite;\n\theight: 20px;\n\n\t.rtl & {\n\t\tmargin: 3px 35px 0 0;\n\t}\n\n\t::before {\n\t\tcontent: '';\n\t\tdisplay: block;\n\t\tposition: absolute;\n\t\tleft: -35px;\n\t\ttop: -3px;\n\t\twidth: 27px;\n\t\theight: 27px;\n\t\tbackground: ",";\n\t\tborder-radius: 100%;\n\n\t\t.rtl & {\n\t\t\tright: -35px;\n\t\t\tleft: auto;\n\t\t}\n\t}\n"],["\n\tfont-size: 14px;\n\tcontent: '';\n\tfont-weight: ",";\n\tbackground: ",";\n\tcolor: ",";\n\twidth: 40%;\n\tmargin: 3px 0 0 35px;\n\tpadding: 0;\n\tposition: relative;\n\tanimation: "," 2s ease-in-out infinite;\n\theight: 20px;\n\n\t.rtl & {\n\t\tmargin: 3px 35px 0 0;\n\t}\n\n\t::before {\n\t\tcontent: '';\n\t\tdisplay: block;\n\t\tposition: absolute;\n\t\tleft: -35px;\n\t\ttop: -3px;\n\t\twidth: 27px;\n\t\theight: 27px;\n\t\tbackground: ",";\n\t\tborder-radius: 100%;\n\n\t\t.rtl & {\n\t\t\tright: -35px;\n\t\t\tleft: auto;\n\t\t}\n\t}\n"])),(function(e){return e.theme.weights.normal}),(function(e){return e.theme.colors.borderColorLight}),(function(e){return e.theme.colors.borderColorLight}),kn,(function(e){return e.theme.colors.borderColorLight})),an.p(On||(On=Object(N.e)(["\n\tfont-size: 14px;\n\theight: 16px;\n\tcontent: '';\n\tbackground: ",";\n\tcolor: ",";\n\tmargin: 8px 0 0 35px;\n\tpadding: 0;\n\tanimation: "," 2s ease-in-out infinite;\n\n\t.rtl & {\n\t\tmargin: 8px 35px 0 0;\n\t}\n"],["\n\tfont-size: 14px;\n\theight: 16px;\n\tcontent: '';\n\tbackground: ",";\n\tcolor: ",";\n\tmargin: 8px 0 0 35px;\n\tpadding: 0;\n\tanimation: "," 2s ease-in-out infinite;\n\n\t.rtl & {\n\t\tmargin: 8px 35px 0 0;\n\t}\n"])),(function(e){return e.theme.colors.borderColorLight}),(function(e){return e.theme.colors.borderColorLight}),kn),an.div(En||(En=Object(N.e)(["\n\tbackground: ",";\n\tcontent: '';\n\tborder-top: 1px solid ",";\n\tpadding: 24px;\n\n\t::before {\n\t\tcontent: '';\n\t\tdisplay: block;\n\t\tborder: 1px solid ",";\n\t\tborder-radius: 3px;\n\t\tfont-size: 14px;\n\t\twidth: 100%;\n\t\theight: 40px;\n\t}\n"],["\n\tbackground: ",";\n\tcontent: '';\n\tborder-top: 1px solid ",";\n\tpadding: 24px;\n\n\t::before {\n\t\tcontent: '';\n\t\tdisplay: block;\n\t\tborder: 1px solid ",";\n\t\tborder-radius: 3px;\n\t\tfont-size: 14px;\n\t\twidth: 100%;\n\t\theight: 40px;\n\t}\n"])),(function(e){return e.theme.colors.background}),(function(e){return e.theme.colors.borderColorLight}),(function(e){return e.theme.colors.borderColorLight})),J()("composite-checkout:payment-methods"));function jn(){var e=Object(d.useContext)(gn),t=e.paymentMethodId,n=e.setPaymentMethodId,r=Cn();if(!n)throw new Error("usePaymentMethod can only be used inside a CheckoutProvider");if(!t)return null;var i=r.find((function(e){return e.id===t}));return i||(Sn("No payment method found matching id '"+t+"' in",r),null)}function Cn(){var e=Object(d.useContext)(gn).allPaymentMethods;if(!e)throw new Error("useAllPaymentMethods cannot be used outside of CheckoutProvider");return e}var Nn,Pn=function(e){var t=e.className,n=e.buttonType,r=e.isBusy,i=e.children,o=e.fullWidth,a=Object(N.f)(e,["className","buttonType","isBusy","children","fullWidth"]),c=Zt(Object(N.h)(["checkout-button"],n?["is-status-"+n]:[],r?["is-busy"]:[],t?[t]:[]));return p.a.createElement(An,Object(N.a)({fullWidth:o,buttonType:n,className:c},a),i)},An=an("button")(Nn||(Nn=Object(N.e)(["\n\tdisplay: block;\n\twidth: ",";\n\tfont-size: 16px;\n\tborder-radius: ",";\n\tpadding: ",";\n\tborder: ",";\n\tbackground: ",";\n\tcolor: ",";\n\tfont-weight: ",";\n\ttext-decoration: ",";\n\n\t:hover {\n\t\tbackground: ",";\n\t\tborder-color: ",";\n\t\ttext-decoration: none;\n\t\tcolor: ",";\n\t\tcursor: ",";\n\t}\n\n\t:active {\n\t\tbackground: ",";\n\t\ttext-decoration: ",";\n\t\tcolor: ",";\n\t}\n\n\tsvg {\n\t\tmargin-bottom: -1px;\n\t\ttransform: translateY( 2px );\n\t\tfilter: ",";\n\t\topacity: ",";\n\t}\n\n\t&.is-busy {\n\t\tanimation: components-button__busy-animation 2500ms infinite linear;\n\t\tbackground-image: linear-gradient(\n\t\t\t-45deg,\n\t\t\t"," 28%,\n\t\t\t"," 28%,\n\t\t\t"," 72%,\n\t\t\t"," 72%\n\t\t);\n\t\tbackground-size: 200px;\n\t\topacity: 1;\n\t}\n\n\t@keyframes components-button__busy-animation {\n\t\t0% {\n\t\t\tbackground-position: 200px 0;\n\t\t}\n\t}\n"],["\n\tdisplay: block;\n\twidth: ",";\n\tfont-size: 16px;\n\tborder-radius: ",";\n\tpadding: ",";\n\tborder: ",";\n\tbackground: ",";\n\tcolor: ",";\n\tfont-weight: ",";\n\ttext-decoration: ",";\n\n\t:hover {\n\t\tbackground: ",";\n\t\tborder-color: ",";\n\t\ttext-decoration: none;\n\t\tcolor: ",";\n\t\tcursor: ",";\n\t}\n\n\t:active {\n\t\tbackground: ",";\n\t\ttext-decoration: ",";\n\t\tcolor: ",";\n\t}\n\n\tsvg {\n\t\tmargin-bottom: -1px;\n\t\ttransform: translateY( 2px );\n\t\tfilter: ",";\n\t\topacity: ",";\n\t}\n\n\t&.is-busy {\n\t\tanimation: components-button__busy-animation 2500ms infinite linear;\n\t\tbackground-image: linear-gradient(\n\t\t\t-45deg,\n\t\t\t"," 28%,\n\t\t\t"," 28%,\n\t\t\t"," 72%,\n\t\t\t"," 72%\n\t\t);\n\t\tbackground-size: 200px;\n\t\topacity: 1;\n\t}\n\n\t@keyframes components-button__busy-animation {\n\t\t0% {\n\t\t\tbackground-position: 200px 0;\n\t\t}\n\t}\n"])),(function(e){return e.fullWidth?"100%":"auto"}),(function(e){return"paypal"===e.buttonType?"50px":"2px"}),(function(e){return"text-button"===e.buttonType?"0":"10px 15px"}),(function(e){return!e.buttonType||e.disabled?"1px solid "+e.theme.colors.borderColor:"0"}),Fn,Ln,(function(e){var t=e.disabled,n=e.buttonType,r=e.theme;if(t||"text-button"===n)return r.weights.normal;return r.weights.bold}),Dn,Tn,(function(e){return e.buttonType?"inherit":e.theme.colors.borderColorDark}),Ln,(function(e){return e.disabled?"not-allowed":"pointer"}),Tn,Dn,Ln,(function(e){var t=e.buttonType;return"grayscale( "+("primary"===t||"paypal"===t?"0":"100")+" ) invert( 0 );"}),(function(e){var t=e.buttonType;return"primary"===t||"paypal"===t?"1":"0.5"}),Fn,Mn,Mn,Fn);function Tn(e){var t=e.disabled,n=e.buttonType,r=e.theme.colors;if(t)return r.disabledPaymentButtons;switch(n){case"paypal":return r.paypalGoldHover;case"primary":return r.primaryOver;case"secondary":return r.highlightOver;case"text-button":case"borderless":default:return"none"}}function Ln(e){var t=e.disabled,n=e.buttonType,r=e.theme.colors;if(t)return r.disabledButtons;switch(n){case"primary":case"secondary":return r.surface;case"text-button":return r.highlight;default:return r.textColor}}function Fn(e){var t=e.disabled,n=e.buttonType,r=e.theme.colors;if(t)return r.disabledPaymentButtons;switch(n){case"paypal":return r.paypalGold;case"primary":return r.primary;case"secondary":return r.highlight;default:return"none"}}function Mn(e){var t=e.disabled,n=e.buttonType,r=e.theme.colors;if(t)return r.disabledPaymentButtonsAccent;switch(n){case"paypal":return r.paypalGoldHover;case"primary":return r.primaryOver;case"secondary":return r.highlightOver;case"text-button":case"borderless":default:return"none"}}function Dn(e){return"text-button"===e.buttonType?"underline":"none"}function Rn(e){var t=e.className,n=e.id;return p.a.createElement(In,{width:"20",height:"20",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",className:t},p.a.createElement("mask",{id:n+"-check-icon-mask","mask-type":"alpha",maskUnits:"userSpaceOnUse",x:"2",y:"4",width:"16",height:"12"},p.a.createElement("path",{d:"M7.32916 13.2292L3.85416 9.75417L2.67083 10.9292L7.32916 15.5875L17.3292 5.58751L16.1542 4.41251L7.32916 13.2292Z"})),p.a.createElement("g",{mask:"url(#"+n+"-check-icon-mask)"},p.a.createElement("rect",{width:"20",height:"20"})))}Rn.propTypes={className:Xt.a.string,id:Xt.a.string};var Bn,In=an.svg(Bn||(Bn=Object(N.e)(["\n\tfill: #fff;\n"],["\n\tfill: #fff;\n"])));var zn=function(e){var t=e.value,n=e.onClick,r=e.ariaLabel,i=Object(N.f)(e,["value","onClick","ariaLabel"]);return p.a.createElement(Pn,Object(N.a)({onClick:n,buttonType:"primary","aria-label":r},i),t)},Un=Object(d.createContext)({items:[],total:{id:"title",type:"total",label:"Total",amount:{currency:"USD",value:0,displayValue:"0"}}});function Hn(){var e=Object(d.useContext)(Un),t=e.items,n=e.total;if(!t||!n)throw new Error("useLineItems can only be used inside a CheckoutProvider");return[t,n]}an.ul($n||($n=Object(N.e)(["\n\tmargin: 0;\n\tpadding: 0;\n"],["\n\tmargin: 0;\n\tpadding: 0;\n"]))),an.li(Vn||(Vn=Object(N.e)(["\n\tmargin: 0;\n\tpadding: 0;\n\tlist-style-type: none;\n"],["\n\tmargin: 0;\n\tpadding: 0;\n\tlist-style-type: none;\n"])));an.span(qn||(qn=Object(N.e)(["\n\tdisplay: flex;\n\tjustify-content: space-between;\n"],["\n\tdisplay: flex;\n\tjustify-content: space-between;\n"]))),an.span(Gn||(Gn=Object(N.e)(["\n\tfont-weight: ",";\n"],["\n\tfont-weight: ",";\n"])),(function(e){return e.theme.weights.bold}));an.div(Yn||(Yn=Object(N.e)(["\n\tcolor: ",";\n\tfont-weight: ",";\n\tpadding: 24px 20px;\n"],["\n\tcolor: ",";\n\tfont-weight: ",";\n\tpadding: 24px 20px;\n"])),(function(e){return e.theme.colors.textColor}),(function(e){return e.theme.weights.bold})),an.div(Wn||(Wn=Object(N.e)(["\n\tborder-top: 1px solid ",";\n\tpadding: 24px 20px;\n"],["\n\tborder-top: 1px solid ",";\n\tpadding: 24px 20px;\n"])),(function(e){return e.theme.colors.borderColorLight}));var $n,Vn,qn,Gn,Yn,Wn,Kn,Xn,Zn=an.div(Kn||(Kn=Object(N.e)(["\n\tdisplay: flex;\n\tjustify-content: space-between;\n"],["\n\tdisplay: flex;\n\tjustify-content: space-between;\n"])));an(Zn)(Xn||(Xn=Object(N.e)(["\n\tfont-weight: ",";\n"],["\n\tfont-weight: ",";\n"])),(function(e){return e.theme.weights.bold}));function Jn(e){var t=e.children,n=e.className;return p.a.createElement(Qn,{className:Zt([n,"order-review-section"])},t)}Jn.propTypes={className:Xt.a.string};var Qn=an.div(tr||(tr=Object(N.e)(["\n\tmargin-bottom: 16px;\n"],["\n\tmargin-bottom: 16px;\n"])));function er(e){var t=e.item,n=e.className,r="checkout-line-item-"+t.id;return p.a.createElement("div",{className:Zt([n,"checkout-line-item"])},p.a.createElement("span",{id:r},t.label),p.a.createElement("span",{"aria-labelledby":r},t.amount.displayValue))}er.propTypes={className:Xt.a.string,total:Xt.a.bool,isSummaryVisible:Xt.a.bool,item:Xt.a.shape({label:Xt.a.string,amount:Xt.a.shape({displayValue:Xt.a.string})})};var tr,nr,rr=an(er)(nr||(nr=Object(N.e)(["\n\tdisplay: flex;\n\twidth: 100%;\n\tjustify-content: space-between;\n\tfont-weight: ",";\n\tcolor: ",";\n\tfont-size: ",";\n\tpadding: ",";\n\tborder-bottom: ",";\n\n\t:first-of-type {\n\t\tpadding-top: 0;\n\t}\n"],["\n\tdisplay: flex;\n\twidth: 100%;\n\tjustify-content: space-between;\n\tfont-weight: ",";\n\tcolor: ",";\n\tfont-size: ",";\n\tpadding: ",";\n\tborder-bottom: ",";\n\n\t:first-of-type {\n\t\tpadding-top: 0;\n\t}\n"])),(function(e){var t=e.theme;return e.total?t.weights.bold:t.weights.normal}),(function(e){var t=e.theme;return e.total?t.colors.textColorDark:"inherit"}),(function(e){return e.total?"1.2em":"1em"}),(function(e){var t=e.total;return e.isSummaryVisible||t?0:"24px 0"}),(function(e){var t=e.theme,n=e.total;return e.isSummaryVisible||n?0:"1px solid "+t.colors.borderColorLight}));function ir(e){var t=e.total,n=e.className;return p.a.createElement("div",{className:Zt([n,"order-review-total"])},p.a.createElement(rr,{total:!0,item:t}))}function or(e){var t=e.items,n=e.className,r=e.isSummaryVisible;return p.a.createElement("div",{className:Zt([n,"order-review-line-items"])},t.map((function(e){return p.a.createElement(rr,{isSummaryVisible:r,key:e.id,item:e})})))}function ar(e){var t=e.className,n=Hn(),r=n[0],i=n[1];return p.a.createElement("div",{className:Zt([t,"checkout-review-order"])},p.a.createElement(Jn,null,p.a.createElement(or,{items:r})),p.a.createElement(Jn,null,p.a.createElement(ir,{total:i})))}function cr(e){var t=e.checked,n=e.name,r=e.value,i=e.onChange,o=e.children,a=e.label,c=e.disabled,s=e.id,l=e.ariaLabel,u=Object(d.useState)(!1),m=u[0],f=u[1];return p.a.createElement(sr,{disabled:c,isFocused:m,checked:t},p.a.createElement(lr,{type:"radio",name:n,id:s,disabled:c,value:r,checked:t,onChange:i,onFocus:function(){f(!0)},onBlur:function(){f(!1)},readOnly:!i,"aria-label":l}),p.a.createElement(ur,{checked:t,htmlFor:s,disabled:c},a),o&&p.a.createElement(hr,{checked:t},o))}or.propTypes={className:Xt.a.string,isSummaryVisible:Xt.a.bool,items:Xt.a.arrayOf(Xt.a.shape({label:Xt.a.string,amount:Xt.a.shape({displayValue:Xt.a.string})}))},ar.propTypes={className:Xt.a.string},cr.propTypes={name:Xt.a.string.isRequired,id:Xt.a.string.isRequired,label:Xt.a.node.isRequired,disabled:Xt.a.bool,checked:Xt.a.bool,value:Xt.a.string.isRequired,onChange:Xt.a.func,ariaLabel:Xt.a.string.isRequired};var sr=an.div(dr||(dr=Object(N.e)(["\n\tposition: relative;\n\tmargin-top: 8px;\n\tborder-radius: 3px;\n\tbox-sizing: border-box;\n\twidth: 100%;\n\toutline: ",";\n\n\t:first-of-type {\n\t\tmargin: 0;\n\t}\n\n\t::before {\n\t\tdisplay: block;\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\tposition: absolute;\n\t\ttop: 0;\n\t\tleft: 0;\n\t\tcontent: '';\n\t\tborder: "," solid ",";\n\t\tborder-radius: 3px;\n\t\tbox-sizing: border-box;\n\n\t\t.rtl & {\n\t\t\tright: 0;\n\t\t\tleft: auto;\n\t\t}\n\t}\n\n\t:hover::before {\n\t\tborder: 3px solid ",";\n\t}\n\n\t.payment-logos {\n\t\tdisplay: none;\n\n\t\t@media ( "," ) {\n\t\t\tdisplay: block;\n\t\t\tfilter: grayscale( "," );\n\t\t}\n\t}\n\n\t:hover .payment-logos {\n\t\t@media ( "," ) {\n\t\t\tfilter: grayscale( 0 );\n\t\t}\n\t}\n\n\tsvg {\n\t\tfilter: grayscale( "," );\n\t}\n\n\t:hover svg {\n\t\tfilter: grayscale( 0 );\n\t}\n\n\t",";\n"],["\n\tposition: relative;\n\tmargin-top: 8px;\n\tborder-radius: 3px;\n\tbox-sizing: border-box;\n\twidth: 100%;\n\toutline: ",";\n\n\t:first-of-type {\n\t\tmargin: 0;\n\t}\n\n\t::before {\n\t\tdisplay: block;\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\tposition: absolute;\n\t\ttop: 0;\n\t\tleft: 0;\n\t\tcontent: '';\n\t\tborder: "," solid ",";\n\t\tborder-radius: 3px;\n\t\tbox-sizing: border-box;\n\n\t\t.rtl & {\n\t\t\tright: 0;\n\t\t\tleft: auto;\n\t\t}\n\t}\n\n\t:hover::before {\n\t\tborder: 3px solid ",";\n\t}\n\n\t.payment-logos {\n\t\tdisplay: none;\n\n\t\t@media ( "," ) {\n\t\t\tdisplay: block;\n\t\t\tfilter: grayscale( "," );\n\t\t}\n\t}\n\n\t:hover .payment-logos {\n\t\t@media ( "," ) {\n\t\t\tfilter: grayscale( 0 );\n\t\t}\n\t}\n\n\tsvg {\n\t\tfilter: grayscale( "," );\n\t}\n\n\t:hover svg {\n\t\tfilter: grayscale( 0 );\n\t}\n\n\t",";\n"])),(function(e){var t=e.isFocused,n=e.theme;if(t)return n.colors.outline+" solid 2px";return"0"}),(function(e){return e.checked?"3px":"1px"}),(function(e){var t=e.checked,n=e.theme;return t?n.colors.highlight:n.colors.borderColor}),(function(e){return e.theme.colors.highlight}),(function(e){return e.theme.breakpoints.smallPhoneUp}),br,(function(e){return e.theme.breakpoints.smallPhoneUp}),br,(function(e){if(!e.disabled)return null;return"\n\t\t::before,\n\t\t:hover::before {\n\t\t\tborder: 1px solid lightgray;\n\t\t}\n\n\t\tsvg,\n\t\t:hover svg {\n\t\t\tfilter: grayscale( 100% );\n\t\t\topacity: 50%;\n\t\t}\n\t"}));var lr=an.input(pr||(pr=Object(N.e)(["\n\tposition: absolute;\n\topacity: 0 !important;\n\n\tclear: none;\n\tcursor: pointer;\n\tdisplay: inline-block;\n\tline-height: 0;\n\theight: 16px;\n\tmargin: 2px 0 0;\n\tfloat: left;\n\toutline: 0;\n\tpadding: 0;\n\ttext-align: center;\n\tvertical-align: middle;\n\twidth: 16px;\n\tmin-width: 16px;\n\tappearance: none;\n"],["\n\tposition: absolute;\n\topacity: 0 !important;\n\n\tclear: none;\n\tcursor: pointer;\n\tdisplay: inline-block;\n\tline-height: 0;\n\theight: 16px;\n\tmargin: 2px 0 0;\n\tfloat: left;\n\toutline: 0;\n\tpadding: 0;\n\ttext-align: center;\n\tvertical-align: middle;\n\twidth: 16px;\n\tmin-width: 16px;\n\tappearance: none;\n"]))),ur=an.label(mr||(mr=Object(N.e)(["\n\tposition: relative;\n\tpadding: 16px 14px 16px 40px;\n\tborder-radius: 3px;\n\tbox-sizing: border-box;\n\twidth: 100%;\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\tjustify-content: space-between;\n\talign-items: flex-start;\n\tfont-size: 14px;\n\n\t.rtl & {\n\t\tpadding: 16px 40px 16px 14px;\n\t}\n\n\t:hover {\n\t\tcursor: pointer;\n\t}\n\n\t::before {\n\t\tdisplay: block;\n\t\twidth: 16px;\n\t\theight: 16px;\n\t\tcontent: '';\n\t\tborder: 1px solid ",";\n\t\tborder-radius: 100%;\n\t\ttop: 19px;\n\t\tleft: 16px;\n\t\tposition: absolute;\n\t\tbackground: ",";\n\t\tbox-sizing: border-box;\n\t\tz-index: 2;\n\n\t\t.rtl & {\n\t\t\tright: 16px;\n\t\t\tleft: auto;\n\t\t}\n\t}\n\n\t::after {\n\t\tdisplay: block;\n\t\twidth: 8px;\n\t\theight: 8px;\n\t\tcontent: '';\n\t\tborder-radius: 100%;\n\t\ttop: 23px;\n\t\tleft: 20px;\n\t\tposition: absolute;\n\t\tbackground: ",";\n\t\tbox-sizing: border-box;\n\t\tz-index: 3;\n\n\t\t.rtl & {\n\t\t\tright: 20px;\n\t\t\tleft: auto;\n\t\t}\n\t}\n\n\t",";\n"],["\n\tposition: relative;\n\tpadding: 16px 14px 16px 40px;\n\tborder-radius: 3px;\n\tbox-sizing: border-box;\n\twidth: 100%;\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\tjustify-content: space-between;\n\talign-items: flex-start;\n\tfont-size: 14px;\n\n\t.rtl & {\n\t\tpadding: 16px 40px 16px 14px;\n\t}\n\n\t:hover {\n\t\tcursor: pointer;\n\t}\n\n\t::before {\n\t\tdisplay: block;\n\t\twidth: 16px;\n\t\theight: 16px;\n\t\tcontent: '';\n\t\tborder: 1px solid ",";\n\t\tborder-radius: 100%;\n\t\ttop: 19px;\n\t\tleft: 16px;\n\t\tposition: absolute;\n\t\tbackground: ",";\n\t\tbox-sizing: border-box;\n\t\tz-index: 2;\n\n\t\t.rtl & {\n\t\t\tright: 16px;\n\t\t\tleft: auto;\n\t\t}\n\t}\n\n\t::after {\n\t\tdisplay: block;\n\t\twidth: 8px;\n\t\theight: 8px;\n\t\tcontent: '';\n\t\tborder-radius: 100%;\n\t\ttop: 23px;\n\t\tleft: 20px;\n\t\tposition: absolute;\n\t\tbackground: ",";\n\t\tbox-sizing: border-box;\n\t\tz-index: 3;\n\n\t\t.rtl & {\n\t\t\tright: 20px;\n\t\t\tleft: auto;\n\t\t}\n\t}\n\n\t",";\n"])),(function(e){return e.theme.colors.borderColor}),(function(e){return e.theme.colors.surface}),(function(e){var t=e.checked,n=e.theme;return t?n.colors.highlight:n.colors.surface}),(function(e){if(!e.disabled)return null;return"\n\t\tcolor: lightgray;\n\t\tfont-style: italic;\n\n\t\t:hover {\n\t\t\tcursor: default;\n\t\t}\n\n\t\t::before {\n\t\t\tborder: 1px solid lightgray;\n\t\t\tbackground: lightgray;\n\t\t}\n\n\t\t::after {\n\t\t\tbackground: white;\n\t\t}\n\n\t\tspan {\n\t\t\tcolor: lightgray;\n\t\t}\n\t"}));var dr,pr,mr,fr,hr=an.div(fr||(fr=Object(N.e)(["\n\tdisplay: ",";\n"],["\n\tdisplay: ",";\n"])),(function(e){return e.checked?"block":"none"}));function br(e){return e.checked?0:"100%"}function gr(){var e=Object(d.useContext)(gn).onEvent;if(!e)throw new Error("useEvents can only be used inside a CheckoutProvider");return e}var vr=J()("composite-checkout:checkout-payment-methods");function yr(e){var t=e.summary,n=e.isComplete,r=e.className,i=T().__,o=gr(),a=Object(d.useCallback)((function(e){return o({type:"PAYMENT_METHOD_LOAD_ERROR",payload:e})}),[o]),c=jn(),s=function(){var e=Object(d.useContext)(gn),t=e.paymentMethodId,n=e.setPaymentMethodId;if(!n)throw new Error("usePaymentMethodId can only be used inside a CheckoutProvider");return[t,n]}()[1],l=function(e){vr("setting payment method to",e),o({type:"PAYMENT_METHOD_SELECT",payload:e}),s(e)},u=Cn();return t&&n&&c?(vr("rendering selected paymentMethod",c),p.a.createElement("div",{className:Zt([r,"checkout-payment-methods"])},p.a.createElement(sn,{errorMessage:i("There was a problem with this payment method."),onError:a},p.a.createElement(xr,{id:c.id,label:c.label,activeContent:c.activeContent,inactiveContent:c.inactiveContent,checked:!0,summary:!0,ariaLabel:c.getAriaLabel(i)})))):t?(vr("summary requested, but no complete paymentMethod is selected; isComplete:",n,"paymentMethod:",c),null):(vr("rendering paymentMethods",u),p.a.createElement("div",{className:Zt([r,"checkout-payment-methods"])},p.a.createElement(wr,null,u.map((function(e){return p.a.createElement(sn,{key:e.id,errorMessage:Object(f.sprintf)(i("There was a problem with the payment method: %s"),e.id),onError:a},p.a.createElement(xr,{id:e.id,label:e.label,activeContent:e.activeContent,inactiveContent:e.inactiveContent,checked:(null==c?void 0:c.id)===e.id,onClick:l,ariaLabel:e.getAriaLabel(i)}))})))))}function xr(e){var t=e.id,n=e.label,r=e.activeContent,i=e.inactiveContent,o=e.checked,a=e.onClick,c=e.ariaLabel,s=e.summary,l=vn().formStatus;return s?p.a.createElement(p.a.Fragment,null,i&&i):p.a.createElement(cr,{name:"paymentMethod",value:t,id:t,checked:o,disabled:l!==dn.READY,onChange:a?function(){return a(t)}:void 0,ariaLabel:c,label:n},r&&r)}yr.propTypes={summary:Xt.a.bool,isComplete:Xt.a.bool.isRequired,className:Xt.a.string},xr.propTypes={id:Xt.a.string.isRequired,onClick:Xt.a.func,checked:Xt.a.bool.isRequired,ariaLabel:Xt.a.string.isRequired,activeContent:Xt.a.node,label:Xt.a.node,inactiveContent:Xt.a.node,summary:Xt.a.bool};var _r,wr=an.div(_r||(_r=Object(N.e)(["\n\tmargin-bottom: 16px;\n"],["\n\tmargin-bottom: 16px;\n"])));J()("composite-checkout:checkout");var Or=function(e){var t=e.children,n=e.className;return p.a.createElement(jr,{className:Zt([n,"checkout__summary-area"])},t)},Er=an.div(zr||(zr=Object(N.e)(["\n\tbackground: ",";\n\tborder-bottom: 1px solid ",";\n\n\t@media ( "," ) {\n\t\tborder: 1px solid ",";\n\t\tborder-bottom: none 0;\n\t}\n\n\t@media ( "," ) {\n\t\tborder: 1px solid ",";\n\t}\n"],["\n\tbackground: ",";\n\tborder-bottom: 1px solid ",";\n\n\t@media ( "," ) {\n\t\tborder: 1px solid ",";\n\t\tborder-bottom: none 0;\n\t}\n\n\t@media ( "," ) {\n\t\tborder: 1px solid ",";\n\t}\n"])),(function(e){return e.theme.colors.surface}),(function(e){return e.theme.colors.borderColorLight}),(function(e){return e.theme.breakpoints.smallPhoneUp}),(function(e){return e.theme.colors.borderColorLight}),(function(e){return e.theme.breakpoints.desktopUp}),(function(e){return e.theme.colors.borderColorLight}));function kr(e){var t=e.errorMessage,n=e.editButtonText,r=e.editButtonAriaLabel,i=e.nextStepButtonText,o=e.validatingButtonText,a=e.nextStepButtonAriaLabel,c=e.validatingButtonAriaLabel,s=e.isStepActive,l=e.isStepComplete,u=e.className,d=e.stepNumber,m=e.stepId,f=e.titleContent,h=e.goToThisStep,b=e.goToNextStep,g=e.activeStepContent,v=e.formStatus,y=e.completeStepContent,x=e.onError,_=T().__;return p.a.createElement(sn,{errorMessage:t||_("There was an error with this step."),onError:x},p.a.createElement(Pr,{className:u},p.a.createElement(Ar,{id:m,stepNumber:d,title:f,isActive:s,isComplete:l,onEdit:v===dn.READY&&l&&h&&!s?h:void 0,editButtonText:n||_("Edit"),editButtonAriaLabel:r||_("Edit this step")}),p.a.createElement(ni,{isVisible:s,className:"checkout-steps__step-content"},g,b&&s&&p.a.createElement(zn,{onClick:b,value:v===dn.VALIDATING?o||_("Please wait…"):i||_("Continue"),ariaLabel:v===dn.VALIDATING?c||_("Please wait…"):a||_("Continue to next step"),buttonType:"primary",disabled:v!==dn.READY,isBusy:v===dn.VALIDATING})),l&&y?p.a.createElement(ri,{isVisible:!s,className:"checkout-steps__step-complete-content"},y):null))}kr.propTypes={errorMessage:Xt.a.string,onError:Xt.a.func,editButtonAriaLabel:Xt.a.string,editButtonText:Xt.a.string,nextStepButtonText:Xt.a.string,nextStepButtonAriaLabel:Xt.a.string,isStepActive:Xt.a.bool.isRequired,isStepComplete:Xt.a.bool.isRequired,className:Xt.a.string,stepNumber:Xt.a.number,stepId:Xt.a.string.isRequired,titleContent:Xt.a.node.isRequired,goToThisStep:Xt.a.func,goToNextStep:Xt.a.func,activeStepContent:Xt.a.node,formStatus:Xt.a.string,completeStepContent:Xt.a.node,validatingButtonText:Xt.a.string,validatingButtonAriaLabel:Xt.a.string};an.div(Ur||(Ur=Object(N.e)(["\n\t*:focus {\n\t\toutline: "," solid 2px;\n\t}\n"],["\n\t*:focus {\n\t\toutline: "," solid 2px;\n\t}\n"])),(function(e){return e.theme.colors.outline}));var Sr=an.div(Hr||(Hr=Object(N.e)(["\n\tdisplay: flex;\n\tflex-direction: column;\n\twidth: 100%;\n\n\t@media ( "," ) {\n\t\tmargin: 0 auto 32px;\n\t}\n\n\t@media ( "," ) {\n\t\talign-items: flex-start;\n\t\tflex-direction: row;\n\t\tjustify-content: center;\n\t\tmax-width: none;\n\t}\n"],["\n\tdisplay: flex;\n\tflex-direction: column;\n\twidth: 100%;\n\n\t@media ( "," ) {\n\t\tmargin: 0 auto 32px;\n\t}\n\n\t@media ( "," ) {\n\t\talign-items: flex-start;\n\t\tflex-direction: row;\n\t\tjustify-content: center;\n\t\tmax-width: none;\n\t}\n"])),(function(e){return e.theme.breakpoints.tabletUp}),(function(e){return e.theme.breakpoints.desktopUp})),jr=an.div($r||($r=Object(N.e)(["\n\tbox-sizing: border-box;\n\tmargin: 0 auto;\n\twidth: 100%;\n\n\t@media ( "," ) {\n\t\tmax-width: 556px;\n\t}\n\n\t@media ( "," ) {\n\t\tmargin-right: 0;\n\t\tmargin-left: 24px;\n\t\torder: 2;\n\t\twidth: 328px;\n\n\t\t.rtl & {\n\t\t\tmargin-right: 24px;\n\t\t\tmargin-left: 0;\n\t\t}\n\t}\n"],["\n\tbox-sizing: border-box;\n\tmargin: 0 auto;\n\twidth: 100%;\n\n\t@media ( "," ) {\n\t\tmax-width: 556px;\n\t}\n\n\t@media ( "," ) {\n\t\tmargin-right: 0;\n\t\tmargin-left: 24px;\n\t\torder: 2;\n\t\twidth: 328px;\n\n\t\t.rtl & {\n\t\t\tmargin-right: 24px;\n\t\t\tmargin-left: 0;\n\t\t}\n\t}\n"])),(function(e){return e.theme.breakpoints.tabletUp}),(function(e){return e.theme.breakpoints.desktopUp})),Cr=an.div(Vr||(Vr=Object(N.e)(["\n\tbackground: ",";\n\tbox-sizing: border-box;\n\tmargin: 0 auto;\n\twidth: 100%;\n\n\t&.checkout__step-wrapper--last-step {\n\t\tmargin-bottom: 100px;\n\t}\n\n\t@media ( "," ) {\n\t\tborder: 1px solid ",";\n\t}\n\n\t@media ( "," ) {\n\t\tmax-width: 556px;\n\t}\n\n\t@media ( "," ) {\n\t\tmargin: 0;\n\t\torder: 1;\n\t\twidth: 556px;\n\t}\n"],["\n\tbackground: ",";\n\tbox-sizing: border-box;\n\tmargin: 0 auto;\n\twidth: 100%;\n\n\t&.checkout__step-wrapper--last-step {\n\t\tmargin-bottom: 100px;\n\t}\n\n\t@media ( "," ) {\n\t\tborder: 1px solid ",";\n\t}\n\n\t@media ( "," ) {\n\t\tmax-width: 556px;\n\t}\n\n\t@media ( "," ) {\n\t\tmargin: 0;\n\t\torder: 1;\n\t\twidth: 556px;\n\t}\n"])),(function(e){return e.theme.colors.surface}),(function(e){return e.theme.breakpoints.smallPhoneUp}),(function(e){return e.theme.colors.borderColorLight}),(function(e){return e.theme.breakpoints.tabletUp}),(function(e){return e.theme.breakpoints.desktopUp})),Nr=an.div(qr||(qr=Object(N.e)(["\n\tbackground: ",";\n\tpadding: 24px;\n\tbottom: 0;\n\tleft: 0;\n\tbox-sizing: border-box;\n\twidth: 100%;\n\tz-index: 10;\n\tborder-top-width: 0;\n\tborder-top-style: solid;\n\tborder-top-color: ",";\n\n\t.checkout__step-wrapper--last-step & {\n\t\tborder-top-width: 1px;\n\t\tposition: fixed;\n\t}\n\n\t.rtl & {\n\t\tright: 0;\n\t\tleft: auto;\n\t}\n\n\t.checkout-button {\n\t\twidth: 100%;\n\n\t\t.checkout__step-wrapper--last-step & {\n\t\t\twidth: calc( 100% - 60px );\n\t\t}\n\t}\n\n\t@media ( "," ) {\n\t\t.checkout__step-wrapper--last-step & {\n\t\t\tposition: relative;\n\t\t\tborder: 0;\n\n\t\t\t.checkout-button {\n\t\t\t\twidth: 100%;\n\t\t\t}\n\t\t}\n\t}\n"],["\n\tbackground: ",";\n\tpadding: 24px;\n\tbottom: 0;\n\tleft: 0;\n\tbox-sizing: border-box;\n\twidth: 100%;\n\tz-index: 10;\n\tborder-top-width: 0;\n\tborder-top-style: solid;\n\tborder-top-color: ",";\n\n\t.checkout__step-wrapper--last-step & {\n\t\tborder-top-width: 1px;\n\t\tposition: fixed;\n\t}\n\n\t.rtl & {\n\t\tright: 0;\n\t\tleft: auto;\n\t}\n\n\t.checkout-button {\n\t\twidth: 100%;\n\n\t\t.checkout__step-wrapper--last-step & {\n\t\t\twidth: calc( 100% - 60px );\n\t\t}\n\t}\n\n\t@media ( "," ) {\n\t\t.checkout__step-wrapper--last-step & {\n\t\t\tposition: relative;\n\t\t\tborder: 0;\n\n\t\t\t.checkout-button {\n\t\t\t\twidth: 100%;\n\t\t\t}\n\t\t}\n\t}\n"])),(function(e){return e.theme.colors.background}),(function(e){return e.theme.colors.borderColorLight}),(function(e){return e.theme.breakpoints.tabletUp}));var Pr=an.div(Gr||(Gr=Object(N.e)(["\n\tposition: relative;\n\tborder-bottom: 1px solid ",";\n\tpadding: 16px;\n\n\t&.checkout-step {\n\t\tbackground: ",";\n\t}\n\n\t&.checkout-step.is-active,\n\t&.checkout-step.is-complete {\n\t\tbackground: ",";\n\t}\n\n\t@media ( "," ) {\n\t\tpadding: 24px;\n\t}\n"],["\n\tposition: relative;\n\tborder-bottom: 1px solid ",";\n\tpadding: 16px;\n\n\t&.checkout-step {\n\t\tbackground: ",";\n\t}\n\n\t&.checkout-step.is-active,\n\t&.checkout-step.is-complete {\n\t\tbackground: ",";\n\t}\n\n\t@media ( "," ) {\n\t\tpadding: 24px;\n\t}\n"])),(function(e){return e.theme.colors.borderColorLight}),(function(e){return e.theme.colors.background}),(function(e){return e.theme.colors.surface}),(function(e){return e.theme.breakpoints.tabletUp}));function Ar(e){var t=e.id,n=e.className,r=e.stepNumber,i=e.title,o=e.isActive,a=e.isComplete,c=e.onEdit,s=e.editButtonText,l=e.editButtonAriaLabel,u=T().__,d=!!c;return p.a.createElement(Fr,{isComplete:a,isActive:o,className:Zt([n,"checkout-step__header"])},p.a.createElement(Tr,{isComplete:a,isActive:o,id:t},r||null),p.a.createElement(Lr,{fullWidth:!d,isActive:o},i),d&&p.a.createElement(Ir,{className:"checkout-step__edit-button",buttonType:"text-button",onClick:c,"aria-label":l||u("Edit this step")},s||u("Edit")))}function Tr(e){var t=e.isComplete,n=e.isActive,r=e.className,i=e.children,o=e.id,a=!n&&t;return p.a.createElement(Mr,{className:Zt([r,"checkout-step__stepper"])},p.a.createElement(Dr,{isComplete:a},p.a.createElement(Rr,{isComplete:a,isActive:n},i),p.a.createElement(Br,null,p.a.createElement(Rn,{id:o}))))}Ar.propTypes={id:Xt.a.string,className:Xt.a.string,stepNumber:Xt.a.number,title:Xt.a.node.isRequired,isActive:Xt.a.bool,isComplete:Xt.a.bool,editButtonText:Xt.a.string,editButtonAriaLabel:Xt.a.string,onEdit:Xt.a.func},Tr.propTypes={id:Xt.a.string,className:Xt.a.string,isComplete:Xt.a.bool,isActive:Xt.a.bool};var Lr=an.span(Yr||(Yr=Object(N.e)(["\n\tcolor: ",";\n\tfont-weight: ",";\n\tmargin-right: ",";\n\tflex: ",";\n\n\t.rtl & {\n\t\tmargin-right: 0;\n\t\tmargin-left: ",";\n\t}\n"],["\n\tcolor: ",";\n\tfont-weight: ",";\n\tmargin-right: ",";\n\tflex: ",";\n\n\t.rtl & {\n\t\tmargin-right: 0;\n\t\tmargin-left: ",";\n\t}\n"])),(function(e){return e.isActive?e.theme.colors.textColorDark:e.theme.colors.textColor}),(function(e){return e.isActive?e.theme.weights.bold:e.theme.weights.normal}),(function(e){return e.fullWidth?"0":"8px"}),(function(e){return e.fullWidth?"1":"inherit"}),(function(e){return e.fullWidth?"0":"8px"})),Fr=an.h2(Wr||(Wr=Object(N.e)(["\n\tfont-size: 16px;\n\tdisplay: flex;\n\twidth: 100%;\n\talign-items: center;\n\tmargin: 0 0 ",";\n"],["\n\tfont-size: 16px;\n\tdisplay: flex;\n\twidth: 100%;\n\talign-items: center;\n\tmargin: 0 0 ",";\n"])),(function(e){return e.isComplete||e.isActive?"8px":"0"})),Mr=an.div(Kr||(Kr=Object(N.e)(["\n\tposition: relative;\n\twidth: 27px;\n\theight: 27px;\n\tmargin-right: 8px;\n\n\t.rtl & {\n\t\tmargin-right: 0;\n\t\tmargin-left: 8px;\n\t}\n"],["\n\tposition: relative;\n\twidth: 27px;\n\theight: 27px;\n\tmargin-right: 8px;\n\n\t.rtl & {\n\t\tmargin-right: 0;\n\t\tmargin-left: 8px;\n\t}\n"]))),Dr=an.div(Xr||(Xr=Object(N.e)(["\n\tposition: relative;\n\ttransform-origin: center center;\n\ttransition: transform 0.3s 0.1s ease-out;\n\ttransform-style: preserve-3d;\n\ttransform: ",";\n"],["\n\tposition: relative;\n\ttransform-origin: center center;\n\ttransition: transform 0.3s 0.1s ease-out;\n\ttransform-style: preserve-3d;\n\ttransform: ",";\n"])),(function(e){return e.isComplete?"rotateY(180deg)":"rotateY(0)"})),Rr=an.div(Zr||(Zr=Object(N.e)(["\n\tbackground: ",";\n\tfont-weight: normal;\n\twidth: 27px;\n\theight: 27px;\n\tline-height: 27px;\n\tbox-sizing: border-box;\n\ttext-align: center;\n\tborder-radius: 50%;\n\tcolor: ",";\n\tposition: absolute;\n\ttop: 0;\n\tleft: 0;\n\tbackface-visibility: hidden;\n\n\t.rtl & {\n\t\tright: 0;\n\t\tleft: auto;\n\t}\n\n\t// Reason: The IE media query needs to not have spaces within brackets otherwise ie11 doesn't read them\n\t// prettier-ignore\n\t@media all and (-ms-high-contrast:none), (-ms-high-contrast:active) {\n\t\tz-index: ",";\n\t}\n"],["\n\tbackground: ",";\n\tfont-weight: normal;\n\twidth: 27px;\n\theight: 27px;\n\tline-height: 27px;\n\tbox-sizing: border-box;\n\ttext-align: center;\n\tborder-radius: 50%;\n\tcolor: ",";\n\tposition: absolute;\n\ttop: 0;\n\tleft: 0;\n\tbackface-visibility: hidden;\n\n\t.rtl & {\n\t\tright: 0;\n\t\tleft: auto;\n\t}\n\n\t// Reason: The IE media query needs to not have spaces within brackets otherwise ie11 doesn't read them\n\t// prettier-ignore\n\t@media all and (-ms-high-contrast:none), (-ms-high-contrast:active) {\n\t\tz-index: ",";\n\t}\n"])),(function(e){var t=e.isComplete,n=e.isActive,r=e.theme;if(n)return r.colors.highlight;if(t)return r.colors.success;return r.colors.upcomingStepBackground}),(function(e){var t=e.isComplete,n=e.isActive,r=e.theme;if(t||n)return r.colors.surface;return r.colors.textColor}),(function(e){return e.isComplete?"0":"1"})),Br=an(Rr)(Jr||(Jr=Object(N.e)(["\n\tbackground: ",";\n\ttransform: rotateY( 180deg );\n\t// Reason: media query needs to not have spaces within brackets otherwise ie11 doesn't read them\n\t// prettier-ignore\n\t@media all and (-ms-high-contrast:none), (-ms-high-contrast:active) {\n\t\tbackface-visibility: visible;\n\t\tz-index: ",";\n\t}\n\n\tsvg {\n\t\tmargin-top: 4px;\n\t}\n"],["\n\tbackground: ",";\n\ttransform: rotateY( 180deg );\n\t// Reason: media query needs to not have spaces within brackets otherwise ie11 doesn't read them\n\t// prettier-ignore\n\t@media all and (-ms-high-contrast:none), (-ms-high-contrast:active) {\n\t\tbackface-visibility: visible;\n\t\tz-index: ",";\n\t}\n\n\tsvg {\n\t\tmargin-top: 4px;\n\t}\n"])),(function(e){return e.theme.colors.success}),(function(e){return e.isComplete?"1":"0"})),Ir=an(Pn)(Qr||(Qr=Object(N.e)(["\n\tfont-size: 14px;\n\tpadding-top: 1px;\n"],["\n\tfont-size: 14px;\n\tpadding-top: 1px;\n"])));var zr,Ur,Hr,$r,Vr,qr,Gr,Yr,Wr,Kr,Xr,Zr,Jr,Qr,ei,ti,ni=an.div(ei||(ei=Object(N.e)(["\n\tcolor: ",";\n\tdisplay: ",";\n\tpadding-left: 35px;\n\n\t.rtl & {\n\t\tpadding-right: 35px;\n\t\tpadding-left: 0;\n\t}\n"],["\n\tcolor: ",";\n\tdisplay: ",";\n\tpadding-left: 35px;\n\n\t.rtl & {\n\t\tpadding-right: 35px;\n\t\tpadding-left: 0;\n\t}\n"])),(function(e){return e.theme.colors.textColor}),(function(e){return e.isVisible?"block":"none"})),ri=an.div(ti||(ti=Object(N.e)(["\n\tcolor: ",";\n\tfont-size: 14px;\n\tdisplay: ",";\n\tpadding-left: 35px;\n\n\t.rtl & {\n\t\tpadding-right: 35px;\n\t\tpadding-left: 0;\n\t}\n"],["\n\tcolor: ",";\n\tfont-size: 14px;\n\tdisplay: ",";\n\tpadding-left: 35px;\n\n\t.rtl & {\n\t\tpadding-right: 35px;\n\t\tpadding-left: 0;\n\t}\n"])),(function(e){return e.theme.colors.textColorLight}),(function(e){return e.isVisible?"block":"none"}));n(97);var ii,oi,ai=Object(a.createElement)(y,{icon:Bt,size:17}),ci=function(e){var t=e.onNextStep,n=Object(c.useSelect)((function(e){return e(i).getSelectedDomain()})),r=Object(c.useSelect)((function(e){return e(i).getSelectedPlan()})),s=Object(c.useSelect)((function(e){return e(o).getPrices()})),l=Object(c.useSelect)((function(e){return e(i).getLaunchStep()})),d=Object(c.useSelect)((function(e){return e(i).isStepCompleted})),p=Object(c.useSelect)((function(e){return e(i).isFlowCompleted()})),b=Object(m.useEntityProp)("root","site","title"),g=u()(b,1)[0],v=R().currentDomainName,y=function(){var e,t=q();return null===(e=Object(c.useSelect)((function(e){if(t&&!(t.length<2))return e("automattic/domains/suggestions").getDomainSuggestions(t,{include_wordpressdotcom:!1,include_dotblogsubdomain:!1,quantity:1,locale:"en"})}),[t]))||void 0===e?void 0:e[0]}(),x=q(),_=Object(c.useDispatch)(i).setStep,w=Object(a.createElement)("div",{className:"nux-launch__summary-item"},Object(a.createElement)("p",null,Object(f.__)("Site","full-site-editing"),": ",g)),O=Object(a.createElement)("div",{className:"nux-launch__summary-item"},(null==n?void 0:n.domain_name)?Object(a.createElement)("p",null,Object(f.__)("Custom domain","full-site-editing"),": ",n.domain_name):Object(a.createElement)(a.Fragment,null,Object(a.createElement)("p",null,Object(f.__)("Free site address","full-site-editing"),": ",v),Object(a.createElement)(h.Tip,null,x?Object(a.createInterpolateElement)(Object(f.__)("A custom site address like <DomainName /> (<Link>now available!</Link>) is more unique and can help with your SEO ranking.","full-site-editing"),{DomainName:Object(a.createElement)("span",{className:E()("nux-launch__summary-item__domain-name",{"is-loading":!y})},(null==y?void 0:y.domain_name)||"loading-example.com"),Link:Object(a.createElement)(h.Button,{isLink:!0,onClick:function(){return _(l.Domain)}})}):Object(f.__)("A custom site address is more unique and can help with your SEO ranking.","full-site-editing")))),k=Object(a.createElement)("div",{className:"nux-launch__summary-item"},r&&!(null==r?void 0:r.isFree)?Object(a.createElement)(a.Fragment,null,Object(a.createElement)("p",{className:"nux-launch__summary-item__plan-name"},"WordPress.com ",r.title),Object(f.__)("Plan subscription","full-site-editing"),": ",s[r.storeSlug]," ",Object(f.__)("per month, billed yearly","full-site-editing")):Object(a.createElement)(a.Fragment,null,Object(a.createElement)("p",{className:"nux-launch__summary-item__plan-name"},"WordPress.com Free"),Object(a.createElement)("p",null,Object(f.__)("Plan subscription: Free forever","full-site-editing")),Object(a.createElement)(h.Tip,null,Object(a.createInterpolateElement)(Object(f.__)("<Link>Upgrade to Premium</Link> to get access to 13GB storage space, payment collection options, 24/7 Live Chat support, and more. Not sure? Give it a spin—we offer 30-day full-refunds, guaranteed.","full-site-editing"),{Link:Object(a.createElement)(h.Button,{isLink:!0,onClick:function(){return _(l.Plan)}})}))));return Object(a.createElement)(D,{className:"nux-launch-final-step"},Object(a.createElement)("div",{className:"nux-launch-step__header"},Object(a.createElement)("div",null,Object(a.createElement)(j,null,Object(f.__)("Launch your site","full-site-editing")),Object(a.createElement)(C,null,Object(f.__)("Your site will be made public and ready to share with others.","full-site-editing")))),Object(a.createElement)("div",{className:"nux-launch-step__body"},Object(a.createElement)(Rt,{theme:Wt},Object(a.createElement)(Sr,null,d(l.Plan)&&Object(a.createElement)(Or,null,Object(a.createElement)(Er,{className:"nux-launch__feature-list"},Object(a.createElement)("h3",{className:"nux-launch__feature-list-title"},Object(f.__)("Included in your plan","full-site-editing")),Object(a.createElement)("ul",{className:"nux-launch__feature-item-group"},null==r?void 0:r.features.map((function(e,t){return Object(a.createElement)("li",{key:t,className:"nux-launch__feature-item"},ai," ",e)}))),Object(a.createElement)("p",null,Object(f.__)("Questions?","full-site-editing")," ",Object(a.createElement)(h.Button,{isLink:!0,href:"https://wordpress.com/help/contact",target:"_blank"},Object(f.__)("Ask a Happiness Engineer","full-site-editing"))))),Object(a.createElement)(Cr,null,Object(a.createElement)(kr,{titleContent:Object(f.__)("Your site name","full-site-editing"),isStepComplete:d(l.Name),goToThisStep:function(){return _(l.Name)},completeStepContent:w,stepId:"name",formStatus:"ready"}),Object(a.createElement)(kr,{titleContent:Object(f.__)("Your domain","full-site-editing"),isStepComplete:d(l.Domain),goToThisStep:function(){return _(l.Domain)},completeStepContent:O,stepId:"domain",formStatus:"ready"}),Object(a.createElement)(kr,{titleContent:Object(f.__)("Your plan","full-site-editing"),isStepComplete:d(l.Plan),goToThisStep:function(){return _(l.Plan)},completeStepContent:k,stepId:"plan",formStatus:"ready"}),Object(a.createElement)(Nr,null,Object(a.createElement)(h.Button,{isPrimary:!0,disabled:!p,onClick:t,className:"nux-launch__submit-button"},Object(f.__)("Launch your site","full-site-editing"))))))))},si=(n(100),function(e){var t,n=e.onSubmit,r=Object(c.useSelect)((function(e){return e(i).getState()})).step,o=Object(c.useSelect)((function(e){return e(i).getLaunchStep()})),s=Object(c.useSelect)((function(e){return e(i).getLaunchSequence()})),l=Object(c.useSelect)((function(e){return e(i).getFirstIncompleteStep()})),u=Object(c.useDispatch)(i).setStep,p=(t={},S()(t,o.Name,G),S()(t,o.Domain,De),S()(t,o.Plan,nt),S()(t,o.Final,ci),t),m=s.indexOf(r),f=p[r];return d.useEffect((function(){l&&l!==o.Name&&u(l)}),[]),Object(a.createElement)("div",{className:"nux-launch"},Object(a.createElement)(f,{onPrevStep:function(){var e=m-1;e<0&&(e=0),u(s[e])},onNextStep:function(){var e=m+1;e>s.length-1&&(null==n||n()),u(s[e])}}))}),li=Object(a.createElement)(h.SVG,{viewBox:"0 0 24 24"},Object(a.createElement)(h.Circle,{cx:"12",cy:"12",r:"5"})),ui=function(e){var t=e.title,n=e.isCompleted,r=e.isCurrent,i=e.isDisabled,o=e.onClick;return Object(a.createElement)(h.Button,{className:E()("nux-launch-menu__item",{"is-current":r,"is-completed":n}),onClick:o,disabled:i,isLink:!0},Object(a.createElement)(y,{icon:n?Bt:li,size:16}),Object(a.createElement)("span",null,t))},di=(n(101),function(){var e,t=Object(c.useSelect)((function(e){return e(i).getState()})).step,n=Object(c.useSelect)((function(e){return e(i).getLaunchStep()})),r=Object(c.useSelect)((function(e){return e(i).getLaunchSequence()})),o=Object(c.useSelect)((function(e){return e(i).isStepCompleted})),s=Object(c.useSelect)((function(e){return e(i).isFlowStarted()})),l=(e={},S()(e,n.Name,Object(f.__)("Name your site","full-site-editing")),S()(e,n.Domain,Object(f.__)("Select a domain","full-site-editing")),S()(e,n.Plan,Object(f.__)("Select a plan","full-site-editing")),S()(e,n.Final,Object(f.__)("Launch your site","full-site-editing")),e),u=Object(c.useDispatch)(i).setStep;return Object(a.createElement)("div",{className:"nux-launch-menu"},Object(a.createElement)("h4",null,Object(f.__)("Site Launch Steps","full-site-editing")),Object(a.createElement)("div",{className:"nux-launch-menu__item-group"},r.map((function(e){return Object(a.createElement)(ui,{title:l[e],isCompleted:o(e),isCurrent:e===t,onClick:function(){return u(e)},isDisabled:e===n.Final&&!s})}))))}),pi=(n(102),function(){return Object(a.createElement)("div",{className:"nux-launch-sidebar"},Object(a.createElement)("h2",null,Object(f.__)("You're almost there!","full-site-editing")),Object(a.createElement)("h3",null,Object(f.__)("Complete the following steps to launch your site. Your site will remain private until you Launch.","full-site-editing")),Object(a.createElement)(di,null))}),mi=(n(103),function(e){var t=e.onClose,n=Object(c.useSelect)((function(e){return e(i).getState()})).step,r=Object(c.useDispatch)(i).launchSite,o=d.useState(!1),s=u()(o,2),l=s[0],p=s[1],b=function(){p(!0),r()};return R().isPaidPlan&&!l&&b(),Object(a.createElement)(h.Modal,{open:!0,className:E()("nux-launch-modal","step-".concat(n)),overlayClassName:"nux-launch-modal-overlay",bodyOpenClassName:"has-nux-launch-modal",onRequestClose:t,title:""},l?Object(a.createElement)("div",{className:"nux-launch-modal-body__launching"},Object(f.__)("Hooray! Your site will be ready shortly.","full-site-editing")):Object(a.createElement)(a.Fragment,null,Object(a.createElement)("div",{className:"nux-launch-modal-header"},Object(a.createElement)("div",{className:"nux-launch-modal-header__wp-logo"},Object(a.createElement)(y,{icon:_,size:36}))),Object(a.createElement)("div",{className:"nux-launch-modal-body"},Object(a.createElement)(m.EntityProvider,{kind:"root",type:"site"},Object(a.createElement)(si,{onSubmit:b}))),Object(a.createElement)("div",{className:"nux-launch-modal-aside"},Object(a.createElement)(h.Button,{isLink:!0,className:"nux-launch-modal__close-button",onClick:t,"aria-label":Object(f.__)("Close dialog","full-site-editing"),disabled:!t},Object(a.createElement)(y,{icon:w,size:24})),Object(a.createElement)(pi,null))))});ii="a8c-editor-site-launch",oi={render:function(){var e=Object(c.useSelect)((function(e){return e(i).getState()})).isSidebarOpen,t=Object(c.useDispatch)(i).closeSidebar;return function(){var e=R().launchStatus,t=Object(c.useSelect)((function(e){return e(i).getState()})),n=t.plan,a=t.domain,s=Object(c.useSelect)((function(e){return e(o).isPlanEcommerce(null==n?void 0:n.storeSlug)})),l=Object(c.useDispatch)(r),u=l.getCart,p=l.setCart;d.useEffect((function(){if(e){if(n&&!(null==n?void 0:n.isFree)){var t={product_id:n.productId,product_slug:n.storeSlug,extra:{source:"gutenboarding"}},r={meta:null==a?void 0:a.domain_name,product_id:null==a?void 0:a.product_id,extra:{privacy_available:null==a?void 0:a.supports_privacy,privacy:null==a?void 0:a.supports_privacy,source:"gutenboarding"}};return void function(){var e=$()(regeneratorRuntime.mark((function e(){var n,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,u(window._currentSiteId);case 2:return n=e.sent,e.next=5,p(window._currentSiteId,U()(U()({},n),{},{products:[].concat(I()(n.products),[t,r])}));case 5:i=Object(V.addQueryArgs)("https://wordpress.com/checkout/".concat(window._currentSiteId),U()({preLaunch:1},!s&&{redirect_to:"/home/".concat(window._currentSiteId)})),window.top.location.href=i;case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()()}window.top.location.href="https://wordpress.com/home/".concat(window._currentSiteId)}}),[e])}(),e?Object(a.createElement)(mi,{onClose:t}):null}},Object(s.registerPlugin)(ii,oi)}]));
event-countdown-block/dist/event-countdown-block.asset.php CHANGED
@@ -1 +1 @@
1
- <?php return array('dependencies' => array('wp-blocks', 'wp-components', 'wp-date', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => '168dd40fe07d61072d3f76fb79a69343');
1
+ <?php return array('dependencies' => array('wp-blocks', 'wp-components', 'wp-date', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => '725e3fe31ff1e71ae532d3d8c841024b');
full-site-editing-plugin.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Plugin Name: WordPress.com Editing Toolkit
4
  * Description: Enhances your page creation workflow within the Block Editor.
5
- * Version: 2.5
6
  * Author: Automattic
7
  * Author URI: https://automattic.com/wordpress-plugins/
8
  * License: GPLv2 or later
@@ -35,7 +35,7 @@ namespace A8C\FSE;
35
  *
36
  * @var string
37
  */
38
- define( 'PLUGIN_VERSION', '2.5' );
39
 
40
  // Always include these helper files for dotcom FSE.
41
  require_once __DIR__ . '/dotcom-fse/helpers.php';
2
  /**
3
  * Plugin Name: WordPress.com Editing Toolkit
4
  * Description: Enhances your page creation workflow within the Block Editor.
5
+ * Version: 2.6
6
  * Author: Automattic
7
  * Author URI: https://automattic.com/wordpress-plugins/
8
  * License: GPLv2 or later
35
  *
36
  * @var string
37
  */
38
+ define( 'PLUGIN_VERSION', '2.6' );
39
 
40
  // Always include these helper files for dotcom FSE.
41
  require_once __DIR__ . '/dotcom-fse/helpers.php';
global-styles/dist/global-styles.asset.php CHANGED
@@ -1 +1 @@
1
- <?php return array('dependencies' => array('lodash', 'wp-api-fetch', 'wp-components', 'wp-compose', 'wp-data', 'wp-dom-ready', 'wp-edit-post', 'wp-element', 'wp-i18n', 'wp-keycodes', 'wp-plugins', 'wp-polyfill'), 'version' => '13b3639b33c32237582488caf4947230');
1
+ <?php return array('dependencies' => array('lodash', 'wp-api-fetch', 'wp-components', 'wp-compose', 'wp-data', 'wp-dom-ready', 'wp-edit-post', 'wp-element', 'wp-i18n', 'wp-keycodes', 'wp-plugins', 'wp-polyfill'), 'version' => '748a14b152df74c0c8701ce2a90f386b');
jetpack-timeline/dist/jetpack-timeline.asset.php CHANGED
@@ -1 +1 @@
1
- <?php return array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-primitives'), 'version' => 'aed0cb09cb23debe6b4d35371d0b557d');
1
+ <?php return array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-primitives'), 'version' => '477f7a227fbe0f8835f2df4adb2e215d');
newspack-blocks/dist/blog-posts-block-editor.asset.php CHANGED
@@ -1 +1 @@
1
- <?php return array('dependencies' => array('lodash', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-date', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-polyfill', 'wp-url'), 'version' => '5174591558573b21c89b5b06cf6fff3b');
1
+ <?php return array('dependencies' => array('lodash', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-date', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-polyfill', 'wp-url'), 'version' => '379ed0ef34a9057ad0c1863f5a18f8bb');
newspack-blocks/dist/blog-posts-block-editor.js CHANGED
@@ -3,4 +3,4 @@
3
  Copyright (c) 2017 Jed Watson.
4
  Licensed under the MIT License (MIT), see
5
  http://jedwatson.github.io/classnames
6
- */!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var c=typeof r;if("string"===c||"number"===c)e.push(r);else if(Array.isArray(r)&&r.length){var i=o.apply(null,r);i&&e.push(i)}else if("object"===c)for(var a in r)n.call(r,a)&&r[a]&&e.push(a)}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(r=function(){return o}.apply(t,[]))||(e.exports=r)}()},function(e,t){!function(){e.exports=this.wp.date}()},function(e,t){e.exports=function(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(e,t){function n(){return e.exports=n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},n.apply(this,arguments)}e.exports=n},function(e,t,n){"use strict";function r(e){var t,n=e.Symbol;return"function"==typeof n?n.observable?t=n.observable:(t=n("observable"),n.observable=t):t="@@observable",t}n.d(t,"a",(function(){return r}))},function(e,t){!function(){e.exports=this.wp.compose}()},function(e,t){function n(t,r){return e.exports=n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},n(t,r)}e.exports=n},function(e,t){function n(t){return e.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},n(t)}e.exports=n},function(e,t){e.exports=function(){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(e,t,n){var r=n(31),o=n(4);e.exports=function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?o(e):t}},function(e,t){function n(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?e.exports=n=function(e){return typeof e}:e.exports=n=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(t)}e.exports=n},function(e,t,n){var r=n(23);e.exports=function(e){if(Array.isArray(e))return r(e)}},function(e,t){e.exports=function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}},function(e,t,n){var r=n(23);e.exports=function(e,t){if(e){if("string"==typeof e)return r(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)?r(e,t):void 0}}},function(e,t){e.exports=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(e,t,n){},function(e,t){e.exports=function(e){if(!e.webpackPolyfill){var t=Object.create(e);t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),Object.defineProperty(t,"exports",{enumerable:!0}),t.webpackPolyfill=1}return t}},function(e,t,n){},function(e,t,n){},function(e,t,n){"use strict";n.r(t);var r=n(11),o=n.n(r),c=n(17),i=n(1),a=n(18),u=n(0),s=n(2),l=n(12),f=n.n(l),p=n(19),d=n.n(p),h=n(4),g=n.n(h),b=n(13),m=n.n(b),v=n(14),y=n.n(v),O=n(3),w=n.n(O),j=n(24),_=n.n(j),E=n(7),S=n.n(E),k=n(8),x=n(6),C=n(9),P=n.n(C),A=n(5),T=(n(36),function(e){m()(n,e);var t=y()(n);function n(e){var r;return f()(this,n),r=t.call(this,e),w()(g()(r),"isFetchingInfoOnLoad",(function(){var e=r.props,t=e.tokens,n=e.fetchSavedInfo;return Boolean(t.length&&n)})),r.state={suggestions:[],validValues:{},loading:r.isFetchingInfoOnLoad()},r.debouncedUpdateSuggestions=Object(A.debounce)(r.updateSuggestions,500),r}return d()(n,[{key:"componentDidMount",value:function(){var e=this;if(this.isFetchingInfoOnLoad()){var t=this.props,n=t.tokens;(0,t.fetchSavedInfo)(n).then((function(t){var n=e.state.validValues;t.forEach((function(e){n[e.value]=e.label})),e.setState({validValues:n,loading:!1})}))}}},{key:"componentWillUnmount",value:function(){delete this.suggestionsRequest,this.debouncedUpdateSuggestions.cancel()}},{key:"getLabelsForValues",value:function(e){var t=this.state.validValues;return e.reduce((function(e,n){return t[n]?[].concat(P()(e),[t[n]]):e}),[])}},{key:"getValuesForLabels",value:function(e){var t=this.state.validValues;return e.map((function(e){return Object.keys(t).find((function(n){return t[n]===e}))}))}},{key:"updateSuggestions",value:function(e){var t=this,n=this.props.fetchSuggestions;n&&this.setState({loading:!0},(function(){var r=n(e);r.then((function(e){if(t.suggestionsRequest===r){var n=t.state.validValues,o=[];e.forEach((function(e){o.push(e.label),n[e.value]=e.label})),t.setState({suggestions:o,validValues:n,loading:!1})}})).catch((function(){t.suggestionsRequest===r&&t.setState({loading:!1})})),t.suggestionsRequest=r}))}},{key:"handleOnChange",value:function(e){(0,this.props.onChange)(this.getValuesForLabels(e))}},{key:"getTokens",value:function(){var e=this.props.tokens;return this.getLabelsForValues(e)}},{key:"render",value:function(){var e=this,t=this.props,n=t.help,r=t.label,o=void 0===r?"":r,c=this.state,i=c.suggestions,a=c.loading;return Object(u.createElement)("div",{className:"autocomplete-tokenfield"},Object(u.createElement)(s.FormTokenField,{value:this.getTokens(),suggestions:i,onChange:function(t){return e.handleOnChange(t)},onInputChange:function(t){return e.debouncedUpdateSuggestions(t)},label:o}),a&&Object(u.createElement)(s.Spinner,null),n&&Object(u.createElement)("p",{className:"autocomplete-tokenfield__help"},n))}}]),n}(u.Component)),I=function(e){m()(n,e);var t=y()(n);function n(){var e;f()(this,n);for(var r=arguments.length,o=new Array(r),c=0;c<r;c++)o[c]=arguments[c];return e=t.call.apply(t,[this].concat(o)),w()(g()(e),"state",{showAdvancedFilters:!1}),w()(g()(e),"fetchPostSuggestions",(function(e){return S()({path:Object(k.addQueryArgs)("/wp/v2/search",{search:e,per_page:20,_fields:"id,title",type:"post"})}).then((function(e){return e.map((function(e){return{value:e.id,label:Object(x.decodeEntities)(e.title)||Object(i.__)("(no title)","full-site-editing")}}))}))})),w()(g()(e),"fetchSavedPosts",(function(e){return S()({path:Object(k.addQueryArgs)("/wp/v2/posts",{per_page:100,include:e.join(","),_fields:"id,title"})}).then((function(e){return e.map((function(e){return{value:e.id,label:Object(x.decodeEntities)(e.title.rendered)||Object(i.__)("(no title)","full-site-editing")}}))}))})),w()(g()(e),"fetchAuthorSuggestions",(function(e){return S()({path:Object(k.addQueryArgs)("/wp/v2/users",{search:e,per_page:20,_fields:"id,name"})}).then((function(e){return e.map((function(e){return{value:e.id,label:Object(x.decodeEntities)(e.name)||Object(i.__)("(no name)","full-site-editing")}}))}))})),w()(g()(e),"fetchSavedAuthors",(function(e){return S()({path:Object(k.addQueryArgs)("/wp/v2/users",{per_page:100,include:e.join(","),_fields:"id,name"})}).then((function(e){return e.map((function(e){return{value:e.id,label:Object(x.decodeEntities)(e.name)||Object(i.__)("(no name)","full-site-editing")}}))}))})),w()(g()(e),"fetchCategorySuggestions",(function(e){return S()({path:Object(k.addQueryArgs)("/wp/v2/categories",{search:e,per_page:20,_fields:"id,name",orderby:"count",order:"desc"})}).then((function(e){return e.map((function(e){return{value:e.id,label:Object(x.decodeEntities)(e.name)||Object(i.__)("(no title)","full-site-editing")}}))}))})),w()(g()(e),"fetchSavedCategories",(function(e){return S()({path:Object(k.addQueryArgs)("/wp/v2/categories",{per_page:100,_fields:"id,name",include:e.join(",")})}).then((function(e){return e.map((function(e){return{value:e.id,label:Object(x.decodeEntities)(e.name)||Object(i.__)("(no title)","full-site-editing")}}))}))})),w()(g()(e),"fetchTagSuggestions",(function(e){return S()({path:Object(k.addQueryArgs)("/wp/v2/tags",{search:e,per_page:20,_fields:"id,name",orderby:"count",order:"desc"})}).then((function(e){return e.map((function(e){return{value:e.id,label:Object(x.decodeEntities)(e.name)||Object(i.__)("(no title)","full-site-editing")}}))}))})),w()(g()(e),"fetchSavedTags",(function(e){return S()({path:Object(k.addQueryArgs)("/wp/v2/tags",{per_page:100,_fields:"id,name",include:e.join(",")})}).then((function(e){return e.map((function(e){return{value:e.id,label:Object(x.decodeEntities)(e.name)||Object(i.__)("(no title)","full-site-editing")}}))}))})),w()(g()(e),"render",(function(){var t=e.props,n=t.specificMode,r=t.onSpecificModeChange,o=t.specificPosts,c=t.onSpecificPostsChange,a=t.authors,l=t.onAuthorsChange,f=t.categories,p=t.onCategoriesChange,d=t.tags,h=t.onTagsChange,g=t.tagExclusions,b=t.onTagExclusionsChange,m=t.enableSpecific,v=e.state.showAdvancedFilters;return[m&&Object(u.createElement)(s.ToggleControl,{key:"specificMode",checked:n,onChange:r,label:Object(i.__)("Choose Specific Posts","full-site-editing")}),n&&Object(u.createElement)(T,{key:"posts",tokens:o||[],onChange:c,fetchSuggestions:e.fetchPostSuggestions,fetchSavedInfo:e.fetchSavedPosts,label:Object(i.__)("Posts","full-site-editing"),help:Object(i.__)("Begin typing post title, click autocomplete result to select.","full-site-editing")}),!n&&Object(u.createElement)(s.QueryControls,_()({key:"queryControls"},e.props)),!n&&l&&Object(u.createElement)(T,{key:"authors",tokens:a||[],onChange:l,fetchSuggestions:e.fetchAuthorSuggestions,fetchSavedInfo:e.fetchSavedAuthors,label:Object(i.__)("Authors","full-site-editing")}),!n&&p&&Object(u.createElement)(T,{key:"categories",tokens:f||[],onChange:p,fetchSuggestions:e.fetchCategorySuggestions,fetchSavedInfo:e.fetchSavedCategories,label:Object(i.__)("Categories","full-site-editing")}),!n&&h&&Object(u.createElement)(T,{key:"tags",tokens:d||[],onChange:h,fetchSuggestions:e.fetchTagSuggestions,fetchSavedInfo:e.fetchSavedTags,label:Object(i.__)("Tags","full-site-editing")}),!n&&b&&Object(u.createElement)("p",{key:"toggle-advanced-filters"},Object(u.createElement)(s.Button,{isLink:!0,onClick:function(){return e.setState({showAdvancedFilters:!v})}},v?Object(i.__)("Hide Advanced Filters","full-site-editing"):Object(i.__)("Show Advanced Filters","full-site-editing"))),!n&&b&&v&&Object(u.createElement)(T,{key:"tag-exclusion",tokens:g||[],onChange:b,fetchSuggestions:e.fetchTagSuggestions,fetchSavedInfo:e.fetchSavedTags,label:Object(i.__)("Excluded Tags","full-site-editing")})]})),e}return n}(u.Component);I.defaultProps={enableSpecific:!0,specificPosts:[],authors:[],categories:[],tags:[],tagExclusions:[]};var R=I,N=n(20),B=function(){return Math.random().toString(36).substring(7).split("").join(".")},L={INIT:"@@redux/INIT"+B(),REPLACE:"@@redux/REPLACE"+B(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+B()}};function M(e){if("object"!=typeof e||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function D(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function H(e,t){var n=Object.keys(e);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(e)),t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n}function F(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?H(n,!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):H(n).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function U(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return 0===t.length?function(e){return e}:1===t.length?t[0]:t.reduce((function(e,t){return function(){return e(t.apply(void 0,arguments))}}))}var z=function(e){return"@@redux-saga/"+e},V=z("CANCEL_PROMISE"),q=z("CHANNEL_END"),Q=z("IO"),G=z("MATCH"),K=z("MULTICAST"),W=z("SAGA_ACTION"),J=z("SELF_CANCELLATION"),X=z("TASK"),Y=z("TASK_CANCEL"),$=z("TERMINATE"),Z=z("LOCATION");function ee(){return(ee=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var te=function(e){return null==e},ne=function(e){return null!=e},re=function(e){return"function"==typeof e},oe=function(e){return"string"==typeof e},ce=Array.isArray,ie=function(e){return e&&re(e.then)},ae=function(e){return e&&re(e.next)&&re(e.throw)},ue=function e(t){return t&&(oe(t)||fe(t)||re(t)||ce(t)&&t.every(e))},se=function(e){return e&&re(e.take)&&re(e.close)},le=function(e){return re(e)&&e.hasOwnProperty("toString")},fe=function(e){return Boolean(e)&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype};var pe=function(e,t){var n;void 0===t&&(t=!0);var r=new Promise((function(r){n=setTimeout(r,e,t)}));return r[V]=function(){clearTimeout(n)},r},de=function(e){return function(){return e}}(!0),he=function(){};var ge=function(e){return e};"function"==typeof Symbol&&Symbol.asyncIterator&&Symbol.asyncIterator;var be=function(e,t){ee(e,t),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(t).forEach((function(n){e[n]=t[n]}))};function me(e,t){var n=e.indexOf(t);n>=0&&e.splice(n,1)}function ve(e){var t=!1;return function(){t||(t=!0,e())}}var ye=function(e){throw e},Oe=function(e){return{value:e,done:!0}};function we(e,t,n){void 0===t&&(t=ye),void 0===n&&(n="iterator");var r={meta:{name:n},next:e,throw:t,return:Oe,isSagaIterator:!0};return"undefined"!=typeof Symbol&&(r[Symbol.iterator]=function(){return r}),r}function je(e,t){var n=t.sagaStack;console.error(e),console.error(n)}var _e=function(e){return Array.apply(null,new Array(e))},Ee=function(e){return function(t){return e(Object.defineProperty(t,W,{value:!0}))}},Se=function(e){return e===$},ke=function(e){return e===Y},xe=function(e){return Se(e)||ke(e)};function Ce(e,t){var n=Object.keys(e),r=n.length;var o,c=0,i=ce(e)?_e(r):{},a={};return n.forEach((function(e){var n=function(n,a){o||(a||xe(n)?(t.cancel(),t(n,a)):(i[e]=n,++c===r&&(o=!0,t(i))))};n.cancel=he,a[e]=n})),t.cancel=function(){o||(o=!0,n.forEach((function(e){return a[e].cancel()})))},a}function Pe(e){return{name:e.name||"anonymous",location:Ae(e)}}function Ae(e){return e[Z]}function Te(e,t){void 0===e&&(e=10);var n=new Array(e),r=0,o=0,c=0,i=function(t){n[o]=t,o=(o+1)%e,r++},a=function(){if(0!=r){var t=n[c];return n[c]=null,r--,c=(c+1)%e,t}},u=function(){for(var e=[];r;)e.push(a());return e};return{isEmpty:function(){return 0==r},put:function(a){var s;if(r<e)i(a);else switch(t){case 1:throw new Error("Channel's Buffer overflow!");case 3:n[o]=a,c=o=(o+1)%e;break;case 4:s=2*e,n=u(),r=n.length,o=n.length,c=0,n.length=s,e=s,i(a)}},take:a,flush:u}}var Ie=function(e){return Te(e,4)},Re="TAKE",Ne="PUT",Be="CALL",Le="FORK",Me="CANCEL",De=function(e,t){var n;return(n={})[Q]=!0,n.combinator=!1,n.type=e,n.payload=t,n};function He(e,t){return void 0===e&&(e="*"),ue(e)?De(Re,{pattern:e}):se(n=e)&&n[K]&&ne(t)&&ue(t)?De(Re,{channel:e,pattern:t}):se(e)?De(Re,{channel:e}):void 0;var n}function Fe(e,t){return te(t)&&(t=e,e=void 0),De(Ne,{channel:e,action:t})}function Ue(e,t){var n,r=null;return re(e)?n=e:(ce(e)?(r=e[0],n=e[1]):(r=e.context,n=e.fn),r&&oe(n)&&re(r[n])&&(n=r[n])),{context:r,fn:n,args:t}}function ze(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 De(Be,Ue(e,n))}function Ve(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 De(Le,Ue(e,n))}function qe(e){return void 0===e&&(e=J),De(Me,e)}var Qe=ze.bind(null,pe),Ge=function(e){return{done:!0,value:e}},Ke={};function We(e){return se(e)?"channel":le(e)?String(e):re(e)?e.name:String(e)}function Je(e,t,n){var r,o,c,i=t;function a(t,n){if(i===Ke)return Ge(t);if(n&&!o)throw i=Ke,n;r&&r(t);var a=n?e[o](n):e[i]();return i=a.nextState,c=a.effect,r=a.stateUpdater,o=a.errorState,i===Ke?Ge(t):c}return we(a,(function(e){return a(null,e)}),n)}function Xe(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];var c,i,a={done:!1,value:He(e)},u=function(e){return{done:!1,value:Ve.apply(void 0,[t].concat(r,[e]))}},s=function(e){return{done:!1,value:qe(e)}},l=function(e){return c=e},f=function(e){return i=e};return Je({q1:function(){return{nextState:"q2",effect:a,stateUpdater:f}},q2:function(){return c?{nextState:"q3",effect:s(c)}:{nextState:"q1",effect:u(i),stateUpdater:l}},q3:function(){return{nextState:"q1",effect:u(i),stateUpdater:l}}},"q1","takeLatest("+We(e)+", "+t.name+")")}function Ye(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];return Ve.apply(void 0,[Xe,e,t].concat(r))}function $e(){var e={};return e.promise=new Promise((function(t,n){e.resolve=t,e.reject=n})),e}var Ze=$e,et=[],tt=0;function nt(e){try{ct(),e()}finally{it()}}function rt(e){et.push(e),tt||(ct(),at())}function ot(e){try{return ct(),e()}finally{at()}}function ct(){tt++}function it(){tt--}function at(){var e;for(it();!tt&&void 0!==(e=et.shift());)nt(e)}var ut=function(e){return function(t){return e.some((function(e){return dt(e)(t)}))}},st=function(e){return function(t){return e(t)}},lt=function(e){return function(t){return t.type===String(e)}},ft=function(e){return function(t){return t.type===e}},pt=function(){return de};function dt(e){var t="*"===e?pt:oe(e)?lt:ce(e)?ut:le(e)?lt:re(e)?st:fe(e)?ft:null;if(null===t)throw new Error("invalid pattern: "+e);return t(e)}var ht={type:q},gt=function(e){return e&&e.type===q};function bt(e){void 0===e&&(e=Ie());var t=!1,n=[];return{take:function(r){t&&e.isEmpty()?r(ht):e.isEmpty()?(n.push(r),r.cancel=function(){me(n,r)}):r(e.take())},put:function(r){if(!t){if(0===n.length)return e.put(r);n.shift()(r)}},flush:function(n){t&&e.isEmpty()?n(ht):n(e.flush())},close:function(){if(!t){t=!0;var e=n;n=[];for(var r=0,o=e.length;r<o;r++){(0,e[r])(ht)}}}}}function mt(){var e,t,n,r,o,c,i=(t=!1,r=n=[],o=function(){r===n&&(r=n.slice())},c=function(){t=!0;var e=n=r;r=[],e.forEach((function(e){e(ht)}))},(e={})[K]=!0,e.put=function(e){if(!t)if(gt(e))c();else for(var o=n=r,i=0,a=o.length;i<a;i++){var u=o[i];u[G](e)&&(u.cancel(),u(e))}},e.take=function(e,n){void 0===n&&(n=pt),t?e(ht):(e[G]=n,o(),r.push(e),e.cancel=ve((function(){o(),me(r,e)})))},e.close=c,e),a=i.put;return i.put=function(e){e[W]?a(e):rt((function(){a(e)}))},i}function vt(e,t){var n=e[V];re(n)&&(t.cancel=n),e.then(t,(function(e){t(e,!0)}))}var yt,Ot=0,wt=function(){return++Ot};function jt(e){e.isRunning()&&e.cancel()}var _t=((yt={}).TAKE=function(e,t,n){var r=t.channel,o=void 0===r?e.channel:r,c=t.pattern,i=t.maybe,a=function(e){e instanceof Error?n(e,!0):!gt(e)||i?n(e):n($)};try{o.take(a,ne(c)?dt(c):null)}catch(u){return void n(u,!0)}n.cancel=a.cancel},yt.PUT=function(e,t,n){var r=t.channel,o=t.action,c=t.resolve;rt((function(){var t;try{t=(r?r.put:e.dispatch)(o)}catch(i){return void n(i,!0)}c&&ie(t)?vt(t,n):n(t)}))},yt.ALL=function(e,t,n,r){var o=r.digestEffect,c=Ot,i=Object.keys(t);if(0!==i.length){var a=Ce(t,n);i.forEach((function(e){o(t[e],c,a[e],e)}))}else n(ce(t)?[]:{})},yt.RACE=function(e,t,n,r){var o=r.digestEffect,c=Ot,i=Object.keys(t),a=ce(t)?_e(i.length):{},u={},s=!1;i.forEach((function(e){var t=function(t,r){s||(r||xe(t)?(n.cancel(),n(t,r)):(n.cancel(),s=!0,a[e]=t,n(a)))};t.cancel=he,u[e]=t})),n.cancel=function(){s||(s=!0,i.forEach((function(e){return u[e].cancel()})))},i.forEach((function(e){s||o(t[e],c,u[e],e)}))},yt.CALL=function(e,t,n,r){var o=t.context,c=t.fn,i=t.args,a=r.task;try{var u=c.apply(o,i);if(ie(u))return void vt(u,n);if(ae(u))return void Tt(e,u,a.context,Ot,Pe(c),!1,n);n(u)}catch(s){n(s,!0)}},yt.CPS=function(e,t,n){var r=t.context,o=t.fn,c=t.args;try{var i=function(e,t){te(e)?n(t):n(e,!0)};o.apply(r,c.concat(i)),i.cancel&&(n.cancel=i.cancel)}catch(a){n(a,!0)}},yt.FORK=function(e,t,n,r){var o=t.context,c=t.fn,i=t.args,a=t.detached,u=r.task,s=function(e){var t=e.context,n=e.fn,r=e.args;try{var o=n.apply(t,r);if(ae(o))return o;var c=!1;return we((function(e){return c?{value:e,done:!0}:(c=!0,{value:o,done:!ie(o)})}))}catch(i){return we((function(){throw i}))}}({context:o,fn:c,args:i}),l=function(e,t){return e.isSagaIterator?{name:e.meta.name}:Pe(t)}(s,c);ot((function(){var t=Tt(e,s,u.context,Ot,l,a,void 0);a?n(t):t.isRunning()?(u.queue.addTask(t),n(t)):t.isAborted()?u.queue.abort(t.error()):n(t)}))},yt.JOIN=function(e,t,n,r){var o=r.task,c=function(e,t){if(e.isRunning()){var n={task:o,cb:t};t.cancel=function(){e.isRunning()&&me(e.joiners,n)},e.joiners.push(n)}else e.isAborted()?t(e.error(),!0):t(e.result())};if(ce(t)){if(0===t.length)return void n([]);var i=Ce(t,n);t.forEach((function(e,t){c(e,i[t])}))}else c(t,n)},yt.CANCEL=function(e,t,n,r){var o=r.task;t===J?jt(o):ce(t)?t.forEach(jt):jt(t),n()},yt.SELECT=function(e,t,n){var r=t.selector,o=t.args;try{n(r.apply(void 0,[e.getState()].concat(o)))}catch(c){n(c,!0)}},yt.ACTION_CHANNEL=function(e,t,n){var r=t.pattern,o=bt(t.buffer),c=dt(r),i=function t(n){gt(n)||e.channel.take(t,c),o.put(n)},a=o.close;o.close=function(){i.cancel(),a()},e.channel.take(i,c),n(o)},yt.CANCELLED=function(e,t,n,r){n(r.task.isCancelled())},yt.FLUSH=function(e,t,n){t.flush(n)},yt.GET_CONTEXT=function(e,t,n,r){n(r.task.context[t])},yt.SET_CONTEXT=function(e,t,n,r){var o=r.task;be(o.context,t),n()},yt);function Et(e,t){return e+"?"+t}function St(e){var t=e.name,n=e.location;return n?t+" "+Et(n.fileName,n.lineNumber):t}var kt=null,xt=[],Ct=function(){kt=null,xt.length=0},Pt=function(){var e,t,n,r,o,c,i,a=xt[0],u=xt.slice(1),s=a.crashedEffect?(e=a.crashedEffect,(t=Ae(e))?t.code+" "+Et(t.fileName,t.lineNumber):""):null;return["The above error occurred in task "+St(a.meta)+(s?" \n when executing effect "+s:"")].concat(u.map((function(e){return" created by "+St(e.meta)})),[(n=xt,r=function(e){return e.cancelledTasks},o=n,i=(c=[]).concat.apply(c,o.map(r)),i.length?["Tasks cancelled due to error:"].concat(i).join("\n"):"")]).join("\n")};function At(e,t,n,r,o,c,i){var a;void 0===i&&(i=he);var u,s,l=0,f=null,p=[],d=Object.create(n),h=function(e,t,n){var r,o=[],c=!1;function i(e){t(),u(),n(e,!0)}function a(t){o.push(t),t.cont=function(a,u){c||(me(o,t),t.cont=he,u?i(a):(t===e&&(r=a),o.length||(c=!0,n(r))))}}function u(){c||(c=!0,o.forEach((function(e){e.cont=he,e.cancel()})),o=[])}return a(e),{addTask:a,cancelAll:u,abort:i,getTasks:function(){return o}}}(t,(function(){p.push.apply(p,h.getTasks().map((function(e){return e.meta.name})))}),g);function g(t,n){if(n){if(l=2,(c={meta:o,cancelledTasks:p}).crashedEffect=kt,xt.push(c),b.isRoot){var r=Pt();Ct(),e.onError(t,{sagaStack:r})}s=t,f&&f.reject(t)}else t===Y?l=1:1!==l&&(l=3),u=t,f&&f.resolve(t);var c;b.cont(t,n),b.joiners.forEach((function(e){e.cb(t,n)})),b.joiners=null}var b=((a={})[X]=!0,a.id=r,a.meta=o,a.isRoot=c,a.context=d,a.joiners=[],a.queue=h,a.cancel=function(){0===l&&(l=1,h.cancelAll(),g(Y,!1))},a.cont=i,a.end=g,a.setContext=function(e){be(d,e)},a.toPromise=function(){return f||(f=Ze(),2===l?f.reject(s):0!==l&&f.resolve(u)),f.promise},a.isRunning=function(){return 0===l},a.isCancelled=function(){return 1===l||0===l&&1===t.status},a.isAborted=function(){return 2===l},a.result=function(){return u},a.error=function(){return s},a);return b}function Tt(e,t,n,r,o,c,i){var a=e.finalizeRunEffect((function(t,n,r){if(ie(t))vt(t,r);else if(ae(t))Tt(e,t,s.context,n,o,!1,r);else if(t&&t[Q]){(0,_t[t.type])(e,t.payload,r,l)}else r(t)}));f.cancel=he;var u={meta:o,cancel:function(){0===u.status&&(u.status=1,f(Y))},status:0},s=At(e,u,n,r,o,c,i),l={task:s,digestEffect:p};return i&&(i.cancel=s.cancel),f(),s;function f(e,n){try{var o;n?(o=t.throw(e),Ct()):ke(e)?(u.status=1,f.cancel(),o=re(t.return)?t.return(Y):{done:!0,value:Y}):o=Se(e)?re(t.return)?t.return():{done:!0}:t.next(e),o.done?(1!==u.status&&(u.status=3),u.cont(o.value)):p(o.value,r,f)}catch(c){if(1===u.status)throw c;u.status=2,u.cont(c,!0)}}function p(t,n,r,o){void 0===o&&(o="");var c,i=wt();function u(n,o){c||(c=!0,r.cancel=he,e.sagaMonitor&&(o?e.sagaMonitor.effectRejected(i,n):e.sagaMonitor.effectResolved(i,n)),o&&function(e){kt=e}(t),r(n,o))}e.sagaMonitor&&e.sagaMonitor.effectTriggered({effectId:i,parentEffectId:n,label:o,effect:t}),u.cancel=he,r.cancel=function(){c||(c=!0,u.cancel(),u.cancel=he,e.sagaMonitor&&e.sagaMonitor.effectCancelled(i))},a(t,i,u)}}function It(e,t){var n=e.channel,r=void 0===n?mt():n,o=e.dispatch,c=e.getState,i=e.context,a=void 0===i?{}:i,u=e.sagaMonitor,s=e.effectMiddlewares,l=e.onError,f=void 0===l?je:l;for(var p=arguments.length,d=new Array(p>2?p-2:0),h=2;h<p;h++)d[h-2]=arguments[h];var g=t.apply(void 0,d);var b,m=wt();if(u&&(u.rootSagaStarted=u.rootSagaStarted||he,u.effectTriggered=u.effectTriggered||he,u.effectResolved=u.effectResolved||he,u.effectRejected=u.effectRejected||he,u.effectCancelled=u.effectCancelled||he,u.actionDispatched=u.actionDispatched||he,u.rootSagaStarted({effectId:m,saga:t,args:d})),s){var v=U.apply(void 0,s);b=function(e){return function(t,n,r){return v((function(t){return e(t,n,r)}))(t)}}}else b=ge;var y={channel:r,dispatch:Ee(o),getState:c,sagaMonitor:u,onError:f,finalizeRunEffect:b};return ot((function(){var e=Tt(y,g,a,m,Pe(t),!0,void 0);return u&&u.effectResolved(m,e),e}))}var Rt=function(e){var t,n=void 0===e?{}:e,r=n.context,o=void 0===r?{}:r,c=n.channel,i=void 0===c?mt():c,a=n.sagaMonitor,u=function(e,t){if(null==e)return{};var n,r,o={},c=Object.keys(e);for(r=0;r<c.length;r++)n=c[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(n,["context","channel","sagaMonitor"]);function s(e){var n=e.getState,r=e.dispatch;return t=It.bind(null,ee({},u,{context:o,channel:i,dispatch:r,getState:n,sagaMonitor:a})),function(e){return function(t){a&&a.actionDispatched&&a.actionDispatched(t);var n=e(t);return i.put(t),n}}}return s.run=function(){return t.apply(void 0,arguments)},s.setContext=function(e){be(o,e)},s},Nt=n(15),Bt=n(16),Lt=function(){return"object"==typeof window&&window.wpcomGutenberg&&-1===Number(window.wpcomGutenberg.blogPublic)},Mt=["postsToShow","authors","categories","tags","specificPosts","specificMode","tagExclusions"],Dt=function(e){var t=Object(A.pick)(e,Mt),n=t.postsToShow,r=t.authors,o=t.categories,c=t.tags,i=t.specificPosts,a=t.specificMode,u=t.tagExclusions,s=a&&i&&i.length;return Object(A.pickBy)(s?{include:i,orderby:"include",per_page:i.length}:{per_page:n,categories:o,author:r,tags:c,tags_exclude:u},(function(e){return!Object(A.isUndefined)(e)}))},Ht=function e(t,n){return t.flatMap((function(t){var r=[];if(t.name===n){var o=Dt(t.attributes);r.push({postsQuery:o,clientId:t.clientId})}return r.concat(e(t.innerBlocks,n))}))},Ft=regeneratorRuntime.mark(Yt),Ut=Bt.name,zt="newspack-blocks/".concat(Ut),Vt={postsByBlock:{},errorsByBlock:{}},qt={reflow:function(){Kt.dispatch({type:"REFLOW"})}},Qt={getPosts:function(e){var t=e.clientId;return Kt.getState().postsByBlock[t]},getError:function(e){var t=e.clientId;return Kt.getState().errorsByBlock[t]},isUIDisabled:function(){return Kt.getState().isUIDisabled}},Gt=Rt(),Kt=function e(t,n,r){var o;if("function"==typeof n&&"function"==typeof r||"function"==typeof r&&"function"==typeof arguments[3])throw new Error("It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function.");if("function"==typeof n&&void 0===r&&(r=n,n=void 0),void 0!==r){if("function"!=typeof r)throw new Error("Expected the enhancer to be a function.");return r(e)(t,n)}if("function"!=typeof t)throw new Error("Expected the reducer to be a function.");var c=t,i=n,a=[],u=a,s=!1;function l(){u===a&&(u=a.slice())}function f(){if(s)throw new Error("You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return i}function p(e){if("function"!=typeof e)throw new Error("Expected the listener to be a function.");if(s)throw new Error("You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api-reference/store#subscribelistener for more details.");var t=!0;return l(),u.push(e),function(){if(t){if(s)throw new Error("You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api-reference/store#subscribelistener for more details.");t=!1,l();var n=u.indexOf(e);u.splice(n,1),a=null}}}function d(e){if(!M(e))throw new Error("Actions must be plain objects. Use custom middleware for async actions.");if(void 0===e.type)throw new Error('Actions may not have an undefined "type" property. Have you misspelled a constant?');if(s)throw new Error("Reducers may not dispatch actions.");try{s=!0,i=c(i,e)}finally{s=!1}for(var t=a=u,n=0;n<t.length;n++){(0,t[n])()}return e}function h(e){if("function"!=typeof e)throw new Error("Expected the nextReducer to be a function.");c=e,d({type:L.REPLACE})}function g(){var e,t=p;return(e={subscribe:function(e){if("object"!=typeof e||null===e)throw new TypeError("Expected the observer to be an object.");function n(){e.next&&e.next(f())}return n(),{unsubscribe:t(n)}}})[N.a]=function(){return this},e}return d({type:L.INIT}),(o={dispatch:d,subscribe:p,getState:f,replaceReducer:h})[N.a]=g,o}((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Vt,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"DISABLE_UI":return Object(A.set)(e,"isUIDisabled",!0);case"ENABLE_UI":return Object(A.set)(e,"isUIDisabled",!1);case"UPDATE_BLOCK_POSTS":return Object(A.set)(e,["postsByBlock",t.clientId],t.posts);case"UPDATE_BLOCK_ERROR":return Object(A.set)(e,["errorsByBlock",t.clientId],t.error)}return e}),function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return function(){var n=e.apply(void 0,arguments),r=function(){throw new Error("Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")},o={getState:n.getState,dispatch:function(){return r.apply(void 0,arguments)}},c=t.map((function(e){return e(o)}));return F({},n,{dispatch:r=U.apply(void 0,c)(n.dispatch)})}}}(Gt)),Wt=o()({getSelectors:function(){return Qt},getActions:function(){return qt}},Kt),Jt={},Xt=JSON.stringify;function Yt(e){var t,n,r,c;return regeneratorRuntime.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(t=Xt(e.postsQuery),void 0!==(n=Jt[t])){i.next=8;break}return r=Object(k.addQueryArgs)("/wp/v2/posts",o()(o()({},e.postsQuery),{},{context:"edit"})),i.next=6,ze(S.a,{path:r});case 6:n=i.sent,Jt[t]=n;case 8:return c=n.map((function(e){return e.id})),i.next=11,Fe({type:"UPDATE_BLOCK_POSTS",clientId:e.clientId,posts:n});case 11:return i.abrupt("return",c);case 12:case"end":return i.stop()}}),Ft)}var $t,Zt=function(e){return e.map((function(e){return Object(u.createElement)("span",{className:"avatar author-avatar",key:e.id},Object(u.createElement)("a",{className:"url fn n",href:e.author_link},Object(u.createElement)(u.RawHTML,null,e.avatar)))}))},en=function(e){return Object(u.createElement)("span",{className:"byline"},Object(i._x)("by","post author","full-site-editing")," ",e.reduce((function(t,n,r){return[].concat(P()(t),[Object(u.createElement)("span",{className:"author vcard",key:n.id},Object(u.createElement)("a",{className:"url fn n",href:n.author_link},n.display_name)),r<e.length-2&&", ",e.length>1&&r===e.length-2&&Object(i._x)(" and ","post author","full-site-editing")])}),[]))},tn=n(21),nn=n.n(tn),rn=n(22),on=n(10),cn=n(26);"object"==typeof window&&window.newspackIsPostSubtitleSupported&&window.newspackIsPostSubtitleSupported.post_subtitle&&($t=!0);var an,un=Object(u.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(u.createElement)(s.Path,{d:"M0 0h24v24H0z",fill:"none"}),Object(u.createElement)(s.Path,{d:"M19 5H5c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 12H5V7h14v10z"})),sn=Object(u.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(u.createElement)(s.Path,{d:"M0 0h24v24H0z",fill:"none"}),Object(u.createElement)(s.Path,{d:"M17 3H7c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h10c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H7V5h10v14z"})),ln=Object(u.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(u.createElement)(s.Path,{d:"M0 0h24v24H0z",fill:"none"}),Object(u.createElement)(s.Path,{d:"M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 14H6V6h12v12z"})),fn=Object(u.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(u.createElement)(s.Path,{d:"M0 0h24v24H0z",fill:"none"}),Object(u.createElement)(s.Path,{d:"M3 5v4h2V5h4V3H5c-1.1 0-2 .9-2 2zm2 10H3v4c0 1.1.9 2 2 2h4v-2H5v-4zm14 4h-4v2h4c1.1 0 2-.9 2-2v-4h-2v4zm0-16h-4v2h4v4h2V5c0-1.1-.9-2-2-2z"})),pn=Object(u.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(u.createElement)(s.Path,{d:"M0 0h24v24H0z",fill:"none"}),Object(u.createElement)(s.Path,{d:"M4 4h7V2H4c-1.1 0-2 .9-2 2v7h2V4zm6 9l-4 5h12l-3-4-2.03 2.71L10 13zm7-4.5c0-.83-.67-1.5-1.5-1.5S14 7.67 14 8.5s.67 1.5 1.5 1.5S17 9.33 17 8.5zM20 2h-7v2h7v7h2V4c0-1.1-.9-2-2-2zm0 18h-7v2h7c1.1 0 2-.9 2-2v-7h-2v7zM4 13H2v7c0 1.1.9 2 2 2h7v-2H4v-7z"})),dn=function(e){m()(n,e);var t=y()(n);function n(){var e;f()(this,n);for(var r=arguments.length,o=new Array(r),c=0;c<r;c++)o[c]=arguments[c];return e=t.call.apply(t,[this].concat(o)),w()(g()(e),"renderPost",(function(t){var n=e.props,r=n.attributes,o=n.isUIDisabled,c=r.showImage,i=r.imageShape,a=r.mediaPosition,s=r.minHeight,l=r.showCaption,f=r.showExcerpt,p=r.showSubtitle,d=r.showAuthor,h=r.showAvatar,g=r.showDate,b=r.showCategory,m=r.sectionHeader,v={minHeight:"behind"===a&&c&&t.newspack_featured_image_src&&s+"vh",paddingTop:"behind"===a&&c&&t.newspack_featured_image_src&&s/5+"vh"},y=nn()({"post-has-image":t.newspack_featured_image_src,"homepage-posts-block__post--disabled":o},t.newspack_article_classes),O=e.titleForPost(t),w=Object(rn.__experimentalGetSettings)().formats.date;return Object(u.createElement)("article",{className:y,key:t.id,style:v},c&&t.newspack_featured_image_src&&Object(u.createElement)("figure",{className:"post-thumbnail",key:"thumbnail"},Object(u.createElement)("a",{href:"#"},"landscape"===i&&Object(u.createElement)("img",{src:t.newspack_featured_image_src.landscape,alt:""}),"portrait"===i&&Object(u.createElement)("img",{src:t.newspack_featured_image_src.portrait,alt:""}),"square"===i&&Object(u.createElement)("img",{src:t.newspack_featured_image_src.square,alt:""}),"uncropped"===i&&Object(u.createElement)("img",{src:t.newspack_featured_image_src.uncropped,alt:""})),l&&""!==t.newspack_featured_image_caption&&Object(u.createElement)("figcaption",null,t.newspack_featured_image_caption)),Object(u.createElement)("div",{className:"entry-wrapper"},b&&t.newspack_category_info.length&&Object(u.createElement)("div",{className:"cat-links"},Object(u.createElement)("a",{href:"#"},Object(x.decodeEntities)(t.newspack_category_info))),on.RichText.isEmpty(m)?Object(u.createElement)("h2",{className:"entry-title",key:"title"},Object(u.createElement)("a",{href:"#"},O)):Object(u.createElement)("h3",{className:"entry-title",key:"title"},Object(u.createElement)("a",{href:"#"},O)),$t&&p&&Object(u.createElement)(u.RawHTML,{key:"subtitle",className:"newspack-post-subtitle newspack-post-subtitle--in-homepage-block"},t.meta.newspack_post_subtitle||""),f&&Object(u.createElement)(u.RawHTML,{key:"excerpt",className:"excerpt-contain"},t.excerpt.rendered),Object(u.createElement)("div",{className:"entry-meta"},d&&h&&Zt(t.newspack_author_info),d&&en(t.newspack_author_info),g&&Object(u.createElement)("time",{className:"entry-date published",key:"pub-date"},Object(rn.dateI18n)(w,t.date_gmt)))))})),w()(g()(e),"titleForPost",(function(e){return e.title?"string"==typeof e.title?Object(x.decodeEntities)(e.title.trim()):"object"==typeof e.title&&e.title.rendered?Object(x.decodeEntities)(e.title.rendered.trim()):void 0:""})),w()(g()(e),"renderInspectorControls",(function(){var t=e.props,n=t.attributes,r=t.setAttributes,o=t.textColor,c=t.setTextColor,a=n.authors,l=n.specificPosts,f=n.postsToShow,p=n.categories,d=n.columns,h=n.showImage,g=n.showCaption,b=n.imageScale,m=n.mobileStack,v=n.minHeight,y=n.moreButton,O=n.showExcerpt,w=n.showSubtitle,j=n.typeScale,_=n.showDate,E=n.showAuthor,S=n.showAvatar,k=n.showCategory,x=n.postLayout,C=n.mediaPosition,P=n.specificMode,A=n.tags,T=n.tagExclusions,I=[{value:1,label:Object(i.__)("Small","full-site-editing"),shortName:Object(i.__)("S","full-site-editing")},{value:2,label:Object(i.__)("Medium","full-site-editing"),shortName:Object(i.__)("M","full-site-editing")},{value:3,label:Object(i.__)("Large","full-site-editing"),shortName:Object(i.__)("L","full-site-editing")},{value:4,label:Object(i.__)("Extra Large","full-site-editing"),shortName:Object(i.__)("XL","full-site-editing")}];return Object(u.createElement)(u.Fragment,null,Object(u.createElement)(s.PanelBody,{title:Object(i.__)("Display Settings","full-site-editing"),initialOpen:!0},Object(u.createElement)(R,{numberOfItems:f,onNumberOfItemsChange:function(e){return r({postsToShow:e||1})},specificMode:P,onSpecificModeChange:function(e){return r({specificMode:e})},specificPosts:l,onSpecificPostsChange:function(e){return r({specificPosts:e})},authors:a,onAuthorsChange:function(e){return r({authors:e})},categories:p,onCategoriesChange:function(e){return r({categories:e})},tags:A,onTagsChange:function(e){r({tags:e})},tagExclusions:T,onTagExclusionsChange:function(e){return r({tagExclusions:e})}}),"grid"===x&&Object(u.createElement)(s.RangeControl,{label:Object(i.__)("Columns","full-site-editing"),value:d,onChange:function(e){return r({columns:e})},min:2,max:6,required:!0}),!P&&!Lt()&&Object(u.createElement)(s.ToggleControl,{label:Object(i.__)('Show "More" Button',"full-site-editing"),checked:y,onChange:function(){return r({moreButton:!y})}})),Object(u.createElement)(s.PanelBody,{title:Object(i.__)("Featured Image Settings","full-site-editing")},Object(u.createElement)(s.PanelRow,null,Object(u.createElement)(s.ToggleControl,{label:Object(i.__)("Show Featured Image","full-site-editing"),checked:h,onChange:function(){return r({showImage:!h})}})),h&&Object(u.createElement)(s.PanelRow,null,Object(u.createElement)(s.ToggleControl,{label:Object(i.__)("Show Featured Image Caption","full-site-editing"),checked:g,onChange:function(){return r({showCaption:!g})}})),h&&"top"!==C&&"behind"!==C&&Object(u.createElement)(u.Fragment,null,Object(u.createElement)(s.PanelRow,null,Object(u.createElement)(s.ToggleControl,{label:Object(i.__)("Stack on mobile","full-site-editing"),checked:m,onChange:function(){return r({mobileStack:!m})}})),Object(u.createElement)(s.BaseControl,{label:Object(i.__)("Featured Image Size","full-site-editing"),id:"newspackfeatured-image-size"},Object(u.createElement)(s.PanelRow,null,Object(u.createElement)(s.ButtonGroup,{id:"newspackfeatured-image-size","aria-label":Object(i.__)("Featured Image Size","full-site-editing")},I.map((function(e){var t=b===e.value;return Object(u.createElement)(s.Button,{isLarge:!0,isPrimary:t,"aria-pressed":t,"aria-label":e.label,key:e.value,onClick:function(){return r({imageScale:e.value})}},e.shortName)})))))),h&&"behind"===C&&Object(u.createElement)(s.RangeControl,{label:Object(i.__)("Minimum height","full-site-editing"),help:Object(i.__)("Sets a minimum height for the block, using a percentage of the screen's current height.","full-site-editing"),value:v,onChange:function(e){return r({minHeight:e})},min:0,max:100,required:!0})),Object(u.createElement)(s.PanelBody,{title:Object(i.__)("Post Control Settings","full-site-editing")},$t&&Object(u.createElement)(s.PanelRow,null,Object(u.createElement)(s.ToggleControl,{label:Object(i.__)("Show Subtitle","full-site-editing"),checked:w,onChange:function(){return r({showSubtitle:!w})}})),Object(u.createElement)(s.PanelRow,null,Object(u.createElement)(s.ToggleControl,{label:Object(i.__)("Show Excerpt","full-site-editing"),checked:O,onChange:function(){return r({showExcerpt:!O})}})),Object(u.createElement)(s.RangeControl,{className:"type-scale-slider",label:Object(i.__)("Type Scale","full-site-editing"),value:j,onChange:function(e){return r({typeScale:e})},min:1,max:10,beforeIcon:"editor-textcolor",afterIcon:"editor-textcolor",required:!0})),Object(u.createElement)(on.PanelColorSettings,{title:Object(i.__)("Color Settings","full-site-editing"),initialOpen:!0,colorSettings:[{value:o.color,onChange:c,label:Object(i.__)("Text Color","full-site-editing")}]}),Object(u.createElement)(s.PanelBody,{title:Object(i.__)("Post Meta Settings","full-site-editing")},Object(u.createElement)(s.PanelRow,null,Object(u.createElement)(s.ToggleControl,{label:Object(i.__)("Show Date","full-site-editing"),checked:_,onChange:function(){return r({showDate:!_})}})),Object(u.createElement)(s.PanelRow,null,Object(u.createElement)(s.ToggleControl,{label:Object(i.__)("Show Category","full-site-editing"),checked:k,onChange:function(){return r({showCategory:!k})}})),Object(u.createElement)(s.PanelRow,null,Object(u.createElement)(s.ToggleControl,{label:Object(i.__)("Show Author","full-site-editing"),checked:E,onChange:function(){return r({showAuthor:!E})}})),E&&Object(u.createElement)(s.PanelRow,null,Object(u.createElement)(s.ToggleControl,{label:Object(i.__)("Show Author Avatar","full-site-editing"),checked:S,onChange:function(){return r({showAvatar:!S})}}))))})),e}return d()(n,[{key:"componentDidMount",value:function(){this.props.triggerReflow()}},{key:"componentDidUpdate",value:function(e){(function(e,t){return!Object(A.isEqual)(Object(A.pick)(e.attributes,Mt),Object(A.pick)(t.attributes,Mt))||!Object(A.isEqual)(e.topBlocksClientIdsInOrder,t.topBlocksClientIdsInOrder)})(e,this.props)&&this.props.triggerReflow()}},{key:"componentWillUnmount",value:function(){this.props.triggerReflow()}},{key:"render",value:function(){var e,t=this,n=this.props,r=n.attributes,o=n.className,c=n.setAttributes,a=n.isSelected,l=n.latestPosts,f=n.textColor,p=n.error,d=r.showImage,h=r.imageShape,g=r.postLayout,b=r.mediaPosition,m=r.moreButton,v=r.moreButtonText,y=r.columns,O=r.typeScale,j=r.imageScale,_=r.mobileStack,E=r.sectionHeader,S=r.showCaption,k=r.showCategory,x=r.specificMode,C=nn()(o,(e={"is-grid":"grid"===g,"show-image":d},w()(e,"columns-".concat(y),"grid"===g),w()(e,"ts-".concat(O),"5"!==O),w()(e,"image-align".concat(b),d),w()(e,"is-".concat(j),"1"!==j&&d),w()(e,"mobile-stack",_),w()(e,"is-".concat(h),d),w()(e,"has-text-color",""!==f.color),w()(e,"show-caption",S),w()(e,"show-category",k),w()(e,"wpnbha",!0),e)),P=[{icon:"list-view",title:Object(i.__)("List View","full-site-editing"),onClick:function(){return c({postLayout:"list"})},isActive:"list"===g},{icon:"grid-view",title:Object(i.__)("Grid View","full-site-editing"),onClick:function(){return c({postLayout:"grid"})},isActive:"grid"===g}],A=[{icon:"align-none",title:Object(i.__)("Show media on top","full-site-editing"),isActive:"top"===b,onClick:function(){return c({mediaPosition:"top"})}},{icon:"align-pull-left",title:Object(i.__)("Show media on left","full-site-editing"),isActive:"left"===b,onClick:function(){return c({mediaPosition:"left"})}},{icon:"align-pull-right",title:Object(i.__)("Show media on right","full-site-editing"),isActive:"right"===b,onClick:function(){return c({mediaPosition:"right"})}},{icon:pn,title:Object(i.__)("Show media behind","full-site-editing"),isActive:"behind"===b,onClick:function(){return c({mediaPosition:"behind"})}}],T=[{icon:un,title:Object(i.__)("Landscape Image Shape","full-site-editing"),isActive:"landscape"===h,onClick:function(){return c({imageShape:"landscape"})}},{icon:sn,title:Object(i.__)("portrait Image Shape","full-site-editing"),isActive:"portrait"===h,onClick:function(){return c({imageShape:"portrait"})}},{icon:ln,title:Object(i.__)("Square Image Shape","full-site-editing"),isActive:"square"===h,onClick:function(){return c({imageShape:"square"})}},{icon:fn,title:Object(i.__)("Uncropped","full-site-editing"),isActive:"uncropped"===h,onClick:function(){return c({imageShape:"uncropped"})}}];return Object(u.createElement)(u.Fragment,null,Object(u.createElement)("div",{className:C,style:{color:f.color}},Object(u.createElement)("div",null,l&&(!on.RichText.isEmpty(E)||a)&&Object(u.createElement)(on.RichText,{onChange:function(e){return c({sectionHeader:e})},placeholder:Object(i.__)("Write header…","full-site-editing"),value:E,tagName:"h2",className:"article-section-title"}),l&&!l.length&&Object(u.createElement)(s.Placeholder,null,Object(i.__)("Sorry, no posts were found.","full-site-editing")),!l&&!p&&Object(u.createElement)(s.Placeholder,{icon:Object(u.createElement)(s.Spinner,null),className:"component-placeholder__align-center"}),!l&&p&&Object(u.createElement)(s.Placeholder,{className:"component-placeholder__align-center homepage-posts-block--error"},p),l&&l.map((function(e){return t.renderPost(e)})))),!x&&l&&m&&!Lt()&&Object(u.createElement)("div",{className:"editor-styles-wrapper wpnbha__wp-block-button__wrapper"},Object(u.createElement)("div",{className:"wp-block-button"},Object(u.createElement)(on.RichText,{placeholder:Object(i.__)("Load more posts","full-site-editing"),value:v,onChange:function(e){return c({moreButtonText:e})},className:"wp-block-button__link",keepPlaceholderOnFocus:!0,allowedFormats:[]}))),Object(u.createElement)(on.BlockControls,null,Object(u.createElement)(s.Toolbar,{controls:P}),d&&Object(u.createElement)(s.Toolbar,{controls:A}),d&&Object(u.createElement)(s.Toolbar,{controls:T})),Object(u.createElement)(on.InspectorControls,null,this.renderInspectorControls()))}}]),n}(u.Component),hn=Object(cn.compose)([Object(on.withColors)({textColor:"color"}),Object(Nt.withSelect)((function(e,t){var n=t.clientId,r=t.attributes,o=e("core/editor"),c=o.getEditorBlocks,i=o.getBlocks,a=function e(t){return t.flatMap((function(t){var n=[];return n.push(t.clientId),n.concat(e(t.innerBlocks))}))}(c()).indexOf(n)>=0,u=e(zt),s=u.getPosts,l=u.getError,f={isEditorBlock:a,isUIDisabled:(0,u.isUIDisabled)(),error:l({clientId:n}),topBlocksClientIdsInOrder:i().map((function(e){return e.clientId}))};return f.latestPosts=a?s({clientId:n}):e("core").getEntityRecords("postType","post",Dt(r)),f})),Object(Nt.withDispatch)((function(e,t){return{triggerReflow:t.isEditorBlock?e(zt).reflow:function(){}}}))])(dn),gn=(n(38),n(39),Bt.name,Bt.attributes),bn=Bt.category,mn={title:Object(i.__)("Homepage Posts","full-site-editing"),icon:Object(u.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(u.createElement)(s.Path,{d:"M0 0h24v24H0z",fill:"none"}),Object(u.createElement)(s.Path,{d:"M4 6H2v14c0 1.1.9 2 2 2h14v-2H4V6zm16-4H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H8V4h12v12zM10 9h8v2h-8zm0 3h4v2h-4zm0-6h8v2h-8z"})),attributes:gn,category:bn,keywords:[Object(i.__)("posts","full-site-editing"),Object(i.__)("articles","full-site-editing"),Object(i.__)("latest","full-site-editing")],description:Object(i.__)("A block for displaying homepage posts.","full-site-editing"),styles:[{name:"default",label:Object(i._x)("Default","block style","full-site-editing"),isDefault:!0},{name:"borders",label:Object(i._x)("Borders","block style","full-site-editing")}],supports:{html:!1,align:["wide","full"],default:""},edit:hn,save:function(){return null},transforms:{from:[{type:"block",blocks:["core/latest-posts"],transform:function(e){var t=e.displayPostContent,n=e.displayPostDate,r=e.postLayout,o=e.columns,i=e.postsToShow,u=e.categories;return Object(c.createBlock)(Object(a.applyFilters)("blocks.transforms_from_name","newspack-blocks/homepage-articles"),{showExcerpt:t,showDate:n,postLayout:r,columns:o,postsToShow:i,showAuthor:!1,categories:u?[u]:[]})}}],to:[{type:"block",blocks:["core/latest-posts"],transform:function(e){var t=e.showExcerpt,n=e.showDate,r=e.postLayout,o=e.columns,i=e.postsToShow,a=e.categories;return Object(c.createBlock)("core/latest-posts",{displayPostContent:t,displayPostDate:n,postLayout:r,columns:o,postsToShow:i,categories:a[0]||""})}}]}},vn="a8c/blog-posts";Object(a.addFilter)("blocks.transforms_from_name","set-transformed-block-name",(function(e){return"newspack-blocks/homepage-articles"!==e?e:vn})),Object(c.registerBlockType)(vn,o()(o()({},mn),{},{title:Object(i.__)("Blog Posts","full-site-editing"),category:"widgets"})),an=vn,Object(Nt.registerGenericStore)(zt,Wt),Gt.run(function(e){var t=regeneratorRuntime.mark(n);function n(){var n,r,o,c,i,a,u;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Qe(300);case 2:return n=Object(Nt.select)("core/block-editor"),r=n.getBlocks,t.next=5,Fe({type:"DISABLE_UI"});case 5:o=Ht(r(),e),c=o.reduce((function(e,t){var n=t.postsQuery;return n.include&&(e=[].concat(P()(e),P()(n.include))),e}),[]),i=c;case 8:if(!o.length){t.next=25;break}return(a=o.shift()).postsQuery.exclude=i,u=[],t.prev=12,t.next=15,ze(Yt,a);case 15:u=t.sent,t.next=22;break;case 18:return t.prev=18,t.t0=t.catch(12),t.next=22,Fe({type:"UPDATE_BLOCK_ERROR",clientId:a.clientId,error:t.t0.message});case 22:i=[].concat(P()(i),P()(u)),t.next=8;break;case 25:return t.next=27,Fe({type:"ENABLE_UI"});case 27:case"end":return t.stop()}}),t,null,[[12,18]])}return regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ye("REFLOW",n);case 2:case"end":return e.stop()}}),e)}))}(an))}]));
3
  Copyright (c) 2017 Jed Watson.
4
  Licensed under the MIT License (MIT), see
5
  http://jedwatson.github.io/classnames
6
+ */!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var c=typeof r;if("string"===c||"number"===c)e.push(r);else if(Array.isArray(r)&&r.length){var i=o.apply(null,r);i&&e.push(i)}else if("object"===c)for(var a in r)n.call(r,a)&&r[a]&&e.push(a)}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(r=function(){return o}.apply(t,[]))||(e.exports=r)}()},function(e,t){!function(){e.exports=this.wp.date}()},function(e,t){e.exports=function(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(e,t){function n(){return e.exports=n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},n.apply(this,arguments)}e.exports=n},function(e,t,n){"use strict";function r(e){var t,n=e.Symbol;return"function"==typeof n?n.observable?t=n.observable:(t=n("observable"),n.observable=t):t="@@observable",t}n.d(t,"a",(function(){return r}))},function(e,t){!function(){e.exports=this.wp.compose}()},function(e,t){function n(t,r){return e.exports=n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},n(t,r)}e.exports=n},function(e,t){function n(t){return e.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},n(t)}e.exports=n},function(e,t){e.exports=function(){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(e,t,n){var r=n(31),o=n(4);e.exports=function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?o(e):t}},function(e,t){function n(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?e.exports=n=function(e){return typeof e}:e.exports=n=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(t)}e.exports=n},function(e,t,n){var r=n(23);e.exports=function(e){if(Array.isArray(e))return r(e)}},function(e,t){e.exports=function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}},function(e,t,n){var r=n(23);e.exports=function(e,t){if(e){if("string"==typeof e)return r(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)?r(e,t):void 0}}},function(e,t){e.exports=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(e,t,n){},function(e,t){e.exports=function(e){if(!e.webpackPolyfill){var t=Object.create(e);t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),Object.defineProperty(t,"exports",{enumerable:!0}),t.webpackPolyfill=1}return t}},function(e,t,n){},function(e,t,n){},function(e,t,n){"use strict";n.r(t);var r=n(11),o=n.n(r),c=n(17),i=n(1),a=n(18),u=n(0),s=n(2),l=n(12),f=n.n(l),p=n(19),d=n.n(p),h=n(4),g=n.n(h),b=n(13),m=n.n(b),v=n(14),y=n.n(v),O=n(3),w=n.n(O),j=n(24),_=n.n(j),E=n(7),S=n.n(E),k=n(8),x=n(6),C=n(9),P=n.n(C),A=n(5),T=(n(36),function(e){m()(n,e);var t=y()(n);function n(e){var r;return f()(this,n),r=t.call(this,e),w()(g()(r),"isFetchingInfoOnLoad",(function(){var e=r.props,t=e.tokens,n=e.fetchSavedInfo;return Boolean(t.length&&n)})),r.state={suggestions:[],validValues:{},loading:r.isFetchingInfoOnLoad()},r.debouncedUpdateSuggestions=Object(A.debounce)(r.updateSuggestions,500),r}return d()(n,[{key:"componentDidMount",value:function(){var e=this;if(this.isFetchingInfoOnLoad()){var t=this.props,n=t.tokens;(0,t.fetchSavedInfo)(n).then((function(t){var n=e.state.validValues;t.forEach((function(e){n[e.value]=e.label})),e.setState({validValues:n,loading:!1})}))}}},{key:"componentWillUnmount",value:function(){delete this.suggestionsRequest,this.debouncedUpdateSuggestions.cancel()}},{key:"getLabelsForValues",value:function(e){var t=this.state.validValues;return e.reduce((function(e,n){return t[n]?[].concat(P()(e),[t[n]]):e}),[])}},{key:"getValuesForLabels",value:function(e){var t=this.state.validValues;return e.map((function(e){return Object.keys(t).find((function(n){return t[n]===e}))}))}},{key:"updateSuggestions",value:function(e){var t=this,n=this.props.fetchSuggestions;n&&this.setState({loading:!0},(function(){var r=n(e);r.then((function(e){if(t.suggestionsRequest===r){var n=t.state.validValues,o=[];e.forEach((function(e){o.push(e.label),n[e.value]=e.label})),t.setState({suggestions:o,validValues:n,loading:!1})}})).catch((function(){t.suggestionsRequest===r&&t.setState({loading:!1})})),t.suggestionsRequest=r}))}},{key:"handleOnChange",value:function(e){(0,this.props.onChange)(this.getValuesForLabels(e))}},{key:"getTokens",value:function(){var e=this.props.tokens;return this.getLabelsForValues(e)}},{key:"render",value:function(){var e=this,t=this.props,n=t.help,r=t.label,o=void 0===r?"":r,c=this.state,i=c.suggestions,a=c.loading;return Object(u.createElement)("div",{className:"autocomplete-tokenfield"},Object(u.createElement)(s.FormTokenField,{value:this.getTokens(),suggestions:i,onChange:function(t){return e.handleOnChange(t)},onInputChange:function(t){return e.debouncedUpdateSuggestions(t)},label:o}),a&&Object(u.createElement)(s.Spinner,null),n&&Object(u.createElement)("p",{className:"autocomplete-tokenfield__help"},n))}}]),n}(u.Component)),I=function(e){m()(n,e);var t=y()(n);function n(){var e;f()(this,n);for(var r=arguments.length,o=new Array(r),c=0;c<r;c++)o[c]=arguments[c];return e=t.call.apply(t,[this].concat(o)),w()(g()(e),"state",{showAdvancedFilters:!1}),w()(g()(e),"fetchPostSuggestions",(function(e){return S()({path:Object(k.addQueryArgs)("/wp/v2/search",{search:e,per_page:20,_fields:"id,title",type:"post"})}).then((function(e){return e.map((function(e){return{value:e.id,label:Object(x.decodeEntities)(e.title)||Object(i.__)("(no title)","full-site-editing")}}))}))})),w()(g()(e),"fetchSavedPosts",(function(e){return S()({path:Object(k.addQueryArgs)("/wp/v2/posts",{per_page:100,include:e.join(","),_fields:"id,title"})}).then((function(e){return e.map((function(e){return{value:e.id,label:Object(x.decodeEntities)(e.title.rendered)||Object(i.__)("(no title)","full-site-editing")}}))}))})),w()(g()(e),"fetchAuthorSuggestions",(function(e){return S()({path:Object(k.addQueryArgs)("/wp/v2/users",{search:e,per_page:20,_fields:"id,name"})}).then((function(e){return e.map((function(e){return{value:e.id,label:Object(x.decodeEntities)(e.name)||Object(i.__)("(no name)","full-site-editing")}}))}))})),w()(g()(e),"fetchSavedAuthors",(function(e){return S()({path:Object(k.addQueryArgs)("/wp/v2/users",{per_page:100,include:e.join(","),_fields:"id,name"})}).then((function(e){return e.map((function(e){return{value:e.id,label:Object(x.decodeEntities)(e.name)||Object(i.__)("(no name)","full-site-editing")}}))}))})),w()(g()(e),"fetchCategorySuggestions",(function(e){return S()({path:Object(k.addQueryArgs)("/wp/v2/categories",{search:e,per_page:20,_fields:"id,name",orderby:"count",order:"desc"})}).then((function(e){return e.map((function(e){return{value:e.id,label:Object(x.decodeEntities)(e.name)||Object(i.__)("(no title)","full-site-editing")}}))}))})),w()(g()(e),"fetchSavedCategories",(function(e){return S()({path:Object(k.addQueryArgs)("/wp/v2/categories",{per_page:100,_fields:"id,name",include:e.join(",")})}).then((function(e){return e.map((function(e){return{value:e.id,label:Object(x.decodeEntities)(e.name)||Object(i.__)("(no title)","full-site-editing")}}))}))})),w()(g()(e),"fetchTagSuggestions",(function(e){return S()({path:Object(k.addQueryArgs)("/wp/v2/tags",{search:e,per_page:20,_fields:"id,name",orderby:"count",order:"desc"})}).then((function(e){return e.map((function(e){return{value:e.id,label:Object(x.decodeEntities)(e.name)||Object(i.__)("(no title)","full-site-editing")}}))}))})),w()(g()(e),"fetchSavedTags",(function(e){return S()({path:Object(k.addQueryArgs)("/wp/v2/tags",{per_page:100,_fields:"id,name",include:e.join(",")})}).then((function(e){return e.map((function(e){return{value:e.id,label:Object(x.decodeEntities)(e.name)||Object(i.__)("(no title)","full-site-editing")}}))}))})),w()(g()(e),"render",(function(){var t=e.props,n=t.specificMode,r=t.onSpecificModeChange,o=t.specificPosts,c=t.onSpecificPostsChange,a=t.authors,l=t.onAuthorsChange,f=t.categories,p=t.onCategoriesChange,d=t.tags,h=t.onTagsChange,g=t.tagExclusions,b=t.onTagExclusionsChange,m=t.enableSpecific,v=e.state.showAdvancedFilters;return[m&&Object(u.createElement)(s.ToggleControl,{key:"specificMode",checked:n,onChange:r,label:Object(i.__)("Choose Specific Posts","full-site-editing")}),n&&Object(u.createElement)(T,{key:"posts",tokens:o||[],onChange:c,fetchSuggestions:e.fetchPostSuggestions,fetchSavedInfo:e.fetchSavedPosts,label:Object(i.__)("Posts","full-site-editing"),help:Object(i.__)("Begin typing post title, click autocomplete result to select.","full-site-editing")}),!n&&Object(u.createElement)(s.QueryControls,_()({key:"queryControls"},e.props)),!n&&l&&Object(u.createElement)(T,{key:"authors",tokens:a||[],onChange:l,fetchSuggestions:e.fetchAuthorSuggestions,fetchSavedInfo:e.fetchSavedAuthors,label:Object(i.__)("Authors","full-site-editing")}),!n&&p&&Object(u.createElement)(T,{key:"categories",tokens:f||[],onChange:p,fetchSuggestions:e.fetchCategorySuggestions,fetchSavedInfo:e.fetchSavedCategories,label:Object(i.__)("Categories","full-site-editing")}),!n&&h&&Object(u.createElement)(T,{key:"tags",tokens:d||[],onChange:h,fetchSuggestions:e.fetchTagSuggestions,fetchSavedInfo:e.fetchSavedTags,label:Object(i.__)("Tags","full-site-editing")}),!n&&b&&Object(u.createElement)("p",{key:"toggle-advanced-filters"},Object(u.createElement)(s.Button,{isLink:!0,onClick:function(){return e.setState({showAdvancedFilters:!v})}},v?Object(i.__)("Hide Advanced Filters","full-site-editing"):Object(i.__)("Show Advanced Filters","full-site-editing"))),!n&&b&&v&&Object(u.createElement)(T,{key:"tag-exclusion",tokens:g||[],onChange:b,fetchSuggestions:e.fetchTagSuggestions,fetchSavedInfo:e.fetchSavedTags,label:Object(i.__)("Excluded Tags","full-site-editing")})]})),e}return n}(u.Component);I.defaultProps={enableSpecific:!0,specificPosts:[],authors:[],categories:[],tags:[],tagExclusions:[]};var R=I,N=n(20),B=function(){return Math.random().toString(36).substring(7).split("").join(".")},L={INIT:"@@redux/INIT"+B(),REPLACE:"@@redux/REPLACE"+B(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+B()}};function M(e){if("object"!=typeof e||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function D(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function H(e,t){var n=Object.keys(e);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(e)),t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n}function F(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?H(n,!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):H(n).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function U(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return 0===t.length?function(e){return e}:1===t.length?t[0]:t.reduce((function(e,t){return function(){return e(t.apply(void 0,arguments))}}))}var z=function(e){return"@@redux-saga/"+e},V=z("CANCEL_PROMISE"),q=z("CHANNEL_END"),Q=z("IO"),G=z("MATCH"),K=z("MULTICAST"),W=z("SAGA_ACTION"),J=z("SELF_CANCELLATION"),X=z("TASK"),Y=z("TASK_CANCEL"),$=z("TERMINATE"),Z=z("LOCATION");function ee(){return(ee=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var te=function(e){return null==e},ne=function(e){return null!=e},re=function(e){return"function"==typeof e},oe=function(e){return"string"==typeof e},ce=Array.isArray,ie=function(e){return e&&re(e.then)},ae=function(e){return e&&re(e.next)&&re(e.throw)},ue=function e(t){return t&&(oe(t)||fe(t)||re(t)||ce(t)&&t.every(e))},se=function(e){return e&&re(e.take)&&re(e.close)},le=function(e){return re(e)&&e.hasOwnProperty("toString")},fe=function(e){return Boolean(e)&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype};var pe=function(e,t){var n;void 0===t&&(t=!0);var r=new Promise((function(r){n=setTimeout(r,e,t)}));return r[V]=function(){clearTimeout(n)},r},de=function(e){return function(){return e}}(!0),he=function(){};var ge=function(e){return e};"function"==typeof Symbol&&Symbol.asyncIterator&&Symbol.asyncIterator;var be=function(e,t){ee(e,t),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(t).forEach((function(n){e[n]=t[n]}))};function me(e,t){var n=e.indexOf(t);n>=0&&e.splice(n,1)}function ve(e){var t=!1;return function(){t||(t=!0,e())}}var ye=function(e){throw e},Oe=function(e){return{value:e,done:!0}};function we(e,t,n){void 0===t&&(t=ye),void 0===n&&(n="iterator");var r={meta:{name:n},next:e,throw:t,return:Oe,isSagaIterator:!0};return"undefined"!=typeof Symbol&&(r[Symbol.iterator]=function(){return r}),r}function je(e,t){var n=t.sagaStack;console.error(e),console.error(n)}var _e=function(e){return Array.apply(null,new Array(e))},Ee=function(e){return function(t){return e(Object.defineProperty(t,W,{value:!0}))}},Se=function(e){return e===$},ke=function(e){return e===Y},xe=function(e){return Se(e)||ke(e)};function Ce(e,t){var n=Object.keys(e),r=n.length;var o,c=0,i=ce(e)?_e(r):{},a={};return n.forEach((function(e){var n=function(n,a){o||(a||xe(n)?(t.cancel(),t(n,a)):(i[e]=n,++c===r&&(o=!0,t(i))))};n.cancel=he,a[e]=n})),t.cancel=function(){o||(o=!0,n.forEach((function(e){return a[e].cancel()})))},a}function Pe(e){return{name:e.name||"anonymous",location:Ae(e)}}function Ae(e){return e[Z]}function Te(e,t){void 0===e&&(e=10);var n=new Array(e),r=0,o=0,c=0,i=function(t){n[o]=t,o=(o+1)%e,r++},a=function(){if(0!=r){var t=n[c];return n[c]=null,r--,c=(c+1)%e,t}},u=function(){for(var e=[];r;)e.push(a());return e};return{isEmpty:function(){return 0==r},put:function(a){var s;if(r<e)i(a);else switch(t){case 1:throw new Error("Channel's Buffer overflow!");case 3:n[o]=a,c=o=(o+1)%e;break;case 4:s=2*e,n=u(),r=n.length,o=n.length,c=0,n.length=s,e=s,i(a)}},take:a,flush:u}}var Ie=function(e){return Te(e,4)},Re="TAKE",Ne="PUT",Be="CALL",Le="FORK",Me="CANCEL",De=function(e,t){var n;return(n={})[Q]=!0,n.combinator=!1,n.type=e,n.payload=t,n};function He(e,t){return void 0===e&&(e="*"),ue(e)?De(Re,{pattern:e}):se(n=e)&&n[K]&&ne(t)&&ue(t)?De(Re,{channel:e,pattern:t}):se(e)?De(Re,{channel:e}):void 0;var n}function Fe(e,t){return te(t)&&(t=e,e=void 0),De(Ne,{channel:e,action:t})}function Ue(e,t){var n,r=null;return re(e)?n=e:(ce(e)?(r=e[0],n=e[1]):(r=e.context,n=e.fn),r&&oe(n)&&re(r[n])&&(n=r[n])),{context:r,fn:n,args:t}}function ze(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 De(Be,Ue(e,n))}function Ve(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 De(Le,Ue(e,n))}function qe(e){return void 0===e&&(e=J),De(Me,e)}var Qe=ze.bind(null,pe),Ge=function(e){return{done:!0,value:e}},Ke={};function We(e){return se(e)?"channel":le(e)?String(e):re(e)?e.name:String(e)}function Je(e,t,n){var r,o,c,i=t;function a(t,n){if(i===Ke)return Ge(t);if(n&&!o)throw i=Ke,n;r&&r(t);var a=n?e[o](n):e[i]();return i=a.nextState,c=a.effect,r=a.stateUpdater,o=a.errorState,i===Ke?Ge(t):c}return we(a,(function(e){return a(null,e)}),n)}function Xe(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];var c,i,a={done:!1,value:He(e)},u=function(e){return{done:!1,value:Ve.apply(void 0,[t].concat(r,[e]))}},s=function(e){return{done:!1,value:qe(e)}},l=function(e){return c=e},f=function(e){return i=e};return Je({q1:function(){return{nextState:"q2",effect:a,stateUpdater:f}},q2:function(){return c?{nextState:"q3",effect:s(c)}:{nextState:"q1",effect:u(i),stateUpdater:l}},q3:function(){return{nextState:"q1",effect:u(i),stateUpdater:l}}},"q1","takeLatest("+We(e)+", "+t.name+")")}function Ye(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];return Ve.apply(void 0,[Xe,e,t].concat(r))}function $e(){var e={};return e.promise=new Promise((function(t,n){e.resolve=t,e.reject=n})),e}var Ze=$e,et=[],tt=0;function nt(e){try{ct(),e()}finally{it()}}function rt(e){et.push(e),tt||(ct(),at())}function ot(e){try{return ct(),e()}finally{at()}}function ct(){tt++}function it(){tt--}function at(){var e;for(it();!tt&&void 0!==(e=et.shift());)nt(e)}var ut=function(e){return function(t){return e.some((function(e){return dt(e)(t)}))}},st=function(e){return function(t){return e(t)}},lt=function(e){return function(t){return t.type===String(e)}},ft=function(e){return function(t){return t.type===e}},pt=function(){return de};function dt(e){var t="*"===e?pt:oe(e)?lt:ce(e)?ut:le(e)?lt:re(e)?st:fe(e)?ft:null;if(null===t)throw new Error("invalid pattern: "+e);return t(e)}var ht={type:q},gt=function(e){return e&&e.type===q};function bt(e){void 0===e&&(e=Ie());var t=!1,n=[];return{take:function(r){t&&e.isEmpty()?r(ht):e.isEmpty()?(n.push(r),r.cancel=function(){me(n,r)}):r(e.take())},put:function(r){if(!t){if(0===n.length)return e.put(r);n.shift()(r)}},flush:function(n){t&&e.isEmpty()?n(ht):n(e.flush())},close:function(){if(!t){t=!0;var e=n;n=[];for(var r=0,o=e.length;r<o;r++){(0,e[r])(ht)}}}}}function mt(){var e,t,n,r,o,c,i=(t=!1,r=n=[],o=function(){r===n&&(r=n.slice())},c=function(){t=!0;var e=n=r;r=[],e.forEach((function(e){e(ht)}))},(e={})[K]=!0,e.put=function(e){if(!t)if(gt(e))c();else for(var o=n=r,i=0,a=o.length;i<a;i++){var u=o[i];u[G](e)&&(u.cancel(),u(e))}},e.take=function(e,n){void 0===n&&(n=pt),t?e(ht):(e[G]=n,o(),r.push(e),e.cancel=ve((function(){o(),me(r,e)})))},e.close=c,e),a=i.put;return i.put=function(e){e[W]?a(e):rt((function(){a(e)}))},i}function vt(e,t){var n=e[V];re(n)&&(t.cancel=n),e.then(t,(function(e){t(e,!0)}))}var yt,Ot=0,wt=function(){return++Ot};function jt(e){e.isRunning()&&e.cancel()}var _t=((yt={}).TAKE=function(e,t,n){var r=t.channel,o=void 0===r?e.channel:r,c=t.pattern,i=t.maybe,a=function(e){e instanceof Error?n(e,!0):!gt(e)||i?n(e):n($)};try{o.take(a,ne(c)?dt(c):null)}catch(u){return void n(u,!0)}n.cancel=a.cancel},yt.PUT=function(e,t,n){var r=t.channel,o=t.action,c=t.resolve;rt((function(){var t;try{t=(r?r.put:e.dispatch)(o)}catch(i){return void n(i,!0)}c&&ie(t)?vt(t,n):n(t)}))},yt.ALL=function(e,t,n,r){var o=r.digestEffect,c=Ot,i=Object.keys(t);if(0!==i.length){var a=Ce(t,n);i.forEach((function(e){o(t[e],c,a[e],e)}))}else n(ce(t)?[]:{})},yt.RACE=function(e,t,n,r){var o=r.digestEffect,c=Ot,i=Object.keys(t),a=ce(t)?_e(i.length):{},u={},s=!1;i.forEach((function(e){var t=function(t,r){s||(r||xe(t)?(n.cancel(),n(t,r)):(n.cancel(),s=!0,a[e]=t,n(a)))};t.cancel=he,u[e]=t})),n.cancel=function(){s||(s=!0,i.forEach((function(e){return u[e].cancel()})))},i.forEach((function(e){s||o(t[e],c,u[e],e)}))},yt.CALL=function(e,t,n,r){var o=t.context,c=t.fn,i=t.args,a=r.task;try{var u=c.apply(o,i);if(ie(u))return void vt(u,n);if(ae(u))return void Tt(e,u,a.context,Ot,Pe(c),!1,n);n(u)}catch(s){n(s,!0)}},yt.CPS=function(e,t,n){var r=t.context,o=t.fn,c=t.args;try{var i=function(e,t){te(e)?n(t):n(e,!0)};o.apply(r,c.concat(i)),i.cancel&&(n.cancel=i.cancel)}catch(a){n(a,!0)}},yt.FORK=function(e,t,n,r){var o=t.context,c=t.fn,i=t.args,a=t.detached,u=r.task,s=function(e){var t=e.context,n=e.fn,r=e.args;try{var o=n.apply(t,r);if(ae(o))return o;var c=!1;return we((function(e){return c?{value:e,done:!0}:(c=!0,{value:o,done:!ie(o)})}))}catch(i){return we((function(){throw i}))}}({context:o,fn:c,args:i}),l=function(e,t){return e.isSagaIterator?{name:e.meta.name}:Pe(t)}(s,c);ot((function(){var t=Tt(e,s,u.context,Ot,l,a,void 0);a?n(t):t.isRunning()?(u.queue.addTask(t),n(t)):t.isAborted()?u.queue.abort(t.error()):n(t)}))},yt.JOIN=function(e,t,n,r){var o=r.task,c=function(e,t){if(e.isRunning()){var n={task:o,cb:t};t.cancel=function(){e.isRunning()&&me(e.joiners,n)},e.joiners.push(n)}else e.isAborted()?t(e.error(),!0):t(e.result())};if(ce(t)){if(0===t.length)return void n([]);var i=Ce(t,n);t.forEach((function(e,t){c(e,i[t])}))}else c(t,n)},yt.CANCEL=function(e,t,n,r){var o=r.task;t===J?jt(o):ce(t)?t.forEach(jt):jt(t),n()},yt.SELECT=function(e,t,n){var r=t.selector,o=t.args;try{n(r.apply(void 0,[e.getState()].concat(o)))}catch(c){n(c,!0)}},yt.ACTION_CHANNEL=function(e,t,n){var r=t.pattern,o=bt(t.buffer),c=dt(r),i=function t(n){gt(n)||e.channel.take(t,c),o.put(n)},a=o.close;o.close=function(){i.cancel(),a()},e.channel.take(i,c),n(o)},yt.CANCELLED=function(e,t,n,r){n(r.task.isCancelled())},yt.FLUSH=function(e,t,n){t.flush(n)},yt.GET_CONTEXT=function(e,t,n,r){n(r.task.context[t])},yt.SET_CONTEXT=function(e,t,n,r){var o=r.task;be(o.context,t),n()},yt);function Et(e,t){return e+"?"+t}function St(e){var t=e.name,n=e.location;return n?t+" "+Et(n.fileName,n.lineNumber):t}var kt=null,xt=[],Ct=function(){kt=null,xt.length=0},Pt=function(){var e,t,n,r,o,c,i,a=xt[0],u=xt.slice(1),s=a.crashedEffect?(e=a.crashedEffect,(t=Ae(e))?t.code+" "+Et(t.fileName,t.lineNumber):""):null;return["The above error occurred in task "+St(a.meta)+(s?" \n when executing effect "+s:"")].concat(u.map((function(e){return" created by "+St(e.meta)})),[(n=xt,r=function(e){return e.cancelledTasks},o=n,i=(c=[]).concat.apply(c,o.map(r)),i.length?["Tasks cancelled due to error:"].concat(i).join("\n"):"")]).join("\n")};function At(e,t,n,r,o,c,i){var a;void 0===i&&(i=he);var u,s,l=0,f=null,p=[],d=Object.create(n),h=function(e,t,n){var r,o=[],c=!1;function i(e){t(),u(),n(e,!0)}function a(t){o.push(t),t.cont=function(a,u){c||(me(o,t),t.cont=he,u?i(a):(t===e&&(r=a),o.length||(c=!0,n(r))))}}function u(){c||(c=!0,o.forEach((function(e){e.cont=he,e.cancel()})),o=[])}return a(e),{addTask:a,cancelAll:u,abort:i,getTasks:function(){return o}}}(t,(function(){p.push.apply(p,h.getTasks().map((function(e){return e.meta.name})))}),g);function g(t,n){if(n){if(l=2,(c={meta:o,cancelledTasks:p}).crashedEffect=kt,xt.push(c),b.isRoot){var r=Pt();Ct(),e.onError(t,{sagaStack:r})}s=t,f&&f.reject(t)}else t===Y?l=1:1!==l&&(l=3),u=t,f&&f.resolve(t);var c;b.cont(t,n),b.joiners.forEach((function(e){e.cb(t,n)})),b.joiners=null}var b=((a={})[X]=!0,a.id=r,a.meta=o,a.isRoot=c,a.context=d,a.joiners=[],a.queue=h,a.cancel=function(){0===l&&(l=1,h.cancelAll(),g(Y,!1))},a.cont=i,a.end=g,a.setContext=function(e){be(d,e)},a.toPromise=function(){return f||(f=Ze(),2===l?f.reject(s):0!==l&&f.resolve(u)),f.promise},a.isRunning=function(){return 0===l},a.isCancelled=function(){return 1===l||0===l&&1===t.status},a.isAborted=function(){return 2===l},a.result=function(){return u},a.error=function(){return s},a);return b}function Tt(e,t,n,r,o,c,i){var a=e.finalizeRunEffect((function(t,n,r){if(ie(t))vt(t,r);else if(ae(t))Tt(e,t,s.context,n,o,!1,r);else if(t&&t[Q]){(0,_t[t.type])(e,t.payload,r,l)}else r(t)}));f.cancel=he;var u={meta:o,cancel:function(){0===u.status&&(u.status=1,f(Y))},status:0},s=At(e,u,n,r,o,c,i),l={task:s,digestEffect:p};return i&&(i.cancel=s.cancel),f(),s;function f(e,n){try{var o;n?(o=t.throw(e),Ct()):ke(e)?(u.status=1,f.cancel(),o=re(t.return)?t.return(Y):{done:!0,value:Y}):o=Se(e)?re(t.return)?t.return():{done:!0}:t.next(e),o.done?(1!==u.status&&(u.status=3),u.cont(o.value)):p(o.value,r,f)}catch(c){if(1===u.status)throw c;u.status=2,u.cont(c,!0)}}function p(t,n,r,o){void 0===o&&(o="");var c,i=wt();function u(n,o){c||(c=!0,r.cancel=he,e.sagaMonitor&&(o?e.sagaMonitor.effectRejected(i,n):e.sagaMonitor.effectResolved(i,n)),o&&function(e){kt=e}(t),r(n,o))}e.sagaMonitor&&e.sagaMonitor.effectTriggered({effectId:i,parentEffectId:n,label:o,effect:t}),u.cancel=he,r.cancel=function(){c||(c=!0,u.cancel(),u.cancel=he,e.sagaMonitor&&e.sagaMonitor.effectCancelled(i))},a(t,i,u)}}function It(e,t){var n=e.channel,r=void 0===n?mt():n,o=e.dispatch,c=e.getState,i=e.context,a=void 0===i?{}:i,u=e.sagaMonitor,s=e.effectMiddlewares,l=e.onError,f=void 0===l?je:l;for(var p=arguments.length,d=new Array(p>2?p-2:0),h=2;h<p;h++)d[h-2]=arguments[h];var g=t.apply(void 0,d);var b,m=wt();if(u&&(u.rootSagaStarted=u.rootSagaStarted||he,u.effectTriggered=u.effectTriggered||he,u.effectResolved=u.effectResolved||he,u.effectRejected=u.effectRejected||he,u.effectCancelled=u.effectCancelled||he,u.actionDispatched=u.actionDispatched||he,u.rootSagaStarted({effectId:m,saga:t,args:d})),s){var v=U.apply(void 0,s);b=function(e){return function(t,n,r){return v((function(t){return e(t,n,r)}))(t)}}}else b=ge;var y={channel:r,dispatch:Ee(o),getState:c,sagaMonitor:u,onError:f,finalizeRunEffect:b};return ot((function(){var e=Tt(y,g,a,m,Pe(t),!0,void 0);return u&&u.effectResolved(m,e),e}))}var Rt=function(e){var t,n=void 0===e?{}:e,r=n.context,o=void 0===r?{}:r,c=n.channel,i=void 0===c?mt():c,a=n.sagaMonitor,u=function(e,t){if(null==e)return{};var n,r,o={},c=Object.keys(e);for(r=0;r<c.length;r++)n=c[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(n,["context","channel","sagaMonitor"]);function s(e){var n=e.getState,r=e.dispatch;return t=It.bind(null,ee({},u,{context:o,channel:i,dispatch:r,getState:n,sagaMonitor:a})),function(e){return function(t){a&&a.actionDispatched&&a.actionDispatched(t);var n=e(t);return i.put(t),n}}}return s.run=function(){return t.apply(void 0,arguments)},s.setContext=function(e){be(o,e)},s},Nt=n(15),Bt=n(16),Lt=function(){return"object"==typeof window&&window.wpcomGutenberg&&-1===Number(window.wpcomGutenberg.blogPublic)},Mt=["postsToShow","authors","categories","tags","specificPosts","specificMode","tagExclusions"],Dt=function(e){var t=Object(A.pick)(e,Mt),n=t.postsToShow,r=t.authors,o=t.categories,c=t.tags,i=t.specificPosts,a=t.specificMode,u=t.tagExclusions,s=a&&i&&i.length;return Object(A.pickBy)(s?{include:i,orderby:"include",per_page:i.length}:{per_page:n,categories:o,author:r,tags:c,tags_exclude:u},(function(e){return!Object(A.isUndefined)(e)}))},Ht=function e(t,n){return t.flatMap((function(t){var r=[];if(t.name===n){var o=Dt(t.attributes);r.push({postsQuery:o,clientId:t.clientId})}return r.concat(e(t.innerBlocks,n))}))},Ft=function e(t){return t.flatMap((function(t){var n=[];return n.push(t.clientId),n.concat(e(t.innerBlocks))}))},Ut=regeneratorRuntime.mark($t),zt=Bt.name,Vt="newspack-blocks/".concat(zt),qt={postsByBlock:{},errorsByBlock:{}},Qt={reflow:function(){Wt.dispatch({type:"REFLOW"})}},Gt={getPosts:function(e){var t=e.clientId;return Wt.getState().postsByBlock[t]},getError:function(e){var t=e.clientId;return Wt.getState().errorsByBlock[t]},isUIDisabled:function(){return Wt.getState().isUIDisabled}},Kt=Rt(),Wt=function e(t,n,r){var o;if("function"==typeof n&&"function"==typeof r||"function"==typeof r&&"function"==typeof arguments[3])throw new Error("It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function.");if("function"==typeof n&&void 0===r&&(r=n,n=void 0),void 0!==r){if("function"!=typeof r)throw new Error("Expected the enhancer to be a function.");return r(e)(t,n)}if("function"!=typeof t)throw new Error("Expected the reducer to be a function.");var c=t,i=n,a=[],u=a,s=!1;function l(){u===a&&(u=a.slice())}function f(){if(s)throw new Error("You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return i}function p(e){if("function"!=typeof e)throw new Error("Expected the listener to be a function.");if(s)throw new Error("You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api-reference/store#subscribelistener for more details.");var t=!0;return l(),u.push(e),function(){if(t){if(s)throw new Error("You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api-reference/store#subscribelistener for more details.");t=!1,l();var n=u.indexOf(e);u.splice(n,1),a=null}}}function d(e){if(!M(e))throw new Error("Actions must be plain objects. Use custom middleware for async actions.");if(void 0===e.type)throw new Error('Actions may not have an undefined "type" property. Have you misspelled a constant?');if(s)throw new Error("Reducers may not dispatch actions.");try{s=!0,i=c(i,e)}finally{s=!1}for(var t=a=u,n=0;n<t.length;n++){(0,t[n])()}return e}function h(e){if("function"!=typeof e)throw new Error("Expected the nextReducer to be a function.");c=e,d({type:L.REPLACE})}function g(){var e,t=p;return(e={subscribe:function(e){if("object"!=typeof e||null===e)throw new TypeError("Expected the observer to be an object.");function n(){e.next&&e.next(f())}return n(),{unsubscribe:t(n)}}})[N.a]=function(){return this},e}return d({type:L.INIT}),(o={dispatch:d,subscribe:p,getState:f,replaceReducer:h})[N.a]=g,o}((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:qt,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"DISABLE_UI":return Object(A.set)(e,"isUIDisabled",!0);case"ENABLE_UI":return Object(A.set)(e,"isUIDisabled",!1);case"UPDATE_BLOCK_POSTS":return Object(A.set)(e,["postsByBlock",t.clientId],t.posts);case"UPDATE_BLOCK_ERROR":return Object(A.set)(e,["errorsByBlock",t.clientId],t.error)}return e}),function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return function(){var n=e.apply(void 0,arguments),r=function(){throw new Error("Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")},o={getState:n.getState,dispatch:function(){return r.apply(void 0,arguments)}},c=t.map((function(e){return e(o)}));return F({},n,{dispatch:r=U.apply(void 0,c)(n.dispatch)})}}}(Kt)),Jt=o()({getSelectors:function(){return Gt},getActions:function(){return Qt}},Wt),Xt={},Yt=JSON.stringify;function $t(e){var t,n,r,c;return regeneratorRuntime.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(t=Yt(e.postsQuery),void 0!==(n=Xt[t])){i.next=8;break}return r=Object(k.addQueryArgs)("/wp/v2/posts",o()(o()({},e.postsQuery),{},{context:"edit"})),i.next=6,ze(S.a,{path:r});case 6:n=i.sent,Xt[t]=n;case 8:return c=n.map((function(e){return e.id})),i.next=11,Fe({type:"UPDATE_BLOCK_POSTS",clientId:e.clientId,posts:n});case 11:return i.abrupt("return",c);case 12:case"end":return i.stop()}}),Ut)}var Zt,en=function(e){return e.map((function(e){return Object(u.createElement)("span",{className:"avatar author-avatar",key:e.id},Object(u.createElement)("a",{className:"url fn n",href:e.author_link},Object(u.createElement)(u.RawHTML,null,e.avatar)))}))},tn=function(e){return Object(u.createElement)("span",{className:"byline"},Object(i._x)("by","post author","full-site-editing")," ",e.reduce((function(t,n,r){return[].concat(P()(t),[Object(u.createElement)("span",{className:"author vcard",key:n.id},Object(u.createElement)("a",{className:"url fn n",href:n.author_link},n.display_name)),r<e.length-2&&", ",e.length>1&&r===e.length-2&&Object(i._x)(" and ","post author","full-site-editing")])}),[]))},nn=n(21),rn=n.n(nn),on=n(22),cn=n(10),an=n(26);"object"==typeof window&&window.newspackIsPostSubtitleSupported&&window.newspackIsPostSubtitleSupported.post_subtitle&&(Zt=!0);var un,sn=Object(u.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(u.createElement)(s.Path,{d:"M0 0h24v24H0z",fill:"none"}),Object(u.createElement)(s.Path,{d:"M19 5H5c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 12H5V7h14v10z"})),ln=Object(u.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(u.createElement)(s.Path,{d:"M0 0h24v24H0z",fill:"none"}),Object(u.createElement)(s.Path,{d:"M17 3H7c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h10c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H7V5h10v14z"})),fn=Object(u.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(u.createElement)(s.Path,{d:"M0 0h24v24H0z",fill:"none"}),Object(u.createElement)(s.Path,{d:"M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 14H6V6h12v12z"})),pn=Object(u.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(u.createElement)(s.Path,{d:"M0 0h24v24H0z",fill:"none"}),Object(u.createElement)(s.Path,{d:"M3 5v4h2V5h4V3H5c-1.1 0-2 .9-2 2zm2 10H3v4c0 1.1.9 2 2 2h4v-2H5v-4zm14 4h-4v2h4c1.1 0 2-.9 2-2v-4h-2v4zm0-16h-4v2h4v4h2V5c0-1.1-.9-2-2-2z"})),dn=Object(u.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(u.createElement)(s.Path,{d:"M0 0h24v24H0z",fill:"none"}),Object(u.createElement)(s.Path,{d:"M4 4h7V2H4c-1.1 0-2 .9-2 2v7h2V4zm6 9l-4 5h12l-3-4-2.03 2.71L10 13zm7-4.5c0-.83-.67-1.5-1.5-1.5S14 7.67 14 8.5s.67 1.5 1.5 1.5S17 9.33 17 8.5zM20 2h-7v2h7v7h2V4c0-1.1-.9-2-2-2zm0 18h-7v2h7c1.1 0 2-.9 2-2v-7h-2v7zM4 13H2v7c0 1.1.9 2 2 2h7v-2H4v-7z"})),hn=function(e){m()(n,e);var t=y()(n);function n(){var e;f()(this,n);for(var r=arguments.length,o=new Array(r),c=0;c<r;c++)o[c]=arguments[c];return e=t.call.apply(t,[this].concat(o)),w()(g()(e),"renderPost",(function(t){var n=e.props,r=n.attributes,o=n.isUIDisabled,c=r.showImage,i=r.imageShape,a=r.mediaPosition,s=r.minHeight,l=r.showCaption,f=r.showExcerpt,p=r.showSubtitle,d=r.showAuthor,h=r.showAvatar,g=r.showDate,b=r.showCategory,m=r.sectionHeader,v={minHeight:"behind"===a&&c&&t.newspack_featured_image_src&&s+"vh",paddingTop:"behind"===a&&c&&t.newspack_featured_image_src&&s/5+"vh"},y=rn()({"post-has-image":t.newspack_featured_image_src,"homepage-posts-block__post--disabled":o},t.newspack_article_classes),O=e.titleForPost(t),w=Object(on.__experimentalGetSettings)().formats.date;return Object(u.createElement)("article",{className:y,key:t.id,style:v},c&&t.newspack_featured_image_src&&Object(u.createElement)("figure",{className:"post-thumbnail",key:"thumbnail"},Object(u.createElement)("a",{href:"#"},"landscape"===i&&Object(u.createElement)("img",{src:t.newspack_featured_image_src.landscape,alt:""}),"portrait"===i&&Object(u.createElement)("img",{src:t.newspack_featured_image_src.portrait,alt:""}),"square"===i&&Object(u.createElement)("img",{src:t.newspack_featured_image_src.square,alt:""}),"uncropped"===i&&Object(u.createElement)("img",{src:t.newspack_featured_image_src.uncropped,alt:""})),l&&""!==t.newspack_featured_image_caption&&Object(u.createElement)("figcaption",null,t.newspack_featured_image_caption)),Object(u.createElement)("div",{className:"entry-wrapper"},b&&t.newspack_category_info.length&&Object(u.createElement)("div",{className:"cat-links"},Object(u.createElement)("a",{href:"#"},Object(x.decodeEntities)(t.newspack_category_info))),cn.RichText.isEmpty(m)?Object(u.createElement)("h2",{className:"entry-title",key:"title"},Object(u.createElement)("a",{href:"#"},O)):Object(u.createElement)("h3",{className:"entry-title",key:"title"},Object(u.createElement)("a",{href:"#"},O)),Zt&&p&&Object(u.createElement)(u.RawHTML,{key:"subtitle",className:"newspack-post-subtitle newspack-post-subtitle--in-homepage-block"},t.meta.newspack_post_subtitle||""),f&&Object(u.createElement)(u.RawHTML,{key:"excerpt",className:"excerpt-contain"},t.excerpt.rendered),Object(u.createElement)("div",{className:"entry-meta"},d&&h&&en(t.newspack_author_info),d&&tn(t.newspack_author_info),g&&Object(u.createElement)("time",{className:"entry-date published",key:"pub-date"},Object(on.dateI18n)(w,t.date_gmt)))))})),w()(g()(e),"titleForPost",(function(e){return e.title?"string"==typeof e.title?Object(x.decodeEntities)(e.title.trim()):"object"==typeof e.title&&e.title.rendered?Object(x.decodeEntities)(e.title.rendered.trim()):void 0:""})),w()(g()(e),"renderInspectorControls",(function(){var t=e.props,n=t.attributes,r=t.setAttributes,o=t.textColor,c=t.setTextColor,a=n.authors,l=n.specificPosts,f=n.postsToShow,p=n.categories,d=n.columns,h=n.showImage,g=n.showCaption,b=n.imageScale,m=n.mobileStack,v=n.minHeight,y=n.moreButton,O=n.showExcerpt,w=n.showSubtitle,j=n.typeScale,_=n.showDate,E=n.showAuthor,S=n.showAvatar,k=n.showCategory,x=n.postLayout,C=n.mediaPosition,P=n.specificMode,A=n.tags,T=n.tagExclusions,I=[{value:1,label:Object(i.__)("Small","full-site-editing"),shortName:Object(i.__)("S","full-site-editing")},{value:2,label:Object(i.__)("Medium","full-site-editing"),shortName:Object(i.__)("M","full-site-editing")},{value:3,label:Object(i.__)("Large","full-site-editing"),shortName:Object(i.__)("L","full-site-editing")},{value:4,label:Object(i.__)("Extra Large","full-site-editing"),shortName:Object(i.__)("XL","full-site-editing")}];return Object(u.createElement)(u.Fragment,null,Object(u.createElement)(s.PanelBody,{title:Object(i.__)("Display Settings","full-site-editing"),initialOpen:!0},Object(u.createElement)(R,{numberOfItems:f,onNumberOfItemsChange:function(e){return r({postsToShow:e||1})},specificMode:P,onSpecificModeChange:function(e){return r({specificMode:e})},specificPosts:l,onSpecificPostsChange:function(e){return r({specificPosts:e})},authors:a,onAuthorsChange:function(e){return r({authors:e})},categories:p,onCategoriesChange:function(e){return r({categories:e})},tags:A,onTagsChange:function(e){r({tags:e})},tagExclusions:T,onTagExclusionsChange:function(e){return r({tagExclusions:e})}}),"grid"===x&&Object(u.createElement)(s.RangeControl,{label:Object(i.__)("Columns","full-site-editing"),value:d,onChange:function(e){return r({columns:e})},min:2,max:6,required:!0}),!P&&!Lt()&&Object(u.createElement)(s.ToggleControl,{label:Object(i.__)('Show "More" Button',"full-site-editing"),checked:y,onChange:function(){return r({moreButton:!y})}})),Object(u.createElement)(s.PanelBody,{title:Object(i.__)("Featured Image Settings","full-site-editing")},Object(u.createElement)(s.PanelRow,null,Object(u.createElement)(s.ToggleControl,{label:Object(i.__)("Show Featured Image","full-site-editing"),checked:h,onChange:function(){return r({showImage:!h})}})),h&&Object(u.createElement)(s.PanelRow,null,Object(u.createElement)(s.ToggleControl,{label:Object(i.__)("Show Featured Image Caption","full-site-editing"),checked:g,onChange:function(){return r({showCaption:!g})}})),h&&"top"!==C&&"behind"!==C&&Object(u.createElement)(u.Fragment,null,Object(u.createElement)(s.PanelRow,null,Object(u.createElement)(s.ToggleControl,{label:Object(i.__)("Stack on mobile","full-site-editing"),checked:m,onChange:function(){return r({mobileStack:!m})}})),Object(u.createElement)(s.BaseControl,{label:Object(i.__)("Featured Image Size","full-site-editing"),id:"newspackfeatured-image-size"},Object(u.createElement)(s.PanelRow,null,Object(u.createElement)(s.ButtonGroup,{id:"newspackfeatured-image-size","aria-label":Object(i.__)("Featured Image Size","full-site-editing")},I.map((function(e){var t=b===e.value;return Object(u.createElement)(s.Button,{isLarge:!0,isPrimary:t,"aria-pressed":t,"aria-label":e.label,key:e.value,onClick:function(){return r({imageScale:e.value})}},e.shortName)})))))),h&&"behind"===C&&Object(u.createElement)(s.RangeControl,{label:Object(i.__)("Minimum height","full-site-editing"),help:Object(i.__)("Sets a minimum height for the block, using a percentage of the screen's current height.","full-site-editing"),value:v,onChange:function(e){return r({minHeight:e})},min:0,max:100,required:!0})),Object(u.createElement)(s.PanelBody,{title:Object(i.__)("Post Control Settings","full-site-editing")},Zt&&Object(u.createElement)(s.PanelRow,null,Object(u.createElement)(s.ToggleControl,{label:Object(i.__)("Show Subtitle","full-site-editing"),checked:w,onChange:function(){return r({showSubtitle:!w})}})),Object(u.createElement)(s.PanelRow,null,Object(u.createElement)(s.ToggleControl,{label:Object(i.__)("Show Excerpt","full-site-editing"),checked:O,onChange:function(){return r({showExcerpt:!O})}})),Object(u.createElement)(s.RangeControl,{className:"type-scale-slider",label:Object(i.__)("Type Scale","full-site-editing"),value:j,onChange:function(e){return r({typeScale:e})},min:1,max:10,beforeIcon:"editor-textcolor",afterIcon:"editor-textcolor",required:!0})),Object(u.createElement)(cn.PanelColorSettings,{title:Object(i.__)("Color Settings","full-site-editing"),initialOpen:!0,colorSettings:[{value:o.color,onChange:c,label:Object(i.__)("Text Color","full-site-editing")}]}),Object(u.createElement)(s.PanelBody,{title:Object(i.__)("Post Meta Settings","full-site-editing")},Object(u.createElement)(s.PanelRow,null,Object(u.createElement)(s.ToggleControl,{label:Object(i.__)("Show Date","full-site-editing"),checked:_,onChange:function(){return r({showDate:!_})}})),Object(u.createElement)(s.PanelRow,null,Object(u.createElement)(s.ToggleControl,{label:Object(i.__)("Show Category","full-site-editing"),checked:k,onChange:function(){return r({showCategory:!k})}})),Object(u.createElement)(s.PanelRow,null,Object(u.createElement)(s.ToggleControl,{label:Object(i.__)("Show Author","full-site-editing"),checked:E,onChange:function(){return r({showAuthor:!E})}})),E&&Object(u.createElement)(s.PanelRow,null,Object(u.createElement)(s.ToggleControl,{label:Object(i.__)("Show Author Avatar","full-site-editing"),checked:S,onChange:function(){return r({showAvatar:!S})}}))))})),e}return d()(n,[{key:"componentDidMount",value:function(){this.props.triggerReflow()}},{key:"componentDidUpdate",value:function(e){(function(e,t){return!Object(A.isEqual)(Object(A.pick)(e.attributes,Mt),Object(A.pick)(t.attributes,Mt))||!Object(A.isEqual)(e.topBlocksClientIdsInOrder,t.topBlocksClientIdsInOrder)})(e,this.props)&&this.props.triggerReflow()}},{key:"componentWillUnmount",value:function(){this.props.triggerReflow()}},{key:"render",value:function(){var e,t=this,n=this.props,r=n.attributes,o=n.className,c=n.setAttributes,a=n.isSelected,l=n.latestPosts,f=n.textColor,p=n.error,d=r.showImage,h=r.imageShape,g=r.postLayout,b=r.mediaPosition,m=r.moreButton,v=r.moreButtonText,y=r.columns,O=r.typeScale,j=r.imageScale,_=r.mobileStack,E=r.sectionHeader,S=r.showCaption,k=r.showCategory,x=r.specificMode,C=rn()(o,(e={"is-grid":"grid"===g,"show-image":d},w()(e,"columns-".concat(y),"grid"===g),w()(e,"ts-".concat(O),"5"!==O),w()(e,"image-align".concat(b),d),w()(e,"is-".concat(j),"1"!==j&&d),w()(e,"mobile-stack",_),w()(e,"is-".concat(h),d),w()(e,"has-text-color",""!==f.color),w()(e,"show-caption",S),w()(e,"show-category",k),w()(e,"wpnbha",!0),e)),P=[{icon:"list-view",title:Object(i.__)("List View","full-site-editing"),onClick:function(){return c({postLayout:"list"})},isActive:"list"===g},{icon:"grid-view",title:Object(i.__)("Grid View","full-site-editing"),onClick:function(){return c({postLayout:"grid"})},isActive:"grid"===g}],A=[{icon:"align-none",title:Object(i.__)("Show media on top","full-site-editing"),isActive:"top"===b,onClick:function(){return c({mediaPosition:"top"})}},{icon:"align-pull-left",title:Object(i.__)("Show media on left","full-site-editing"),isActive:"left"===b,onClick:function(){return c({mediaPosition:"left"})}},{icon:"align-pull-right",title:Object(i.__)("Show media on right","full-site-editing"),isActive:"right"===b,onClick:function(){return c({mediaPosition:"right"})}},{icon:dn,title:Object(i.__)("Show media behind","full-site-editing"),isActive:"behind"===b,onClick:function(){return c({mediaPosition:"behind"})}}],T=[{icon:sn,title:Object(i.__)("Landscape Image Shape","full-site-editing"),isActive:"landscape"===h,onClick:function(){return c({imageShape:"landscape"})}},{icon:ln,title:Object(i.__)("portrait Image Shape","full-site-editing"),isActive:"portrait"===h,onClick:function(){return c({imageShape:"portrait"})}},{icon:fn,title:Object(i.__)("Square Image Shape","full-site-editing"),isActive:"square"===h,onClick:function(){return c({imageShape:"square"})}},{icon:pn,title:Object(i.__)("Uncropped","full-site-editing"),isActive:"uncropped"===h,onClick:function(){return c({imageShape:"uncropped"})}}];return Object(u.createElement)(u.Fragment,null,Object(u.createElement)("div",{className:C,style:{color:f.color}},Object(u.createElement)("div",null,l&&(!cn.RichText.isEmpty(E)||a)&&Object(u.createElement)(cn.RichText,{onChange:function(e){return c({sectionHeader:e})},placeholder:Object(i.__)("Write header…","full-site-editing"),value:E,tagName:"h2",className:"article-section-title"}),l&&!l.length&&Object(u.createElement)(s.Placeholder,null,Object(i.__)("Sorry, no posts were found.","full-site-editing")),!l&&!p&&Object(u.createElement)(s.Placeholder,{icon:Object(u.createElement)(s.Spinner,null),className:"component-placeholder__align-center"}),!l&&p&&Object(u.createElement)(s.Placeholder,{className:"component-placeholder__align-center homepage-posts-block--error"},p),l&&l.map((function(e){return t.renderPost(e)})))),!x&&l&&m&&!Lt()&&Object(u.createElement)("div",{className:"editor-styles-wrapper wpnbha__wp-block-button__wrapper"},Object(u.createElement)("div",{className:"wp-block-button"},Object(u.createElement)(cn.RichText,{placeholder:Object(i.__)("Load more posts","full-site-editing"),value:v,onChange:function(e){return c({moreButtonText:e})},className:"wp-block-button__link",keepPlaceholderOnFocus:!0,allowedFormats:[]}))),Object(u.createElement)(cn.BlockControls,null,Object(u.createElement)(s.Toolbar,{controls:P}),d&&Object(u.createElement)(s.Toolbar,{controls:A}),d&&Object(u.createElement)(s.Toolbar,{controls:T})),Object(u.createElement)(cn.InspectorControls,null,this.renderInspectorControls()))}}]),n}(u.Component),gn=Object(an.compose)([Object(cn.withColors)({textColor:"color"}),Object(Nt.withSelect)((function(e,t){var n=t.clientId,r=t.attributes,o=e("core/editor"),c=o.getEditorBlocks,i=o.getBlocks,a=Ft(c()).indexOf(n)>=0,u=e(Vt),s=u.getPosts,l=u.getError,f={isEditorBlock:a,isUIDisabled:(0,u.isUIDisabled)(),error:l({clientId:n}),topBlocksClientIdsInOrder:i().map((function(e){return e.clientId}))};return f.latestPosts=a?s({clientId:n}):e("core").getEntityRecords("postType","post",Dt(r)),f})),Object(Nt.withDispatch)((function(e,t){return{triggerReflow:t.isEditorBlock?e(Vt).reflow:function(){}}}))])(hn),bn=(n(38),n(39),Bt.name,Bt.attributes),mn=Bt.category,vn={title:Object(i.__)("Homepage Posts","full-site-editing"),icon:Object(u.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(u.createElement)(s.Path,{d:"M0 0h24v24H0z",fill:"none"}),Object(u.createElement)(s.Path,{d:"M4 6H2v14c0 1.1.9 2 2 2h14v-2H4V6zm16-4H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H8V4h12v12zM10 9h8v2h-8zm0 3h4v2h-4zm0-6h8v2h-8z"})),attributes:bn,category:mn,keywords:[Object(i.__)("posts","full-site-editing"),Object(i.__)("articles","full-site-editing"),Object(i.__)("latest","full-site-editing")],description:Object(i.__)("A block for displaying homepage posts.","full-site-editing"),styles:[{name:"default",label:Object(i._x)("Default","block style","full-site-editing"),isDefault:!0},{name:"borders",label:Object(i._x)("Borders","block style","full-site-editing")}],supports:{html:!1,align:["wide","full"],default:""},edit:gn,save:function(){return null},transforms:{from:[{type:"block",blocks:["core/latest-posts"],transform:function(e){var t=e.displayPostContent,n=e.displayPostDate,r=e.postLayout,o=e.columns,i=e.postsToShow,u=e.categories;return Object(c.createBlock)(Object(a.applyFilters)("blocks.transforms_from_name","newspack-blocks/homepage-articles"),{showExcerpt:t,showDate:n,postLayout:r,columns:o,postsToShow:i,showAuthor:!1,categories:u?[u]:[]})}}],to:[{type:"block",blocks:["core/latest-posts"],transform:function(e){var t=e.showExcerpt,n=e.showDate,r=e.postLayout,o=e.columns,i=e.postsToShow,a=e.categories;return Object(c.createBlock)("core/latest-posts",{displayPostContent:t,displayPostDate:n,postLayout:r,columns:o,postsToShow:i,categories:a[0]||""})}}]}},yn="a8c/blog-posts";Object(a.addFilter)("blocks.transforms_from_name","set-transformed-block-name",(function(e){return"newspack-blocks/homepage-articles"!==e?e:yn})),Object(c.registerBlockType)(yn,o()(o()({},vn),{},{title:Object(i.__)("Blog Posts","full-site-editing"),category:"widgets"})),un=yn,Object(Nt.registerGenericStore)(Vt,Jt),Kt.run(function(e){var t=regeneratorRuntime.mark(n);function n(){var n,r,o,c,i,a,u;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Qe(300);case 2:return n=Object(Nt.select)("core/block-editor"),r=n.getBlocks,t.next=5,Fe({type:"DISABLE_UI"});case 5:o=Ht(r(),e),c=o.reduce((function(e,t){var n=t.postsQuery;return n.include&&(e=[].concat(P()(e),P()(n.include))),e}),[]),i=c;case 8:if(!o.length){t.next=25;break}return(a=o.shift()).postsQuery.exclude=i,u=[],t.prev=12,t.next=15,ze($t,a);case 15:u=t.sent,t.next=22;break;case 18:return t.prev=18,t.t0=t.catch(12),t.next=22,Fe({type:"UPDATE_BLOCK_ERROR",clientId:a.clientId,error:t.t0.message});case 22:i=[].concat(P()(i),P()(u)),t.next=8;break;case 25:return t.next=27,Fe({type:"ENABLE_UI"});case 27:case"end":return t.stop()}}),t,null,[[12,18]])}return regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ye("REFLOW",n);case 2:case"end":return e.stop()}}),e)}))}(un))}]));
newspack-blocks/dist/blog-posts-block-view.asset.php CHANGED
@@ -1 +1 @@
1
- <?php return array('dependencies' => array('wp-polyfill'), 'version' => 'b392bc95471d84c4ba98c190d91cf0d1');
1
+ <?php return array('dependencies' => array('wp-polyfill'), 'version' => '07268e36092175d2e9254a9b8493f0ee');
newspack-blocks/dist/blog-posts-block-view.js CHANGED
@@ -1 +1 @@
1
- !function(t,e){for(var r in e)t[r]=e[r]}(window,function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=7)}([function(t,e){t.exports=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}},function(t,e,r){var n=r(2),o=r(3),i=r(4),a=r(5);t.exports=function(t){return n(t)||o(t)||i(t)||a()}},function(t,e,r){var n=r(0);t.exports=function(t){if(Array.isArray(t))return n(t)}},function(t,e){t.exports=function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}},function(t,e,r){var n=r(0);t.exports=function(t,e){if(t){if("string"==typeof t)return n(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(t,e):void 0}}},function(t,e){t.exports=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(t,e,r){},function(t,e,r){"use strict";r.r(e);var n=r(1),o=r.n(n);r(6);function i(t,e){return Object.prototype.hasOwnProperty.call(t,e)}Array.prototype.forEach.call(document.querySelectorAll(".wp-block-newspack-blocks-homepage-articles.has-more-button"),(function(t){var e=t.querySelector("[data-next]");if(!e)return;var r=t.querySelector("[data-posts]"),n=!1,a=!1;e.addEventListener("click",(function(){if(n||a)return!1;var u,s;function c(){n=!1,t.classList.remove("is-loading"),t.classList.add("is-error")}n=!0,t.classList.remove("is-error"),t.classList.add("is-loading"),function t(e,r){var n=new XMLHttpRequest;n.onreadystatechange=function(){if(4===n.readyState){if(n.status>=200&&n.status<300){var o=JSON.parse(n.responseText);return e.onSuccess(o)}return r?t(e,r-1):e.onError()}},n.open("GET",e.url),n.send()}({url:e.getAttribute("data-next")+"&exclude_ids="+(u=document.querySelectorAll(".wp-block-newspack-blocks-homepage-articles [data-post-id]"),s=Array.from(u).map((function(t){return t.getAttribute("data-post-id")})),o()(new Set(s))).join(","),onSuccess:function(o){if(!function(t){var e=!1;t&&i(t,"items")&&Array.isArray(t.items)&&i(t,"next")&&"string"==typeof t.next&&(e=!0,!t.items.length||i(t.items[0],"html")&&"string"==typeof t.items[0].html||(e=!1));return e}(o))return c();if(o.items.length){var u=o.items.map((function(t){return t.html})).join("");r.insertAdjacentHTML("beforeend",u)}o.next&&e.setAttribute("data-next",o.next);o.items.length&&o.next||(a=!0,t.classList.remove("has-more-button"));n=!1,t.classList.remove("is-loading")},onError:c},3)}))}))}]));
1
+ !function(t,e){for(var r in e)t[r]=e[r]}(window,function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=7)}([function(t,e){t.exports=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}},function(t,e,r){var n=r(2),o=r(3),i=r(4),a=r(5);t.exports=function(t){return n(t)||o(t)||i(t)||a()}},function(t,e,r){var n=r(0);t.exports=function(t){if(Array.isArray(t))return n(t)}},function(t,e){t.exports=function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}},function(t,e,r){var n=r(0);t.exports=function(t,e){if(t){if("string"==typeof t)return n(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(t,e):void 0}}},function(t,e){t.exports=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(t,e,r){},function(t,e,r){"use strict";r.r(e);var n=r(1),o=r.n(n);r(6);function i(t,e){var r=new XMLHttpRequest;r.onreadystatechange=function(){if(4===r.readyState){if(r.status>=200&&r.status<300){var n=JSON.parse(r.responseText);return t.onSuccess(n)}return e?i(t,e-1):t.onError()}},r.open("GET",t.url),r.send()}function a(t,e){return Object.prototype.hasOwnProperty.call(t,e)}Array.prototype.forEach.call(document.querySelectorAll(".wp-block-newspack-blocks-homepage-articles.has-more-button"),(function(t){var e=t.querySelector("[data-next]");if(!e)return;var r=t.querySelector("[data-posts]"),n=!1,u=!1;e.addEventListener("click",(function(){if(n||u)return!1;var s,c;function l(){n=!1,t.classList.remove("is-loading"),t.classList.add("is-error")}n=!0,t.classList.remove("is-error"),t.classList.add("is-loading"),i({url:e.getAttribute("data-next")+"&exclude_ids="+(s=document.querySelectorAll(".wp-block-newspack-blocks-homepage-articles [data-post-id]"),c=Array.from(s).map((function(t){return t.getAttribute("data-post-id")})),o()(new Set(c))).join(","),onSuccess:function(o){if(!function(t){var e=!1;t&&a(t,"items")&&Array.isArray(t.items)&&a(t,"next")&&"string"==typeof t.next&&(e=!0,!t.items.length||a(t.items[0],"html")&&"string"==typeof t.items[0].html||(e=!1));return e}(o))return l();if(o.items.length){var i=o.items.map((function(t){return t.html})).join("");r.insertAdjacentHTML("beforeend",i)}o.next&&e.setAttribute("data-next",o.next);o.items.length&&o.next||(u=!0,t.classList.remove("has-more-button"));n=!1,t.classList.remove("is-loading")},onError:l},3)}))}))}]));
newspack-blocks/dist/carousel-block-editor.asset.php CHANGED
@@ -1 +1 @@
1
- <?php return array('dependencies' => array('lodash', 'wp-a11y', 'wp-api-fetch', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-date', 'wp-editor', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-polyfill', 'wp-url'), 'version' => '6a8373395824f64c578f31821f93bc69');
1
+ <?php return array('dependencies' => array('lodash', 'wp-a11y', 'wp-api-fetch', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-date', 'wp-editor', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-polyfill', 'wp-url'), 'version' => 'b1e267cb83a1b0e9b69143a776fac100');
newspack-blocks/dist/carousel-block-view.asset.php CHANGED
@@ -1 +1 @@
1
- <?php return array('dependencies' => array('wp-a11y', 'wp-dom-ready', 'wp-escape-html', 'wp-i18n', 'wp-polyfill'), 'version' => '2284074ae208bba93148585bf4b035a6');
1
+ <?php return array('dependencies' => array('wp-a11y', 'wp-dom-ready', 'wp-escape-html', 'wp-i18n', 'wp-polyfill'), 'version' => 'e45a88564a94f9951aa9d2c88f824d5a');
posts-list-block/dist/posts-list-block.asset.php CHANGED
@@ -1 +1 @@
1
- <?php return array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => '9d6c0a6f20c0b586ed9c6d6c26eb9bf7');
1
+ <?php return array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => 'f1e60410b9a2055989583cb490760329');
premium-content/blocks/buttons/edit.js CHANGED
@@ -24,7 +24,13 @@ const alignmentHooksSetting = {
24
  isEmbedButton: true,
25
  };
26
 
27
- function ButtonsEdit( { context, subscribeButton, setSubscribeButtonPlan } ) {
 
 
 
 
 
 
28
  const planId = context ? context[ 'premium-content/planId' ] : null;
29
 
30
  const template = [
@@ -68,6 +74,14 @@ function ButtonsEdit( { context, subscribeButton, setSubscribeButtonPlan } ) {
68
  );
69
  }, [ subscribeButton ] );
70
 
 
 
 
 
 
 
 
 
71
  return (
72
  // eslint-disable-next-line wpcalypso/jsx-classname-namespace
73
  <Block.div className="wp-block-buttons">
@@ -83,13 +97,21 @@ function ButtonsEdit( { context, subscribeButton, setSubscribeButtonPlan } ) {
83
  }
84
 
85
  export default compose( [
86
- withSelect( ( select, props ) => ( {
87
  // Only first block is assumed to be a subscribe button (users can add additional Recurring Payments blocks for
88
  // other plans).
89
- subscribeButton: select( 'core/block-editor' )
90
  .getBlock( props.clientId )
91
- .innerBlocks.find( ( block ) => block.name === 'jetpack/recurring-payments' ),
92
- } ) ),
 
 
 
 
 
 
 
 
93
  withDispatch( ( dispatch, props ) => ( {
94
  /**
95
  * Updates the plan on the Recurring Payments block acting as a subscribe button.
@@ -101,5 +123,15 @@ export default compose( [
101
  planId,
102
  } );
103
  },
 
 
 
 
 
 
 
 
 
 
104
  } ) ),
105
  ] )( ButtonsEdit );
24
  isEmbedButton: true,
25
  };
26
 
27
+ function ButtonsEdit( {
28
+ context,
29
+ jetpackButton,
30
+ subscribeButton,
31
+ setSubscribeButtonText,
32
+ setSubscribeButtonPlan,
33
+ } ) {
34
  const planId = context ? context[ 'premium-content/planId' ] : null;
35
 
36
  const template = [
74
  );
75
  }, [ subscribeButton ] );
76
 
77
+ // Updates the subscribe button text.
78
+ useEffect( () => {
79
+ if ( ! jetpackButton ) {
80
+ return;
81
+ }
82
+ setSubscribeButtonText( __( 'Subscribe', 'full-site-editing' ) );
83
+ }, [ jetpackButton, setSubscribeButtonText ] );
84
+
85
  return (
86
  // eslint-disable-next-line wpcalypso/jsx-classname-namespace
87
  <Block.div className="wp-block-buttons">
97
  }
98
 
99
  export default compose( [
100
+ withSelect( ( select, props ) => {
101
  // Only first block is assumed to be a subscribe button (users can add additional Recurring Payments blocks for
102
  // other plans).
103
+ const subscribeButton = select( 'core/block-editor' )
104
  .getBlock( props.clientId )
105
+ .innerBlocks.find( ( block ) => block.name === 'jetpack/recurring-payments' );
106
+
107
+ const jetpackButton = select( 'core/block-editor' )
108
+ .getBlock( subscribeButton.clientId )
109
+ .innerBlocks.find( ( block ) => block.name === 'jetpack/button' );
110
+ return {
111
+ subscribeButton,
112
+ jetpackButton,
113
+ };
114
+ } ),
115
  withDispatch( ( dispatch, props ) => ( {
116
  /**
117
  * Updates the plan on the Recurring Payments block acting as a subscribe button.
123
  planId,
124
  } );
125
  },
126
+ /**
127
+ * Updates the button text on the Recurring Payments block acting as a subscribe button.
128
+ *
129
+ * @param text {string} Button text.
130
+ */
131
+ setSubscribeButtonText( text ) {
132
+ dispatch( 'core/block-editor' ).updateBlockAttributes( props.jetpackButton.clientId, {
133
+ text,
134
+ } );
135
+ },
136
  } ) ),
137
  ] )( ButtonsEdit );
premium-content/blocks/buttons/index.js CHANGED
@@ -31,7 +31,7 @@ const settings = {
31
  keywords: [ __( 'link', 'full-site-editing' ) ],
32
  edit,
33
  save,
34
- context: [ 'premium-content/planId' ],
35
  };
36
 
37
  export { name, category, settings };
31
  keywords: [ __( 'link', 'full-site-editing' ) ],
32
  edit,
33
  save,
34
+ usesContext: [ 'premium-content/planId' ],
35
  };
36
 
37
  export { name, category, settings };
premium-content/blocks/container/edit.js CHANGED
@@ -70,7 +70,6 @@ const defaultString = null;
70
  * @property { boolean } isSelected
71
  * @property { string } className
72
  * @property { string } clientId
73
- * @property { string } containerClientId
74
  * @property { Attributes } attributes
75
  * @property { (attributes: object<Attributes>) => void } setAttributes
76
  * @property { ?object } noticeUI
@@ -275,7 +274,10 @@ function Edit( props ) {
275
  onError( props, result.message );
276
  }
277
  );
278
- props.selectBlock();
 
 
 
279
  }, [] );
280
 
281
  if ( apiState === API_STATE_LOADING ) {
@@ -458,14 +460,10 @@ function getConnectUrl( props, connectURL ) {
458
  }
459
 
460
  export default compose( [
461
- withSelect( ( select, ownProps ) => {
462
  const { getCurrentPostId } = select( 'core/editor' );
463
  return {
464
  postId: getCurrentPostId(),
465
- // @ts-ignore difficult to type via JSDoc
466
- containerClientId: select( 'core/block-editor' ).getBlockHierarchyRootClientId(
467
- ownProps.clientId
468
- ),
469
  };
470
  } ),
471
  withNotices,
@@ -474,7 +472,7 @@ export default compose( [
474
  return {
475
  selectBlock() {
476
  // @ts-ignore difficult to type via JSDoc
477
- blockEditor.selectBlock( ownProps.containerClientId );
478
  },
479
  };
480
  } ),
70
  * @property { boolean } isSelected
71
  * @property { string } className
72
  * @property { string } clientId
 
73
  * @property { Attributes } attributes
74
  * @property { (attributes: object<Attributes>) => void } setAttributes
75
  * @property { ?object } noticeUI
274
  onError( props, result.message );
275
  }
276
  );
277
+
278
+ // Execution delayed with setTimeout to ensure it runs after any block auto-selection performed by inner blocks
279
+ // (such as the Recurring Payments block)
280
+ setTimeout( () => props.selectBlock(), 1000 );
281
  }, [] );
282
 
283
  if ( apiState === API_STATE_LOADING ) {
460
  }
461
 
462
  export default compose( [
463
+ withSelect( ( select ) => {
464
  const { getCurrentPostId } = select( 'core/editor' );
465
  return {
466
  postId: getCurrentPostId(),
 
 
 
 
467
  };
468
  } ),
469
  withNotices,
472
  return {
473
  selectBlock() {
474
  // @ts-ignore difficult to type via JSDoc
475
+ blockEditor.selectBlock( ownProps.clientId );
476
  },
477
  };
478
  } ),
premium-content/blocks/logged-out-view/edit.js CHANGED
@@ -3,9 +3,6 @@
3
  */
4
  import { InnerBlocks } from '@wordpress/block-editor';
5
  import { __ } from '@wordpress/i18n';
6
- import { useEffect } from '@wordpress/element';
7
- import { compose } from '@wordpress/compose';
8
- import { withDispatch, withSelect } from '@wordpress/data';
9
 
10
  /**
11
  * Internal dependencies
@@ -14,75 +11,36 @@ import Context from '../container/context';
14
 
15
  /**
16
  * Block edit function
17
- *
18
- * @typedef { import('./').Attributes } Attributes
19
- * @typedef { object } Props
20
- * @property { boolean } isSelected
21
- * @property { string } className
22
- * @property { string } clientId
23
- * @property { string } containerClientId
24
- * @property { Attributes } attributes
25
- * @property { Function } setAttributes
26
- * @property { Function } selectContainerBlock
27
- *
28
- * @param { Props } props Properties
29
  */
30
- function Edit( { selectContainerBlock } ) {
31
- useEffect( () => {
32
- // Selects the container block on mount.
33
- //
34
- // Execution delayed with setTimeout to ensure it runs after any block auto-selection performed by inner blocks
35
- // (such as the Recurring Payments block). @see https://github.com/Automattic/wp-calypso/issues/43450
36
- setTimeout( selectContainerBlock, 0 );
37
- }, [] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38
 
39
- return (
40
- <Context.Consumer>
41
- { ( { selectedTab, stripeNudge } ) => (
42
- /** @see https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/no-static-element-interactions.md#case-the-event-handler-is-only-being-used-to-capture-bubbled-events */
43
- // eslint-disable-next-line
44
- <div hidden={ selectedTab.id === 'premium' } className={ selectedTab.className }>
45
- { stripeNudge }
46
- <InnerBlocks
47
- templateLock={ false }
48
- template={ [
49
- [
50
- 'core/heading',
51
- { content: __( 'Subscribe to get access', 'full-site-editing' ), level: 3 },
52
- ],
53
- [
54
- 'core/paragraph',
55
- {
56
- content: __(
57
- 'Read more of this content when you subscribe today.',
58
- 'full-site-editing'
59
- ),
60
- },
61
- ],
62
- [ 'premium-content/buttons' ],
63
- ] }
64
- />
65
- </div>
66
- ) }
67
- </Context.Consumer>
68
- );
69
- }
70
-
71
- export default compose( [
72
- withSelect( ( select, props ) => {
73
- const { getBlockHierarchyRootClientId } = select( 'core/block-editor' );
74
- return {
75
- // @ts-ignore difficult to type with JSDoc
76
- containerClientId: getBlockHierarchyRootClientId( props.clientId ),
77
- };
78
- } ),
79
- withDispatch( ( dispatch, props ) => {
80
- const { selectBlock } = dispatch( 'core/block-editor' );
81
- return {
82
- selectContainerBlock() {
83
- // @ts-ignore difficult to type with JSDoc
84
- selectBlock( props.containerClientId );
85
- },
86
- };
87
- } ),
88
- ] )( Edit );
3
  */
4
  import { InnerBlocks } from '@wordpress/block-editor';
5
  import { __ } from '@wordpress/i18n';
 
 
 
6
 
7
  /**
8
  * Internal dependencies
11
 
12
  /**
13
  * Block edit function
 
 
 
 
 
 
 
 
 
 
 
 
14
  */
15
+ const Edit = () => (
16
+ <Context.Consumer>
17
+ { ( { selectedTab, stripeNudge } ) => (
18
+ /** @see https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/no-static-element-interactions.md#case-the-event-handler-is-only-being-used-to-capture-bubbled-events */
19
+ // eslint-disable-next-line
20
+ <div hidden={ selectedTab.id === 'premium' } className={ selectedTab.className }>
21
+ { stripeNudge }
22
+ <InnerBlocks
23
+ templateLock={ false }
24
+ template={ [
25
+ [
26
+ 'core/heading',
27
+ { content: __( 'Subscribe to get access', 'full-site-editing' ), level: 3 },
28
+ ],
29
+ [
30
+ 'core/paragraph',
31
+ {
32
+ content: __(
33
+ 'Read more of this content when you subscribe today.',
34
+ 'full-site-editing'
35
+ ),
36
+ },
37
+ ],
38
+ [ 'premium-content/buttons' ],
39
+ ] }
40
+ />
41
+ </div>
42
+ ) }
43
+ </Context.Consumer>
44
+ );
45
 
46
+ export default Edit;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
premium-content/blocks/subscriber-view/edit.js CHANGED
@@ -3,9 +3,8 @@
3
  */
4
  import { InnerBlocks } from '@wordpress/block-editor';
5
  import { __ } from '@wordpress/i18n';
6
- import { useEffect } from '@wordpress/element';
7
  import { compose } from '@wordpress/compose';
8
- import { withDispatch, withSelect } from '@wordpress/data';
9
 
10
  /**
11
  * Internal dependencies
@@ -17,43 +16,36 @@ import Context from '../container/context';
17
  *
18
  * @typedef { object } Props
19
  * @property { string } clientId
20
- * @property { string } containerClientId
21
- * @property { Function } selectBlock
22
  *
23
  * @param { Props } props Properties
24
  */
25
- function Edit( props ) {
26
- useEffect( () => {
27
- props.selectBlock();
28
- }, [] );
29
-
30
- return (
31
- <Context.Consumer>
32
- { ( { selectedTab, stripeNudge } ) => (
33
- /** @see https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/no-static-element-interactions.md#case-the-event-handler-is-only-being-used-to-capture-bubbled-events */
34
- // eslint-disable-next-line
35
- <div hidden={ selectedTab.id === 'wall' } className={ selectedTab.className }>
36
- { stripeNudge }
37
- <InnerBlocks
38
- renderAppender={ ! props.hasInnerBlocks && InnerBlocks.ButtonBlockAppender }
39
- templateLock={ false }
40
- template={ [
41
- [
42
- 'core/paragraph',
43
- {
44
- placeholder: __(
45
- 'Insert the piece of content you want your visitors to see after they subscribe.',
46
- 'full-site-editing'
47
- ),
48
- },
49
- ],
50
- ] }
51
- />
52
- </div>
53
- ) }
54
- </Context.Consumer>
55
- );
56
- }
57
 
58
  export default compose( [
59
  withSelect( ( select, props ) => {
@@ -61,19 +53,6 @@ export default compose( [
61
  // @ts-ignore difficult to type with JSDoc
62
  hasInnerBlocks: !! select( 'core/block-editor' ).getBlocksByClientId( props.clientId )[ 0 ]
63
  .innerBlocks.length,
64
- // @ts-ignore difficult to type with JSDoc
65
- containerClientId: select( 'core/block-editor' ).getBlockHierarchyRootClientId(
66
- props.clientId
67
- ),
68
- };
69
- } ),
70
- withDispatch( ( dispatch, props ) => {
71
- const blockEditor = dispatch( 'core/block-editor' );
72
- return {
73
- selectBlock() {
74
- // @ts-ignore difficult to type with JSDoc
75
- blockEditor.selectBlock( props.containerClientId );
76
- },
77
  };
78
  } ),
79
  ] )( Edit );
3
  */
4
  import { InnerBlocks } from '@wordpress/block-editor';
5
  import { __ } from '@wordpress/i18n';
 
6
  import { compose } from '@wordpress/compose';
7
+ import { withSelect } from '@wordpress/data';
8
 
9
  /**
10
  * Internal dependencies
16
  *
17
  * @typedef { object } Props
18
  * @property { string } clientId
19
+ * @property { boolean } hasInnerBlocks
 
20
  *
21
  * @param { Props } props Properties
22
  */
23
+ const Edit = ( props ) => (
24
+ <Context.Consumer>
25
+ { ( { selectedTab, stripeNudge } ) => (
26
+ /** @see https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/no-static-element-interactions.md#case-the-event-handler-is-only-being-used-to-capture-bubbled-events */
27
+ // eslint-disable-next-line
28
+ <div hidden={ selectedTab.id === 'wall' } className={ selectedTab.className }>
29
+ { stripeNudge }
30
+ <InnerBlocks
31
+ renderAppender={ ! props.hasInnerBlocks && InnerBlocks.ButtonBlockAppender }
32
+ templateLock={ false }
33
+ template={ [
34
+ [
35
+ 'core/paragraph',
36
+ {
37
+ placeholder: __(
38
+ 'Insert the piece of content you want your visitors to see after they subscribe.',
39
+ 'full-site-editing'
40
+ ),
41
+ },
42
+ ],
43
+ ] }
44
+ />
45
+ </div>
46
+ ) }
47
+ </Context.Consumer>
48
+ );
 
 
 
 
 
 
49
 
50
  export default compose( [
51
  withSelect( ( select, props ) => {
53
  // @ts-ignore difficult to type with JSDoc
54
  hasInnerBlocks: !! select( 'core/block-editor' ).getBlocksByClientId( props.clientId )[ 0 ]
55
  .innerBlocks.length,
 
 
 
 
 
 
 
 
 
 
 
 
 
56
  };
57
  } ),
58
  ] )( Edit );
premium-content/dist/premium-content.asset.php CHANGED
@@ -1 +1 @@
1
- <?php return array('dependencies' => array('lodash', 'react', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-url'), 'version' => '5ad785df9b0a92852446b296ad8bc28c');
1
+ <?php return array('dependencies' => array('lodash', 'react', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-url'), 'version' => '41b087cee0c96774ad3f1c9805c355f0');
premium-content/dist/premium-content.js CHANGED
@@ -1,4 +1,4 @@
1
- !function(e,t){for(var n in t)e[n]=t[n]}(window,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}return 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=60)}([function(e,t){!function(){e.exports=this.wp.element}()},function(e,t){!function(){e.exports=this.wp.i18n}()},function(e,t){!function(){e.exports=this.wp.blockEditor}()},function(e,t){!function(){e.exports=this.wp.components}()},function(e,t,n){var r=n(10);function o(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}e.exports=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}},function(e,t){!function(){e.exports=this.wp.data}()},function(e,t){!function(){e.exports=this.wp.blocks}()},function(e,t,n){var r=n(39),o=n(40),i=n(23),c=n(41);e.exports=function(e,t){return r(e)||o(e,t)||i(e,t)||c()}},function(e,t){!function(){e.exports=this.wp.compose}()},function(e,t){function n(){return e.exports=n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},n.apply(this,arguments)}e.exports=n},function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},function(e,t){!function(){e.exports=this.React}()},function(e,t){!function(){e.exports=this.lodash}()},function(e,t,n){var r;
2
  /*!
3
  Copyright (c) 2017 Jed Watson.
4
  Licensed under the MIT License (MIT), see
@@ -16,11 +16,11 @@
16
  object-assign
17
  (c) Sindre Sorhus
18
  @license MIT
19
- */var r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;function c(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(o){return!1}}()?Object.assign:function(e,t){for(var n,s,l=c(e),a=1;a<arguments.length;a++){for(var u in n=Object(arguments[a]))o.call(n,u)&&(l[u]=n[u]);if(r){s=r(n);for(var p=0;p<s.length;p++)i.call(n,s[p])&&(l[s[p]]=n[s[p]])}}return l}},function(e,t,n){"use strict";n.r(t),n.d(t,"registerPremiumContentBlocks",(function(){return $t}));var r={};n.r(r),n.d(r,"name",(function(){return Ze})),n.d(r,"category",(function(){return Ye})),n.d(r,"settings",(function(){return qe})),n.d(r,"SUPPORTED_CURRENCIES",(function(){return Xe})),n.d(r,"CURRENCY_OPTIONS",(function(){return Qe})),n.d(r,"minimumTransactionAmountForCurrency",(function(){return et})),n.d(r,"isPriceValid",(function(){return tt}));var o={};n.r(o),n.d(o,"name",(function(){return rt})),n.d(o,"category",(function(){return ot})),n.d(o,"settings",(function(){return it}));var i={};n.r(i),n.d(i,"name",(function(){return at})),n.d(i,"category",(function(){return ut})),n.d(i,"settings",(function(){return pt}));var c={};n.r(c),n.d(c,"name",(function(){return yt})),n.d(c,"category",(function(){return Ot})),n.d(c,"settings",(function(){return jt}));var s={};n.r(s),n.d(s,"name",(function(){return Bt})),n.d(s,"category",(function(){return Nt})),n.d(s,"settings",(function(){return At}));var l=n(16),a=n.n(l),u=n(4),p=n.n(u),d=n(12),m=n(17),f=n.n(m),g=n(6),b=n(2),h=n(0),v=n(1),y={AED:{symbol:"د.إ.‏",grouping:",",decimal:".",precision:2},AFN:{symbol:"؋",grouping:",",decimal:".",precision:2},ALL:{symbol:"Lek",grouping:".",decimal:",",precision:2},AMD:{symbol:"֏",grouping:",",decimal:".",precision:2},ANG:{symbol:"ƒ",grouping:",",decimal:".",precision:2},AOA:{symbol:"Kz",grouping:",",decimal:".",precision:2},ARS:{symbol:"$",grouping:".",decimal:",",precision:2},AUD:{symbol:"A$",grouping:",",decimal:".",precision:2},AWG:{symbol:"ƒ",grouping:",",decimal:".",precision:2},AZN:{symbol:"₼",grouping:" ",decimal:",",precision:2},BAM:{symbol:"КМ",grouping:".",decimal:",",precision:2},BBD:{symbol:"Bds$",grouping:",",decimal:".",precision:2},BDT:{symbol:"৳",grouping:",",decimal:".",precision:0},BGN:{symbol:"лв.",grouping:" ",decimal:",",precision:2},BHD:{symbol:"د.ب.‏",grouping:",",decimal:".",precision:3},BIF:{symbol:"FBu",grouping:",",decimal:".",precision:0},BMD:{symbol:"$",grouping:",",decimal:".",precision:2},BND:{symbol:"$",grouping:".",decimal:",",precision:0},BOB:{symbol:"Bs",grouping:".",decimal:",",precision:2},BRL:{symbol:"R$",grouping:".",decimal:",",precision:2},BSD:{symbol:"$",grouping:",",decimal:".",precision:2},BTC:{symbol:"Ƀ",grouping:",",decimal:".",precision:2},BTN:{symbol:"Nu.",grouping:",",decimal:".",precision:1},BWP:{symbol:"P",grouping:",",decimal:".",precision:2},BYR:{symbol:"р.",grouping:" ",decimal:",",precision:2},BZD:{symbol:"BZ$",grouping:",",decimal:".",precision:2},CAD:{symbol:"C$",grouping:",",decimal:".",precision:2},CDF:{symbol:"FC",grouping:",",decimal:".",precision:2},CHF:{symbol:"CHF",grouping:"'",decimal:".",precision:2},CLP:{symbol:"$",grouping:".",decimal:",",precision:2},CNY:{symbol:"¥",grouping:",",decimal:".",precision:2},COP:{symbol:"$",grouping:".",decimal:",",precision:2},CRC:{symbol:"₡",grouping:".",decimal:",",precision:2},CUC:{symbol:"CUC",grouping:",",decimal:".",precision:2},CUP:{symbol:"$MN",grouping:",",decimal:".",precision:2},CVE:{symbol:"$",grouping:",",decimal:".",precision:2},CZK:{symbol:"Kč",grouping:" ",decimal:",",precision:2},DJF:{symbol:"Fdj",grouping:",",decimal:".",precision:0},DKK:{symbol:"kr.",grouping:"",decimal:",",precision:2},DOP:{symbol:"RD$",grouping:",",decimal:".",precision:2},DZD:{symbol:"د.ج.‏",grouping:",",decimal:".",precision:2},EGP:{symbol:"ج.م.‏",grouping:",",decimal:".",precision:2},ERN:{symbol:"Nfk",grouping:",",decimal:".",precision:2},ETB:{symbol:"ETB",grouping:",",decimal:".",precision:2},EUR:{symbol:"€",grouping:".",decimal:",",precision:2},FJD:{symbol:"FJ$",grouping:",",decimal:".",precision:2},FKP:{symbol:"£",grouping:",",decimal:".",precision:2},GBP:{symbol:"£",grouping:",",decimal:".",precision:2},GEL:{symbol:"Lari",grouping:" ",decimal:",",precision:2},GHS:{symbol:"₵",grouping:",",decimal:".",precision:2},GIP:{symbol:"£",grouping:",",decimal:".",precision:2},GMD:{symbol:"D",grouping:",",decimal:".",precision:2},GNF:{symbol:"FG",grouping:",",decimal:".",precision:0},GTQ:{symbol:"Q",grouping:",",decimal:".",precision:2},GYD:{symbol:"G$",grouping:",",decimal:".",precision:2},HKD:{symbol:"HK$",grouping:",",decimal:".",precision:2},HNL:{symbol:"L.",grouping:",",decimal:".",precision:2},HRK:{symbol:"kn",grouping:".",decimal:",",precision:2},HTG:{symbol:"G",grouping:",",decimal:".",precision:2},HUF:{symbol:"Ft",grouping:".",decimal:",",precision:0},IDR:{symbol:"Rp",grouping:".",decimal:",",precision:0},ILS:{symbol:"₪",grouping:",",decimal:".",precision:2},INR:{symbol:"₹",grouping:",",decimal:".",precision:2},IQD:{symbol:"د.ع.‏",grouping:",",decimal:".",precision:2},IRR:{symbol:"﷼",grouping:",",decimal:"/",precision:2},ISK:{symbol:"kr.",grouping:".",decimal:",",precision:0},JMD:{symbol:"J$",grouping:",",decimal:".",precision:2},JOD:{symbol:"د.ا.‏",grouping:",",decimal:".",precision:3},JPY:{symbol:"¥",grouping:",",decimal:".",precision:0},KES:{symbol:"S",grouping:",",decimal:".",precision:2},KGS:{symbol:"сом",grouping:" ",decimal:"-",precision:2},KHR:{symbol:"៛",grouping:",",decimal:".",precision:0},KMF:{symbol:"CF",grouping:",",decimal:".",precision:2},KPW:{symbol:"₩",grouping:",",decimal:".",precision:0},KRW:{symbol:"₩",grouping:",",decimal:".",precision:0},KWD:{symbol:"د.ك.‏",grouping:",",decimal:".",precision:3},KYD:{symbol:"$",grouping:",",decimal:".",precision:2},KZT:{symbol:"₸",grouping:" ",decimal:"-",precision:2},LAK:{symbol:"₭",grouping:",",decimal:".",precision:0},LBP:{symbol:"ل.ل.‏",grouping:",",decimal:".",precision:2},LKR:{symbol:"₨",grouping:",",decimal:".",precision:0},LRD:{symbol:"L$",grouping:",",decimal:".",precision:2},LSL:{symbol:"M",grouping:",",decimal:".",precision:2},LYD:{symbol:"د.ل.‏",grouping:",",decimal:".",precision:3},MAD:{symbol:"د.م.‏",grouping:",",decimal:".",precision:2},MDL:{symbol:"lei",grouping:",",decimal:".",precision:2},MGA:{symbol:"Ar",grouping:",",decimal:".",precision:0},MKD:{symbol:"ден.",grouping:".",decimal:",",precision:2},MMK:{symbol:"K",grouping:",",decimal:".",precision:2},MNT:{symbol:"₮",grouping:" ",decimal:",",precision:2},MOP:{symbol:"MOP$",grouping:",",decimal:".",precision:2},MRO:{symbol:"UM",grouping:",",decimal:".",precision:2},MTL:{symbol:"₤",grouping:",",decimal:".",precision:2},MUR:{symbol:"₨",grouping:",",decimal:".",precision:2},MVR:{symbol:"MVR",grouping:",",decimal:".",precision:1},MWK:{symbol:"MK",grouping:",",decimal:".",precision:2},MXN:{symbol:"MX$",grouping:",",decimal:".",precision:2},MYR:{symbol:"RM",grouping:",",decimal:".",precision:2},MZN:{symbol:"MT",grouping:",",decimal:".",precision:0},NAD:{symbol:"N$",grouping:",",decimal:".",precision:2},NGN:{symbol:"₦",grouping:",",decimal:".",precision:2},NIO:{symbol:"C$",grouping:",",decimal:".",precision:2},NOK:{symbol:"kr",grouping:" ",decimal:",",precision:2},NPR:{symbol:"₨",grouping:",",decimal:".",precision:2},NZD:{symbol:"NZ$",grouping:",",decimal:".",precision:2},OMR:{symbol:"﷼",grouping:",",decimal:".",precision:3},PAB:{symbol:"B/.",grouping:",",decimal:".",precision:2},PEN:{symbol:"S/.",grouping:",",decimal:".",precision:2},PGK:{symbol:"K",grouping:",",decimal:".",precision:2},PHP:{symbol:"₱",grouping:",",decimal:".",precision:2},PKR:{symbol:"₨",grouping:",",decimal:".",precision:2},PLN:{symbol:"zł",grouping:" ",decimal:",",precision:2},PYG:{symbol:"₲",grouping:".",decimal:",",precision:2},QAR:{symbol:"﷼",grouping:",",decimal:".",precision:2},RON:{symbol:"lei",grouping:".",decimal:",",precision:2},RSD:{symbol:"Дин.",grouping:".",decimal:",",precision:2},RUB:{symbol:"₽",grouping:" ",decimal:",",precision:2},RWF:{symbol:"RWF",grouping:" ",decimal:",",precision:2},SAR:{symbol:"﷼",grouping:",",decimal:".",precision:2},SBD:{symbol:"S$",grouping:",",decimal:".",precision:2},SCR:{symbol:"₨",grouping:",",decimal:".",precision:2},SDD:{symbol:"LSd",grouping:",",decimal:".",precision:2},SDG:{symbol:"£‏",grouping:",",decimal:".",precision:2},SEK:{symbol:"kr",grouping:",",decimal:".",precision:2},SGD:{symbol:"S$",grouping:",",decimal:".",precision:2},SHP:{symbol:"£",grouping:",",decimal:".",precision:2},SLL:{symbol:"Le",grouping:",",decimal:".",precision:2},SOS:{symbol:"S",grouping:",",decimal:".",precision:2},SRD:{symbol:"$",grouping:",",decimal:".",precision:2},STD:{symbol:"Db",grouping:",",decimal:".",precision:2},SVC:{symbol:"₡",grouping:",",decimal:".",precision:2},SYP:{symbol:"£",grouping:",",decimal:".",precision:2},SZL:{symbol:"E",grouping:",",decimal:".",precision:2},THB:{symbol:"฿",grouping:",",decimal:".",precision:2},TJS:{symbol:"TJS",grouping:" ",decimal:";",precision:2},TMT:{symbol:"m",grouping:" ",decimal:",",precision:0},TND:{symbol:"د.ت.‏",grouping:",",decimal:".",precision:3},TOP:{symbol:"T$",grouping:",",decimal:".",precision:2},TRY:{symbol:"TL",grouping:".",decimal:",",precision:2},TTD:{symbol:"TT$",grouping:",",decimal:".",precision:2},TVD:{symbol:"$T",grouping:",",decimal:".",precision:2},TWD:{symbol:"NT$",grouping:",",decimal:".",precision:2},TZS:{symbol:"TSh",grouping:",",decimal:".",precision:2},UAH:{symbol:"₴",grouping:" ",decimal:",",precision:2},UGX:{symbol:"USh",grouping:",",decimal:".",precision:2},USD:{symbol:"$",grouping:",",decimal:".",precision:2},UYU:{symbol:"$U",grouping:".",decimal:",",precision:2},UZS:{symbol:"сўм",grouping:" ",decimal:",",precision:2},VEB:{symbol:"Bs.",grouping:",",decimal:".",precision:2},VEF:{symbol:"Bs. F.",grouping:".",decimal:",",precision:2},VND:{symbol:"₫",grouping:".",decimal:",",precision:1},VUV:{symbol:"VT",grouping:",",decimal:".",precision:0},WST:{symbol:"WS$",grouping:",",decimal:".",precision:2},XAF:{symbol:"F",grouping:",",decimal:".",precision:2},XCD:{symbol:"$",grouping:",",decimal:".",precision:2},XOF:{symbol:"F",grouping:" ",decimal:",",precision:2},XPF:{symbol:"F",grouping:",",decimal:".",precision:2},YER:{symbol:"﷼",grouping:",",decimal:".",precision:2},ZAR:{symbol:"R",grouping:" ",decimal:",",precision:2},ZMW:{symbol:"ZK",grouping:",",decimal:".",precision:2},WON:{symbol:"₩",grouping:",",decimal:".",precision:2}};function O(e){return y[e]||{symbol:"$",grouping:",",decimal:".",precision:2}}var j,w,C,_,k=n(5),x=n(9),E=n.n(x),S=n(7),P=n.n(S),F=n(3),B=n(8),N=n(14),A=n(15),R=n.n(A),L=n(10),T=n.n(L),I=n(28),D=n.n(I),M=n(29),$=n.n(M);j={"(":9,"!":8,"*":7,"/":7,"%":7,"+":6,"-":6,"<":5,"<=":5,">":5,">=":5,"==":4,"!=":4,"&&":3,"||":2,"?":1,"?:":1},w=["(","?"],C={")":["("],":":["?","?:"]},_=/<=|>=|==|!=|&&|\|\||\?:|\(|!|\*|\/|%|\+|-|<|>|\?|\)|:/;var U={"!":function(e){return!e},"*":function(e,t){return e*t},"/":function(e,t){return e/t},"%":function(e,t){return e%t},"+":function(e,t){return e+t},"-":function(e,t){return e-t},"<":function(e,t){return e<t},"<=":function(e,t){return e<=t},">":function(e,t){return e>t},">=":function(e,t){return e>=t},"==":function(e,t){return e===t},"!=":function(e,t){return e!==t},"&&":function(e,t){return e&&t},"||":function(e,t){return e||t},"?:":function(e,t,n){if(e)throw t;return n}};function K(e){var t=function(e){for(var t,n,r,o,i=[],c=[];t=e.match(_);){for(n=t[0],(r=e.substr(0,t.index).trim())&&i.push(r);o=c.pop();){if(C[n]){if(C[n][0]===o){n=C[n][1]||n;break}}else if(w.indexOf(o)>=0||j[o]<j[n]){c.push(o);break}i.push(o)}C[n]||c.push(n),e=e.substr(t.index+n.length)}return(e=e.trim())&&i.push(e),i.concat(c.reverse())}(e);return function(e){return function(e,t){var n,r,o,i,c,s,l=[];for(n=0;n<e.length;n++){if(c=e[n],i=U[c]){for(r=i.length,o=Array(r);r--;)o[r]=l.pop();try{s=i.apply(null,o)}catch(a){return a}}else s=t.hasOwnProperty(c)?t[c]:+c;l.push(s)}return l[0]}(t,e)}}var G={contextDelimiter:"",onMissingKey:null};function H(e,t){var n;for(n in this.data=e,this.pluralForms={},this.options={},G)this.options[n]=void 0!==t&&n in t?t[n]:G[n]}H.prototype.getPluralForm=function(e,t){var n,r,o,i,c=this.pluralForms[e];return c||("function"!=typeof(o=(n=this.data[e][""])["Plural-Forms"]||n["plural-forms"]||n.plural_forms)&&(r=function(e){var t,n,r;for(t=e.split(";"),n=0;n<t.length;n++)if(0===(r=t[n].trim()).indexOf("plural="))return r.substr(7)}(n["Plural-Forms"]||n["plural-forms"]||n.plural_forms),i=K(r),o=function(e){return+i({n:e})}),c=this.pluralForms[e]=o),c(t)},H.prototype.dcnpgettext=function(e,t,n,r,o){var i,c,s;return i=void 0===o?0:this.getPluralForm(e,o),c=n,t&&(c=t+this.options.contextDelimiter+n),(s=this.data[e][c])&&s[i]?s[i]:(this.options.onMissingKey&&this.options.onMissingKey(n,e),0===i?n:r)};var V=n(30),W=n.n(V),z=n(31),Z=n.n(z),Y=n(20),J=/%(((\d+)\$)|(\(([$_a-zA-Z][$_a-zA-Z0-9]*)\)))?[ +0#-]*\d*(\.(\d+|\*))?(ll|[lhqL])?([cduxXefgsp%])/g;function q(e,t){var n;if(!Array.isArray(t))for(t=new Array(arguments.length-1),n=1;n<arguments.length;n++)t[n-1]=arguments[n];return n=1,e.replace(J,(function(){var e,r,o,i,c;return e=arguments[3],r=arguments[5],"%"===(i=arguments[9])?"%":("*"===(o=arguments[7])&&(o=t[n-1],n++),void 0!==r?t[0]&&"object"==typeof t[0]&&t[0].hasOwnProperty(r)&&(c=t[0][r]):(void 0===e&&(e=n),n++,c=t[e-1]),"f"===i?c=parseFloat(c)||0:"d"===i&&(c=parseInt(c)||0),void 0!==o&&("f"===i?c=c.toFixed(o):"s"===i&&(c=c.substr(0,o))),null!=c?c:"")}))}
20
  /*
21
  * Exposes number format capability
22
  *
23
  * @copyright Copyright (c) 2013 Kevin van Zonneveld (http://kvz.io) and Contributors (http://phpjs.org/authors).
24
  * @license See CREDITS.md
25
  * @see https://github.com/kvz/phpjs/blob/ffe1356af23a6f2512c84c954dd4e828e92579fa/functions/strings/number_format.js
26
- */function X(e,t,n,r){e=(e+"").replace(/[^0-9+\-Ee.]/g,"");var o=isFinite(+e)?+e:0,i=isFinite(+t)?Math.abs(t):0,c=void 0===r?",":r,s=void 0===n?".":n,l="";return(l=(i?function(e,t){var n=Math.pow(10,t);return""+(Math.round(e*n)/n).toFixed(t)}(o,i):""+Math.round(o)).split("."))[0].length>3&&(l[0]=l[0].replace(/\B(?=(?:\d{3})+(?!\d))/g,c)),(l[1]||"").length<i&&(l[1]=l[1]||"",l[1]+=new Array(i-l[1].length+1).join("0")),l.join(s)}var Q=D()("i18n-calypso"),ee="number_format_decimals",te="number_format_thousands_sep",ne="messages",re=[function(e){return e}],oe={};function ie(){ue.throwErrors&&"undefined"!=typeof window&&window.console&&window.console.warn&&window.console.warn.apply(window.console,arguments)}function ce(e){return Array.prototype.slice.call(e)}function se(e){var t=e[0];("string"!=typeof t||e.length>3||e.length>2&&"object"==typeof e[1]&&"object"==typeof e[2])&&ie("Deprecated Invocation: `translate()` accepts ( string, [string], [object] ). These arguments passed:",ce(e),". See https://github.com/Automattic/i18n-calypso#translate-method"),2===e.length&&"string"==typeof t&&"string"==typeof e[1]&&ie("Invalid Invocation: `translate()` requires an options object for plural translations, but passed:",ce(e));for(var n={},r=0;r<e.length;r++)"object"==typeof e[r]&&(n=e[r]);if("string"==typeof t?n.original=t:"object"==typeof n.original&&(n.plural=n.original.plural,n.count=n.original.count,n.original=n.original.single),"string"==typeof e[1]&&(n.plural=e[1]),void 0===n.original)throw new Error("Translate called without a `string` value as first argument.");return n}function le(e,t){return e.dcnpgettext(ne,t.context,t.original,t.plural,t.count)}function ae(e,t){for(var n=re.length-1;n>=0;n--){var r=re[n](Object.assign({},t)),o=r.context?r.context+""+r.original:r.original;if(e.state.locale[o])return le(e.state.tannin,r)}return null}function ue(){if(!(this instanceof ue))return new ue;this.defaultLocaleSlug="en",this.defaultPluralForms=function(e){return 1===e?0:1},this.state={numberFormatSettings:{},tannin:void 0,locale:void 0,localeSlug:void 0,textDirection:void 0,translations:W()({max:100})},this.componentUpdateHooks=[],this.translateHooks=[],this.stateObserver=new Y.EventEmitter,this.stateObserver.setMaxListeners(0),this.configure()}ue.throwErrors=!1,ue.prototype.on=function(){var e;(e=this.stateObserver).on.apply(e,arguments)},ue.prototype.off=function(){var e;(e=this.stateObserver).off.apply(e,arguments)},ue.prototype.emit=function(){var e;(e=this.stateObserver).emit.apply(e,arguments)},ue.prototype.numberFormat=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n="number"==typeof t?t:t.decimals||0,r=t.decPoint||this.state.numberFormatSettings.decimal_point||".",o=t.thousandsSep||this.state.numberFormatSettings.thousands_sep||",";return X(e,n,r,o)},ue.prototype.configure=function(e){Object.assign(this,e||{}),this.setLocale()},ue.prototype.setLocale=function(e){var t,n,r;if(e&&e[""]&&e[""]["key-hash"]){var o=e[""]["key-hash"],i=function(e,t){var n=!1===t?"":String(t);if(void 0!==oe[n+e])return oe[n+e];var r=Z()().update(e).digest("hex");return oe[n+e]=t?r.substr(0,t):r},c=function(e){return function(t){return t.context?(t.original=i(t.context+String.fromCharCode(4)+t.original,e),delete t.context):t.original=i(t.original,e),t}};if("sha1"===o.substr(0,4))if(4===o.length)re.push(c(!1));else{var s=o.substr(5).indexOf("-");if(s<0){var l=Number(o.substr(5));re.push(c(l))}else for(var a=Number(o.substr(5,s)),u=Number(o.substr(6+s)),p=a;p<=u;p++)re.push(c(p))}}if(e&&e[""].localeSlug)if(e[""].localeSlug===this.state.localeSlug){if(e===this.state.locale)return;Object.assign(this.state.locale,e)}else this.state.locale=Object.assign({},e);else this.state.locale={"":{localeSlug:this.defaultLocaleSlug,plural_forms:this.defaultPluralForms}};this.state.localeSlug=this.state.locale[""].localeSlug,this.state.textDirection=(null===(t=this.state.locale["text directionltr"])||void 0===t?void 0:t[0])||(null===(n=this.state.locale[""])||void 0===n||null===(r=n.momentjs_locale)||void 0===r?void 0:r.textDirection),this.state.tannin=new H(T()({},ne,this.state.locale)),this.state.numberFormatSettings.decimal_point=le(this.state.tannin,se([ee])),this.state.numberFormatSettings.thousands_sep=le(this.state.tannin,se([te])),this.state.numberFormatSettings.decimal_point===ee&&(this.state.numberFormatSettings.decimal_point="."),this.state.numberFormatSettings.thousands_sep===te&&(this.state.numberFormatSettings.thousands_sep=","),this.stateObserver.emit("change")},ue.prototype.getLocale=function(){return this.state.locale},ue.prototype.getLocaleSlug=function(){return this.state.localeSlug},ue.prototype.isRtl=function(){return"rtl"===this.state.textDirection},ue.prototype.addTranslations=function(e){for(var t in e)""!==t&&(this.state.tannin.data.messages[t]=e[t]);this.stateObserver.emit("change")},ue.prototype.hasTranslation=function(){return!!ae(this,se(arguments))},ue.prototype.translate=function(){var e=se(arguments),t=ae(this,e);if(t||(t=le(this.state.tannin,e)),e.args){var n=Array.isArray(e.args)?e.args.slice(0):[e.args];n.unshift(t);try{t=q.apply(void 0,R()(n))}catch(o){if(!window||!window.console)return;var r=this.throwErrors?"error":"warn";"string"!=typeof o?window.console[r](o):window.console[r]("i18n sprintf error:",n)}}return e.components&&(t=$()({mixedString:t,components:e.components,throwErrors:this.throwErrors})),this.translateHooks.forEach((function(n){t=n(t,e)})),t},ue.prototype.reRenderTranslations=function(){Q("Re-rendering all translations due to external request"),this.stateObserver.emit("change")},ue.prototype.registerComponentUpdateHook=function(e){this.componentUpdateHooks.push(e)},ue.prototype.registerTranslateHook=function(e){this.translateHooks.push(e)};var pe=ue,de=n(32),me=n.n(de),fe=n(33),ge=n.n(fe),be=n(18),he=n.n(be),ve=n(34),ye=n.n(ve),Oe=n(35),je=n.n(Oe),we=n(11),Ce=n.n(we),_e=n(36);var ke,xe,Ee=new pe,Se=Ee.numberFormat.bind(Ee),Pe=(Ee.translate.bind(Ee),Ee.configure.bind(Ee),Ee.setLocale.bind(Ee),Ee.getLocale.bind(Ee),Ee.getLocaleSlug.bind(Ee),Ee.addTranslations.bind(Ee),Ee.reRenderTranslations.bind(Ee),Ee.registerComponentUpdateHook.bind(Ee),Ee.registerTranslateHook.bind(Ee),Ee.state,Ee.stateObserver,Ee.on.bind(Ee),Ee.off.bind(Ee),Ee.emit.bind(Ee),xe={numberFormat:(ke=Ee).numberFormat.bind(ke),translate:ke.translate.bind(ke)},function(e){function t(){var t=e.translate.bind(e);return Object.defineProperty(t,"localeSlug",{get:e.getLocaleSlug.bind(e)}),t}}(Ee),function(e){var t={getCurrentValue:function(){return e.isRtl()},subscribe:function(t){return e.on("change",t),function(){return e.off("change",t)}}};function n(){return Object(_e.useSubscription)(t)}var r=Object(B.createHigherOrderComponent)((function(e){return Object(we.forwardRef)((function(t,r){var o=n();return Ce.a.createElement(e,E()({},t,{isRtl:o,ref:r}))}))}),"WithRTL");return{useRtl:n,withRtl:r}}(Ee));Pe.useRtl,Pe.withRtl;function Fe(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=O(t);if(!r||isNaN(e))return null;var o=p()(p()({},r),n),i=o.decimal,c=o.grouping,s=o.precision,l=o.symbol,a=e<0?"-":"",u=Se(Math.abs(e),{decimals:s,thousandsSep:c,decPoint:i});return n.stripZeros&&(u=Be(u,i)),"".concat(a).concat(l).concat(u)}function Be(e,t){var n=new RegExp("\\".concat(t,"0+$"));return e.replace(n,"")}function Ne(e){var t=e.className,n=e.tab,r=e.label,o=e.selectedTab,i=e.onSelected,c=(n.id===o.id?["is-pressed","is-active"]:[]).concat([t,"components-button","components-tab-button"]);return Object(h.createElement)("button",{type:"button",onClick:function(){return i(n)},className:c.join(" ")},r)}function Ae(e){var t=e.className,n=e.tabs,r=e.selectedTab,o=e.onSelected,i=e.selectBlock;return Object(h.createElement)("div",{className:"premium-content-tabs block-editor-block-toolbar"},n.map((function(n){return Object(h.createElement)(Ne,E()({key:n.id},e,{tab:n,selectedTab:r,className:"".concat(t,"--tab"),label:n.label,onSelected:o}))})),Object(h.createElement)("button",{onClick:function(){Object(k.select)("core/edit-post").isEditorSidebarOpened()||Object(k.dispatch)("core/edit-post").openGeneralSidebar("edit-post/block"),i()},className:"edit components-button is-button is-secondary"},Object(v.__)("Edit","full-site-editing")))}function Re(){return Object(h.createElement)("div",{className:"premium-content-wrapper"},Object(h.createElement)(b.InnerBlocks,{allowedBlocks:["premium-content/subscriber-view","premium-content/logged-out-view"],templateLock:"all",template:[["premium-content/subscriber-view"],["premium-content/logged-out-view"]]}))}function Le(e){var t=e.className,n=e.plan,r=e.selectedPlan,o=e.onSelected,i=e.onClose,c=e.getPlanDescription,s=r&&n.id===r.id,l=(s?["is-selected"]:[]).concat([t]).join(" "),a=s?"yes":void 0,u=null;return n&&(u=" "+c(n)),Object(h.createElement)(F.MenuItem,{onClick:function(e){e.preventDefault(),o(n),i()},className:l,key:n.id,value:n.id,selected:s,icon:a},n.title," : ",u)}function Te(e){var t=e.plans,n=e.selectedPlan,r=e.onSelected;return Object(h.createElement)(F.MenuGroup,null,t.map((function(t){return Object(h.createElement)(Le,E()({},e,{key:t.id,selectedPlan:n,onSelected:r,plan:t}))})))}function Ie(e){return Object(h.createElement)(F.MenuGroup,null,Object(h.createElement)(F.MenuItem,{onClick:function(t){t.preventDefault(),Object(k.select)("core/edit-post").isEditorSidebarOpened()||Object(k.dispatch)("core/edit-post").openGeneralSidebar("edit-post/block");var n=document.getElementById("new-plan-name");null!==n&&n.focus(),e.onClose()}},Object(v.__)("Add a new subscription","full-site-editing")))}function De(e){var t=e.selectedPlanId,n=e.onSelected,r=e.plans,o=e.getPlanDescription,i=r.find((function(e){return e.id===t})),c=null;return i&&(c=" "+o(i)),Object(h.createElement)(b.BlockControls,null,Object(h.createElement)(F.Toolbar,null,Object(h.createElement)(F.DropdownMenu,{icon:Object(h.createElement)(h.Fragment,null,Object(h.createElement)(F.Dashicon,{icon:"update"})," ",c&&Object(h.createElement)(h.Fragment,null,c)),label:Object(v.__)("Select a plan","full-site-editing"),className:"premium-content-toolbar-button"},(function(t){var r=t.onClose;return Object(h.createElement)(h.Fragment,null,Object(h.createElement)(Te,E()({},e,{onSelected:n,onClose:r,selectedPlan:i})),Object(h.createElement)(Ie,E()({},e,{onClose:r})))}))))}function Me(e){var t=Object(h.useState)(0),n=P()(t,2),r=n[0],o=n[1],i=e.attributes,c=e.setAttributes,s=e.className,l=e.savePlan,a=(e.currencies,e.siteSlug);return Object(h.createElement)(b.InspectorControls,null,a&&Object(h.createElement)(F.ExternalLink,{href:"https://wordpress.com/earn/payments/".concat(a),className:"wp-block-premium-content-container---link-to-earn"},Object(v.__)("Manage your subscriptions.","full-site-editing")),Object(h.createElement)(F.PanelBody,{title:"Add a new subscription",initialOpen:!0,className:"".concat(s,"---settings-add_plan")},1===r&&Object(h.createElement)(F.Placeholder,{icon:"lock",label:Object(v.__)("Premium Content","full-site-editing"),instructions:Object(v.__)("Saving plan…","full-site-editing")},Object(h.createElement)(F.Spinner,null)),0===r&&Object(h.createElement)("div",null,Object(h.createElement)(F.PanelRow,{className:"plan-name"},Object(h.createElement)(F.TextControl,{id:"new-plan-name",label:"Name",value:i.newPlanName,onChange:function(e){return c({newPlanName:e})}})),Object(h.createElement)(F.PanelRow,{className:"plan-price"},Object(h.createElement)(F.SelectControl,{label:"Currency",onChange:function(e){return c({newPlanCurrency:e})},value:i.newPlanCurrency,options:Qe}),Object(h.createElement)(F.TextControl,{label:"Price",value:i.newPlanPrice,onChange:function(e){return c({newPlanPrice:parseFloat(e)})},type:"number"})),Object(h.createElement)(F.PanelRow,{className:"plan-interval"},Object(h.createElement)(F.SelectControl,{label:"Interval",onChange:function(e){return c({newPlanInterval:e})},value:i.newPlanInterval,options:[{label:"Month",value:"1 month"},{label:"Year",value:"1 year"}]})),Object(h.createElement)(F.PanelRow,null,Object(h.createElement)(F.Button,{isSecondary:!0,isLarge:!0,onClick:function(t){t.preventDefault(),o(1),l(e.attributes,(function(e){o(0),e&&(c({newPlanPrice:5}),c({newPlanName:""}))}))}},Object(v.__)("Add subscription","full-site-editing"))))))}var $e=Object(B.compose)([Object(k.withDispatch)((function(e,t){var n,r=t.stripeConnectUrl;return{autosaveAndRedirect:(n=a()(regeneratorRuntime.mark((function t(n){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n.preventDefault(),t.next=3,e("core/editor").savePost();case 3:window.top.location.href=r;case 4:case"end":return t.stop()}}),t)}))),function(e){return n.apply(this,arguments)})}}))])((function(e){var t=e.autosaveAndRedirect,n=e.stripeConnectUrl;return Object(h.createElement)(b.Warning,{actions:n&&[Object(h.createElement)(F.Button,{key:"connect",href:n,onClick:t,target:"_top",isDefault:!0,className:"premium-content-block-nudge__button stripe-nudge__button"},Object(v.__)("Connect","full-site-editing"))],className:"premium-content-block-nudge"},Object(h.createElement)("span",{className:"premium-content-block-nudge__info"},Object(h.createElement)(F.Dashicon,{icon:"star-filled"}),Object(h.createElement)("span",{className:"premium-content-block-nudge__text-container"},Object(h.createElement)("span",{className:"premium-content-block-nudge__title"},Object(v.__)("Connect to Stripe to use this block on your site","full-site-editing")),Object(h.createElement)("span",{className:"premium-content-block-nudge__message"},Object(v.__)("This block will be hidden from your visitors until you connect to Stripe.","full-site-editing")))))})),Ue={selectedTab:{id:"",className:"",label:Object(h.createElement)(h.Fragment,null)},stripeNudge:null},Ke=Object(h.createContext)(Ue),Ge=[{id:"premium",label:Object(h.createElement)("span",null,Object(v.__)("Subscriber View","full-site-editing")),className:"wp-premium-content-subscriber-view"},{id:"wall",label:Object(h.createElement)("span",null,Object(v.__)("Non-subscriber View","full-site-editing")),className:"wp-premium-content-logged-out-view"}],He=[];function Ve(e,t){var n=e.noticeOperations;n.removeAllNotices(),n.createErrorNotice(t)}var We=Object(B.compose)([Object(k.withSelect)((function(e,t){return{postId:(0,e("core/editor").getCurrentPostId)(),containerClientId:e("core/block-editor").getBlockHierarchyRootClientId(t.clientId)}})),F.withNotices,Object(k.withDispatch)((function(e,t){var n=e("core/block-editor");return{selectBlock:function(){n.selectBlock(t.containerClientId)}}}))])((function(e){var t=Object(h.useState)(Ge[1]),n=P()(t,2),r=n[0],o=n[1],i=Object(h.useState)(!1),c=P()(i,2),s=c[0],l=c[1],a=Object(h.useState)(He),u=P()(a,2),p=u[0],d=u[1],m=Object(h.useState)(null),g=P()(m,2),b=g[0],y=g[1],O=Object(h.useState)(0),j=P()(O,2),w=j[0],C=j[1],_=Object(h.useState)(!1),k=P()(_,2),x=k[0],S=k[1],B=Object(h.useState)(""),A=P()(B,2),R=A[0],L=A[1],T=Object(h.useState)(""),I=P()(T,2),D=I[0],M=I[1];function $(t,n){if(!t.newPlanName||0===t.newPlanName.length)return Ve(e,Object(v.__)("Plan requires a name","full-site-editing")),void n(!1);var r=parseFloat(t.newPlanPrice),o=et(t.newPlanCurrency),i=Object(v.sprintf)(Object(v.__)("Minimum allowed price is %s.","full-site-editing"),Fe(o,t.newPlanCurrency));if(r<o)return Ve(e,i),void n(!1);if(!tt(t.newPlanCurrency,r))return Ve(e,Object(v.__)("Plan requires a valid price","full-site-editing")),void n(!1);var c={path:"/wpcom/v2/memberships/product",method:"POST",data:{currency:t.newPlanCurrency,price:t.newPlanPrice,title:t.newPlanName,interval:t.newPlanInterval}};f()(c).then((function(t){var r={id:t.id,title:t.title,interval:t.interval,price:t.price,currency:t.currency};d(p.concat([r])),U(r),function(e,t){var n=e.noticeOperations;n.removeAllNotices(),n.createNotice({status:"info",content:t})}(e,Object(v.__)("Successfully created plan","full-site-editing")),n&&n(!0)}),(function(){Ve(e,Object(v.__)("There was an error when adding the plan.","full-site-editing")),n&&n(!1)}))}function U(t){e.setAttributes({selectedPlanId:t.id})}var K=Object(h.useRef)(null);!function(e,t){function n(n){e.current&&n.target&&n.target instanceof Node&&!e.current.contains(n.target)?t(!1):t(!0)}Object(h.useEffect)((function(){return document.addEventListener("mousedown",n),function(){document.removeEventListener("mousedown",n)}}))}(K,l);var G=e.isSelected,H=e.className;if(Object(h.useEffect)((function(){var t=Object(N.getQueryArg)(window.location.href,"origin"),n={path:Object(N.addQueryArgs)("/wpcom/v2/memberships/status",{source:"https://wordpress.com"===t?"gutenberg-wpcom":"gutenberg"}),method:"GET"};f()(n).then((function(t){if(t||"object"==typeof t){if(t.errors&&Object.values(t.errors)&&Object.values(t.errors)[0][0])return C(2),void Ve(e,Object.values(t.errors)[0][0]);y(t.connect_url),S(t.should_upgrade_to_access_memberships),L(t.upgrade_url),M(t.site_slug),t.products&&0===t.products.length&&!t.should_upgrade_to_access_memberships&&t.connected_account_id?$({newPlanCurrency:"USD",newPlanPrice:5,newPlanName:Object(v.__)("Monthly Subscription","full-site-editing"),newPlanInterval:"1 month"},(function(){C(t.connected_account_id?1:2)})):(t.products&&t.products.length>0&&(d(t.products),e.attributes.selectedPlanId||U(t.products[0])),C(t.connected_account_id?1:2))}}),(function(t){y(null),C(2),Ve(e,t.message)})),e.selectBlock()}),[]),0===w)return Object(h.createElement)("div",{className:H,ref:K},e.noticeUI,Object(h.createElement)(F.Placeholder,{icon:"lock",label:Object(v.__)("Premium Content","full-site-editing"),instructions:Object(v.__)("Loading data…","full-site-editing")},Object(h.createElement)(F.Spinner,null)));if(x)return Object(h.createElement)("div",{className:H,ref:K},e.noticeUI,Object(h.createElement)(F.Placeholder,{icon:"lock",label:Object(v.__)("Premium Content","full-site-editing"),instructions:Object(v.__)("You'll need to upgrade your plan to use the Premium Content block.","full-site-editing")},Object(h.createElement)(F.Button,{isSecondary:!0,isLarge:!0,href:R,target:"_blank",className:"premium-content-block-nudge__button plan-nudge__button"},Object(v.__)("Upgrade Your Plan","full-site-editing")),Object(h.createElement)("div",{className:"membership-button__disclaimer"},Object(h.createElement)(F.ExternalLink,{href:"https://wordpress.com/support/premium-content-block/"},Object(v.__)("Read more about Premium Content and related fees.","full-site-editing")))));var V=null;if(!x&&1!==w&&b){var W=function(e,t){var n,r=e.postId;if(!Object(N.isURL)(t))return null;if(!r)return t;try{var o=Object(N.getQueryArg)(t,"state");"string"==typeof o&&(n=JSON.parse(window.atob(o)))}catch(i){return t}return n.from_editor_post_id=r,Object(N.addQueryArgs)(t,{state:window.btoa(JSON.stringify(n))})}(e,b);V=Object(h.createElement)($e,E()({},e,{stripeConnectUrl:W}))}return Object(h.createElement)("div",{className:H,ref:K},e.noticeUI,(G||s)&&1===w&&Object(h.createElement)(De,E()({},e,{plans:p,selectedPlanId:e.attributes.selectedPlanId,onSelected:U,getPlanDescription:function(e){var t=Fe(parseFloat(e.price),e.currency);return"1 month"===e.interval?Object(v.sprintf)(Object(v.__)("%s / month","full-site-editing"),t):"1 year"===e.interval?Object(v.sprintf)(Object(v.__)("%s / year","full-site-editing"),t):"one-time"===e.interval?t:Object(v.sprintf)(Object(v.__)("%1$s / %2$s","full-site-editing"),t,e.interval)}})),(G||s)&&1===w&&Object(h.createElement)(Me,E()({},e,{savePlan:$,siteSlug:D})),(G||s)&&Object(h.createElement)(Ae,E()({},e,{tabs:Ge,selectedTab:r,onSelected:o})),Object(h.createElement)(Ke.Provider,{value:{selectedTab:r,stripeNudge:V}},Object(h.createElement)(Re,null)))}));function ze(){for(var e=Object(g.getCategories)(),t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];for(var o=function(){var t=c[i];if(e.some((function(e){return e.slug===t})))return{v:t}},i=0,c=n;i<c.length;i++){var s=o();if("object"==typeof s)return s.v}throw new Error("Could not find a category from the provided list: ".concat(n.join(",")))}var Ze="premium-content/container",Ye=ze("design","common"),Je=function e(t){return 0===t.name.indexOf("premium-content/")||t.innerBlocks.some(e)},qe={name:Ze,attributes:{newPlanName:{type:"string",default:"Monthly Subscription"},newPlanCurrency:{type:"string",default:"USD"},newPlanPrice:{type:"number",default:5},newPlanInterval:{type:"string",default:"1 month"},selectedPlanId:{type:"number",default:0}},title:Object(v.__)("Premium Content","full-site-editing"),description:Object(v.__)("Restrict access to your content for paying subscribers.","full-site-editing"),category:Ye,icon:Object(h.createElement)("svg",{width:"25",height:"24",viewBox:"0 0 25 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Object(h.createElement)("path",{d:"M12.7439 14.4271L8.64053 13.165L8.51431 13.8718L8.09208 20.7415C8.06165 21.2365 8.61087 21.5526 9.02363 21.2776L12.7439 18.799L16.7475 21.304C17.1687 21.5676 17.7094 21.2343 17.6631 20.7396L17.0212 13.8718L17.0212 13.165L12.7439 14.4271Z",fill:"black"}),Object(h.createElement)("circle",{cx:"12.7439",cy:"8.69796",r:"5.94466",stroke:"black",strokeWidth:"1.5",fill:"none"}),Object(h.createElement)("path",{d:"M9.71023 8.12461L11.9543 10.3687L15.7776 6.54533",stroke:"black",strokeWidth:"1.5",fill:"none"})),supports:{html:!1},transforms:{from:[{type:"block",isMultiBlock:!0,blocks:["*"],__experimentalConvert:function(e){if(!e.some(Je)&&(t=e[0],!(0,(n=Object(k.select)("core/block-editor")).getBlocksByClientId)((0,n.getBlockParents)(t.clientId)).find((function(e){return 0===e.name.indexOf("premium-content/")})))){var t,n,r=e.map((function(e){return Object(g.createBlock)(e.name,e.attributes,e.innerBlocks)}));return Object(g.createBlock)("premium-content/container",{},[Object(g.createBlock)("premium-content/subscriber-view",{},r),Object(g.createBlock)("premium-content/logged-out-view")])}}}]},keywords:["premium-content",Object(v.__)("premium","full-site-editing"),Object(v.__)("paywall","full-site-editing")],edit:We,save:function(){return Object(h.createElement)("div",{className:"wp-block-premium-content-container"},Object(h.createElement)(b.InnerBlocks.Content,null))},providesContext:{"premium-content/planId":"selectedPlanId"}},Xe={USD:.5,AUD:.5,BRL:.5,CAD:.5,CHF:.5,DKK:2.5,EUR:.5,GBP:.3,HKD:4,INR:.5,JPY:50,MXN:10,NOK:3,NZD:.5,PLN:2,SEK:3,SGD:.5},Qe=Object.keys(Xe).map((function(e){var t=O(e).symbol;return{value:e,label:t===e?e:"".concat(e," ").concat(Object(d.trimEnd)(t,"."))}}));function et(e){return Xe[e]}function tt(e,t){return!isNaN(t)&&t>=et(e)}var nt=Object(B.compose)([Object(k.withSelect)((function(e,t){return{hasInnerBlocks:!!e("core/block-editor").getBlocksByClientId(t.clientId)[0].innerBlocks.length,containerClientId:e("core/block-editor").getBlockHierarchyRootClientId(t.clientId)}})),Object(k.withDispatch)((function(e,t){var n=e("core/block-editor");return{selectBlock:function(){n.selectBlock(t.containerClientId)}}}))])((function(e){return Object(h.useEffect)((function(){e.selectBlock()}),[]),Object(h.createElement)(Ke.Consumer,null,(function(t){var n=t.selectedTab,r=t.stripeNudge;return Object(h.createElement)("div",{hidden:"wall"===n.id,className:n.className},r,Object(h.createElement)(b.InnerBlocks,{renderAppender:!e.hasInnerBlocks&&b.InnerBlocks.ButtonBlockAppender,templateLock:!1,template:[["core/paragraph",{placeholder:Object(v.__)("Insert the piece of content you want your visitors to see after they subscribe.","full-site-editing")}]]}))}))}));var rt="premium-content/subscriber-view",ot=ze("design","common"),it={name:rt,category:ot,attributes:{},title:Object(v.__)("Subscriber View","full-site-editing"),description:Object(v.__)("Subscriber View.","full-site-editing"),parent:["premium-content/container"],supports:{inserter:!1,html:!1},edit:nt,save:function(){return Object(h.createElement)("div",{className:"wp-block-premium-content-subscriber-view"},Object(h.createElement)(b.InnerBlocks.Content,null))}};var ct=Object(B.compose)([Object(k.withSelect)((function(e,t){return{containerClientId:(0,e("core/block-editor").getBlockHierarchyRootClientId)(t.clientId)}})),Object(k.withDispatch)((function(e,t){var n=e("core/block-editor").selectBlock;return{selectContainerBlock:function(){n(t.containerClientId)}}}))])((function(e){var t=e.selectContainerBlock;return Object(h.useEffect)((function(){setTimeout(t,0)}),[]),Object(h.createElement)(Ke.Consumer,null,(function(e){var t=e.selectedTab,n=e.stripeNudge;return Object(h.createElement)("div",{hidden:"premium"===t.id,className:t.className},n,Object(h.createElement)(b.InnerBlocks,{templateLock:!1,template:[["core/heading",{content:Object(v.__)("Subscribe to get access","full-site-editing"),level:3}],["core/paragraph",{content:Object(v.__)("Read more of this content when you subscribe today.","full-site-editing")}],["premium-content/buttons"]]}))}))}));var st=[{attributes:{subscribeButtonText:{type:"string",default:"Subscribe"},loginButtonText:{type:"string",default:"Log In"},buttonClasses:{type:"string",default:""},backgroundButtonColor:{type:"string",default:""},textButtonColor:{type:"string",default:""},customBackgroundButtonColor:{type:"string",default:""},customTextButtonColor:{type:"string",default:""}},isEligible:function(e){return!!e.buttonClasses},migrate:function(e,t){var n=Object(g.createBlock)("premium-content/buttons",{},[Object(g.createBlock)("jetpack/recurring-payments",{submitButtonText:e.subscribeButtonText,backgroundButtonColor:e.backgroundButtonColor,textButtonColor:e.textButtonColor,customBackgroundButtonColor:e.customBackgroundButtonColor,customTextButtonColor:e.customTextButtonColor}),Object(g.createBlock)("premium-content/login-button",{text:e.loginButtonText,backgroundColor:e.backgroundButtonColor,textColor:e.textButtonColor,style:{color:{background:e.customBackgroundButtonColor,text:e.customTextButtonColor}}})]);return[e,[].concat(R()(t),[n])]},save:function(){return Object(h.createElement)("div",{className:"wp-block-premium-content-logged-out-view"},Object(h.createElement)(b.InnerBlocks.Content,null))}}],lt=n(21),at="premium-content/logged-out-view",ut=ze("design","common"),pt={name:at,category:ut,attributes:{},title:Object(v.__)("Logged Out View","full-site-editing"),description:Object(v.__)("Logged Out View.","full-site-editing"),parent:["premium-content/container"],supports:{inserter:!1,html:!1},edit:ct,save:function(){return Object(h.createElement)("div",{className:"wp-block-premium-content-logged-out-view"},Object(h.createElement)(b.InnerBlocks.Content,null))},deprecated:st},dt=Object(k.subscribe)((function(){var e=Object(k.select)("core/rich-text").getFormatType("core/link");if(e){dt(),Object(lt.unregisterFormatType)("core/link");var t=Object(B.compose)(Object(k.withSelect)((function(e){return{selectedBlock:e("core/block-editor").getSelectedBlock()}})),Object(B.ifCondition)((function(e){return e.selectedBlock&&e.selectedBlock.name!==at})))(e.edit);Object(lt.registerFormatType)("core/link",p()(p()({},e),{},{edit:t}))}})),mt=n(22),ft=Object(h.createElement)(mt.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(h.createElement)(mt.Path,{d:"M19 6.5H5c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-7c0-1.1-.9-2-2-2zm.5 9c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-7c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v7zM8 13h8v-1.5H8V13z"})),gt=n(37),bt=["core/button","jetpack/recurring-payments","premium-content/login-button"],ht={isEmbedButton:!0};var vt=Object(B.compose)([Object(k.withSelect)((function(e,t){return{subscribeButton:e("core/block-editor").getBlock(t.clientId).innerBlocks.find((function(e){return"jetpack/recurring-payments"===e.name}))}})),Object(k.withDispatch)((function(e,t){return{setSubscribeButtonPlan:function(n){e("core/block-editor").updateBlockAttributes(t.subscribeButton.clientId,{planId:n})}}}))])((function(e){var t=e.context,n=e.subscribeButton,r=e.setSubscribeButtonPlan,o=t?t["premium-content/planId"]:null,i=[["jetpack/recurring-payments",{planId:o,submitButtonText:Object(v.__)("Subscribe","full-site-editing")}],["premium-content/login-button"]];return Object(h.useEffect)((function(){o&&n&&n.attributes.planId!==o&&r(o)}),[o,n]),Object(h.useEffect)((function(){n&&Object(gt.addFilter)("jetpack.RecurringPayments.showControls","full-site-editing/premium-content-hide-recurring-payments-controls",(function(e,t){return t!==n.clientId&&e}))}),[n]),Object(h.createElement)(b.__experimentalBlock.div,{className:"wp-block-buttons"},Object(h.createElement)(b.__experimentalAlignmentHookSettingsProvider,{value:ht},Object(h.createElement)(b.InnerBlocks,{allowedBlocks:bt,template:i,__experimentalMoverDirection:"horizontal"})))}));var yt="premium-content/buttons",Ot=ze("design","common"),jt={name:yt,category:Ot,title:Object(v.__)("Premium Content buttons","full-site-editing"),description:Object(v.__)("Prompt Premium Content visitors to take action with a group of button-style links.","full-site-editing"),icon:ft,supports:{align:!0,alignWide:!1,lightBlockWrapper:!0},keywords:[Object(v.__)("link","full-site-editing")],edit:vt,save:function(){return Object(h.createElement)("div",{className:"wp-block-buttons"},Object(h.createElement)(b.InnerBlocks.Content,null))},context:["premium-content/planId"]},wt=n(13),Ct=n.n(wt),_t="web"===h.Platform.OS;var kt=function e(t){if(!Object(d.isObject)(t))return t;var n=Object(d.pickBy)(Object(d.mapValues)(t,e),d.identity);return Object(d.isEqual)(n,{})?void 0:n};function xt(e){var t=e.settings,n=e.clientId,r=e.enableContrastChecking,o=void 0===r||r,i=window,c=i.getComputedStyle,s=i.Node,l=Object(h.useState)(),a=P()(l,2),u=a[0],p=a[1],d=Object(h.useState)(),m=P()(d,2),f=m[0],g=m[1],y=_t?Object(v.__)("Color settings","full-site-editing"):Object(v.__)("Color Settings","full-site-editing");return Object(h.useEffect)((function(){if(!_t||o){var e=function(e){return document.getElementById("block-"+e)}(n);if(e){g(c(e).color);for(var t=e,r=c(t).backgroundColor;"rgba(0, 0, 0, 0)"===r&&t.parentNode&&t.parentNode.nodeType===s.ELEMENT_NODE;)t=t.parentNode,r=c(t).backgroundColor;p(r)}}})),Object(h.createElement)(b.InspectorControls,null,Object(h.createElement)(b.__experimentalPanelColorGradientSettings,{title:y,initialOpen:!1,settings:t},_t&&o&&Object(h.createElement)(b.ContrastChecker,{backgroundColor:u,textColor:f})))}var Et=function(e){var t,n,r,o=e.attributes,i=Object(k.useSelect)((function(e){return e("core/block-editor").getSettings()}),[]),c=i.colors,s=i.gradients,l=Object(h.useRef)(o);Object(h.useEffect)((function(){l.current=o}),[o]);var a,u,d=o.style,m=o.textColor,f=o.backgroundColor,g=o.gradient;a=g?Object(b.getGradientValueBySlug)(s,g):null==d||null===(u=d.color)||void 0===u?void 0:u.gradient;var y=function(t){return function(n){var r,o,i=Object(b.getColorObjectByColorValue)(c,n),s=t+"Color",a=p()(p()({},l.current.style),{},{color:p()(p()({},null===(r=l.current)||void 0===r||null===(o=r.style)||void 0===o?void 0:o.color),{},T()({},t,(null==i?void 0:i.slug)?void 0:n))}),u=(null==i?void 0:i.slug)?i.slug:void 0,d=T()({style:kt(a)},s,u);e.setAttributes(d),l.current=p()(p()({},l.current),d)}};return Object(h.createElement)(xt,{enableContrastChecking:!g&&!(null==d||null===(t=d.color)||void 0===t?void 0:t.gradient),clientId:e.clientId,settings:[{label:Object(v.__)("Text Color","full-site-editing"),onColorChange:y("text"),colorValue:Object(b.getColorObjectByAttributeValues)(c,m,null==d||null===(n=d.color)||void 0===n?void 0:n.text).color},{label:Object(v.__)("Background Color","full-site-editing"),onColorChange:y("background"),colorValue:Object(b.getColorObjectByAttributeValues)(c,f,null==d||null===(r=d.color)||void 0===r?void 0:r.background).color,gradientValue:a,onGradientChange:function(t){var n,r=Object(b.getGradientSlugByValue)(s,t);if(r){var o,i,c,a=p()(p()({},null===(o=l.current)||void 0===o?void 0:o.style),{},{color:p()(p()({},null===(i=l.current)||void 0===i||null===(c=i.style)||void 0===c?void 0:c.color),{},{gradient:void 0})});n={style:kt(a),gradient:r}}else{var u,d,m,f=p()(p()({},null===(u=l.current)||void 0===u?void 0:u.style),{},{color:p()(p()({},null===(d=l.current)||void 0===d||null===(m=d.style)||void 0===m?void 0:m.color),{},{gradient:t})});n={style:kt(f),gradient:void 0}}e.setAttributes(n),l.current=p()(p()({},l.current),n)}}]})};function St(e){var t,n,r,o,i,c,s,l,a,u,p,d=e.backgroundColor,m=e.textColor,f=e.gradient,g=e.style,h=Object(b.getColorClassName)("background-color",d),v=Object(b.__experimentalGetGradientClass)(f),y=Object(b.getColorClassName)("color",m),O=Ct()(y,v,(i={},T()(i,h,!(null==g||null===(t=g.color)||void 0===t?void 0:t.gradient)&&!!h),T()(i,"has-text-color",m||(null==g||null===(n=g.color)||void 0===n?void 0:n.text)),T()(i,"has-background",d||(null==g||null===(r=g.color)||void 0===r?void 0:r.background)||f||(null==g||null===(o=g.color)||void 0===o?void 0:o.gradient)),i));return{className:O||void 0,style:(null==g||null===(c=g.color)||void 0===c?void 0:c.background)||(null==g||null===(s=g.color)||void 0===s?void 0:s.text)||(null==g||null===(l=g.color)||void 0===l?void 0:l.gradient)?{background:(null==g||null===(a=g.color)||void 0===a?void 0:a.gradient)?g.color.gradient:void 0,backgroundColor:(null==g||null===(u=g.color)||void 0===u?void 0:u.background)?g.color.background:void 0,color:(null==g||null===(p=g.color)||void 0===p?void 0:p.text)?g.color.text:void 0}:{}}}function Pt(e){var t=e.borderRadius,n=void 0===t?"":t,r=e.setAttributes,o=Object(h.useCallback)((function(e){r({borderRadius:e})}),[r]);return Object(h.createElement)(F.PanelBody,{title:Object(v.__)("Border settings","full-site-editing")},Object(h.createElement)(F.RangeControl,{value:n,label:Object(v.__)("Border radius","full-site-editing"),min:0,max:50,initialPosition:5,allowReset:!0,onChange:o}))}var Ft=function(e){var t=e.attributes,n=e.setAttributes,r=e.className,o=t.borderRadius,i=t.text,c=St(t);return Object(h.createElement)(h.Fragment,null,Object(h.createElement)(b.__experimentalBlock.div,{className:"wp-block-button"},Object(h.createElement)(b.RichText,{placeholder:Object(v.__)("Add text…","full-site-editing"),value:i,onChange:function(e){return n({text:e})},withoutInteractiveFormatting:!0,className:Ct()(r,"wp-block-button__link",c.className,{"no-border-radius":0===o}),style:p()({borderRadius:o?o+"px":void 0},c.style)})),Object(h.createElement)(b.InspectorControls,null,Object(h.createElement)(Et,e),Object(h.createElement)(Pt,{borderRadius:o,setAttributes:n})))};var Bt="premium-content/login-button",Nt=ze("design","common"),At={name:Bt,title:Object(v.__)("Premium Content login button","full-site-editing"),description:Object(v.__)("Prompt subscriber visitors to log in with a button-style link (only visible for logged out users).","full-site-editing"),attributes:{text:{type:"string",source:"html",selector:"a",default:Object(v.__)("Log in","full-site-editing")},borderRadius:{type:"number"},backgroundColor:{type:"string"},textColor:{type:"string"},gradient:{type:"string"},style:{type:"object"}},icon:ft,keywords:[Object(v.__)("link","full-site-editing")],supports:{align:!0,alignWide:!1,html:!1,lightBlockWrapper:!0},edit:Ft,save:function(e){var t=e.attributes,n=t.borderRadius,r=t.text,o=St(t),i=Ct()("wp-block-button__link",o.className,{"no-border-radius":0===n}),c=p()({borderRadius:n?n+"px":void 0},o.style);return Object(h.createElement)("div",{className:"wp-block-button"},Object(h.createElement)(b.RichText.Content,{tagName:"a",className:i,style:c,value:r}))}},Rt=!(!b.__experimentalAlignmentHookSettingsProvider||!b.__experimentalBlock),Lt=function(e){if(e){var t=e.name,n=e.category,r=e.settings;Object(g.registerBlockType)(t,p()({category:n},r))}},Tt=function(e,t){var n=Object(g.getBlockType)(e);if(n){Object(g.unregisterBlockType)(e);var r=Object(d.mergeWith)({},n,t,(function(e,t){if(Array.isArray(e))return e.concat(t)}));Object(g.registerBlockType)(e,r)}},It=function(){var e=a()(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.abrupt("return",f()({path:"/wpcom/v2/memberships/status"}));case 4:return e.prev=4,e.t0=e.catch(0),e.abrupt("return",null);case 7:case"end":return e.stop()}}),e,null,[[0,4]])})));return function(){return e.apply(this,arguments)}}(),Dt=function(e){!e.should_upgrade_to_access_memberships&&e.connected_account_id||(Tt(yt,{supports:{inserter:!1}}),Tt(Bt,{supports:{inserter:!1}}))},Mt=function(){var e=a()(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,It();case 2:t=e.sent,Dt(t);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),$t=function(){[r,i,o,c,s].forEach(Lt)};Rt&&($t(),Mt())}]));
1
+ !function(e,t){for(var n in t)e[n]=t[n]}(window,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}return 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=60)}([function(e,t){!function(){e.exports=this.wp.element}()},function(e,t){!function(){e.exports=this.wp.i18n}()},function(e,t){!function(){e.exports=this.wp.blockEditor}()},function(e,t){!function(){e.exports=this.wp.components}()},function(e,t,n){var r=n(10);function o(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}e.exports=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}},function(e,t){!function(){e.exports=this.wp.data}()},function(e,t){!function(){e.exports=this.wp.blocks}()},function(e,t,n){var r=n(39),o=n(40),i=n(23),c=n(41);e.exports=function(e,t){return r(e)||o(e,t)||i(e,t)||c()}},function(e,t){function n(){return e.exports=n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},n.apply(this,arguments)}e.exports=n},function(e,t){!function(){e.exports=this.wp.compose}()},function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},function(e,t){!function(){e.exports=this.React}()},function(e,t){!function(){e.exports=this.lodash}()},function(e,t,n){var r;
2
  /*!
3
  Copyright (c) 2017 Jed Watson.
4
  Licensed under the MIT License (MIT), see
16
  object-assign
17
  (c) Sindre Sorhus
18
  @license MIT
19
+ */var r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;function c(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(o){return!1}}()?Object.assign:function(e,t){for(var n,s,l=c(e),a=1;a<arguments.length;a++){for(var u in n=Object(arguments[a]))o.call(n,u)&&(l[u]=n[u]);if(r){s=r(n);for(var p=0;p<s.length;p++)i.call(n,s[p])&&(l[s[p]]=n[s[p]])}}return l}},function(e,t,n){"use strict";n.r(t),n.d(t,"registerPremiumContentBlocks",(function(){return $t}));var r={};n.r(r),n.d(r,"name",(function(){return Ze})),n.d(r,"category",(function(){return Ye})),n.d(r,"settings",(function(){return qe})),n.d(r,"SUPPORTED_CURRENCIES",(function(){return Xe})),n.d(r,"CURRENCY_OPTIONS",(function(){return Qe})),n.d(r,"minimumTransactionAmountForCurrency",(function(){return et})),n.d(r,"isPriceValid",(function(){return tt}));var o={};n.r(o),n.d(o,"name",(function(){return rt})),n.d(o,"category",(function(){return ot})),n.d(o,"settings",(function(){return it}));var i={};n.r(i),n.d(i,"name",(function(){return at})),n.d(i,"category",(function(){return ut})),n.d(i,"settings",(function(){return pt}));var c={};n.r(c),n.d(c,"name",(function(){return yt})),n.d(c,"category",(function(){return Ot})),n.d(c,"settings",(function(){return jt}));var s={};n.r(s),n.d(s,"name",(function(){return Bt})),n.d(s,"category",(function(){return Nt})),n.d(s,"settings",(function(){return At}));var l=n(16),a=n.n(l),u=n(4),p=n.n(u),d=n(12),m=n(17),f=n.n(m),g=n(6),b=n(2),h=n(0),v=n(1),y={AED:{symbol:"د.إ.‏",grouping:",",decimal:".",precision:2},AFN:{symbol:"؋",grouping:",",decimal:".",precision:2},ALL:{symbol:"Lek",grouping:".",decimal:",",precision:2},AMD:{symbol:"֏",grouping:",",decimal:".",precision:2},ANG:{symbol:"ƒ",grouping:",",decimal:".",precision:2},AOA:{symbol:"Kz",grouping:",",decimal:".",precision:2},ARS:{symbol:"$",grouping:".",decimal:",",precision:2},AUD:{symbol:"A$",grouping:",",decimal:".",precision:2},AWG:{symbol:"ƒ",grouping:",",decimal:".",precision:2},AZN:{symbol:"₼",grouping:" ",decimal:",",precision:2},BAM:{symbol:"КМ",grouping:".",decimal:",",precision:2},BBD:{symbol:"Bds$",grouping:",",decimal:".",precision:2},BDT:{symbol:"৳",grouping:",",decimal:".",precision:0},BGN:{symbol:"лв.",grouping:" ",decimal:",",precision:2},BHD:{symbol:"د.ب.‏",grouping:",",decimal:".",precision:3},BIF:{symbol:"FBu",grouping:",",decimal:".",precision:0},BMD:{symbol:"$",grouping:",",decimal:".",precision:2},BND:{symbol:"$",grouping:".",decimal:",",precision:0},BOB:{symbol:"Bs",grouping:".",decimal:",",precision:2},BRL:{symbol:"R$",grouping:".",decimal:",",precision:2},BSD:{symbol:"$",grouping:",",decimal:".",precision:2},BTC:{symbol:"Ƀ",grouping:",",decimal:".",precision:2},BTN:{symbol:"Nu.",grouping:",",decimal:".",precision:1},BWP:{symbol:"P",grouping:",",decimal:".",precision:2},BYR:{symbol:"р.",grouping:" ",decimal:",",precision:2},BZD:{symbol:"BZ$",grouping:",",decimal:".",precision:2},CAD:{symbol:"C$",grouping:",",decimal:".",precision:2},CDF:{symbol:"FC",grouping:",",decimal:".",precision:2},CHF:{symbol:"CHF",grouping:"'",decimal:".",precision:2},CLP:{symbol:"$",grouping:".",decimal:",",precision:2},CNY:{symbol:"¥",grouping:",",decimal:".",precision:2},COP:{symbol:"$",grouping:".",decimal:",",precision:2},CRC:{symbol:"₡",grouping:".",decimal:",",precision:2},CUC:{symbol:"CUC",grouping:",",decimal:".",precision:2},CUP:{symbol:"$MN",grouping:",",decimal:".",precision:2},CVE:{symbol:"$",grouping:",",decimal:".",precision:2},CZK:{symbol:"Kč",grouping:" ",decimal:",",precision:2},DJF:{symbol:"Fdj",grouping:",",decimal:".",precision:0},DKK:{symbol:"kr.",grouping:"",decimal:",",precision:2},DOP:{symbol:"RD$",grouping:",",decimal:".",precision:2},DZD:{symbol:"د.ج.‏",grouping:",",decimal:".",precision:2},EGP:{symbol:"ج.م.‏",grouping:",",decimal:".",precision:2},ERN:{symbol:"Nfk",grouping:",",decimal:".",precision:2},ETB:{symbol:"ETB",grouping:",",decimal:".",precision:2},EUR:{symbol:"€",grouping:".",decimal:",",precision:2},FJD:{symbol:"FJ$",grouping:",",decimal:".",precision:2},FKP:{symbol:"£",grouping:",",decimal:".",precision:2},GBP:{symbol:"£",grouping:",",decimal:".",precision:2},GEL:{symbol:"Lari",grouping:" ",decimal:",",precision:2},GHS:{symbol:"₵",grouping:",",decimal:".",precision:2},GIP:{symbol:"£",grouping:",",decimal:".",precision:2},GMD:{symbol:"D",grouping:",",decimal:".",precision:2},GNF:{symbol:"FG",grouping:",",decimal:".",precision:0},GTQ:{symbol:"Q",grouping:",",decimal:".",precision:2},GYD:{symbol:"G$",grouping:",",decimal:".",precision:2},HKD:{symbol:"HK$",grouping:",",decimal:".",precision:2},HNL:{symbol:"L.",grouping:",",decimal:".",precision:2},HRK:{symbol:"kn",grouping:".",decimal:",",precision:2},HTG:{symbol:"G",grouping:",",decimal:".",precision:2},HUF:{symbol:"Ft",grouping:".",decimal:",",precision:0},IDR:{symbol:"Rp",grouping:".",decimal:",",precision:0},ILS:{symbol:"₪",grouping:",",decimal:".",precision:2},INR:{symbol:"₹",grouping:",",decimal:".",precision:2},IQD:{symbol:"د.ع.‏",grouping:",",decimal:".",precision:2},IRR:{symbol:"﷼",grouping:",",decimal:"/",precision:2},ISK:{symbol:"kr.",grouping:".",decimal:",",precision:0},JMD:{symbol:"J$",grouping:",",decimal:".",precision:2},JOD:{symbol:"د.ا.‏",grouping:",",decimal:".",precision:3},JPY:{symbol:"¥",grouping:",",decimal:".",precision:0},KES:{symbol:"S",grouping:",",decimal:".",precision:2},KGS:{symbol:"сом",grouping:" ",decimal:"-",precision:2},KHR:{symbol:"៛",grouping:",",decimal:".",precision:0},KMF:{symbol:"CF",grouping:",",decimal:".",precision:2},KPW:{symbol:"₩",grouping:",",decimal:".",precision:0},KRW:{symbol:"₩",grouping:",",decimal:".",precision:0},KWD:{symbol:"د.ك.‏",grouping:",",decimal:".",precision:3},KYD:{symbol:"$",grouping:",",decimal:".",precision:2},KZT:{symbol:"₸",grouping:" ",decimal:"-",precision:2},LAK:{symbol:"₭",grouping:",",decimal:".",precision:0},LBP:{symbol:"ل.ل.‏",grouping:",",decimal:".",precision:2},LKR:{symbol:"₨",grouping:",",decimal:".",precision:0},LRD:{symbol:"L$",grouping:",",decimal:".",precision:2},LSL:{symbol:"M",grouping:",",decimal:".",precision:2},LYD:{symbol:"د.ل.‏",grouping:",",decimal:".",precision:3},MAD:{symbol:"د.م.‏",grouping:",",decimal:".",precision:2},MDL:{symbol:"lei",grouping:",",decimal:".",precision:2},MGA:{symbol:"Ar",grouping:",",decimal:".",precision:0},MKD:{symbol:"ден.",grouping:".",decimal:",",precision:2},MMK:{symbol:"K",grouping:",",decimal:".",precision:2},MNT:{symbol:"₮",grouping:" ",decimal:",",precision:2},MOP:{symbol:"MOP$",grouping:",",decimal:".",precision:2},MRO:{symbol:"UM",grouping:",",decimal:".",precision:2},MTL:{symbol:"₤",grouping:",",decimal:".",precision:2},MUR:{symbol:"₨",grouping:",",decimal:".",precision:2},MVR:{symbol:"MVR",grouping:",",decimal:".",precision:1},MWK:{symbol:"MK",grouping:",",decimal:".",precision:2},MXN:{symbol:"MX$",grouping:",",decimal:".",precision:2},MYR:{symbol:"RM",grouping:",",decimal:".",precision:2},MZN:{symbol:"MT",grouping:",",decimal:".",precision:0},NAD:{symbol:"N$",grouping:",",decimal:".",precision:2},NGN:{symbol:"₦",grouping:",",decimal:".",precision:2},NIO:{symbol:"C$",grouping:",",decimal:".",precision:2},NOK:{symbol:"kr",grouping:" ",decimal:",",precision:2},NPR:{symbol:"₨",grouping:",",decimal:".",precision:2},NZD:{symbol:"NZ$",grouping:",",decimal:".",precision:2},OMR:{symbol:"﷼",grouping:",",decimal:".",precision:3},PAB:{symbol:"B/.",grouping:",",decimal:".",precision:2},PEN:{symbol:"S/.",grouping:",",decimal:".",precision:2},PGK:{symbol:"K",grouping:",",decimal:".",precision:2},PHP:{symbol:"₱",grouping:",",decimal:".",precision:2},PKR:{symbol:"₨",grouping:",",decimal:".",precision:2},PLN:{symbol:"zł",grouping:" ",decimal:",",precision:2},PYG:{symbol:"₲",grouping:".",decimal:",",precision:2},QAR:{symbol:"﷼",grouping:",",decimal:".",precision:2},RON:{symbol:"lei",grouping:".",decimal:",",precision:2},RSD:{symbol:"Дин.",grouping:".",decimal:",",precision:2},RUB:{symbol:"₽",grouping:" ",decimal:",",precision:2},RWF:{symbol:"RWF",grouping:" ",decimal:",",precision:2},SAR:{symbol:"﷼",grouping:",",decimal:".",precision:2},SBD:{symbol:"S$",grouping:",",decimal:".",precision:2},SCR:{symbol:"₨",grouping:",",decimal:".",precision:2},SDD:{symbol:"LSd",grouping:",",decimal:".",precision:2},SDG:{symbol:"£‏",grouping:",",decimal:".",precision:2},SEK:{symbol:"kr",grouping:",",decimal:".",precision:2},SGD:{symbol:"S$",grouping:",",decimal:".",precision:2},SHP:{symbol:"£",grouping:",",decimal:".",precision:2},SLL:{symbol:"Le",grouping:",",decimal:".",precision:2},SOS:{symbol:"S",grouping:",",decimal:".",precision:2},SRD:{symbol:"$",grouping:",",decimal:".",precision:2},STD:{symbol:"Db",grouping:",",decimal:".",precision:2},SVC:{symbol:"₡",grouping:",",decimal:".",precision:2},SYP:{symbol:"£",grouping:",",decimal:".",precision:2},SZL:{symbol:"E",grouping:",",decimal:".",precision:2},THB:{symbol:"฿",grouping:",",decimal:".",precision:2},TJS:{symbol:"TJS",grouping:" ",decimal:";",precision:2},TMT:{symbol:"m",grouping:" ",decimal:",",precision:0},TND:{symbol:"د.ت.‏",grouping:",",decimal:".",precision:3},TOP:{symbol:"T$",grouping:",",decimal:".",precision:2},TRY:{symbol:"TL",grouping:".",decimal:",",precision:2},TTD:{symbol:"TT$",grouping:",",decimal:".",precision:2},TVD:{symbol:"$T",grouping:",",decimal:".",precision:2},TWD:{symbol:"NT$",grouping:",",decimal:".",precision:2},TZS:{symbol:"TSh",grouping:",",decimal:".",precision:2},UAH:{symbol:"₴",grouping:" ",decimal:",",precision:2},UGX:{symbol:"USh",grouping:",",decimal:".",precision:2},USD:{symbol:"$",grouping:",",decimal:".",precision:2},UYU:{symbol:"$U",grouping:".",decimal:",",precision:2},UZS:{symbol:"сўм",grouping:" ",decimal:",",precision:2},VEB:{symbol:"Bs.",grouping:",",decimal:".",precision:2},VEF:{symbol:"Bs. F.",grouping:".",decimal:",",precision:2},VND:{symbol:"₫",grouping:".",decimal:",",precision:1},VUV:{symbol:"VT",grouping:",",decimal:".",precision:0},WST:{symbol:"WS$",grouping:",",decimal:".",precision:2},XAF:{symbol:"F",grouping:",",decimal:".",precision:2},XCD:{symbol:"$",grouping:",",decimal:".",precision:2},XOF:{symbol:"F",grouping:" ",decimal:",",precision:2},XPF:{symbol:"F",grouping:",",decimal:".",precision:2},YER:{symbol:"﷼",grouping:",",decimal:".",precision:2},ZAR:{symbol:"R",grouping:" ",decimal:",",precision:2},ZMW:{symbol:"ZK",grouping:",",decimal:".",precision:2},WON:{symbol:"₩",grouping:",",decimal:".",precision:2}};function O(e){return y[e]||{symbol:"$",grouping:",",decimal:".",precision:2}}var j,w,C,_,k=n(5),x=n(8),E=n.n(x),S=n(7),P=n.n(S),F=n(3),B=n(9),N=n(14),A=n(15),R=n.n(A),L=n(10),T=n.n(L),D=n(28),I=n.n(D),M=n(29),$=n.n(M);j={"(":9,"!":8,"*":7,"/":7,"%":7,"+":6,"-":6,"<":5,"<=":5,">":5,">=":5,"==":4,"!=":4,"&&":3,"||":2,"?":1,"?:":1},w=["(","?"],C={")":["("],":":["?","?:"]},_=/<=|>=|==|!=|&&|\|\||\?:|\(|!|\*|\/|%|\+|-|<|>|\?|\)|:/;var U={"!":function(e){return!e},"*":function(e,t){return e*t},"/":function(e,t){return e/t},"%":function(e,t){return e%t},"+":function(e,t){return e+t},"-":function(e,t){return e-t},"<":function(e,t){return e<t},"<=":function(e,t){return e<=t},">":function(e,t){return e>t},">=":function(e,t){return e>=t},"==":function(e,t){return e===t},"!=":function(e,t){return e!==t},"&&":function(e,t){return e&&t},"||":function(e,t){return e||t},"?:":function(e,t,n){if(e)throw t;return n}};function K(e){var t=function(e){for(var t,n,r,o,i=[],c=[];t=e.match(_);){for(n=t[0],(r=e.substr(0,t.index).trim())&&i.push(r);o=c.pop();){if(C[n]){if(C[n][0]===o){n=C[n][1]||n;break}}else if(w.indexOf(o)>=0||j[o]<j[n]){c.push(o);break}i.push(o)}C[n]||c.push(n),e=e.substr(t.index+n.length)}return(e=e.trim())&&i.push(e),i.concat(c.reverse())}(e);return function(e){return function(e,t){var n,r,o,i,c,s,l=[];for(n=0;n<e.length;n++){if(c=e[n],i=U[c]){for(r=i.length,o=Array(r);r--;)o[r]=l.pop();try{s=i.apply(null,o)}catch(a){return a}}else s=t.hasOwnProperty(c)?t[c]:+c;l.push(s)}return l[0]}(t,e)}}var G={contextDelimiter:"",onMissingKey:null};function V(e,t){var n;for(n in this.data=e,this.pluralForms={},this.options={},G)this.options[n]=void 0!==t&&n in t?t[n]:G[n]}V.prototype.getPluralForm=function(e,t){var n,r,o,i,c=this.pluralForms[e];return c||("function"!=typeof(o=(n=this.data[e][""])["Plural-Forms"]||n["plural-forms"]||n.plural_forms)&&(r=function(e){var t,n,r;for(t=e.split(";"),n=0;n<t.length;n++)if(0===(r=t[n].trim()).indexOf("plural="))return r.substr(7)}(n["Plural-Forms"]||n["plural-forms"]||n.plural_forms),i=K(r),o=function(e){return+i({n:e})}),c=this.pluralForms[e]=o),c(t)},V.prototype.dcnpgettext=function(e,t,n,r,o){var i,c,s;return i=void 0===o?0:this.getPluralForm(e,o),c=n,t&&(c=t+this.options.contextDelimiter+n),(s=this.data[e][c])&&s[i]?s[i]:(this.options.onMissingKey&&this.options.onMissingKey(n,e),0===i?n:r)};var H=n(30),W=n.n(H),z=n(31),Z=n.n(z),Y=n(20),J=/%(((\d+)\$)|(\(([$_a-zA-Z][$_a-zA-Z0-9]*)\)))?[ +0#-]*\d*(\.(\d+|\*))?(ll|[lhqL])?([cduxXefgsp%])/g;function q(e,t){var n;if(!Array.isArray(t))for(t=new Array(arguments.length-1),n=1;n<arguments.length;n++)t[n-1]=arguments[n];return n=1,e.replace(J,(function(){var e,r,o,i,c;return e=arguments[3],r=arguments[5],"%"===(i=arguments[9])?"%":("*"===(o=arguments[7])&&(o=t[n-1],n++),void 0!==r?t[0]&&"object"==typeof t[0]&&t[0].hasOwnProperty(r)&&(c=t[0][r]):(void 0===e&&(e=n),n++,c=t[e-1]),"f"===i?c=parseFloat(c)||0:"d"===i&&(c=parseInt(c)||0),void 0!==o&&("f"===i?c=c.toFixed(o):"s"===i&&(c=c.substr(0,o))),null!=c?c:"")}))}
20
  /*
21
  * Exposes number format capability
22
  *
23
  * @copyright Copyright (c) 2013 Kevin van Zonneveld (http://kvz.io) and Contributors (http://phpjs.org/authors).
24
  * @license See CREDITS.md
25
  * @see https://github.com/kvz/phpjs/blob/ffe1356af23a6f2512c84c954dd4e828e92579fa/functions/strings/number_format.js
26
+ */function X(e,t,n,r){e=(e+"").replace(/[^0-9+\-Ee.]/g,"");var o=isFinite(+e)?+e:0,i=isFinite(+t)?Math.abs(t):0,c=void 0===r?",":r,s=void 0===n?".":n,l="";return(l=(i?function(e,t){var n=Math.pow(10,t);return""+(Math.round(e*n)/n).toFixed(t)}(o,i):""+Math.round(o)).split("."))[0].length>3&&(l[0]=l[0].replace(/\B(?=(?:\d{3})+(?!\d))/g,c)),(l[1]||"").length<i&&(l[1]=l[1]||"",l[1]+=new Array(i-l[1].length+1).join("0")),l.join(s)}var Q=I()("i18n-calypso"),ee="number_format_decimals",te="number_format_thousands_sep",ne="messages",re=[function(e){return e}],oe={};function ie(){ue.throwErrors&&"undefined"!=typeof window&&window.console&&window.console.warn&&window.console.warn.apply(window.console,arguments)}function ce(e){return Array.prototype.slice.call(e)}function se(e){var t=e[0];("string"!=typeof t||e.length>3||e.length>2&&"object"==typeof e[1]&&"object"==typeof e[2])&&ie("Deprecated Invocation: `translate()` accepts ( string, [string], [object] ). These arguments passed:",ce(e),". See https://github.com/Automattic/i18n-calypso#translate-method"),2===e.length&&"string"==typeof t&&"string"==typeof e[1]&&ie("Invalid Invocation: `translate()` requires an options object for plural translations, but passed:",ce(e));for(var n={},r=0;r<e.length;r++)"object"==typeof e[r]&&(n=e[r]);if("string"==typeof t?n.original=t:"object"==typeof n.original&&(n.plural=n.original.plural,n.count=n.original.count,n.original=n.original.single),"string"==typeof e[1]&&(n.plural=e[1]),void 0===n.original)throw new Error("Translate called without a `string` value as first argument.");return n}function le(e,t){return e.dcnpgettext(ne,t.context,t.original,t.plural,t.count)}function ae(e,t){for(var n=re.length-1;n>=0;n--){var r=re[n](Object.assign({},t)),o=r.context?r.context+""+r.original:r.original;if(e.state.locale[o])return le(e.state.tannin,r)}return null}function ue(){if(!(this instanceof ue))return new ue;this.defaultLocaleSlug="en",this.defaultPluralForms=function(e){return 1===e?0:1},this.state={numberFormatSettings:{},tannin:void 0,locale:void 0,localeSlug:void 0,textDirection:void 0,translations:W()({max:100})},this.componentUpdateHooks=[],this.translateHooks=[],this.stateObserver=new Y.EventEmitter,this.stateObserver.setMaxListeners(0),this.configure()}ue.throwErrors=!1,ue.prototype.on=function(){var e;(e=this.stateObserver).on.apply(e,arguments)},ue.prototype.off=function(){var e;(e=this.stateObserver).off.apply(e,arguments)},ue.prototype.emit=function(){var e;(e=this.stateObserver).emit.apply(e,arguments)},ue.prototype.numberFormat=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n="number"==typeof t?t:t.decimals||0,r=t.decPoint||this.state.numberFormatSettings.decimal_point||".",o=t.thousandsSep||this.state.numberFormatSettings.thousands_sep||",";return X(e,n,r,o)},ue.prototype.configure=function(e){Object.assign(this,e||{}),this.setLocale()},ue.prototype.setLocale=function(e){var t,n,r;if(e&&e[""]&&e[""]["key-hash"]){var o=e[""]["key-hash"],i=function(e,t){var n=!1===t?"":String(t);if(void 0!==oe[n+e])return oe[n+e];var r=Z()().update(e).digest("hex");return oe[n+e]=t?r.substr(0,t):r},c=function(e){return function(t){return t.context?(t.original=i(t.context+String.fromCharCode(4)+t.original,e),delete t.context):t.original=i(t.original,e),t}};if("sha1"===o.substr(0,4))if(4===o.length)re.push(c(!1));else{var s=o.substr(5).indexOf("-");if(s<0){var l=Number(o.substr(5));re.push(c(l))}else for(var a=Number(o.substr(5,s)),u=Number(o.substr(6+s)),p=a;p<=u;p++)re.push(c(p))}}if(e&&e[""].localeSlug)if(e[""].localeSlug===this.state.localeSlug){if(e===this.state.locale)return;Object.assign(this.state.locale,e)}else this.state.locale=Object.assign({},e);else this.state.locale={"":{localeSlug:this.defaultLocaleSlug,plural_forms:this.defaultPluralForms}};this.state.localeSlug=this.state.locale[""].localeSlug,this.state.textDirection=(null===(t=this.state.locale["text directionltr"])||void 0===t?void 0:t[0])||(null===(n=this.state.locale[""])||void 0===n||null===(r=n.momentjs_locale)||void 0===r?void 0:r.textDirection),this.state.tannin=new V(T()({},ne,this.state.locale)),this.state.numberFormatSettings.decimal_point=le(this.state.tannin,se([ee])),this.state.numberFormatSettings.thousands_sep=le(this.state.tannin,se([te])),this.state.numberFormatSettings.decimal_point===ee&&(this.state.numberFormatSettings.decimal_point="."),this.state.numberFormatSettings.thousands_sep===te&&(this.state.numberFormatSettings.thousands_sep=","),this.stateObserver.emit("change")},ue.prototype.getLocale=function(){return this.state.locale},ue.prototype.getLocaleSlug=function(){return this.state.localeSlug},ue.prototype.isRtl=function(){return"rtl"===this.state.textDirection},ue.prototype.addTranslations=function(e){for(var t in e)""!==t&&(this.state.tannin.data.messages[t]=e[t]);this.stateObserver.emit("change")},ue.prototype.hasTranslation=function(){return!!ae(this,se(arguments))},ue.prototype.translate=function(){var e=se(arguments),t=ae(this,e);if(t||(t=le(this.state.tannin,e)),e.args){var n=Array.isArray(e.args)?e.args.slice(0):[e.args];n.unshift(t);try{t=q.apply(void 0,R()(n))}catch(o){if(!window||!window.console)return;var r=this.throwErrors?"error":"warn";"string"!=typeof o?window.console[r](o):window.console[r]("i18n sprintf error:",n)}}return e.components&&(t=$()({mixedString:t,components:e.components,throwErrors:this.throwErrors})),this.translateHooks.forEach((function(n){t=n(t,e)})),t},ue.prototype.reRenderTranslations=function(){Q("Re-rendering all translations due to external request"),this.stateObserver.emit("change")},ue.prototype.registerComponentUpdateHook=function(e){this.componentUpdateHooks.push(e)},ue.prototype.registerTranslateHook=function(e){this.translateHooks.push(e)};var pe=ue,de=n(32),me=n.n(de),fe=n(33),ge=n.n(fe),be=n(18),he=n.n(be),ve=n(34),ye=n.n(ve),Oe=n(35),je=n.n(Oe),we=n(11),Ce=n.n(we),_e=n(36);var ke,xe,Ee=new pe,Se=Ee.numberFormat.bind(Ee),Pe=(Ee.translate.bind(Ee),Ee.configure.bind(Ee),Ee.setLocale.bind(Ee),Ee.getLocale.bind(Ee),Ee.getLocaleSlug.bind(Ee),Ee.addTranslations.bind(Ee),Ee.reRenderTranslations.bind(Ee),Ee.registerComponentUpdateHook.bind(Ee),Ee.registerTranslateHook.bind(Ee),Ee.state,Ee.stateObserver,Ee.on.bind(Ee),Ee.off.bind(Ee),Ee.emit.bind(Ee),xe={numberFormat:(ke=Ee).numberFormat.bind(ke),translate:ke.translate.bind(ke)},function(e){function t(){var t=e.translate.bind(e);return Object.defineProperty(t,"localeSlug",{get:e.getLocaleSlug.bind(e)}),t}}(Ee),function(e){var t={getCurrentValue:function(){return e.isRtl()},subscribe:function(t){return e.on("change",t),function(){return e.off("change",t)}}};function n(){return Object(_e.useSubscription)(t)}var r=Object(B.createHigherOrderComponent)((function(e){return Object(we.forwardRef)((function(t,r){var o=n();return Ce.a.createElement(e,E()({},t,{isRtl:o,ref:r}))}))}),"WithRTL");return{useRtl:n,withRtl:r}}(Ee));Pe.useRtl,Pe.withRtl;function Fe(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=O(t);if(!r||isNaN(e))return null;var o=p()(p()({},r),n),i=o.decimal,c=o.grouping,s=o.precision,l=o.symbol,a=e<0?"-":"",u=Se(Math.abs(e),{decimals:s,thousandsSep:c,decPoint:i});return n.stripZeros&&(u=Be(u,i)),"".concat(a).concat(l).concat(u)}function Be(e,t){var n=new RegExp("\\".concat(t,"0+$"));return e.replace(n,"")}function Ne(e){var t=e.className,n=e.tab,r=e.label,o=e.selectedTab,i=e.onSelected,c=(n.id===o.id?["is-pressed","is-active"]:[]).concat([t,"components-button","components-tab-button"]);return Object(h.createElement)("button",{type:"button",onClick:function(){return i(n)},className:c.join(" ")},r)}function Ae(e){var t=e.className,n=e.tabs,r=e.selectedTab,o=e.onSelected,i=e.selectBlock;return Object(h.createElement)("div",{className:"premium-content-tabs block-editor-block-toolbar"},n.map((function(n){return Object(h.createElement)(Ne,E()({key:n.id},e,{tab:n,selectedTab:r,className:"".concat(t,"--tab"),label:n.label,onSelected:o}))})),Object(h.createElement)("button",{onClick:function(){Object(k.select)("core/edit-post").isEditorSidebarOpened()||Object(k.dispatch)("core/edit-post").openGeneralSidebar("edit-post/block"),i()},className:"edit components-button is-button is-secondary"},Object(v.__)("Edit","full-site-editing")))}function Re(){return Object(h.createElement)("div",{className:"premium-content-wrapper"},Object(h.createElement)(b.InnerBlocks,{allowedBlocks:["premium-content/subscriber-view","premium-content/logged-out-view"],templateLock:"all",template:[["premium-content/subscriber-view"],["premium-content/logged-out-view"]]}))}function Le(e){var t=e.className,n=e.plan,r=e.selectedPlan,o=e.onSelected,i=e.onClose,c=e.getPlanDescription,s=r&&n.id===r.id,l=(s?["is-selected"]:[]).concat([t]).join(" "),a=s?"yes":void 0,u=null;return n&&(u=" "+c(n)),Object(h.createElement)(F.MenuItem,{onClick:function(e){e.preventDefault(),o(n),i()},className:l,key:n.id,value:n.id,selected:s,icon:a},n.title," : ",u)}function Te(e){var t=e.plans,n=e.selectedPlan,r=e.onSelected;return Object(h.createElement)(F.MenuGroup,null,t.map((function(t){return Object(h.createElement)(Le,E()({},e,{key:t.id,selectedPlan:n,onSelected:r,plan:t}))})))}function De(e){return Object(h.createElement)(F.MenuGroup,null,Object(h.createElement)(F.MenuItem,{onClick:function(t){t.preventDefault(),Object(k.select)("core/edit-post").isEditorSidebarOpened()||Object(k.dispatch)("core/edit-post").openGeneralSidebar("edit-post/block");var n=document.getElementById("new-plan-name");null!==n&&n.focus(),e.onClose()}},Object(v.__)("Add a new subscription","full-site-editing")))}function Ie(e){var t=e.selectedPlanId,n=e.onSelected,r=e.plans,o=e.getPlanDescription,i=r.find((function(e){return e.id===t})),c=null;return i&&(c=" "+o(i)),Object(h.createElement)(b.BlockControls,null,Object(h.createElement)(F.Toolbar,null,Object(h.createElement)(F.DropdownMenu,{icon:Object(h.createElement)(h.Fragment,null,Object(h.createElement)(F.Dashicon,{icon:"update"})," ",c&&Object(h.createElement)(h.Fragment,null,c)),label:Object(v.__)("Select a plan","full-site-editing"),className:"premium-content-toolbar-button"},(function(t){var r=t.onClose;return Object(h.createElement)(h.Fragment,null,Object(h.createElement)(Te,E()({},e,{onSelected:n,onClose:r,selectedPlan:i})),Object(h.createElement)(De,E()({},e,{onClose:r})))}))))}function Me(e){var t=Object(h.useState)(0),n=P()(t,2),r=n[0],o=n[1],i=e.attributes,c=e.setAttributes,s=e.className,l=e.savePlan,a=(e.currencies,e.siteSlug);return Object(h.createElement)(b.InspectorControls,null,a&&Object(h.createElement)(F.ExternalLink,{href:"https://wordpress.com/earn/payments/".concat(a),className:"wp-block-premium-content-container---link-to-earn"},Object(v.__)("Manage your subscriptions.","full-site-editing")),Object(h.createElement)(F.PanelBody,{title:"Add a new subscription",initialOpen:!0,className:"".concat(s,"---settings-add_plan")},1===r&&Object(h.createElement)(F.Placeholder,{icon:"lock",label:Object(v.__)("Premium Content","full-site-editing"),instructions:Object(v.__)("Saving plan…","full-site-editing")},Object(h.createElement)(F.Spinner,null)),0===r&&Object(h.createElement)("div",null,Object(h.createElement)(F.PanelRow,{className:"plan-name"},Object(h.createElement)(F.TextControl,{id:"new-plan-name",label:"Name",value:i.newPlanName,onChange:function(e){return c({newPlanName:e})}})),Object(h.createElement)(F.PanelRow,{className:"plan-price"},Object(h.createElement)(F.SelectControl,{label:"Currency",onChange:function(e){return c({newPlanCurrency:e})},value:i.newPlanCurrency,options:Qe}),Object(h.createElement)(F.TextControl,{label:"Price",value:i.newPlanPrice,onChange:function(e){return c({newPlanPrice:parseFloat(e)})},type:"number"})),Object(h.createElement)(F.PanelRow,{className:"plan-interval"},Object(h.createElement)(F.SelectControl,{label:"Interval",onChange:function(e){return c({newPlanInterval:e})},value:i.newPlanInterval,options:[{label:"Month",value:"1 month"},{label:"Year",value:"1 year"}]})),Object(h.createElement)(F.PanelRow,null,Object(h.createElement)(F.Button,{isSecondary:!0,isLarge:!0,onClick:function(t){t.preventDefault(),o(1),l(e.attributes,(function(e){o(0),e&&(c({newPlanPrice:5}),c({newPlanName:""}))}))}},Object(v.__)("Add subscription","full-site-editing"))))))}var $e=Object(B.compose)([Object(k.withDispatch)((function(e,t){var n,r=t.stripeConnectUrl;return{autosaveAndRedirect:(n=a()(regeneratorRuntime.mark((function t(n){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n.preventDefault(),t.next=3,e("core/editor").savePost();case 3:window.top.location.href=r;case 4:case"end":return t.stop()}}),t)}))),function(e){return n.apply(this,arguments)})}}))])((function(e){var t=e.autosaveAndRedirect,n=e.stripeConnectUrl;return Object(h.createElement)(b.Warning,{actions:n&&[Object(h.createElement)(F.Button,{key:"connect",href:n,onClick:t,target:"_top",isDefault:!0,className:"premium-content-block-nudge__button stripe-nudge__button"},Object(v.__)("Connect","full-site-editing"))],className:"premium-content-block-nudge"},Object(h.createElement)("span",{className:"premium-content-block-nudge__info"},Object(h.createElement)(F.Dashicon,{icon:"star-filled"}),Object(h.createElement)("span",{className:"premium-content-block-nudge__text-container"},Object(h.createElement)("span",{className:"premium-content-block-nudge__title"},Object(v.__)("Connect to Stripe to use this block on your site","full-site-editing")),Object(h.createElement)("span",{className:"premium-content-block-nudge__message"},Object(v.__)("This block will be hidden from your visitors until you connect to Stripe.","full-site-editing")))))})),Ue={selectedTab:{id:"",className:"",label:Object(h.createElement)(h.Fragment,null)},stripeNudge:null},Ke=Object(h.createContext)(Ue),Ge=[{id:"premium",label:Object(h.createElement)("span",null,Object(v.__)("Subscriber View","full-site-editing")),className:"wp-premium-content-subscriber-view"},{id:"wall",label:Object(h.createElement)("span",null,Object(v.__)("Non-subscriber View","full-site-editing")),className:"wp-premium-content-logged-out-view"}],Ve=[];function He(e,t){var n=e.noticeOperations;n.removeAllNotices(),n.createErrorNotice(t)}var We=Object(B.compose)([Object(k.withSelect)((function(e){return{postId:(0,e("core/editor").getCurrentPostId)()}})),F.withNotices,Object(k.withDispatch)((function(e,t){var n=e("core/block-editor");return{selectBlock:function(){n.selectBlock(t.clientId)}}}))])((function(e){var t=Object(h.useState)(Ge[1]),n=P()(t,2),r=n[0],o=n[1],i=Object(h.useState)(!1),c=P()(i,2),s=c[0],l=c[1],a=Object(h.useState)(Ve),u=P()(a,2),p=u[0],d=u[1],m=Object(h.useState)(null),g=P()(m,2),b=g[0],y=g[1],O=Object(h.useState)(0),j=P()(O,2),w=j[0],C=j[1],_=Object(h.useState)(!1),k=P()(_,2),x=k[0],S=k[1],B=Object(h.useState)(""),A=P()(B,2),R=A[0],L=A[1],T=Object(h.useState)(""),D=P()(T,2),I=D[0],M=D[1];function $(t,n){if(!t.newPlanName||0===t.newPlanName.length)return He(e,Object(v.__)("Plan requires a name","full-site-editing")),void n(!1);var r=parseFloat(t.newPlanPrice),o=et(t.newPlanCurrency),i=Object(v.sprintf)(Object(v.__)("Minimum allowed price is %s.","full-site-editing"),Fe(o,t.newPlanCurrency));if(r<o)return He(e,i),void n(!1);if(!tt(t.newPlanCurrency,r))return He(e,Object(v.__)("Plan requires a valid price","full-site-editing")),void n(!1);var c={path:"/wpcom/v2/memberships/product",method:"POST",data:{currency:t.newPlanCurrency,price:t.newPlanPrice,title:t.newPlanName,interval:t.newPlanInterval}};f()(c).then((function(t){var r={id:t.id,title:t.title,interval:t.interval,price:t.price,currency:t.currency};d(p.concat([r])),U(r),function(e,t){var n=e.noticeOperations;n.removeAllNotices(),n.createNotice({status:"info",content:t})}(e,Object(v.__)("Successfully created plan","full-site-editing")),n&&n(!0)}),(function(){He(e,Object(v.__)("There was an error when adding the plan.","full-site-editing")),n&&n(!1)}))}function U(t){e.setAttributes({selectedPlanId:t.id})}var K=Object(h.useRef)(null);!function(e,t){function n(n){e.current&&n.target&&n.target instanceof Node&&!e.current.contains(n.target)?t(!1):t(!0)}Object(h.useEffect)((function(){return document.addEventListener("mousedown",n),function(){document.removeEventListener("mousedown",n)}}))}(K,l);var G=e.isSelected,V=e.className;if(Object(h.useEffect)((function(){var t=Object(N.getQueryArg)(window.location.href,"origin"),n={path:Object(N.addQueryArgs)("/wpcom/v2/memberships/status",{source:"https://wordpress.com"===t?"gutenberg-wpcom":"gutenberg"}),method:"GET"};f()(n).then((function(t){if(t||"object"==typeof t){if(t.errors&&Object.values(t.errors)&&Object.values(t.errors)[0][0])return C(2),void He(e,Object.values(t.errors)[0][0]);y(t.connect_url),S(t.should_upgrade_to_access_memberships),L(t.upgrade_url),M(t.site_slug),t.products&&0===t.products.length&&!t.should_upgrade_to_access_memberships&&t.connected_account_id?$({newPlanCurrency:"USD",newPlanPrice:5,newPlanName:Object(v.__)("Monthly Subscription","full-site-editing"),newPlanInterval:"1 month"},(function(){C(t.connected_account_id?1:2)})):(t.products&&t.products.length>0&&(d(t.products),e.attributes.selectedPlanId||U(t.products[0])),C(t.connected_account_id?1:2))}}),(function(t){y(null),C(2),He(e,t.message)})),setTimeout((function(){return e.selectBlock()}),1e3)}),[]),0===w)return Object(h.createElement)("div",{className:V,ref:K},e.noticeUI,Object(h.createElement)(F.Placeholder,{icon:"lock",label:Object(v.__)("Premium Content","full-site-editing"),instructions:Object(v.__)("Loading data…","full-site-editing")},Object(h.createElement)(F.Spinner,null)));if(x)return Object(h.createElement)("div",{className:V,ref:K},e.noticeUI,Object(h.createElement)(F.Placeholder,{icon:"lock",label:Object(v.__)("Premium Content","full-site-editing"),instructions:Object(v.__)("You'll need to upgrade your plan to use the Premium Content block.","full-site-editing")},Object(h.createElement)(F.Button,{isSecondary:!0,isLarge:!0,href:R,target:"_blank",className:"premium-content-block-nudge__button plan-nudge__button"},Object(v.__)("Upgrade Your Plan","full-site-editing")),Object(h.createElement)("div",{className:"membership-button__disclaimer"},Object(h.createElement)(F.ExternalLink,{href:"https://wordpress.com/support/premium-content-block/"},Object(v.__)("Read more about Premium Content and related fees.","full-site-editing")))));var H=null;if(!x&&1!==w&&b){var W=function(e,t){var n,r=e.postId;if(!Object(N.isURL)(t))return null;if(!r)return t;try{var o=Object(N.getQueryArg)(t,"state");"string"==typeof o&&(n=JSON.parse(window.atob(o)))}catch(i){return t}return n.from_editor_post_id=r,Object(N.addQueryArgs)(t,{state:window.btoa(JSON.stringify(n))})}(e,b);H=Object(h.createElement)($e,E()({},e,{stripeConnectUrl:W}))}return Object(h.createElement)("div",{className:V,ref:K},e.noticeUI,(G||s)&&1===w&&Object(h.createElement)(Ie,E()({},e,{plans:p,selectedPlanId:e.attributes.selectedPlanId,onSelected:U,getPlanDescription:function(e){var t=Fe(parseFloat(e.price),e.currency);return"1 month"===e.interval?Object(v.sprintf)(Object(v.__)("%s / month","full-site-editing"),t):"1 year"===e.interval?Object(v.sprintf)(Object(v.__)("%s / year","full-site-editing"),t):"one-time"===e.interval?t:Object(v.sprintf)(Object(v.__)("%1$s / %2$s","full-site-editing"),t,e.interval)}})),(G||s)&&1===w&&Object(h.createElement)(Me,E()({},e,{savePlan:$,siteSlug:I})),(G||s)&&Object(h.createElement)(Ae,E()({},e,{tabs:Ge,selectedTab:r,onSelected:o})),Object(h.createElement)(Ke.Provider,{value:{selectedTab:r,stripeNudge:H}},Object(h.createElement)(Re,null)))}));function ze(){for(var e=Object(g.getCategories)(),t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];for(var o=function(){var t=c[i];if(e.some((function(e){return e.slug===t})))return{v:t}},i=0,c=n;i<c.length;i++){var s=o();if("object"==typeof s)return s.v}throw new Error("Could not find a category from the provided list: ".concat(n.join(",")))}var Ze="premium-content/container",Ye=ze("design","common"),Je=function e(t){return 0===t.name.indexOf("premium-content/")||t.innerBlocks.some(e)},qe={name:Ze,attributes:{newPlanName:{type:"string",default:"Monthly Subscription"},newPlanCurrency:{type:"string",default:"USD"},newPlanPrice:{type:"number",default:5},newPlanInterval:{type:"string",default:"1 month"},selectedPlanId:{type:"number",default:0}},title:Object(v.__)("Premium Content","full-site-editing"),description:Object(v.__)("Restrict access to your content for paying subscribers.","full-site-editing"),category:Ye,icon:Object(h.createElement)("svg",{width:"25",height:"24",viewBox:"0 0 25 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Object(h.createElement)("path",{d:"M12.7439 14.4271L8.64053 13.165L8.51431 13.8718L8.09208 20.7415C8.06165 21.2365 8.61087 21.5526 9.02363 21.2776L12.7439 18.799L16.7475 21.304C17.1687 21.5676 17.7094 21.2343 17.6631 20.7396L17.0212 13.8718L17.0212 13.165L12.7439 14.4271Z",fill:"black"}),Object(h.createElement)("circle",{cx:"12.7439",cy:"8.69796",r:"5.94466",stroke:"black",strokeWidth:"1.5",fill:"none"}),Object(h.createElement)("path",{d:"M9.71023 8.12461L11.9543 10.3687L15.7776 6.54533",stroke:"black",strokeWidth:"1.5",fill:"none"})),supports:{html:!1},transforms:{from:[{type:"block",isMultiBlock:!0,blocks:["*"],__experimentalConvert:function(e){if(!e.some(Je)&&(t=e[0],!(0,(n=Object(k.select)("core/block-editor")).getBlocksByClientId)((0,n.getBlockParents)(t.clientId)).find((function(e){return 0===e.name.indexOf("premium-content/")})))){var t,n,r=e.map((function(e){return Object(g.createBlock)(e.name,e.attributes,e.innerBlocks)}));return Object(g.createBlock)("premium-content/container",{},[Object(g.createBlock)("premium-content/subscriber-view",{},r),Object(g.createBlock)("premium-content/logged-out-view")])}}}]},keywords:["premium-content",Object(v.__)("premium","full-site-editing"),Object(v.__)("paywall","full-site-editing")],edit:We,save:function(){return Object(h.createElement)("div",{className:"wp-block-premium-content-container"},Object(h.createElement)(b.InnerBlocks.Content,null))},providesContext:{"premium-content/planId":"selectedPlanId"}},Xe={USD:.5,AUD:.5,BRL:.5,CAD:.5,CHF:.5,DKK:2.5,EUR:.5,GBP:.3,HKD:4,INR:.5,JPY:50,MXN:10,NOK:3,NZD:.5,PLN:2,SEK:3,SGD:.5},Qe=Object.keys(Xe).map((function(e){var t=O(e).symbol;return{value:e,label:t===e?e:"".concat(e," ").concat(Object(d.trimEnd)(t,"."))}}));function et(e){return Xe[e]}function tt(e,t){return!isNaN(t)&&t>=et(e)}var nt=Object(B.compose)([Object(k.withSelect)((function(e,t){return{hasInnerBlocks:!!e("core/block-editor").getBlocksByClientId(t.clientId)[0].innerBlocks.length}}))])((function(e){return Object(h.createElement)(Ke.Consumer,null,(function(t){var n=t.selectedTab,r=t.stripeNudge;return Object(h.createElement)("div",{hidden:"wall"===n.id,className:n.className},r,Object(h.createElement)(b.InnerBlocks,{renderAppender:!e.hasInnerBlocks&&b.InnerBlocks.ButtonBlockAppender,templateLock:!1,template:[["core/paragraph",{placeholder:Object(v.__)("Insert the piece of content you want your visitors to see after they subscribe.","full-site-editing")}]]}))}))}));var rt="premium-content/subscriber-view",ot=ze("design","common"),it={name:rt,category:ot,attributes:{},title:Object(v.__)("Subscriber View","full-site-editing"),description:Object(v.__)("Subscriber View.","full-site-editing"),parent:["premium-content/container"],supports:{inserter:!1,html:!1},edit:nt,save:function(){return Object(h.createElement)("div",{className:"wp-block-premium-content-subscriber-view"},Object(h.createElement)(b.InnerBlocks.Content,null))}},ct=function(){return Object(h.createElement)(Ke.Consumer,null,(function(e){var t=e.selectedTab,n=e.stripeNudge;return Object(h.createElement)("div",{hidden:"premium"===t.id,className:t.className},n,Object(h.createElement)(b.InnerBlocks,{templateLock:!1,template:[["core/heading",{content:Object(v.__)("Subscribe to get access","full-site-editing"),level:3}],["core/paragraph",{content:Object(v.__)("Read more of this content when you subscribe today.","full-site-editing")}],["premium-content/buttons"]]}))}))};var st=[{attributes:{subscribeButtonText:{type:"string",default:"Subscribe"},loginButtonText:{type:"string",default:"Log In"},buttonClasses:{type:"string",default:""},backgroundButtonColor:{type:"string",default:""},textButtonColor:{type:"string",default:""},customBackgroundButtonColor:{type:"string",default:""},customTextButtonColor:{type:"string",default:""}},isEligible:function(e){return!!e.buttonClasses},migrate:function(e,t){var n=Object(g.createBlock)("premium-content/buttons",{},[Object(g.createBlock)("jetpack/recurring-payments",{submitButtonText:e.subscribeButtonText,backgroundButtonColor:e.backgroundButtonColor,textButtonColor:e.textButtonColor,customBackgroundButtonColor:e.customBackgroundButtonColor,customTextButtonColor:e.customTextButtonColor}),Object(g.createBlock)("premium-content/login-button",{text:e.loginButtonText,backgroundColor:e.backgroundButtonColor,textColor:e.textButtonColor,style:{color:{background:e.customBackgroundButtonColor,text:e.customTextButtonColor}}})]);return[e,[].concat(R()(t),[n])]},save:function(){return Object(h.createElement)("div",{className:"wp-block-premium-content-logged-out-view"},Object(h.createElement)(b.InnerBlocks.Content,null))}}],lt=n(21),at="premium-content/logged-out-view",ut=ze("design","common"),pt={name:at,category:ut,attributes:{},title:Object(v.__)("Logged Out View","full-site-editing"),description:Object(v.__)("Logged Out View.","full-site-editing"),parent:["premium-content/container"],supports:{inserter:!1,html:!1},edit:ct,save:function(){return Object(h.createElement)("div",{className:"wp-block-premium-content-logged-out-view"},Object(h.createElement)(b.InnerBlocks.Content,null))},deprecated:st},dt=Object(k.subscribe)((function(){var e=Object(k.select)("core/rich-text").getFormatType("core/link");if(e){dt(),Object(lt.unregisterFormatType)("core/link");var t=Object(B.compose)(Object(k.withSelect)((function(e){return{selectedBlock:e("core/block-editor").getSelectedBlock()}})),Object(B.ifCondition)((function(e){return e.selectedBlock&&e.selectedBlock.name!==at})))(e.edit);Object(lt.registerFormatType)("core/link",p()(p()({},e),{},{edit:t}))}})),mt=n(22),ft=Object(h.createElement)(mt.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(h.createElement)(mt.Path,{d:"M19 6.5H5c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-7c0-1.1-.9-2-2-2zm.5 9c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-7c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v7zM8 13h8v-1.5H8V13z"})),gt=n(37),bt=["core/button","jetpack/recurring-payments","premium-content/login-button"],ht={isEmbedButton:!0};var vt=Object(B.compose)([Object(k.withSelect)((function(e,t){var n=e("core/block-editor").getBlock(t.clientId).innerBlocks.find((function(e){return"jetpack/recurring-payments"===e.name}));return{subscribeButton:n,jetpackButton:e("core/block-editor").getBlock(n.clientId).innerBlocks.find((function(e){return"jetpack/button"===e.name}))}})),Object(k.withDispatch)((function(e,t){return{setSubscribeButtonPlan:function(n){e("core/block-editor").updateBlockAttributes(t.subscribeButton.clientId,{planId:n})},setSubscribeButtonText:function(n){e("core/block-editor").updateBlockAttributes(t.jetpackButton.clientId,{text:n})}}}))])((function(e){var t=e.context,n=e.jetpackButton,r=e.subscribeButton,o=e.setSubscribeButtonText,i=e.setSubscribeButtonPlan,c=t?t["premium-content/planId"]:null,s=[["jetpack/recurring-payments",{planId:c,submitButtonText:Object(v.__)("Subscribe","full-site-editing")}],["premium-content/login-button"]];return Object(h.useEffect)((function(){c&&r&&r.attributes.planId!==c&&i(c)}),[c,r]),Object(h.useEffect)((function(){r&&Object(gt.addFilter)("jetpack.RecurringPayments.showControls","full-site-editing/premium-content-hide-recurring-payments-controls",(function(e,t){return t!==r.clientId&&e}))}),[r]),Object(h.useEffect)((function(){n&&o(Object(v.__)("Subscribe","full-site-editing"))}),[n,o]),Object(h.createElement)(b.__experimentalBlock.div,{className:"wp-block-buttons"},Object(h.createElement)(b.__experimentalAlignmentHookSettingsProvider,{value:ht},Object(h.createElement)(b.InnerBlocks,{allowedBlocks:bt,template:s,__experimentalMoverDirection:"horizontal"})))}));var yt="premium-content/buttons",Ot=ze("design","common"),jt={name:yt,category:Ot,title:Object(v.__)("Premium Content buttons","full-site-editing"),description:Object(v.__)("Prompt Premium Content visitors to take action with a group of button-style links.","full-site-editing"),icon:ft,supports:{align:!0,alignWide:!1,lightBlockWrapper:!0},keywords:[Object(v.__)("link","full-site-editing")],edit:vt,save:function(){return Object(h.createElement)("div",{className:"wp-block-buttons"},Object(h.createElement)(b.InnerBlocks.Content,null))},usesContext:["premium-content/planId"]},wt=n(13),Ct=n.n(wt),_t="web"===h.Platform.OS;var kt=function e(t){if(!Object(d.isObject)(t))return t;var n=Object(d.pickBy)(Object(d.mapValues)(t,e),d.identity);return Object(d.isEqual)(n,{})?void 0:n};function xt(e){var t=e.settings,n=e.clientId,r=e.enableContrastChecking,o=void 0===r||r,i=window,c=i.getComputedStyle,s=i.Node,l=Object(h.useState)(),a=P()(l,2),u=a[0],p=a[1],d=Object(h.useState)(),m=P()(d,2),f=m[0],g=m[1],y=_t?Object(v.__)("Color settings","full-site-editing"):Object(v.__)("Color Settings","full-site-editing");return Object(h.useEffect)((function(){if(!_t||o){var e=function(e){return document.getElementById("block-"+e)}(n);if(e){g(c(e).color);for(var t=e,r=c(t).backgroundColor;"rgba(0, 0, 0, 0)"===r&&t.parentNode&&t.parentNode.nodeType===s.ELEMENT_NODE;)t=t.parentNode,r=c(t).backgroundColor;p(r)}}})),Object(h.createElement)(b.InspectorControls,null,Object(h.createElement)(b.__experimentalPanelColorGradientSettings,{title:y,initialOpen:!1,settings:t},_t&&o&&Object(h.createElement)(b.ContrastChecker,{backgroundColor:u,textColor:f})))}var Et=function(e){var t,n,r,o=e.attributes,i=Object(k.useSelect)((function(e){return e("core/block-editor").getSettings()}),[]),c=i.colors,s=i.gradients,l=Object(h.useRef)(o);Object(h.useEffect)((function(){l.current=o}),[o]);var a,u,d=o.style,m=o.textColor,f=o.backgroundColor,g=o.gradient;a=g?Object(b.getGradientValueBySlug)(s,g):null==d||null===(u=d.color)||void 0===u?void 0:u.gradient;var y=function(t){return function(n){var r,o,i=Object(b.getColorObjectByColorValue)(c,n),s=t+"Color",a=p()(p()({},l.current.style),{},{color:p()(p()({},null===(r=l.current)||void 0===r||null===(o=r.style)||void 0===o?void 0:o.color),{},T()({},t,(null==i?void 0:i.slug)?void 0:n))}),u=(null==i?void 0:i.slug)?i.slug:void 0,d=T()({style:kt(a)},s,u);e.setAttributes(d),l.current=p()(p()({},l.current),d)}};return Object(h.createElement)(xt,{enableContrastChecking:!g&&!(null==d||null===(t=d.color)||void 0===t?void 0:t.gradient),clientId:e.clientId,settings:[{label:Object(v.__)("Text Color","full-site-editing"),onColorChange:y("text"),colorValue:Object(b.getColorObjectByAttributeValues)(c,m,null==d||null===(n=d.color)||void 0===n?void 0:n.text).color},{label:Object(v.__)("Background Color","full-site-editing"),onColorChange:y("background"),colorValue:Object(b.getColorObjectByAttributeValues)(c,f,null==d||null===(r=d.color)||void 0===r?void 0:r.background).color,gradientValue:a,onGradientChange:function(t){var n,r=Object(b.getGradientSlugByValue)(s,t);if(r){var o,i,c,a=p()(p()({},null===(o=l.current)||void 0===o?void 0:o.style),{},{color:p()(p()({},null===(i=l.current)||void 0===i||null===(c=i.style)||void 0===c?void 0:c.color),{},{gradient:void 0})});n={style:kt(a),gradient:r}}else{var u,d,m,f=p()(p()({},null===(u=l.current)||void 0===u?void 0:u.style),{},{color:p()(p()({},null===(d=l.current)||void 0===d||null===(m=d.style)||void 0===m?void 0:m.color),{},{gradient:t})});n={style:kt(f),gradient:void 0}}e.setAttributes(n),l.current=p()(p()({},l.current),n)}}]})};function St(e){var t,n,r,o,i,c,s,l,a,u,p,d=e.backgroundColor,m=e.textColor,f=e.gradient,g=e.style,h=Object(b.getColorClassName)("background-color",d),v=Object(b.__experimentalGetGradientClass)(f),y=Object(b.getColorClassName)("color",m),O=Ct()(y,v,(i={},T()(i,h,!(null==g||null===(t=g.color)||void 0===t?void 0:t.gradient)&&!!h),T()(i,"has-text-color",m||(null==g||null===(n=g.color)||void 0===n?void 0:n.text)),T()(i,"has-background",d||(null==g||null===(r=g.color)||void 0===r?void 0:r.background)||f||(null==g||null===(o=g.color)||void 0===o?void 0:o.gradient)),i));return{className:O||void 0,style:(null==g||null===(c=g.color)||void 0===c?void 0:c.background)||(null==g||null===(s=g.color)||void 0===s?void 0:s.text)||(null==g||null===(l=g.color)||void 0===l?void 0:l.gradient)?{background:(null==g||null===(a=g.color)||void 0===a?void 0:a.gradient)?g.color.gradient:void 0,backgroundColor:(null==g||null===(u=g.color)||void 0===u?void 0:u.background)?g.color.background:void 0,color:(null==g||null===(p=g.color)||void 0===p?void 0:p.text)?g.color.text:void 0}:{}}}function Pt(e){var t=e.borderRadius,n=void 0===t?"":t,r=e.setAttributes,o=Object(h.useCallback)((function(e){r({borderRadius:e})}),[r]);return Object(h.createElement)(F.PanelBody,{title:Object(v.__)("Border settings","full-site-editing")},Object(h.createElement)(F.RangeControl,{value:n,label:Object(v.__)("Border radius","full-site-editing"),min:0,max:50,initialPosition:5,allowReset:!0,onChange:o}))}var Ft=function(e){var t=e.attributes,n=e.setAttributes,r=e.className,o=t.borderRadius,i=t.text,c=St(t);return Object(h.createElement)(h.Fragment,null,Object(h.createElement)(b.__experimentalBlock.div,{className:"wp-block-button"},Object(h.createElement)(b.RichText,{placeholder:Object(v.__)("Add text…","full-site-editing"),value:i,onChange:function(e){return n({text:e})},withoutInteractiveFormatting:!0,className:Ct()(r,"wp-block-button__link",c.className,{"no-border-radius":0===o}),style:p()({borderRadius:o?o+"px":void 0},c.style)})),Object(h.createElement)(b.InspectorControls,null,Object(h.createElement)(Et,e),Object(h.createElement)(Pt,{borderRadius:o,setAttributes:n})))};var Bt="premium-content/login-button",Nt=ze("design","common"),At={name:Bt,title:Object(v.__)("Premium Content login button","full-site-editing"),description:Object(v.__)("Prompt subscriber visitors to log in with a button-style link (only visible for logged out users).","full-site-editing"),attributes:{text:{type:"string",source:"html",selector:"a",default:Object(v.__)("Log in","full-site-editing")},borderRadius:{type:"number"},backgroundColor:{type:"string"},textColor:{type:"string"},gradient:{type:"string"},style:{type:"object"}},icon:ft,keywords:[Object(v.__)("link","full-site-editing")],supports:{align:!0,alignWide:!1,html:!1,lightBlockWrapper:!0},edit:Ft,save:function(e){var t=e.attributes,n=t.borderRadius,r=t.text,o=St(t),i=Ct()("wp-block-button__link",o.className,{"no-border-radius":0===n}),c=p()({borderRadius:n?n+"px":void 0},o.style);return Object(h.createElement)("div",{className:"wp-block-button"},Object(h.createElement)(b.RichText.Content,{tagName:"a",className:i,style:c,value:r}))}},Rt=!(!b.__experimentalAlignmentHookSettingsProvider||!b.__experimentalBlock),Lt=function(e){if(e){var t=e.name,n=e.category,r=e.settings;Object(g.registerBlockType)(t,p()({category:n},r))}},Tt=function(e,t){var n=Object(g.getBlockType)(e);if(n){Object(g.unregisterBlockType)(e);var r=Object(d.mergeWith)({},n,t,(function(e,t){if(Array.isArray(e))return e.concat(t)}));Object(g.registerBlockType)(e,r)}},Dt=function(){var e=a()(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.abrupt("return",f()({path:"/wpcom/v2/memberships/status"}));case 4:return e.prev=4,e.t0=e.catch(0),e.abrupt("return",null);case 7:case"end":return e.stop()}}),e,null,[[0,4]])})));return function(){return e.apply(this,arguments)}}(),It=function(e){!e.should_upgrade_to_access_memberships&&e.connected_account_id||(Tt(yt,{supports:{inserter:!1}}),Tt(Bt,{supports:{inserter:!1}}))},Mt=function(){var e=a()(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Dt();case 2:t=e.sent,It(t);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),$t=function(){[r,i,o,c,s].forEach(Lt)};Rt&&($t(),Mt())}]));
premium-content/subscription-service/class-token-subscription-service.php CHANGED
@@ -1,17 +1,25 @@
1
- <?php declare( strict_types = 1 );
2
  /**
3
- * @package A8C\FSE\Earn
4
- *
5
  * A paywall that exchanges JWT tokens from WordPress.com to allow
6
  * a current visitor to view content that has been deemed "Premium content".
 
 
7
  */
 
 
 
8
  namespace A8C\FSE\Earn\PremiumContent\SubscriptionService;
9
 
10
  use A8C\FSE\Earn\PremiumContent\JWT;
11
 
12
  // phpcs:ignore ImportDetection.Imports.RequireImports.Symbol
13
- abstract class Token_Subscription_Service implements Subscription_Service {
14
 
 
 
 
 
 
 
15
 
16
  const JWT_AUTH_TOKEN_COOKIE_NAME = 'jp-premium-content-session';
17
  const DECODE_EXCEPTION_FEATURE = 'memberships';
@@ -19,11 +27,13 @@ abstract class Token_Subscription_Service implements Subscription_Service {
19
  const REST_URL_ORIGIN = 'https://subscribe.wordpress.com/';
20
 
21
  /**
 
 
22
  * @inheritDoc
23
  */
24
  public function initialize() {
25
  $token = $this->token_from_request();
26
- if ( $token !== null ) {
27
  $this->set_token_cookie( $token );
28
  }
29
  }
@@ -38,6 +48,8 @@ abstract class Token_Subscription_Service implements Subscription_Service {
38
  * still a WIP (see api/auth branch)
39
  *
40
  * @inheritDoc
 
 
41
  */
42
  public function visitor_can_view_content( $valid_plan_ids ) {
43
 
@@ -49,22 +61,40 @@ abstract class Token_Subscription_Service implements Subscription_Service {
49
  $token = $this->token_from_cookie();
50
  }
51
 
 
 
52
  if ( empty( $token ) ) {
53
- // no token, no access
54
- return false;
55
  }
56
 
57
  $payload = $this->decode_token( $token );
58
  if ( empty( $payload ) ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
59
  return false;
60
  }
61
 
62
- $subscriptions = (array) $payload['subscriptions'];
63
  return $this->validate_subscriptions( $valid_plan_ids, $subscriptions );
64
  }
65
 
66
  /**
67
- * @param string $token
 
 
68
  *
69
  * @return array|false
70
  */
@@ -78,7 +108,7 @@ abstract class Token_Subscription_Service implements Subscription_Service {
78
  $logstash = array(
79
  'feature' => self::DECODE_EXCEPTION_FEATURE,
80
  'message' => self::DECODE_EXCEPTION_MESSAGE,
81
- 'extra' => json_encode( compact( 'exception', 'token' ) ),
82
  );
83
  // phpcs:ignore ImportDetection.Imports.RequireImports.Symbol
84
  log2logstash( $logstash );
@@ -87,19 +117,25 @@ abstract class Token_Subscription_Service implements Subscription_Service {
87
  }
88
 
89
  /**
 
 
90
  * @return string|false
91
  */
92
- abstract function get_key();
93
 
94
  /**
 
 
95
  * @return int
96
  */
97
- abstract function get_site_id();
98
 
99
  /**
100
- * @inheritDoc
 
 
101
  */
102
- public function access_url( $mode = 'subscribe' ) {
103
  global $wp;
104
  $permalink = get_permalink();
105
  if ( empty( $permalink ) ) {
@@ -111,16 +147,21 @@ abstract class Token_Subscription_Service implements Subscription_Service {
111
  }
112
 
113
  /**
 
 
114
  * @return ?string
115
  */
116
  private function token_from_cookie() {
117
  if ( isset( $_COOKIE[ self::JWT_AUTH_TOKEN_COOKIE_NAME ] ) ) {
 
118
  return $_COOKIE[ self::JWT_AUTH_TOKEN_COOKIE_NAME ];
119
  }
120
  }
121
 
122
  /**
123
- * @param string $token
 
 
124
  * @return void
125
  */
126
  private function set_token_cookie( $token ) {
@@ -130,13 +171,17 @@ abstract class Token_Subscription_Service implements Subscription_Service {
130
  }
131
 
132
  /**
 
 
133
  * @return ?string
134
  */
135
  private function token_from_request() {
136
  $token = null;
 
137
  if ( isset( $_GET['token'] ) ) {
 
138
  if ( preg_match( '/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/', $_GET['token'], $matches ) ) {
139
- // token matches a valid JWT token pattern
140
  $token = reset( $matches );
141
  }
142
  }
@@ -146,14 +191,14 @@ abstract class Token_Subscription_Service implements Subscription_Service {
146
  /**
147
  * Return true if any ID/date pairs are valid. Otherwise false.
148
  *
149
- * @param int[] $valid_plan_ids
150
  * @param array<int, Token_Subscription> $token_subscriptions : ID must exist in the provided <code>$valid_subscriptions</code> parameter.
151
  * The provided end date needs to be greater than <code>now()</code>.
152
  *
153
  * @return bool
154
  */
155
  protected function validate_subscriptions( $valid_plan_ids, $token_subscriptions ) {
156
- // Create a list of product_ids to compare against:
157
  $product_ids = array();
158
  foreach ( $valid_plan_ids as $plan_id ) {
159
  $product_id = (int) get_post_meta( $plan_id, 'jetpack_memberships_product_id', true );
@@ -162,10 +207,6 @@ abstract class Token_Subscription_Service implements Subscription_Service {
162
  }
163
  }
164
 
165
- /**
166
- * @var int $product_id
167
- * @var Token_Subscription $token_subscription
168
- */
169
  foreach ( $token_subscriptions as $product_id => $token_subscription ) {
170
  if ( in_array( $product_id, $product_ids, true ) ) {
171
  $end = is_int( $token_subscription->end_date ) ? $token_subscription->end_date : strtotime( $token_subscription->end_date );
@@ -178,12 +219,38 @@ abstract class Token_Subscription_Service implements Subscription_Service {
178
  }
179
 
180
  /**
181
- * @param int $site_id
182
- * @param string $redirect_url
183
- * @return string
 
 
184
  */
185
  private function get_rest_api_token_url( $site_id, $redirect_url ) {
186
- return sprintf( '%smemberships/jwt?site_id=%d&redirect_url=%s', self::REST_URL_ORIGIN, $site_id, urlencode( $redirect_url ) );
187
  }
188
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
189
  }
1
+ <?php
2
  /**
 
 
3
  * A paywall that exchanges JWT tokens from WordPress.com to allow
4
  * a current visitor to view content that has been deemed "Premium content".
5
+ *
6
+ * @package A8C\FSE\Earn
7
  */
8
+
9
+ declare( strict_types = 1 );
10
+
11
  namespace A8C\FSE\Earn\PremiumContent\SubscriptionService;
12
 
13
  use A8C\FSE\Earn\PremiumContent\JWT;
14
 
15
  // phpcs:ignore ImportDetection.Imports.RequireImports.Symbol
 
16
 
17
+ /**
18
+ * Class Token_Subscription_Service
19
+ *
20
+ * @package A8C\FSE\Earn\PremiumContent\SubscriptionService
21
+ */
22
+ abstract class Token_Subscription_Service implements Subscription_Service {
23
 
24
  const JWT_AUTH_TOKEN_COOKIE_NAME = 'jp-premium-content-session';
25
  const DECODE_EXCEPTION_FEATURE = 'memberships';
27
  const REST_URL_ORIGIN = 'https://subscribe.wordpress.com/';
28
 
29
  /**
30
+ * Initialize the token subscription service.
31
+ *
32
  * @inheritDoc
33
  */
34
  public function initialize() {
35
  $token = $this->token_from_request();
36
+ if ( null !== $token ) {
37
  $this->set_token_cookie( $token );
38
  }
39
  }
48
  * still a WIP (see api/auth branch)
49
  *
50
  * @inheritDoc
51
+ *
52
+ * @param array $valid_plan_ids List of valid plan IDs.
53
  */
54
  public function visitor_can_view_content( $valid_plan_ids ) {
55
 
61
  $token = $this->token_from_cookie();
62
  }
63
 
64
+ $is_valid_token = true;
65
+
66
  if ( empty( $token ) ) {
67
+ // no token, no access.
68
+ $is_valid_token = false;
69
  }
70
 
71
  $payload = $this->decode_token( $token );
72
  if ( empty( $payload ) ) {
73
+ $is_valid_token = false;
74
+ }
75
+
76
+ if ( $is_valid_token ) {
77
+ $subscriptions = (array) $payload['subscriptions'];
78
+ } elseif ( is_user_logged_in() ) {
79
+ // If there is no token, but the user is logged in, get current subscriptions and determine if the user has
80
+ // a valid subscription to match the plan ID.
81
+ $subscriptions = apply_filters( 'earn_get_user_subscriptions_for_site_id', array(), wp_get_current_user()->ID, $this->get_site_id() );
82
+ if ( empty( $subscriptions ) ) {
83
+ return false;
84
+ }
85
+ // format the subscriptions so that they can be validated.
86
+ $subscriptions = self::abbreviate_subscriptions( $subscriptions );
87
+ } else {
88
  return false;
89
  }
90
 
 
91
  return $this->validate_subscriptions( $valid_plan_ids, $subscriptions );
92
  }
93
 
94
  /**
95
+ * Decode the given token.
96
+ *
97
+ * @param string $token Token to decode.
98
  *
99
  * @return array|false
100
  */
108
  $logstash = array(
109
  'feature' => self::DECODE_EXCEPTION_FEATURE,
110
  'message' => self::DECODE_EXCEPTION_MESSAGE,
111
+ 'extra' => wp_json_encode( compact( 'exception', 'token' ) ),
112
  );
113
  // phpcs:ignore ImportDetection.Imports.RequireImports.Symbol
114
  log2logstash( $logstash );
117
  }
118
 
119
  /**
120
+ * Get the key for decoding the auth token.
121
+ *
122
  * @return string|false
123
  */
124
+ abstract public function get_key();
125
 
126
  /**
127
+ * Get the ID of the current site.
128
+ *
129
  * @return int
130
  */
131
+ abstract public function get_site_id();
132
 
133
  /**
134
+ * Get the URL to access the protected content.
135
+ *
136
+ * @param string $mode Access mode (either "subscribe" or "login").
137
  */
138
+ public function access_url( $mode = 'subscribe' ) { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter
139
  global $wp;
140
  $permalink = get_permalink();
141
  if ( empty( $permalink ) ) {
147
  }
148
 
149
  /**
150
+ * Get the token stored in the auth cookie.
151
+ *
152
  * @return ?string
153
  */
154
  private function token_from_cookie() {
155
  if ( isset( $_COOKIE[ self::JWT_AUTH_TOKEN_COOKIE_NAME ] ) ) {
156
+ // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
157
  return $_COOKIE[ self::JWT_AUTH_TOKEN_COOKIE_NAME ];
158
  }
159
  }
160
 
161
  /**
162
+ * Store the auth cookie.
163
+ *
164
+ * @param string $token Auth token.
165
  * @return void
166
  */
167
  private function set_token_cookie( $token ) {
171
  }
172
 
173
  /**
174
+ * Get the token if present in the current request.
175
+ *
176
  * @return ?string
177
  */
178
  private function token_from_request() {
179
  $token = null;
180
+ // phpcs:ignore WordPress.Security.NonceVerification.Recommended
181
  if ( isset( $_GET['token'] ) ) {
182
+ // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Recommended
183
  if ( preg_match( '/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/', $_GET['token'], $matches ) ) {
184
+ // token matches a valid JWT token pattern.
185
  $token = reset( $matches );
186
  }
187
  }
191
  /**
192
  * Return true if any ID/date pairs are valid. Otherwise false.
193
  *
194
+ * @param int[] $valid_plan_ids List of valid plan IDs.
195
  * @param array<int, Token_Subscription> $token_subscriptions : ID must exist in the provided <code>$valid_subscriptions</code> parameter.
196
  * The provided end date needs to be greater than <code>now()</code>.
197
  *
198
  * @return bool
199
  */
200
  protected function validate_subscriptions( $valid_plan_ids, $token_subscriptions ) {
201
+ // Create a list of product_ids to compare against.
202
  $product_ids = array();
203
  foreach ( $valid_plan_ids as $plan_id ) {
204
  $product_id = (int) get_post_meta( $plan_id, 'jetpack_memberships_product_id', true );
207
  }
208
  }
209
 
 
 
 
 
210
  foreach ( $token_subscriptions as $product_id => $token_subscription ) {
211
  if ( in_array( $product_id, $product_ids, true ) ) {
212
  $end = is_int( $token_subscription->end_date ) ? $token_subscription->end_date : strtotime( $token_subscription->end_date );
219
  }
220
 
221
  /**
222
+ * Get the URL of the JWT endpoint.
223
+ *
224
+ * @param int $site_id Site ID.
225
+ * @param string $redirect_url URL to redirect after checking the token validity.
226
+ * @return string URL of the JWT endpoint.
227
  */
228
  private function get_rest_api_token_url( $site_id, $redirect_url ) {
229
+ return sprintf( '%smemberships/jwt?site_id=%d&redirect_url=%s', self::REST_URL_ORIGIN, $site_id, rawurlencode( $redirect_url ) );
230
  }
231
 
232
+ /**
233
+ * Report the subscriptions as an ID => [ 'end_date' => ]. mapping
234
+ *
235
+ * @param array $subscriptions_from_bd List of subscriptions from BD.
236
+ *
237
+ * @return array<int, array>
238
+ */
239
+ public static function abbreviate_subscriptions( $subscriptions_from_bd ) {
240
+ $subscriptions = array();
241
+ foreach ( $subscriptions_from_bd as $subscription ) {
242
+ // We are picking the expiry date that is the most in the future.
243
+ if (
244
+ 'active' === $subscription['status'] && (
245
+ ! isset( $subscriptions[ $subscription['product_id'] ] ) ||
246
+ empty( $subscription['end_date'] ) || // Special condition when subscription has no expiry date - we will default to a year from now for the purposes of the token.
247
+ strtotime( $subscription['end_date'] ) > strtotime( (string) $subscriptions[ $subscription['product_id'] ]['end_date'] )
248
+ )
249
+ ) {
250
+ $subscriptions[ $subscription['product_id'] ] = new \stdClass();
251
+ $subscriptions[ $subscription['product_id'] ]->end_date = empty( $subscription['end_date'] ) ? ( time() + 365 * 24 * 3600 ) : $subscription['end_date'];
252
+ }
253
+ }
254
+ return $subscriptions;
255
+ }
256
  }
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: alexislloyd, allancole, automattic, bartkalisz, codebykat, copons,
3
  Tags: block, blocks, editor, gutenberg, page
4
  Requires at least: 5.0
5
  Tested up to: 5.5
6
- Stable tag: 2.5
7
  Requires PHP: 5.6.20
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
@@ -40,6 +40,9 @@ This plugin is experimental, so we don't provide any support for it outside of w
40
 
41
  == Changelog ==
42
 
 
 
 
43
  = 2.5 =
44
  * Site setup: use selected features to recommend a plan (https://github.com/Automattic/wp-calypso/pull/45718)
45
  * Lint markdown files (https://github.com/Automattic/wp-calypso/pull/45691)
3
  Tags: block, blocks, editor, gutenberg, page
4
  Requires at least: 5.0
5
  Tested up to: 5.5
6
+ Stable tag: 2.6
7
  Requires PHP: 5.6.20
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
40
 
41
  == Changelog ==
42
 
43
+ = 2.6 =
44
+ * Correct regressions to the Premium Content block. (https://github.com/Automattic/wp-calypso/pull/45777)
45
+
46
  = 2.5 =
47
  * Site setup: use selected features to recommend a plan (https://github.com/Automattic/wp-calypso/pull/45718)
48
  * Lint markdown files (https://github.com/Automattic/wp-calypso/pull/45691)
starter-page-templates/dist/starter-page-templates.asset.php CHANGED
@@ -1 +1 @@
1
- <?php return array('dependencies' => array('lodash', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-edit-post', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-nux', 'wp-plugins', 'wp-polyfill', 'wp-url'), 'version' => '1f72b8911fb5b1c825f737d1d5023d00');
1
+ <?php return array('dependencies' => array('lodash', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-edit-post', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-nux', 'wp-plugins', 'wp-polyfill', 'wp-url'), 'version' => '71f9c0403b6b6becc94a6ae06a612323');
wpcom-block-editor-nav-sidebar/dist/wpcom-block-editor-nav-sidebar.asset.php CHANGED
@@ -1 +1 @@
1
- <?php return array('dependencies' => array('lodash', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keycodes', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => '2a13f5d0ef862389c846f0af8609cc70');
1
+ <?php return array('dependencies' => array('lodash', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keycodes', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => '24bfc161cf2b66a2da465bccdb8bd5a3');
wpcom-block-editor-nux/dist/wpcom-block-editor-nux.asset.php CHANGED
@@ -1 +1 @@
1
- <?php return array('dependencies' => array('wp-api-fetch', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-nux', 'wp-plugins', 'wp-polyfill'), 'version' => 'c88bc14915fb7d68b6c12fb49a929c7a');
1
+ <?php return array('dependencies' => array('wp-api-fetch', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-nux', 'wp-plugins', 'wp-polyfill'), 'version' => '10096f79402d6c740b0fcc40bb5f0278');