Changeset 3005412
- Timestamp:
- 12/05/2023 06:05:50 AM (2 years ago)
- Location:
- full-site-editing/trunk
- Files:
-
- 11 edited
-
build_meta.json (modified) (1 diff)
-
full-site-editing-plugin.php (modified) (2 diffs)
-
paragraph-block/index.php (modified) (4 diffs)
-
readme.txt (modified) (1 diff)
-
wpcom-global-styles/dist/wpcom-global-styles.asset.php (modified) (1 diff)
-
wpcom-global-styles/dist/wpcom-global-styles.css (modified) (1 diff)
-
wpcom-global-styles/dist/wpcom-global-styles.js (modified) (4 diffs)
-
wpcom-global-styles/dist/wpcom-global-styles.min.js (modified) (1 diff)
-
wpcom-global-styles/dist/wpcom-global-styles.rtl.css (modified) (1 diff)
-
wpcom-global-styles/notice.scss (modified) (1 diff)
-
wpcom-global-styles/notices.js (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
full-site-editing/trunk/build_meta.json
r3005192 r3005412 1 1 { 2 "build_number": "4.5 430",3 "cache_buster": " 10b1462f358",4 "commit_hash": " 10b1462f358db48f85f4337e208087cffda0cbb5",5 "commit_url": "https://github.com/Automattic/wp-calypso/commit/ 10b1462f358db48f85f4337e208087cffda0cbb5"2 "build_number": "4.5523", 3 "cache_buster": "074ea04a947", 4 "commit_hash": "074ea04a947ccca98a58cdfc7b40a3b5cf5e99d9", 5 "commit_url": "https://github.com/Automattic/wp-calypso/commit/074ea04a947ccca98a58cdfc7b40a3b5cf5e99d9" 6 6 } -
full-site-editing/trunk/full-site-editing-plugin.php
r3005192 r3005412 3 3 * Plugin Name: WordPress.com Editing Toolkit 4 4 * Description: Enhances your page creation workflow within the Block Editor. 5 * Version: 4.5 4305 * Version: 4.5523 6 6 * Author: Automattic 7 7 * Author URI: https://automattic.com/wordpress-plugins/ … … 43 43 * @var string 44 44 */ 45 define( 'A8C_ETK_PLUGIN_VERSION', '4.5 430' );45 define( 'A8C_ETK_PLUGIN_VERSION', '4.5523' ); 46 46 47 47 // Always include these helper files for dotcom FSE. -
full-site-editing/trunk/paragraph-block/index.php
r2718247 r3005412 25 25 26 26 global $post; 27 if ( is set( $post ) && is_post_with_write_intent( $post ) ) {27 if ( is_post_with_write_intent( $post ) ) { 28 28 wp_localize_script( 29 29 'paragraph-block-script', … … 42 42 * Check is it a post with “write” intent 43 43 * 44 * @param WP_Post $post Current post object.44 * @param WP_Post|null $post Current post object. It would be null if the current post is not retrieved. 45 45 */ 46 46 function is_post_with_write_intent( $post ) { 47 return 'post' === $post->post_type && 'write' === get_option( 'site_intent', '' );47 return isset( $post ) && 'post' === $post->post_type && 'write' === get_option( 'site_intent', '' ); 48 48 } 49 49 … … 51 51 * Replace the title placeholder if it's the post with “write” intent 52 52 * 53 * @param string $text Text to shown.54 * @param WP_Post $post Current post object.53 * @param string $text Text to shown. 54 * @param WP_Post|null $post Current post object. It would be null if the current post is not retrieved. 55 55 */ 56 56 function enter_title_here( $text, $post ) { … … 70 70 * Replace the body placeholder if it's the post with “write” intent 71 71 * 72 * @param string $text Text to shown.73 * @param WP_Post $post Current post object.72 * @param string $text Text to shown. 73 * @param WP_Post|null $post Current post object. It would be null if the current post is not retrieved. 74 74 */ 75 75 function write_your_story( $text, $post ) { -
full-site-editing/trunk/readme.txt
r3005192 r3005412 4 4 Requires at least: 5.5 5 5 Tested up to: 6.3 6 Stable tag: 4.5 4306 Stable tag: 4.5523 7 7 Requires PHP: 5.6.20 8 8 License: GPLv2 or later -
full-site-editing/trunk/wpcom-global-styles/dist/wpcom-global-styles.asset.php
r2988148 r3005412 1 <?php return array('dependencies' => array('react', 'wp-components', 'wp-data', 'wp-dom-ready', 'wp-element', 'wp-i18n', 'wp-plugins', 'wp-polyfill', 'wp-url'), 'version' => ' fcf2d8b8e926631dc3f1');1 <?php return array('dependencies' => array('react', 'wp-components', 'wp-data', 'wp-dom-ready', 'wp-element', 'wp-i18n', 'wp-plugins', 'wp-polyfill', 'wp-url'), 'version' => '7c45cd1a93aaab575695'); -
full-site-editing/trunk/wpcom-global-styles/dist/wpcom-global-styles.css
r2947492 r3005412 1 1 @font-face{font-display:swap;font-family:Recoleta;font-weight:400;src:url(https://s1.wp.com/i/fonts/recoleta/400.woff2) format("woff2"),url(https://s1.wp.com/i/fonts/recoleta/400.woff) format("woff")}.wp-brand-font{font-family:"Noto Serif",Georgia,"Times New Roman",Times,serif;font-weight:400}[lang*=af] .wp-brand-font{font-family:"Recoleta","Noto Serif",Georgia,"Times New Roman",Times,serif}[lang*=ca] .wp-brand-font{font-family:"Recoleta","Noto Serif",Georgia,"Times New Roman",Times,serif}[lang*=cs] .wp-brand-font{font-family:"Recoleta","Noto Serif",Georgia,"Times New Roman",Times,serif}[lang*=da] .wp-brand-font{font-family:"Recoleta","Noto Serif",Georgia,"Times New Roman",Times,serif}[lang*=de] .wp-brand-font{font-family:"Recoleta","Noto Serif",Georgia,"Times New Roman",Times,serif}[lang*=en] .wp-brand-font{font-family:"Recoleta","Noto Serif",Georgia,"Times New Roman",Times,serif}[lang*=es] .wp-brand-font{font-family:"Recoleta","Noto Serif",Georgia,"Times New Roman",Times,serif}[lang*=eu] .wp-brand-font{font-family:"Recoleta","Noto Serif",Georgia,"Times New Roman",Times,serif}[lang*=fi] .wp-brand-font{font-family:"Recoleta","Noto Serif",Georgia,"Times New Roman",Times,serif}[lang*=fr] .wp-brand-font{font-family:"Recoleta","Noto Serif",Georgia,"Times New Roman",Times,serif}[lang*=gl] .wp-brand-font{font-family:"Recoleta","Noto Serif",Georgia,"Times New Roman",Times,serif}[lang*=hr] .wp-brand-font{font-family:"Recoleta","Noto Serif",Georgia,"Times New Roman",Times,serif}[lang*=hu] .wp-brand-font{font-family:"Recoleta","Noto Serif",Georgia,"Times New Roman",Times,serif}[lang*=id] .wp-brand-font{font-family:"Recoleta","Noto Serif",Georgia,"Times New Roman",Times,serif}[lang*=is] .wp-brand-font{font-family:"Recoleta","Noto Serif",Georgia,"Times New Roman",Times,serif}[lang*=it] .wp-brand-font{font-family:"Recoleta","Noto Serif",Georgia,"Times New Roman",Times,serif}[lang*=lv] .wp-brand-font{font-family:"Recoleta","Noto Serif",Georgia,"Times New Roman",Times,serif}[lang*=mt] .wp-brand-font{font-family:"Recoleta","Noto Serif",Georgia,"Times New Roman",Times,serif}[lang*=nb] .wp-brand-font{font-family:"Recoleta","Noto Serif",Georgia,"Times New Roman",Times,serif}[lang*=nl] .wp-brand-font{font-family:"Recoleta","Noto Serif",Georgia,"Times New Roman",Times,serif}[lang*=pl] .wp-brand-font{font-family:"Recoleta","Noto Serif",Georgia,"Times New Roman",Times,serif}[lang*=pt] .wp-brand-font{font-family:"Recoleta","Noto Serif",Georgia,"Times New Roman",Times,serif}[lang*=ro] .wp-brand-font{font-family:"Recoleta","Noto Serif",Georgia,"Times New Roman",Times,serif}[lang*=ru] .wp-brand-font{font-family:"Recoleta","Noto Serif",Georgia,"Times New Roman",Times,serif}[lang*=sk] .wp-brand-font{font-family:"Recoleta","Noto Serif",Georgia,"Times New Roman",Times,serif}[lang*=sl] .wp-brand-font{font-family:"Recoleta","Noto Serif",Georgia,"Times New Roman",Times,serif}[lang*=sq] .wp-brand-font{font-family:"Recoleta","Noto Serif",Georgia,"Times New Roman",Times,serif}[lang*=sr] .wp-brand-font{font-family:"Recoleta","Noto Serif",Georgia,"Times New Roman",Times,serif}[lang*=sv] .wp-brand-font{font-family:"Recoleta","Noto Serif",Georgia,"Times New Roman",Times,serif}[lang*=sw] .wp-brand-font{font-family:"Recoleta","Noto Serif",Georgia,"Times New Roman",Times,serif}[lang*=tr] .wp-brand-font{font-family:"Recoleta","Noto Serif",Georgia,"Times New Roman",Times,serif}[lang*=uz] .wp-brand-font{font-family:"Recoleta","Noto Serif",Georgia,"Times New Roman",Times,serif}.wpcom-global-styles-modal .components-modal__content{padding:0;margin-top:0}.wpcom-global-styles-modal .components-modal__header{height:auto;position:absolute;border-bottom-width:0}.wpcom-global-styles-modal .wpcom-global-styles-modal__content{display:flex;flex-direction:column-reverse;justify-content:flex-end;align-items:flex-start}@media(min-width: 600px){.wpcom-global-styles-modal .wpcom-global-styles-modal__content{flex-direction:row;justify-content:flex-start}}@media(min-width: 600px)and (min-height: 600px){.wpcom-global-styles-modal .wpcom-global-styles-modal__content{align-items:stretch}}.wpcom-global-styles-modal .wpcom-global-styles-modal__text,.wpcom-global-styles-modal .wpcom-global-styles-modal__image{width:100%}@media(min-width: 600px){.wpcom-global-styles-modal .wpcom-global-styles-modal__text,.wpcom-global-styles-modal .wpcom-global-styles-modal__image{width:auto;max-width:380px}}.wpcom-global-styles-modal .wpcom-global-styles-modal__text{padding:32px;display:flex;flex-direction:column}@media(min-width: 600px)and (min-height: 600px){.wpcom-global-styles-modal .wpcom-global-styles-modal__text{padding:64px 48px}}.wpcom-global-styles-modal .wpcom-global-styles-modal__heading{margin-top:0;font-family:"Recoleta","Noto Serif",Georgia,"Times New Roman",Times,serif;font-weight:400;font-size:1.75rem;line-height:32px;margin-bottom:16px}@media(min-width: 600px)and (min-height: 600px){.wpcom-global-styles-modal .wpcom-global-styles-modal__heading{font-size:2rem;line-height:40px}}.wpcom-global-styles-modal .wpcom-global-styles-modal__description{font-size:1rem;line-height:24px;margin-top:0;margin-bottom:32px}.wpcom-global-styles-modal .wpcom-global-styles-modal__actions{display:flex;justify-content:center;gap:16px;margin-top:auto}.wpcom-global-styles-modal .wpcom-global-styles-modal__actions .components-button{flex-grow:1;justify-content:center}.wpcom-global-styles-modal .wpcom-global-styles-modal__image{background-color:#d0cce3;padding:32px 0 32px 32px;display:flex;justify-content:flex-end;max-height:50vh}@media(min-width: 600px){.wpcom-global-styles-modal .wpcom-global-styles-modal__image{max-height:70vh}}@media(min-width: 600px)and (min-height: 600px){.wpcom-global-styles-modal .wpcom-global-styles-modal__image{max-height:none;padding:64px 0 64px 64px}}.wpcom-global-styles-modal .wpcom-global-styles-modal__image img{width:100%} 2 . edit-site-save-hub{border-top:none;padding-top:0}.wpcom-global-styles-notice-container{padding:24px 24px 0;border-top:1px solid #2f2f2f}.wpcom-global-styles-notice{margin:0 0 24px;color:var(--color-text)}.wpcom-global-styles-notice .components-notice__content{margin-right:0}.components-notice-list .components-notice__action.components-button.wpcom-global-styles-action-has-icon{display:flex}.components-notice-list .components-notice__action.components-button.wpcom-global-styles-action-has-icon::after,.components-notice-list .components-notice__action.components-button.wpcom-global-styles-action-has-icon::before{display:inline-block;width:15px;height:15px;position:relative;top:1px}.components-notice-list .components-notice__action.components-button.wpcom-global-styles-action-has-icon.is-primary::after,.components-notice-list .components-notice__action.components-button.wpcom-global-styles-action-has-icon.is-primary::before{background-color:#fff;background-color:var(--wp-components-color-accent-inverted, #fff)}.components-notice-list .components-notice__action.components-button.wpcom-global-styles-action-has-icon.is-secondary::after,.components-notice-list .components-notice__action.components-button.wpcom-global-styles-action-has-icon.is-secondary::before,.components-notice-list .components-notice__action.components-button.wpcom-global-styles-action-has-icon.is-link::after,.components-notice-list .components-notice__action.components-button.wpcom-global-styles-action-has-icon.is-link::before{background-color:#3858e9;background-color:var(--wp-components-color-accent, var(--wp-admin-theme-color, #3858e9))}.components-notice-list .components-notice__action.components-button.wpcom-global-styles-action-has-icon.wpcom-global-styles-action-is-external::after{content:"";margin-left:4px;-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27 width=%2715%27 height=%2715%27 aria-hidden=%27true%27 focusable=%27false%27%3E%3Cpath d=%27M18.2 17c0 .7-.6 1.2-1.2 1.2H7c-.7 0-1.2-.6-1.2-1.2V7c0-.7.6-1.2 1.2-1.2h3.2V4.2H7C5.5 4.2 4.2 5.5 4.2 7v10c0 1.5 1.2 2.8 2.8 2.8h10c1.5 0 2.8-1.2 2.8-2.8v-3.6h-1.5V17zM14.9 3v1.5h3.7l-6.4 6.4 1.1 1.1 6.4-6.4v3.7h1.5V3h-6.3z%27%3E%3C/path%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27 width=%2715%27 height=%2715%27 aria-hidden=%27true%27 focusable=%27false%27%3E%3Cpath d=%27M18.2 17c0 .7-.6 1.2-1.2 1.2H7c-.7 0-1.2-.6-1.2-1.2V7c0-.7.6-1.2 1.2-1.2h3.2V4.2H7C5.5 4.2 4.2 5.5 4.2 7v10c0 1.5 1.2 2.8 2.8 2.8h10c1.5 0 2.8-1.2 2.8-2.8v-3.6h-1.5V17zM14.9 3v1.5h3.7l-6.4 6.4 1.1 1.1 6.4-6.4v3.7h1.5V3h-6.3z%27%3E%3C/path%3E%3C/svg%3E")}.components-notice-list .components-notice__action.components-button.wpcom-global-styles-action-has-icon.wpcom-global-styles-action-is-support::before{content:"";width:15px;height:14px;margin-right:4px;-webkit-mask-image:url("data:image/svg+xml,%3Csvg width=\"15\" height=\"14\" viewBox=\"0 0 15 14\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"%3E%3Cpath d=\"M5.8125 5.6875C5.8125 4.75552 6.56802 4 7.5 4C8.43198 4 9.1875 4.75552 9.1875 5.6875C9.1875 6.55621 8.53108 7.2716 7.6872 7.36473C7.58427 7.37609 7.5 7.45895 7.5 7.5625V8.5M7.5 9.25V10.375M13.5 7C13.5 10.3137 10.8137 13 7.5 13C4.18629 13 1.5 10.3137 1.5 7C1.5 3.68629 4.18629 1 7.5 1C10.8137 1 13.5 3.68629 13.5 7Z\" style=\"stroke: %231E1E1E;\" stroke-width=\"1.5\"/%3E%3C/svg%3E%0A");mask-image:url("data:image/svg+xml,%3Csvg width=\"15\" height=\"14\" viewBox=\"0 0 15 14\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"%3E%3Cpath d=\"M5.8125 5.6875C5.8125 4.75552 6.56802 4 7.5 4C8.43198 4 9.1875 4.75552 9.1875 5.6875C9.1875 6.55621 8.53108 7.2716 7.6872 7.36473C7.58427 7.37609 7.5 7.45895 7.5 7.5625V8.5M7.5 9.25V10.375M13.5 7C13.5 10.3137 10.8137 13 7.5 13C4.18629 13 1.5 10.3137 1.5 7C1.5 3.68629 4.18629 1 7.5 1C10.8137 1 13.5 3.68629 13.5 7Z\" style=\"stroke: %231E1E1E;\" stroke-width=\"1.5\"/%3E%3C/svg%3E%0A")}2 .wpcom-global-styles-notice-container{padding:24px 24px 0;border-top:1px solid #2f2f2f}.wpcom-global-styles-notice-container+.edit-site-save-hub{border-top:none;padding-top:0}.wpcom-global-styles-notice{margin:0 0 24px;color:var(--color-text)}.wpcom-global-styles-notice .components-notice__content{margin-right:0}.components-notice-list .components-notice__action.components-button.wpcom-global-styles-action-has-icon{display:flex}.components-notice-list .components-notice__action.components-button.wpcom-global-styles-action-has-icon::after,.components-notice-list .components-notice__action.components-button.wpcom-global-styles-action-has-icon::before{display:inline-block;width:15px;height:15px;position:relative;top:1px}.components-notice-list .components-notice__action.components-button.wpcom-global-styles-action-has-icon.is-primary::after,.components-notice-list .components-notice__action.components-button.wpcom-global-styles-action-has-icon.is-primary::before{background-color:#fff;background-color:var(--wp-components-color-accent-inverted, #fff)}.components-notice-list .components-notice__action.components-button.wpcom-global-styles-action-has-icon.is-secondary::after,.components-notice-list .components-notice__action.components-button.wpcom-global-styles-action-has-icon.is-secondary::before,.components-notice-list .components-notice__action.components-button.wpcom-global-styles-action-has-icon.is-link::after,.components-notice-list .components-notice__action.components-button.wpcom-global-styles-action-has-icon.is-link::before{background-color:#3858e9;background-color:var(--wp-components-color-accent, var(--wp-admin-theme-color, #3858e9))}.components-notice-list .components-notice__action.components-button.wpcom-global-styles-action-has-icon.wpcom-global-styles-action-is-external::after{content:"";margin-left:4px;-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27 width=%2715%27 height=%2715%27 aria-hidden=%27true%27 focusable=%27false%27%3E%3Cpath d=%27M18.2 17c0 .7-.6 1.2-1.2 1.2H7c-.7 0-1.2-.6-1.2-1.2V7c0-.7.6-1.2 1.2-1.2h3.2V4.2H7C5.5 4.2 4.2 5.5 4.2 7v10c0 1.5 1.2 2.8 2.8 2.8h10c1.5 0 2.8-1.2 2.8-2.8v-3.6h-1.5V17zM14.9 3v1.5h3.7l-6.4 6.4 1.1 1.1 6.4-6.4v3.7h1.5V3h-6.3z%27%3E%3C/path%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27 width=%2715%27 height=%2715%27 aria-hidden=%27true%27 focusable=%27false%27%3E%3Cpath d=%27M18.2 17c0 .7-.6 1.2-1.2 1.2H7c-.7 0-1.2-.6-1.2-1.2V7c0-.7.6-1.2 1.2-1.2h3.2V4.2H7C5.5 4.2 4.2 5.5 4.2 7v10c0 1.5 1.2 2.8 2.8 2.8h10c1.5 0 2.8-1.2 2.8-2.8v-3.6h-1.5V17zM14.9 3v1.5h3.7l-6.4 6.4 1.1 1.1 6.4-6.4v3.7h1.5V3h-6.3z%27%3E%3C/path%3E%3C/svg%3E")}.components-notice-list .components-notice__action.components-button.wpcom-global-styles-action-has-icon.wpcom-global-styles-action-is-support::before{content:"";width:15px;height:14px;margin-right:4px;-webkit-mask-image:url("data:image/svg+xml,%3Csvg width=\"15\" height=\"14\" viewBox=\"0 0 15 14\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"%3E%3Cpath d=\"M5.8125 5.6875C5.8125 4.75552 6.56802 4 7.5 4C8.43198 4 9.1875 4.75552 9.1875 5.6875C9.1875 6.55621 8.53108 7.2716 7.6872 7.36473C7.58427 7.37609 7.5 7.45895 7.5 7.5625V8.5M7.5 9.25V10.375M13.5 7C13.5 10.3137 10.8137 13 7.5 13C4.18629 13 1.5 10.3137 1.5 7C1.5 3.68629 4.18629 1 7.5 1C10.8137 1 13.5 3.68629 13.5 7Z\" style=\"stroke: %231E1E1E;\" stroke-width=\"1.5\"/%3E%3C/svg%3E%0A");mask-image:url("data:image/svg+xml,%3Csvg width=\"15\" height=\"14\" viewBox=\"0 0 15 14\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"%3E%3Cpath d=\"M5.8125 5.6875C5.8125 4.75552 6.56802 4 7.5 4C8.43198 4 9.1875 4.75552 9.1875 5.6875C9.1875 6.55621 8.53108 7.2716 7.6872 7.36473C7.58427 7.37609 7.5 7.45895 7.5 7.5625V8.5M7.5 9.25V10.375M13.5 7C13.5 10.3137 10.8137 13 7.5 13C4.18629 13 1.5 10.3137 1.5 7C1.5 3.68629 4.18629 1 7.5 1C10.8137 1 13.5 3.68629 13.5 7Z\" style=\"stroke: %231E1E1E;\" stroke-width=\"1.5\"/%3E%3C/svg%3E%0A")} -
full-site-editing/trunk/wpcom-global-styles/dist/wpcom-global-styles.js
r2996268 r3005412 1655 1655 1656 1656 1657 const GLOBAL_STYLES_VIEW_NOTICE_SELECTOR = 'wpcom-global-styles-notice-container'; 1657 1658 const trackEvent = function (eventName) { 1658 1659 let isSiteEditor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; … … 1663 1664 }; 1664 1665 function GlobalStylesWarningNotice() { 1665 const {1666 globalStylesInUse1667 } = (0,_use_global_styles_config__WEBPACK_IMPORTED_MODULE_6__/* .useGlobalStylesConfig */ .Y)();1668 1666 (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { 1669 if (globalStylesInUse) { 1670 trackEvent('calypso_global_styles_gating_notice_view_canvas_show'); 1671 } 1672 }, [globalStylesInUse]); 1673 if (!globalStylesInUse) { 1674 return null; 1675 } 1667 trackEvent('calypso_global_styles_gating_notice_view_canvas_show'); 1668 }, []); 1676 1669 const upgradeTranslation = __('Your site includes premium styles that are only visible to visitors after <a>upgrading to the Premium plan or higher</a>.', 'full-site-editing'); 1677 1670 return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Notice, { … … 1692 1685 } = (0,_use_canvas__WEBPACK_IMPORTED_MODULE_5__/* .useCanvas */ .$)(); 1693 1686 const [isRendered, setIsRendered] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(false); 1687 const { 1688 globalStylesInUse 1689 } = (0,_use_global_styles_config__WEBPACK_IMPORTED_MODULE_6__/* .useGlobalStylesConfig */ .Y)(); 1694 1690 (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { 1695 if (isRendered || canvas !== 'view') { 1691 if (!globalStylesInUse) { 1692 document.querySelector(`.${GLOBAL_STYLES_VIEW_NOTICE_SELECTOR}`)?.remove(); 1693 setIsRendered(false); 1694 return; 1695 } 1696 if (isRendered) { 1697 return; 1698 } 1699 if (canvas !== 'view') { 1696 1700 return; 1697 1701 } … … 1705 1709 const container = saveHub.parentNode; 1706 1710 const noticeContainer = document.createElement('div'); 1707 noticeContainer.classList.add( 'wpcom-global-styles-notice-container');1711 noticeContainer.classList.add(GLOBAL_STYLES_VIEW_NOTICE_SELECTOR); 1708 1712 container.insertBefore(noticeContainer, saveHub); 1709 1713 (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.render)((0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(GlobalStylesWarningNotice, null), noticeContainer); 1710 1714 setIsRendered(true); 1711 }, [isRendered, canvas ]);1715 }, [isRendered, canvas, globalStylesInUse]); 1712 1716 return null; 1713 1717 } -
full-site-editing/trunk/wpcom-global-styles/dist/wpcom-global-styles.min.js
r2988148 r3005412 1 !function(){var t={421:function(t,e){"use strict";var n=decodeURIComponent,r=encodeURIComponent,o=/; */,i=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function s(t,e){try{return e(t)}catch(n){return t}}},881:function(t){var e=1e3,n=60*e,r=60*n,o=24*r,i=7*o,s=365.25*o;function a(t,e,n,r){var o=e>=1.5*n;return Math.round(t/n)+" "+r+(o?"s":"")}t.exports=function(t,c){c=c||{};var l=typeof t;if("string"===l&&t.length>0)return function(t){if((t=String(t)).length>100)return;var a=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(!a)return;var c=parseFloat(a[1]);switch((a[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return c*s;case"weeks":case"week":case"w":return c*i;case"days":case"day":case"d":return c*o;case"hours":case"hour":case"hrs":case"hr":case"h":return c*r;case"minutes":case"minute":case"mins":case"min":case"m":return c*n;case"seconds":case"second":case"secs":case"sec":case"s":return c*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}(t);if("number"===l&&isFinite(t))return c.long?function(t){var i=Math.abs(t);if(i>=o)return a(t,i,o,"day");if(i>=r)return a(t,i,r,"hour");if(i>=n)return a(t,i,n,"minute");if(i>=e)return a(t,i,e,"second");return t+" ms"}(t):function(t){var i=Math.abs(t);if(i>=o)return Math.round(t/o)+"d";if(i>=r)return Math.round(t/r)+"h";if(i>=n)return Math.round(t/n)+"m";if(i>=e)return Math.round(t/e)+"s";return t+"ms"}(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))}},699:function(t){"use strict";var e,n="object"==typeof Reflect?Reflect:null,r=n&&"function"==typeof n.apply?n.apply:function(t,e,n){return Function.prototype.apply.call(t,e,n)};e=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var o=Number.isNaN||function(t){return t!=t};function i(){i.init.call(this)}t.exports=i,t.exports.once=function(t,e){return new Promise((function(n,r){function o(n){t.removeListener(e,i),r(n)}function i(){"function"==typeof t.removeListener&&t.removeListener("error",o),n([].slice.call(arguments))}g(t,e,i,{once:!0}),"error"!==e&&function(t,e,n){"function"==typeof t.on&&g(t,"error",e,n)}(t,o,{once:!0})}))},i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var s=10;function a(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function c(t){return void 0===t._maxListeners?i.defaultMaxListeners:t._maxListeners}function l(t,e,n,r){var o,i,s,l;if(a(n),void 0===(i=t._events)?(i=t._events=Object.create(null),t._eventsCount=0):(void 0!==i.newListener&&(t.emit("newListener",e,n.listener?n.listener:n),i=t._events),s=i[e]),void 0===s)s=i[e]=n,++t._eventsCount;else if("function"==typeof s?s=i[e]=r?[n,s]:[s,n]:r?s.unshift(n):s.push(n),(o=c(t))>0&&s.length>o&&!s.warned){s.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=t,u.type=e,u.count=s.length,l=u,console&&console.warn&&console.warn(l)}return t}function u(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function f(t,e,n){var r={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},o=u.bind(r);return o.listener=n,r.wrapFn=o,o}function d(t,e,n){var r=t._events;if(void 0===r)return[];var o=r[e];return void 0===o?[]:"function"==typeof o?n?[o.listener||o]:[o]:n?function(t){for(var e=new Array(t.length),n=0;n<e.length;++n)e[n]=t[n].listener||t[n];return e}(o):h(o,o.length)}function p(t){var e=this._events;if(void 0!==e){var n=e[t];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function h(t,e){for(var n=new Array(e),r=0;r<e;++r)n[r]=t[r];return n}function g(t,e,n,r){if("function"==typeof t.on)r.once?t.once(e,n):t.on(e,n);else{if("function"!=typeof t.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t);t.addEventListener(e,(function o(i){r.once&&t.removeEventListener(e,o),n(i)}))}}Object.defineProperty(i,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(t){if("number"!=typeof t||t<0||o(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");s=t}}),i.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},i.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||o(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},i.prototype.getMaxListeners=function(){return c(this)},i.prototype.emit=function(t){for(var e=[],n=1;n<arguments.length;n++)e.push(arguments[n]);var o="error"===t,i=this._events;if(void 0!==i)o=o&&void 0===i.error;else if(!o)return!1;if(o){var s;if(e.length>0&&(s=e[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var c=i[t];if(void 0===c)return!1;if("function"==typeof c)r(c,this,e);else{var l=c.length,u=h(c,l);for(n=0;n<l;++n)r(u[n],this,e)}return!0},i.prototype.addListener=function(t,e){return l(this,t,e,!1)},i.prototype.on=i.prototype.addListener,i.prototype.prependListener=function(t,e){return l(this,t,e,!0)},i.prototype.once=function(t,e){return a(e),this.on(t,f(this,t,e)),this},i.prototype.prependOnceListener=function(t,e){return a(e),this.prependListener(t,f(this,t,e)),this},i.prototype.removeListener=function(t,e){var n,r,o,i,s;if(a(e),void 0===(r=this._events))return this;if(void 0===(n=r[t]))return this;if(n===e||n.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete r[t],r.removeListener&&this.emit("removeListener",t,n.listener||e));else if("function"!=typeof n){for(o=-1,i=n.length-1;i>=0;i--)if(n[i]===e||n[i].listener===e){s=n[i].listener,o=i;break}if(o<0)return this;0===o?n.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(n,o),1===n.length&&(r[t]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",t,s||e)}return this},i.prototype.off=i.prototype.removeListener,i.prototype.removeAllListeners=function(t){var e,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[t]),this;if(0===arguments.length){var o,i=Object.keys(n);for(r=0;r<i.length;++r)"removeListener"!==(o=i[r])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=n[t]))this.removeListener(t,e);else if(void 0!==e)for(r=e.length-1;r>=0;r--)this.removeListener(t,e[r]);return this},i.prototype.listeners=function(t){return d(this,t,!0)},i.prototype.rawListeners=function(t){return d(this,t,!1)},i.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):p.call(t,e)},i.prototype.listenerCount=p,i.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]}},495:function(t,e,n){"use strict";var r=n(212),o=n(561);function i(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}e.BlockHash=i,i.prototype.update=function(t,e){if(t=r.toArray(t,e),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){var n=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-n,t.length),0===this.pending.length&&(this.pending=null),t=r.join32(t,0,t.length-n,this.endian);for(var o=0;o<t.length;o+=this._delta32)this._update(t,o,o+this._delta32)}return this},i.prototype.digest=function(t){return this.update(this._pad()),o(null===this.pending),this._digest(t)},i.prototype._pad=function(){var t=this.pendingTotal,e=this._delta8,n=e-(t+this.padLength)%e,r=new Array(n+this.padLength);r[0]=128;for(var o=1;o<n;o++)r[o]=0;if(t<<=3,"big"===this.endian){for(var i=8;i<this.padLength;i++)r[o++]=0;r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=t>>>24&255,r[o++]=t>>>16&255,r[o++]=t>>>8&255,r[o++]=255&t}else for(r[o++]=255&t,r[o++]=t>>>8&255,r[o++]=t>>>16&255,r[o++]=t>>>24&255,r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,i=8;i<this.padLength;i++)r[o++]=0;return r}},32:function(t,e,n){"use strict";var r=n(212),o=n(495),i=n(713),s=n(561),a=r.sum32,c=r.sum32_4,l=r.sum32_5,u=i.ch32,f=i.maj32,d=i.s0_256,p=i.s1_256,h=i.g0_256,g=i.g1_256,m=o.BlockHash,v=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function y(){if(!(this instanceof y))return new y;m.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=v,this.W=new Array(64)}r.inherits(y,m),t.exports=y,y.blockSize=512,y.outSize=256,y.hmacStrength=192,y.padLength=64,y.prototype._update=function(t,e){for(var n=this.W,r=0;r<16;r++)n[r]=t[e+r];for(;r<n.length;r++)n[r]=c(g(n[r-2]),n[r-7],h(n[r-15]),n[r-16]);var o=this.h[0],i=this.h[1],m=this.h[2],v=this.h[3],y=this.h[4],w=this.h[5],_=this.h[6],b=this.h[7];for(s(this.k.length===n.length),r=0;r<n.length;r++){var C=l(b,p(y),u(y,w,_),this.k[r],n[r]),k=a(d(o),f(o,i,m));b=_,_=w,w=y,y=a(v,C),v=m,m=i,i=o,o=a(C,k)}this.h[0]=a(this.h[0],o),this.h[1]=a(this.h[1],i),this.h[2]=a(this.h[2],m),this.h[3]=a(this.h[3],v),this.h[4]=a(this.h[4],y),this.h[5]=a(this.h[5],w),this.h[6]=a(this.h[6],_),this.h[7]=a(this.h[7],b)},y.prototype._digest=function(t){return"hex"===t?r.toHex32(this.h,"big"):r.split32(this.h,"big")}},713:function(t,e,n){"use strict";var r=n(212).rotr32;function o(t,e,n){return t&e^~t&n}function i(t,e,n){return t&e^t&n^e&n}function s(t,e,n){return t^e^n}e.ft_1=function(t,e,n,r){return 0===t?o(e,n,r):1===t||3===t?s(e,n,r):2===t?i(e,n,r):void 0},e.ch32=o,e.maj32=i,e.p32=s,e.s0_256=function(t){return r(t,2)^r(t,13)^r(t,22)},e.s1_256=function(t){return r(t,6)^r(t,11)^r(t,25)},e.g0_256=function(t){return r(t,7)^r(t,18)^t>>>3},e.g1_256=function(t){return r(t,17)^r(t,19)^t>>>10}},212:function(t,e,n){"use strict";var r=n(561),o=n(285);function i(t,e){return 55296==(64512&t.charCodeAt(e))&&(!(e<0||e+1>=t.length)&&56320==(64512&t.charCodeAt(e+1)))}function s(t){return(t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}function a(t){return 1===t.length?"0"+t:t}function c(t){return 7===t.length?"0"+t:6===t.length?"00"+t:5===t.length?"000"+t:4===t.length?"0000"+t:3===t.length?"00000"+t:2===t.length?"000000"+t:1===t.length?"0000000"+t:t}e.inherits=o,e.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var n=[];if("string"==typeof t)if(e){if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),o=0;o<t.length;o+=2)n.push(parseInt(t[o]+t[o+1],16))}else for(var r=0,o=0;o<t.length;o++){var s=t.charCodeAt(o);s<128?n[r++]=s:s<2048?(n[r++]=s>>6|192,n[r++]=63&s|128):i(t,o)?(s=65536+((1023&s)<<10)+(1023&t.charCodeAt(++o)),n[r++]=s>>18|240,n[r++]=s>>12&63|128,n[r++]=s>>6&63|128,n[r++]=63&s|128):(n[r++]=s>>12|224,n[r++]=s>>6&63|128,n[r++]=63&s|128)}else for(o=0;o<t.length;o++)n[o]=0|t[o];return n},e.toHex=function(t){for(var e="",n=0;n<t.length;n++)e+=a(t[n].toString(16));return e},e.htonl=s,e.toHex32=function(t,e){for(var n="",r=0;r<t.length;r++){var o=t[r];"little"===e&&(o=s(o)),n+=c(o.toString(16))}return n},e.zero2=a,e.zero8=c,e.join32=function(t,e,n,o){var i=n-e;r(i%4==0);for(var s=new Array(i/4),a=0,c=e;a<s.length;a++,c+=4){var l;l="big"===o?t[c]<<24|t[c+1]<<16|t[c+2]<<8|t[c+3]:t[c+3]<<24|t[c+2]<<16|t[c+1]<<8|t[c],s[a]=l>>>0}return s},e.split32=function(t,e){for(var n=new Array(4*t.length),r=0,o=0;r<t.length;r++,o+=4){var i=t[r];"big"===e?(n[o]=i>>>24,n[o+1]=i>>>16&255,n[o+2]=i>>>8&255,n[o+3]=255&i):(n[o+3]=i>>>24,n[o+2]=i>>>16&255,n[o+1]=i>>>8&255,n[o]=255&i)}return n},e.rotr32=function(t,e){return t>>>e|t<<32-e},e.rotl32=function(t,e){return t<<e|t>>>32-e},e.sum32=function(t,e){return t+e>>>0},e.sum32_3=function(t,e,n){return t+e+n>>>0},e.sum32_4=function(t,e,n,r){return t+e+n+r>>>0},e.sum32_5=function(t,e,n,r,o){return t+e+n+r+o>>>0},e.sum64=function(t,e,n,r){var o=t[e],i=r+t[e+1]>>>0,s=(i<r?1:0)+n+o;t[e]=s>>>0,t[e+1]=i},e.sum64_hi=function(t,e,n,r){return(e+r>>>0<e?1:0)+t+n>>>0},e.sum64_lo=function(t,e,n,r){return e+r>>>0},e.sum64_4_hi=function(t,e,n,r,o,i,s,a){var c=0,l=e;return c+=(l=l+r>>>0)<e?1:0,c+=(l=l+i>>>0)<i?1:0,t+n+o+s+(c+=(l=l+a>>>0)<a?1:0)>>>0},e.sum64_4_lo=function(t,e,n,r,o,i,s,a){return e+r+i+a>>>0},e.sum64_5_hi=function(t,e,n,r,o,i,s,a,c,l){var u=0,f=e;return u+=(f=f+r>>>0)<e?1:0,u+=(f=f+i>>>0)<i?1:0,u+=(f=f+a>>>0)<a?1:0,t+n+o+s+c+(u+=(f=f+l>>>0)<l?1:0)>>>0},e.sum64_5_lo=function(t,e,n,r,o,i,s,a,c,l){return e+r+i+a+l>>>0},e.rotr64_hi=function(t,e,n){return(e<<32-n|t>>>n)>>>0},e.rotr64_lo=function(t,e,n){return(t<<32-n|e>>>n)>>>0},e.shr64_hi=function(t,e,n){return t>>>n},e.shr64_lo=function(t,e,n){return(t<<32-n|e>>>n)>>>0}},285:function(t){"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}}},612:function(){},131:function(){},561:function(t){function e(t,e){if(!t)throw new Error(e||"Assertion failed")}t.exports=e,e.equal=function(t,e,n){if(t!=e)throw new Error(n||"Assertion failed: "+t+" != "+e)}},93:function(t,e,n){"use strict";var r=n(307),o=n(115),i=n(609),s=n(818),a=n(736),c=(n(196),n(731)),l=n(773);n(612);const __=a.__;e.Z=()=>{const t=(0,s.useSelect)((t=>!!t("core/edit-site")),[]),{viewCanvasPath:e}=(0,l.$)(),n=(0,s.useSelect)((n=>{if(!t)return!1;const r=n("core/interface").getActiveComplementaryArea("core/edit-site");return n("automattic/wpcom-global-styles").isModalVisible(r,e)}),[e,t]),{dismissModal:a}=(0,s.useDispatch)("automattic/wpcom-global-styles"),{set:u}=(0,s.useDispatch)("core/preferences");(0,r.useEffect)((()=>{t&&u("core/edit-site","welcomeGuideStyles",!1)}),[u,t]),(0,r.useEffect)((()=>{n&&(0,o.jN)("calypso_global_styles_gating_modal_show",{context:"site-editor"})}),[n]);const f=()=>{a(),(0,o.jN)("calypso_global_styles_gating_modal_dismiss",{context:"site-editor"})};if(!t||!n)return null;const d=__("Change all of your site's fonts, colors and more. Available on the Premium plan.","full-site-editing");return(0,r.createElement)(i.Modal,{className:"wpcom-global-styles-modal",onRequestClose:f,shouldCloseOnClickOutside:!1},(0,r.createElement)("div",{className:"wpcom-global-styles-modal__content"},(0,r.createElement)("div",{className:"wpcom-global-styles-modal__text"},(0,r.createElement)("h1",{className:"wpcom-global-styles-modal__heading"},__("A powerful new way to style your site","full-site-editing")),(0,r.createElement)("p",{className:"wpcom-global-styles-modal__description"},d),(0,r.createElement)("div",{className:"wpcom-global-styles-modal__actions"},(0,r.createElement)(i.Button,{variant:"secondary",onClick:f},__("Try it out","full-site-editing")),(0,r.createElement)(i.Button,{variant:"primary",href:wpcomGlobalStyles.upgradeUrl,target:"_top",onClick:()=>(0,o.jN)("calypso_global_styles_gating_modal_upgrade_click",{context:"site-editor"})},__("Upgrade plan","full-site-editing")))),(0,r.createElement)("div",{className:"wpcom-global-styles-modal__image"},(0,r.createElement)("img",{src:c,alt:""}))))}},172:function(t,e,n){"use strict";n.d(e,{Z:function(){return g}});var r=n(307),o=n(115),i=n(609),s=n(818),a=n(736),c=n(773),l=n(210),u=n(807);n(131);const __=a.__,f=function(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return(0,o.jN)(t,{context:e?"site-editor":"post-editor",blog_id:wpcomGlobalStyles.wpcomBlogId})};function d(){const{globalStylesInUse:t}=(0,l.Y)();if((0,r.useEffect)((()=>{t&&f("calypso_global_styles_gating_notice_view_canvas_show")}),[t]),!t)return null;const e=__("Your site includes premium styles that are only visible to visitors after <a>upgrading to the Premium plan or higher</a>.","full-site-editing");return(0,r.createElement)(i.Notice,{status:"warning",isDismissible:!1,className:"wpcom-global-styles-notice"},(0,r.createInterpolateElement)(e,{a:(0,r.createElement)(i.ExternalLink,{href:wpcomGlobalStyles.upgradeUrl,target:"_blank",onClick:()=>f("calypso_global_styles_gating_notice_view_canvas_upgrade_click")})}))}function p(){const{canvas:t}=(0,c.$)(),[e,n]=(0,r.useState)(!1);return(0,r.useEffect)((()=>{if(e||"view"!==t)return;const o=document.querySelector(".edit-site-save-hub");if(!o)return;const i=o.parentNode,s=document.createElement("div");s.classList.add("wpcom-global-styles-notice-container"),i.insertBefore(s,o),(0,r.render)((0,r.createElement)(d,null),s),n(!0)}),[e,t]),null}function h(){const t="wpcom-global-styles/gating-notice",{globalStylesInUse:e,globalStylesId:n}=(0,l.Y)(),{canvas:o}=(0,c.$)(),{isSiteEditor:i,isPostEditor:a}=(0,s.useSelect)((t=>({isSiteEditor:!!t("core/edit-site")&&"edit"===o,isPostEditor:!t("core/edit-site")&&!!t("core/editor").getCurrentPostId()})),[o]),{previewPostWithoutCustomStyles:d,canPreviewPost:p}=(0,u.u)(),{createWarningNotice:h,removeNotice:g}=(0,s.useDispatch)("core/notices"),{editEntityRecord:m}=(0,s.useDispatch)("core"),v=(0,r.useCallback)((()=>{window.open(wpcomGlobalStyles.upgradeUrl,"_blank").focus(),f("calypso_global_styles_gating_notice_upgrade_click",i)}),[i]),y=(0,r.useCallback)((()=>{d(),f("calypso_global_styles_gating_notice_preview_click",i)}),[i,d]),w=(0,r.useCallback)((()=>{n&&(m("root","globalStyles",n,{styles:{},settings:{}}),f("calypso_global_styles_gating_notice_reset_click",i))}),[m,n,i]),_=(0,r.useCallback)((()=>{window.open(wpcomGlobalStyles.resetGlobalStylesSupportUrl,"_blank").focus(),f("calypso_global_styles_gating_notice_reset_support_click",i)}),[i]),b=(0,r.useCallback)((()=>{const e=[{label:__("Upgrade now","full-site-editing"),onClick:v,variant:"primary",noDefaultClasses:!0,className:"wpcom-global-styles-action-has-icon wpcom-global-styles-action-is-external"}];a&&p&&e.push({label:__("Preview without premium styles","full-site-editing"),onClick:y,variant:"secondary",noDefaultClasses:!0,className:"wpcom-global-styles-action-has-icon wpcom-global-styles-action-is-external"}),e.push({label:__("Remove premium styles","full-site-editing"),onClick:i?w:_,variant:i?"secondary":"link",noDefaultClasses:!0,className:i?"":"wpcom-global-styles-action-has-icon wpcom-global-styles-action-is-external wpcom-global-styles-action-is-support"}),h(__("Your site includes premium styles that are only visible to visitors after upgrading to the Premium plan or higher.","full-site-editing"),{id:t,actions:e}),f("calypso_global_styles_gating_notice_show",i)}),[p,h,a,i,_,y,w,v]);return(0,r.useEffect)((()=>{if(i||a)return e?b():g(t),()=>g(t)}),[e,i,a,g,b]),null}function g(){return(0,r.createElement)(r.Fragment,null,(0,r.createElement)(p,null),(0,r.createElement)(h,null))}},915:function(t,e,n){"object"==typeof window&&window.wpcomGlobalStyles?.assetsUrl&&(n.p=window.wpcomGlobalStyles.assetsUrl)},366:function(t,e,n){"use strict";var r=n(818);const o={isModalVisible:!0};(0,r.registerStore)("automattic/wpcom-global-styles",{reducer:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:o;return"DISMISS_MODAL"===(arguments.length>1?arguments[1]:void 0).type?{...t,isModalVisible:!1}:t},actions:{dismissModal:()=>({type:"DISMISS_MODAL"})},selectors:{isModalVisible:(t,e,n)=>t.isModalVisible&&("edit-site/global-styles"===e||"/wp_global_styles"===n)},persist:!0})},773:function(t,e,n){"use strict";n.d(e,{$:function(){return i}});var r=n(818),o=n(307);function i(){const[t,e]=(0,o.useState)(),[n,i]=(0,o.useState)(),s=(0,r.useSelect)((t=>!!t("core/edit-site")),[]);return(0,o.useEffect)((()=>{if(!s)return;const t=(0,r.subscribe)((()=>{const t=new URLSearchParams(window.location.search),n=t.get("canvas")??"view";e(n),i("view"===n?t.get("path"):void 0)}));return()=>t()}),[s]),{canvas:t,viewCanvasPath:n}}},210:function(t,e,n){"use strict";n.d(e,{Y:function(){return o}});var r=n(818);function o(){return(0,r.useSelect)((t=>{const{getEditedEntityRecord:e,__experimentalGetCurrentGlobalStylesId:n}=t("core"),r=n?n():null,o=e("root","globalStyles",r),i={styles:o?.styles??{},settings:o?.settings??{}};return{globalStylesInUse:!(!Object.keys(i.styles).length&&!Object.keys(i.settings).length),globalStylesId:r}}),[])}},807:function(t,e,n){"use strict";n.d(e,{u:function(){return c}});var r=n(307),o=n(609),i=n(818),s=n(736),a=n(483);const __=s.__;function c(){const{currentPostLink:t,isAutosaveable:e,isDraft:n,isPostEditor:s,isLocked:c,isSaveable:l,previewLink:u}=(0,i.useSelect)((t=>{const{getCurrentPostId:e,getCurrentPostAttribute:n,getEditedPostPreviewLink:r,isEditedPostAutosaveable:o,isEditedPostSaveable:i,isPostLocked:s,getEditedPostAttribute:a}=t("core/editor");return{currentPostLink:n("link"),isAutosaveable:o(),isDraft:-1!==["draft","auto-draft"].indexOf(a("status")),isLocked:s(),isPostEditor:!t("core/edit-site")&&!!e(),isSaveable:i(),previewLink:r()}})),f=(0,r.useRef)(null),{autosave:d,savePost:p}=(0,i.useDispatch)("core/editor"),h=(0,r.useCallback)((()=>{s&&(f.current&&!f.current.closed||(f.current=window.open("","_blank")),f.current.focus(),e&&!c?(n?p({isPreview:!0}):d({isPreview:!0}),function(t){let e=(0,r.renderToString)((0,r.createElement)("div",{className:"editor-post-preview-button__interstitial-message"},(0,r.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 96 96"},(0,r.createElement)(o.Path,{className:"outer",d:"M48 12c19.9 0 36 16.1 36 36S67.9 84 48 84 12 67.9 12 48s16.1-36 36-36",fill:"none"}),(0,r.createElement)(o.Path,{className:"inner",d:"M69.5 46.4c0-3.9-1.4-6.7-2.6-8.8-1.6-2.6-3.1-4.9-3.1-7.5 0-2.9 2.2-5.7 5.4-5.7h.4C63.9 19.2 56.4 16 48 16c-11.2 0-21 5.7-26.7 14.4h2.1c3.3 0 8.5-.4 8.5-.4 1.7-.1 1.9 2.4.2 2.6 0 0-1.7.2-3.7.3L40 67.5l7-20.9L42 33c-1.7-.1-3.3-.3-3.3-.3-1.7-.1-1.5-2.7.2-2.6 0 0 5.3.4 8.4.4 3.3 0 8.5-.4 8.5-.4 1.7-.1 1.9 2.4.2 2.6 0 0-1.7.2-3.7.3l11.5 34.3 3.3-10.4c1.6-4.5 2.4-7.8 2.4-10.5zM16.1 48c0 12.6 7.3 23.5 18 28.7L18.8 35c-1.7 4-2.7 8.4-2.7 13zm32.5 2.8L39 78.6c2.9.8 5.9 1.3 9 1.3 3.7 0 7.3-.6 10.6-1.8-.1-.1-.2-.3-.2-.4l-9.8-26.9zM76.2 36c0 3.2-.6 6.9-2.4 11.4L64 75.6c9.5-5.5 15.9-15.8 15.9-27.6 0-5.5-1.4-10.8-3.9-15.3.1 1 .2 2.1.2 3.3z",fill:"none"})),(0,r.createElement)("p",null,__("Generating preview…","full-site-editing"))));e+='\n\t\t<style>\n\t\t\tbody {\n\t\t\t\tmargin: 0;\n\t\t\t}\n\t\t\t.editor-post-preview-button__interstitial-message {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: column;\n\t\t\t\talign-items: center;\n\t\t\t\tjustify-content: center;\n\t\t\t\theight: 100vh;\n\t\t\t\twidth: 100vw;\n\t\t\t}\n\t\t\t@-webkit-keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@-moz-keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@-o-keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t.editor-post-preview-button__interstitial-message svg {\n\t\t\t\twidth: 192px;\n\t\t\t\theight: 192px;\n\t\t\t\tstroke: #555d66;\n\t\t\t\tstroke-width: 0.75;\n\t\t\t}\n\t\t\t.editor-post-preview-button__interstitial-message svg .outer,\n\t\t\t.editor-post-preview-button__interstitial-message svg .inner {\n\t\t\t\tstroke-dasharray: 280;\n\t\t\t\tstroke-dashoffset: 280;\n\t\t\t\t-webkit-animation: paint 1.5s ease infinite alternate;\n\t\t\t\t-moz-animation: paint 1.5s ease infinite alternate;\n\t\t\t\t-o-animation: paint 1.5s ease infinite alternate;\n\t\t\t\tanimation: paint 1.5s ease infinite alternate;\n\t\t\t}\n\t\t\tp {\n\t\t\t\ttext-align: center;\n\t\t\t\tfont-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;\n\t\t\t}\n\t\t</style>\n\t',t.write(e),t.title=__("Generating preview…","full-site-editing"),t.close()}(f.current.document)):f.current&&!f.current.closed&&(f.current.location=(0,a.addQueryArgs)(u||t,{"hide-global-styles":""})))}),[d,t,e,n,c,s,u,p]);return(0,r.useEffect)((()=>{s&&f.current&&u&&!f.current.closed&&(f.current.location=(0,a.addQueryArgs)(u,{"hide-global-styles":!0}))}),[s,u]),{previewPostWithoutCustomStyles:h,canPreviewPost:l}}},115:function(t,e,n){"use strict";n.d(e,{jN:function(){return r.jN}});n(694),n(209),n(377);var r=n(792);n(722)},377:function(t,e,n){"use strict";let r=null;"undefined"!=typeof window&&window.addEventListener("popstate",(function(){r=null}))},792:function(t,e,n){"use strict";n.d(e,{jN:function(){return f}});var r=n(699),o=n(898),i=(n(421),n(377),n(209),n(358));n(694);const s=["a8c_cookie_banner_ok","a8c_cookie_banner_view","a8c_ccpa_optout","wcadmin_storeprofiler_create_jetpack_account","wcadmin_storeprofiler_connect_store","wcadmin_storeprofiler_login_jetpack_account","wcadmin_storeprofiler_payment_login","wcadmin_storeprofiler_payment_create_account","calypso_checkout_switch_to_p_24","calypso_checkout_composite_p24_submit_clicked","wpcom_launchbar_button_click"];let a,c=Promise.resolve();function l(t){"undefined"!=typeof window&&(window._tkq=window._tkq||[],window._tkq.push(t))}"undefined"!=typeof document&&(c=(0,o.ve)("//stats.wp.com/w.js?64"));const u=new r.EventEmitter;function f(t,e){if(e=e||{},(0,i.Z)('Record event "%s" called with props %o',t,e),t.startsWith("calypso_")||t.startsWith("jetpack_")||t.startsWith("wpcom_dsp_widget_")||s.includes(t)){if(a){const t=a(e);e={...e,...t}}e=Object.fromEntries(Object.entries(e).filter((t=>{let[,e]=t;return void 0!==e}))),(0,i.Z)('Recording event "%s" with actual props %o',t,e),l(["recordEvent",t,e]),u.emit("record-event",t,e)}else(0,i.Z)('- Event name must be prefixed by "calypso_", "jetpack_", or added to `EVENT_NAME_EXCEPTIONS`')}},722:function(t,e,n){"use strict";n(792)},209:function(t,e,n){"use strict";n(4)},358:function(t,e,n){"use strict";var r=n(49),o=n.n(r);e.Z=o()("calypso:analytics")},694:function(t,e,n){"use strict";n(358)},4:function(t,e,n){"use strict";n(32)},340:function(t,e,n){"use strict";n.d(e,{Yt:function(){return f},_W:function(){return u},hg:function(){return a},lZ:function(){return c}});var r=n(49);const o=n.n(r)()("lib/load-script/callback-handler"),i=new Map;function s(){return i}function a(t){return s().has(t)}function c(t,e){const n=s();a(t)?(o(`Adding a callback for an existing script from "${t}"`),n.get(t).add(e)):(o(`Adding a callback for a new script from "${t}"`),n.set(t,new Set([e])))}function l(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=s(),r=n.get(t);if(r){o(`Executing callbacks for "${t}"`+(null===e?" with success":` with error "${e}"`)),r.forEach((t=>{"function"==typeof t&&t(e)})),n.delete(t)}}function u(){const t=this.getAttribute("src");o(`Handling successful request for "${t}"`),l(t),this.onload=null}function f(){const t=this.getAttribute("src");o(`Handling failed request for "${t}"`),l(t,new Error(`Failed to load script "${t}"`)),this.onerror=null}},606:function(t,e,n){"use strict";n.d(e,{C:function(){return a},k:function(){return c}});var r=n(49),o=n.n(r),i=n(340);const s=o()("lib/load-script/dom-operations");function a(t,e){s(`Creating script element for "${t}"`);const n=document.createElement("script");return n.src=t,n.type="text/javascript",n.onload=i._W,n.onerror=i.Yt,n.async=!0,e&&Object.entries(e).forEach((t=>{let[e,r]=t;return n[e]=r})),n}function c(t){s("Attaching element to head"),document.head.appendChild(t)}},898:function(t,e,n){"use strict";n.d(e,{ve:function(){return a}});var r=n(49),o=n.n(r),i=n(340),s=n(606);o()("package/load-script");function a(t,e,n){if(!(0,i.hg)(t)&&(0,s.k)((0,s.C)(t,n)),"function"!=typeof e)return new Promise(((e,n)=>{(0,i.lZ)(t,(t=>{null===t?e():n(t)}))}));(0,i.lZ)(t,e)}},49:function(t,e,n){e.formatArgs=function(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;e.splice(1,0,n,"color: inherit");let r=0,o=0;e[0].replace(/%[a-zA-Z%]/g,(t=>{"%%"!==t&&(r++,"%c"===t&&(o=r))})),e.splice(o,0,n)},e.save=function(t){try{t?e.storage.setItem("debug",t):e.storage.removeItem("debug")}catch(n){}},e.load=function(){let t;try{t=e.storage.getItem("debug")}catch(n){}!t&&"undefined"!=typeof process&&"env"in process&&(t=process.env.DEBUG);return t},e.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},e.storage=function(){try{return localStorage}catch(t){}}(),e.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.log=console.debug||console.log||(()=>{}),t.exports=n(632)(e);const{formatters:r}=t.exports;r.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},632:function(t,e,n){t.exports=function(t){function e(t){let n,o,i,s=null;function a(){for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];if(!a.enabled)return;const i=a,s=Number(new Date),c=s-(n||s);i.diff=c,i.prev=n,i.curr=s,n=s,r[0]=e.coerce(r[0]),"string"!=typeof r[0]&&r.unshift("%O");let l=0;r[0]=r[0].replace(/%([a-zA-Z%])/g,((t,n)=>{if("%%"===t)return"%";l++;const o=e.formatters[n];if("function"==typeof o){const e=r[l];t=o.call(i,e),r.splice(l,1),l--}return t})),e.formatArgs.call(i,r);(i.log||e.log).apply(i,r)}return a.namespace=t,a.useColors=e.useColors(),a.color=e.selectColor(t),a.extend=r,a.destroy=e.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(o!==e.namespaces&&(o=e.namespaces,i=e.enabled(t)),i),set:t=>{s=t}}),"function"==typeof e.init&&e.init(a),a}function r(t,n){const r=e(this.namespace+(void 0===n?":":n)+t);return r.log=this.log,r}function o(t){return t.toString().substring(2,t.toString().length-2).replace(/\.\*\?$/,"*")}return e.debug=e,e.default=e,e.coerce=function(t){if(t instanceof Error)return t.stack||t.message;return t},e.disable=function(){const t=[...e.names.map(o),...e.skips.map(o).map((t=>"-"+t))].join(",");return e.enable(""),t},e.enable=function(t){let n;e.save(t),e.namespaces=t,e.names=[],e.skips=[];const r=("string"==typeof t?t:"").split(/[\s,]+/),o=r.length;for(n=0;n<o;n++)r[n]&&("-"===(t=r[n].replace(/\*/g,".*?"))[0]?e.skips.push(new RegExp("^"+t.slice(1)+"$")):e.names.push(new RegExp("^"+t+"$")))},e.enabled=function(t){if("*"===t[t.length-1])return!0;let n,r;for(n=0,r=e.skips.length;n<r;n++)if(e.skips[n].test(t))return!1;for(n=0,r=e.names.length;n<r;n++)if(e.names[n].test(t))return!0;return!1},e.humanize=n(881),e.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(t).forEach((n=>{e[n]=t[n]})),e.names=[],e.skips=[],e.formatters={},e.selectColor=function(t){let n=0;for(let e=0;e<t.length;e++)n=(n<<5)-n+t.charCodeAt(e),n|=0;return e.colors[Math.abs(n)%e.colors.length]},e.enable(e.load()),e}},731:function(t,e,n){"use strict";t.exports=n.p+"images/image-f40c6b2b12b942b650ea.svg"},196:function(t){"use strict";t.exports=window.React},609:function(t){"use strict";t.exports=window.wp.components},818:function(t){"use strict";t.exports=window.wp.data},701:function(t){"use strict";t.exports=window.wp.domReady},307:function(t){"use strict";t.exports=window.wp.element},736:function(t){"use strict";t.exports=window.wp.i18n},817:function(t){"use strict";t.exports=window.wp.plugins},483:function(t){"use strict";t.exports=window.wp.url}},e={};function n(r){var o=e[r];if(void 0!==o)return o.exports;var i=e[r]={exports:{}};return t[r](i,i.exports,n),i.exports}n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,{a:e}),e},n.d=function(t,e){for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},function(){var t;n.g.importScripts&&(t=n.g.location+"");var e=n.g.document;if(!t&&e&&(e.currentScript&&(t=e.currentScript.src),!t)){var r=e.getElementsByTagName("script");if(r.length)for(var o=r.length-1;o>-1&&!t;)t=r[o--].src}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=t}();var r={};!function(){"use strict";n.r(r);var t=n(307),e=(n(915),n(701)),o=n.n(e),i=n(817),s=n(93),a=n(172);n(366);o()((()=>{(0,i.registerPlugin)("wpcom-global-styles",{render:()=>(0,t.createElement)(t.Fragment,null,(0,t.createElement)(s.Z,null),(0,t.createElement)(a.Z,null))})}))}(),window.EditingToolkit=r}();1 !function(){var t={421:function(t,e){"use strict";var n=decodeURIComponent,r=encodeURIComponent,o=/; */,i=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function s(t,e){try{return e(t)}catch(n){return t}}},881:function(t){var e=1e3,n=60*e,r=60*n,o=24*r,i=7*o,s=365.25*o;function c(t,e,n,r){var o=e>=1.5*n;return Math.round(t/n)+" "+r+(o?"s":"")}t.exports=function(t,a){a=a||{};var l=typeof t;if("string"===l&&t.length>0)return function(t){if((t=String(t)).length>100)return;var c=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(!c)return;var a=parseFloat(c[1]);switch((c[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return a*s;case"weeks":case"week":case"w":return a*i;case"days":case"day":case"d":return a*o;case"hours":case"hour":case"hrs":case"hr":case"h":return a*r;case"minutes":case"minute":case"mins":case"min":case"m":return a*n;case"seconds":case"second":case"secs":case"sec":case"s":return a*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return a;default:return}}(t);if("number"===l&&isFinite(t))return a.long?function(t){var i=Math.abs(t);if(i>=o)return c(t,i,o,"day");if(i>=r)return c(t,i,r,"hour");if(i>=n)return c(t,i,n,"minute");if(i>=e)return c(t,i,e,"second");return t+" ms"}(t):function(t){var i=Math.abs(t);if(i>=o)return Math.round(t/o)+"d";if(i>=r)return Math.round(t/r)+"h";if(i>=n)return Math.round(t/n)+"m";if(i>=e)return Math.round(t/e)+"s";return t+"ms"}(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))}},699:function(t){"use strict";var e,n="object"==typeof Reflect?Reflect:null,r=n&&"function"==typeof n.apply?n.apply:function(t,e,n){return Function.prototype.apply.call(t,e,n)};e=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var o=Number.isNaN||function(t){return t!=t};function i(){i.init.call(this)}t.exports=i,t.exports.once=function(t,e){return new Promise((function(n,r){function o(n){t.removeListener(e,i),r(n)}function i(){"function"==typeof t.removeListener&&t.removeListener("error",o),n([].slice.call(arguments))}g(t,e,i,{once:!0}),"error"!==e&&function(t,e,n){"function"==typeof t.on&&g(t,"error",e,n)}(t,o,{once:!0})}))},i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var s=10;function c(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function a(t){return void 0===t._maxListeners?i.defaultMaxListeners:t._maxListeners}function l(t,e,n,r){var o,i,s,l;if(c(n),void 0===(i=t._events)?(i=t._events=Object.create(null),t._eventsCount=0):(void 0!==i.newListener&&(t.emit("newListener",e,n.listener?n.listener:n),i=t._events),s=i[e]),void 0===s)s=i[e]=n,++t._eventsCount;else if("function"==typeof s?s=i[e]=r?[n,s]:[s,n]:r?s.unshift(n):s.push(n),(o=a(t))>0&&s.length>o&&!s.warned){s.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=t,u.type=e,u.count=s.length,l=u,console&&console.warn&&console.warn(l)}return t}function u(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function f(t,e,n){var r={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},o=u.bind(r);return o.listener=n,r.wrapFn=o,o}function d(t,e,n){var r=t._events;if(void 0===r)return[];var o=r[e];return void 0===o?[]:"function"==typeof o?n?[o.listener||o]:[o]:n?function(t){for(var e=new Array(t.length),n=0;n<e.length;++n)e[n]=t[n].listener||t[n];return e}(o):h(o,o.length)}function p(t){var e=this._events;if(void 0!==e){var n=e[t];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function h(t,e){for(var n=new Array(e),r=0;r<e;++r)n[r]=t[r];return n}function g(t,e,n,r){if("function"==typeof t.on)r.once?t.once(e,n):t.on(e,n);else{if("function"!=typeof t.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t);t.addEventListener(e,(function o(i){r.once&&t.removeEventListener(e,o),n(i)}))}}Object.defineProperty(i,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(t){if("number"!=typeof t||t<0||o(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");s=t}}),i.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},i.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||o(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},i.prototype.getMaxListeners=function(){return a(this)},i.prototype.emit=function(t){for(var e=[],n=1;n<arguments.length;n++)e.push(arguments[n]);var o="error"===t,i=this._events;if(void 0!==i)o=o&&void 0===i.error;else if(!o)return!1;if(o){var s;if(e.length>0&&(s=e[0]),s instanceof Error)throw s;var c=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw c.context=s,c}var a=i[t];if(void 0===a)return!1;if("function"==typeof a)r(a,this,e);else{var l=a.length,u=h(a,l);for(n=0;n<l;++n)r(u[n],this,e)}return!0},i.prototype.addListener=function(t,e){return l(this,t,e,!1)},i.prototype.on=i.prototype.addListener,i.prototype.prependListener=function(t,e){return l(this,t,e,!0)},i.prototype.once=function(t,e){return c(e),this.on(t,f(this,t,e)),this},i.prototype.prependOnceListener=function(t,e){return c(e),this.prependListener(t,f(this,t,e)),this},i.prototype.removeListener=function(t,e){var n,r,o,i,s;if(c(e),void 0===(r=this._events))return this;if(void 0===(n=r[t]))return this;if(n===e||n.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete r[t],r.removeListener&&this.emit("removeListener",t,n.listener||e));else if("function"!=typeof n){for(o=-1,i=n.length-1;i>=0;i--)if(n[i]===e||n[i].listener===e){s=n[i].listener,o=i;break}if(o<0)return this;0===o?n.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(n,o),1===n.length&&(r[t]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",t,s||e)}return this},i.prototype.off=i.prototype.removeListener,i.prototype.removeAllListeners=function(t){var e,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[t]),this;if(0===arguments.length){var o,i=Object.keys(n);for(r=0;r<i.length;++r)"removeListener"!==(o=i[r])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=n[t]))this.removeListener(t,e);else if(void 0!==e)for(r=e.length-1;r>=0;r--)this.removeListener(t,e[r]);return this},i.prototype.listeners=function(t){return d(this,t,!0)},i.prototype.rawListeners=function(t){return d(this,t,!1)},i.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):p.call(t,e)},i.prototype.listenerCount=p,i.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]}},495:function(t,e,n){"use strict";var r=n(212),o=n(561);function i(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}e.BlockHash=i,i.prototype.update=function(t,e){if(t=r.toArray(t,e),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){var n=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-n,t.length),0===this.pending.length&&(this.pending=null),t=r.join32(t,0,t.length-n,this.endian);for(var o=0;o<t.length;o+=this._delta32)this._update(t,o,o+this._delta32)}return this},i.prototype.digest=function(t){return this.update(this._pad()),o(null===this.pending),this._digest(t)},i.prototype._pad=function(){var t=this.pendingTotal,e=this._delta8,n=e-(t+this.padLength)%e,r=new Array(n+this.padLength);r[0]=128;for(var o=1;o<n;o++)r[o]=0;if(t<<=3,"big"===this.endian){for(var i=8;i<this.padLength;i++)r[o++]=0;r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=t>>>24&255,r[o++]=t>>>16&255,r[o++]=t>>>8&255,r[o++]=255&t}else for(r[o++]=255&t,r[o++]=t>>>8&255,r[o++]=t>>>16&255,r[o++]=t>>>24&255,r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,i=8;i<this.padLength;i++)r[o++]=0;return r}},32:function(t,e,n){"use strict";var r=n(212),o=n(495),i=n(713),s=n(561),c=r.sum32,a=r.sum32_4,l=r.sum32_5,u=i.ch32,f=i.maj32,d=i.s0_256,p=i.s1_256,h=i.g0_256,g=i.g1_256,m=o.BlockHash,v=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function y(){if(!(this instanceof y))return new y;m.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=v,this.W=new Array(64)}r.inherits(y,m),t.exports=y,y.blockSize=512,y.outSize=256,y.hmacStrength=192,y.padLength=64,y.prototype._update=function(t,e){for(var n=this.W,r=0;r<16;r++)n[r]=t[e+r];for(;r<n.length;r++)n[r]=a(g(n[r-2]),n[r-7],h(n[r-15]),n[r-16]);var o=this.h[0],i=this.h[1],m=this.h[2],v=this.h[3],y=this.h[4],w=this.h[5],_=this.h[6],b=this.h[7];for(s(this.k.length===n.length),r=0;r<n.length;r++){var C=l(b,p(y),u(y,w,_),this.k[r],n[r]),k=c(d(o),f(o,i,m));b=_,_=w,w=y,y=c(v,C),v=m,m=i,i=o,o=c(C,k)}this.h[0]=c(this.h[0],o),this.h[1]=c(this.h[1],i),this.h[2]=c(this.h[2],m),this.h[3]=c(this.h[3],v),this.h[4]=c(this.h[4],y),this.h[5]=c(this.h[5],w),this.h[6]=c(this.h[6],_),this.h[7]=c(this.h[7],b)},y.prototype._digest=function(t){return"hex"===t?r.toHex32(this.h,"big"):r.split32(this.h,"big")}},713:function(t,e,n){"use strict";var r=n(212).rotr32;function o(t,e,n){return t&e^~t&n}function i(t,e,n){return t&e^t&n^e&n}function s(t,e,n){return t^e^n}e.ft_1=function(t,e,n,r){return 0===t?o(e,n,r):1===t||3===t?s(e,n,r):2===t?i(e,n,r):void 0},e.ch32=o,e.maj32=i,e.p32=s,e.s0_256=function(t){return r(t,2)^r(t,13)^r(t,22)},e.s1_256=function(t){return r(t,6)^r(t,11)^r(t,25)},e.g0_256=function(t){return r(t,7)^r(t,18)^t>>>3},e.g1_256=function(t){return r(t,17)^r(t,19)^t>>>10}},212:function(t,e,n){"use strict";var r=n(561),o=n(285);function i(t,e){return 55296==(64512&t.charCodeAt(e))&&(!(e<0||e+1>=t.length)&&56320==(64512&t.charCodeAt(e+1)))}function s(t){return(t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}function c(t){return 1===t.length?"0"+t:t}function a(t){return 7===t.length?"0"+t:6===t.length?"00"+t:5===t.length?"000"+t:4===t.length?"0000"+t:3===t.length?"00000"+t:2===t.length?"000000"+t:1===t.length?"0000000"+t:t}e.inherits=o,e.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var n=[];if("string"==typeof t)if(e){if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),o=0;o<t.length;o+=2)n.push(parseInt(t[o]+t[o+1],16))}else for(var r=0,o=0;o<t.length;o++){var s=t.charCodeAt(o);s<128?n[r++]=s:s<2048?(n[r++]=s>>6|192,n[r++]=63&s|128):i(t,o)?(s=65536+((1023&s)<<10)+(1023&t.charCodeAt(++o)),n[r++]=s>>18|240,n[r++]=s>>12&63|128,n[r++]=s>>6&63|128,n[r++]=63&s|128):(n[r++]=s>>12|224,n[r++]=s>>6&63|128,n[r++]=63&s|128)}else for(o=0;o<t.length;o++)n[o]=0|t[o];return n},e.toHex=function(t){for(var e="",n=0;n<t.length;n++)e+=c(t[n].toString(16));return e},e.htonl=s,e.toHex32=function(t,e){for(var n="",r=0;r<t.length;r++){var o=t[r];"little"===e&&(o=s(o)),n+=a(o.toString(16))}return n},e.zero2=c,e.zero8=a,e.join32=function(t,e,n,o){var i=n-e;r(i%4==0);for(var s=new Array(i/4),c=0,a=e;c<s.length;c++,a+=4){var l;l="big"===o?t[a]<<24|t[a+1]<<16|t[a+2]<<8|t[a+3]:t[a+3]<<24|t[a+2]<<16|t[a+1]<<8|t[a],s[c]=l>>>0}return s},e.split32=function(t,e){for(var n=new Array(4*t.length),r=0,o=0;r<t.length;r++,o+=4){var i=t[r];"big"===e?(n[o]=i>>>24,n[o+1]=i>>>16&255,n[o+2]=i>>>8&255,n[o+3]=255&i):(n[o+3]=i>>>24,n[o+2]=i>>>16&255,n[o+1]=i>>>8&255,n[o]=255&i)}return n},e.rotr32=function(t,e){return t>>>e|t<<32-e},e.rotl32=function(t,e){return t<<e|t>>>32-e},e.sum32=function(t,e){return t+e>>>0},e.sum32_3=function(t,e,n){return t+e+n>>>0},e.sum32_4=function(t,e,n,r){return t+e+n+r>>>0},e.sum32_5=function(t,e,n,r,o){return t+e+n+r+o>>>0},e.sum64=function(t,e,n,r){var o=t[e],i=r+t[e+1]>>>0,s=(i<r?1:0)+n+o;t[e]=s>>>0,t[e+1]=i},e.sum64_hi=function(t,e,n,r){return(e+r>>>0<e?1:0)+t+n>>>0},e.sum64_lo=function(t,e,n,r){return e+r>>>0},e.sum64_4_hi=function(t,e,n,r,o,i,s,c){var a=0,l=e;return a+=(l=l+r>>>0)<e?1:0,a+=(l=l+i>>>0)<i?1:0,t+n+o+s+(a+=(l=l+c>>>0)<c?1:0)>>>0},e.sum64_4_lo=function(t,e,n,r,o,i,s,c){return e+r+i+c>>>0},e.sum64_5_hi=function(t,e,n,r,o,i,s,c,a,l){var u=0,f=e;return u+=(f=f+r>>>0)<e?1:0,u+=(f=f+i>>>0)<i?1:0,u+=(f=f+c>>>0)<c?1:0,t+n+o+s+a+(u+=(f=f+l>>>0)<l?1:0)>>>0},e.sum64_5_lo=function(t,e,n,r,o,i,s,c,a,l){return e+r+i+c+l>>>0},e.rotr64_hi=function(t,e,n){return(e<<32-n|t>>>n)>>>0},e.rotr64_lo=function(t,e,n){return(t<<32-n|e>>>n)>>>0},e.shr64_hi=function(t,e,n){return t>>>n},e.shr64_lo=function(t,e,n){return(t<<32-n|e>>>n)>>>0}},285:function(t){"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}}},612:function(){},131:function(){},561:function(t){function e(t,e){if(!t)throw new Error(e||"Assertion failed")}t.exports=e,e.equal=function(t,e,n){if(t!=e)throw new Error(n||"Assertion failed: "+t+" != "+e)}},93:function(t,e,n){"use strict";var r=n(307),o=n(115),i=n(609),s=n(818),c=n(736),a=(n(196),n(731)),l=n(773);n(612);const __=c.__;e.Z=()=>{const t=(0,s.useSelect)((t=>!!t("core/edit-site")),[]),{viewCanvasPath:e}=(0,l.$)(),n=(0,s.useSelect)((n=>{if(!t)return!1;const r=n("core/interface").getActiveComplementaryArea("core/edit-site");return n("automattic/wpcom-global-styles").isModalVisible(r,e)}),[e,t]),{dismissModal:c}=(0,s.useDispatch)("automattic/wpcom-global-styles"),{set:u}=(0,s.useDispatch)("core/preferences");(0,r.useEffect)((()=>{t&&u("core/edit-site","welcomeGuideStyles",!1)}),[u,t]),(0,r.useEffect)((()=>{n&&(0,o.jN)("calypso_global_styles_gating_modal_show",{context:"site-editor"})}),[n]);const f=()=>{c(),(0,o.jN)("calypso_global_styles_gating_modal_dismiss",{context:"site-editor"})};if(!t||!n)return null;const d=__("Change all of your site's fonts, colors and more. Available on the Premium plan.","full-site-editing");return(0,r.createElement)(i.Modal,{className:"wpcom-global-styles-modal",onRequestClose:f,shouldCloseOnClickOutside:!1},(0,r.createElement)("div",{className:"wpcom-global-styles-modal__content"},(0,r.createElement)("div",{className:"wpcom-global-styles-modal__text"},(0,r.createElement)("h1",{className:"wpcom-global-styles-modal__heading"},__("A powerful new way to style your site","full-site-editing")),(0,r.createElement)("p",{className:"wpcom-global-styles-modal__description"},d),(0,r.createElement)("div",{className:"wpcom-global-styles-modal__actions"},(0,r.createElement)(i.Button,{variant:"secondary",onClick:f},__("Try it out","full-site-editing")),(0,r.createElement)(i.Button,{variant:"primary",href:wpcomGlobalStyles.upgradeUrl,target:"_top",onClick:()=>(0,o.jN)("calypso_global_styles_gating_modal_upgrade_click",{context:"site-editor"})},__("Upgrade plan","full-site-editing")))),(0,r.createElement)("div",{className:"wpcom-global-styles-modal__image"},(0,r.createElement)("img",{src:a,alt:""}))))}},172:function(t,e,n){"use strict";n.d(e,{Z:function(){return m}});var r=n(307),o=n(115),i=n(609),s=n(818),c=n(736),a=n(773),l=n(210),u=n(807);n(131);const __=c.__,f="wpcom-global-styles-notice-container",d=function(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return(0,o.jN)(t,{context:e?"site-editor":"post-editor",blog_id:wpcomGlobalStyles.wpcomBlogId})};function p(){(0,r.useEffect)((()=>{d("calypso_global_styles_gating_notice_view_canvas_show")}),[]);const t=__("Your site includes premium styles that are only visible to visitors after <a>upgrading to the Premium plan or higher</a>.","full-site-editing");return(0,r.createElement)(i.Notice,{status:"warning",isDismissible:!1,className:"wpcom-global-styles-notice"},(0,r.createInterpolateElement)(t,{a:(0,r.createElement)(i.ExternalLink,{href:wpcomGlobalStyles.upgradeUrl,target:"_blank",onClick:()=>d("calypso_global_styles_gating_notice_view_canvas_upgrade_click")})}))}function h(){const{canvas:t}=(0,a.$)(),[e,n]=(0,r.useState)(!1),{globalStylesInUse:o}=(0,l.Y)();return(0,r.useEffect)((()=>{if(!o)return document.querySelector(`.${f}`)?.remove(),void n(!1);if(e)return;if("view"!==t)return;const i=document.querySelector(".edit-site-save-hub");if(!i)return;const s=i.parentNode,c=document.createElement("div");c.classList.add(f),s.insertBefore(c,i),(0,r.render)((0,r.createElement)(p,null),c),n(!0)}),[e,t,o]),null}function g(){const t="wpcom-global-styles/gating-notice",{globalStylesInUse:e,globalStylesId:n}=(0,l.Y)(),{canvas:o}=(0,a.$)(),{isSiteEditor:i,isPostEditor:c}=(0,s.useSelect)((t=>({isSiteEditor:!!t("core/edit-site")&&"edit"===o,isPostEditor:!t("core/edit-site")&&!!t("core/editor").getCurrentPostId()})),[o]),{previewPostWithoutCustomStyles:f,canPreviewPost:p}=(0,u.u)(),{createWarningNotice:h,removeNotice:g}=(0,s.useDispatch)("core/notices"),{editEntityRecord:m}=(0,s.useDispatch)("core"),v=(0,r.useCallback)((()=>{window.open(wpcomGlobalStyles.upgradeUrl,"_blank").focus(),d("calypso_global_styles_gating_notice_upgrade_click",i)}),[i]),y=(0,r.useCallback)((()=>{f(),d("calypso_global_styles_gating_notice_preview_click",i)}),[i,f]),w=(0,r.useCallback)((()=>{n&&(m("root","globalStyles",n,{styles:{},settings:{}}),d("calypso_global_styles_gating_notice_reset_click",i))}),[m,n,i]),_=(0,r.useCallback)((()=>{window.open(wpcomGlobalStyles.resetGlobalStylesSupportUrl,"_blank").focus(),d("calypso_global_styles_gating_notice_reset_support_click",i)}),[i]),b=(0,r.useCallback)((()=>{const e=[{label:__("Upgrade now","full-site-editing"),onClick:v,variant:"primary",noDefaultClasses:!0,className:"wpcom-global-styles-action-has-icon wpcom-global-styles-action-is-external"}];c&&p&&e.push({label:__("Preview without premium styles","full-site-editing"),onClick:y,variant:"secondary",noDefaultClasses:!0,className:"wpcom-global-styles-action-has-icon wpcom-global-styles-action-is-external"}),e.push({label:__("Remove premium styles","full-site-editing"),onClick:i?w:_,variant:i?"secondary":"link",noDefaultClasses:!0,className:i?"":"wpcom-global-styles-action-has-icon wpcom-global-styles-action-is-external wpcom-global-styles-action-is-support"}),h(__("Your site includes premium styles that are only visible to visitors after upgrading to the Premium plan or higher.","full-site-editing"),{id:t,actions:e}),d("calypso_global_styles_gating_notice_show",i)}),[p,h,c,i,_,y,w,v]);return(0,r.useEffect)((()=>{if(i||c)return e?b():g(t),()=>g(t)}),[e,i,c,g,b]),null}function m(){return(0,r.createElement)(r.Fragment,null,(0,r.createElement)(h,null),(0,r.createElement)(g,null))}},915:function(t,e,n){"object"==typeof window&&window.wpcomGlobalStyles?.assetsUrl&&(n.p=window.wpcomGlobalStyles.assetsUrl)},366:function(t,e,n){"use strict";var r=n(818);const o={isModalVisible:!0};(0,r.registerStore)("automattic/wpcom-global-styles",{reducer:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:o;return"DISMISS_MODAL"===(arguments.length>1?arguments[1]:void 0).type?{...t,isModalVisible:!1}:t},actions:{dismissModal:()=>({type:"DISMISS_MODAL"})},selectors:{isModalVisible:(t,e,n)=>t.isModalVisible&&("edit-site/global-styles"===e||"/wp_global_styles"===n)},persist:!0})},773:function(t,e,n){"use strict";n.d(e,{$:function(){return i}});var r=n(818),o=n(307);function i(){const[t,e]=(0,o.useState)(),[n,i]=(0,o.useState)(),s=(0,r.useSelect)((t=>!!t("core/edit-site")),[]);return(0,o.useEffect)((()=>{if(!s)return;const t=(0,r.subscribe)((()=>{const t=new URLSearchParams(window.location.search),n=t.get("canvas")??"view";e(n),i("view"===n?t.get("path"):void 0)}));return()=>t()}),[s]),{canvas:t,viewCanvasPath:n}}},210:function(t,e,n){"use strict";n.d(e,{Y:function(){return o}});var r=n(818);function o(){return(0,r.useSelect)((t=>{const{getEditedEntityRecord:e,__experimentalGetCurrentGlobalStylesId:n}=t("core"),r=n?n():null,o=e("root","globalStyles",r),i={styles:o?.styles??{},settings:o?.settings??{}};return{globalStylesInUse:!(!Object.keys(i.styles).length&&!Object.keys(i.settings).length),globalStylesId:r}}),[])}},807:function(t,e,n){"use strict";n.d(e,{u:function(){return a}});var r=n(307),o=n(609),i=n(818),s=n(736),c=n(483);const __=s.__;function a(){const{currentPostLink:t,isAutosaveable:e,isDraft:n,isPostEditor:s,isLocked:a,isSaveable:l,previewLink:u}=(0,i.useSelect)((t=>{const{getCurrentPostId:e,getCurrentPostAttribute:n,getEditedPostPreviewLink:r,isEditedPostAutosaveable:o,isEditedPostSaveable:i,isPostLocked:s,getEditedPostAttribute:c}=t("core/editor");return{currentPostLink:n("link"),isAutosaveable:o(),isDraft:-1!==["draft","auto-draft"].indexOf(c("status")),isLocked:s(),isPostEditor:!t("core/edit-site")&&!!e(),isSaveable:i(),previewLink:r()}})),f=(0,r.useRef)(null),{autosave:d,savePost:p}=(0,i.useDispatch)("core/editor"),h=(0,r.useCallback)((()=>{s&&(f.current&&!f.current.closed||(f.current=window.open("","_blank")),f.current.focus(),e&&!a?(n?p({isPreview:!0}):d({isPreview:!0}),function(t){let e=(0,r.renderToString)((0,r.createElement)("div",{className:"editor-post-preview-button__interstitial-message"},(0,r.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 96 96"},(0,r.createElement)(o.Path,{className:"outer",d:"M48 12c19.9 0 36 16.1 36 36S67.9 84 48 84 12 67.9 12 48s16.1-36 36-36",fill:"none"}),(0,r.createElement)(o.Path,{className:"inner",d:"M69.5 46.4c0-3.9-1.4-6.7-2.6-8.8-1.6-2.6-3.1-4.9-3.1-7.5 0-2.9 2.2-5.7 5.4-5.7h.4C63.9 19.2 56.4 16 48 16c-11.2 0-21 5.7-26.7 14.4h2.1c3.3 0 8.5-.4 8.5-.4 1.7-.1 1.9 2.4.2 2.6 0 0-1.7.2-3.7.3L40 67.5l7-20.9L42 33c-1.7-.1-3.3-.3-3.3-.3-1.7-.1-1.5-2.7.2-2.6 0 0 5.3.4 8.4.4 3.3 0 8.5-.4 8.5-.4 1.7-.1 1.9 2.4.2 2.6 0 0-1.7.2-3.7.3l11.5 34.3 3.3-10.4c1.6-4.5 2.4-7.8 2.4-10.5zM16.1 48c0 12.6 7.3 23.5 18 28.7L18.8 35c-1.7 4-2.7 8.4-2.7 13zm32.5 2.8L39 78.6c2.9.8 5.9 1.3 9 1.3 3.7 0 7.3-.6 10.6-1.8-.1-.1-.2-.3-.2-.4l-9.8-26.9zM76.2 36c0 3.2-.6 6.9-2.4 11.4L64 75.6c9.5-5.5 15.9-15.8 15.9-27.6 0-5.5-1.4-10.8-3.9-15.3.1 1 .2 2.1.2 3.3z",fill:"none"})),(0,r.createElement)("p",null,__("Generating preview…","full-site-editing"))));e+='\n\t\t<style>\n\t\t\tbody {\n\t\t\t\tmargin: 0;\n\t\t\t}\n\t\t\t.editor-post-preview-button__interstitial-message {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: column;\n\t\t\t\talign-items: center;\n\t\t\t\tjustify-content: center;\n\t\t\t\theight: 100vh;\n\t\t\t\twidth: 100vw;\n\t\t\t}\n\t\t\t@-webkit-keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@-moz-keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@-o-keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t.editor-post-preview-button__interstitial-message svg {\n\t\t\t\twidth: 192px;\n\t\t\t\theight: 192px;\n\t\t\t\tstroke: #555d66;\n\t\t\t\tstroke-width: 0.75;\n\t\t\t}\n\t\t\t.editor-post-preview-button__interstitial-message svg .outer,\n\t\t\t.editor-post-preview-button__interstitial-message svg .inner {\n\t\t\t\tstroke-dasharray: 280;\n\t\t\t\tstroke-dashoffset: 280;\n\t\t\t\t-webkit-animation: paint 1.5s ease infinite alternate;\n\t\t\t\t-moz-animation: paint 1.5s ease infinite alternate;\n\t\t\t\t-o-animation: paint 1.5s ease infinite alternate;\n\t\t\t\tanimation: paint 1.5s ease infinite alternate;\n\t\t\t}\n\t\t\tp {\n\t\t\t\ttext-align: center;\n\t\t\t\tfont-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;\n\t\t\t}\n\t\t</style>\n\t',t.write(e),t.title=__("Generating preview…","full-site-editing"),t.close()}(f.current.document)):f.current&&!f.current.closed&&(f.current.location=(0,c.addQueryArgs)(u||t,{"hide-global-styles":""})))}),[d,t,e,n,a,s,u,p]);return(0,r.useEffect)((()=>{s&&f.current&&u&&!f.current.closed&&(f.current.location=(0,c.addQueryArgs)(u,{"hide-global-styles":!0}))}),[s,u]),{previewPostWithoutCustomStyles:h,canPreviewPost:l}}},115:function(t,e,n){"use strict";n.d(e,{jN:function(){return r.jN}});n(694),n(209),n(377);var r=n(792);n(722)},377:function(t,e,n){"use strict";let r=null;"undefined"!=typeof window&&window.addEventListener("popstate",(function(){r=null}))},792:function(t,e,n){"use strict";n.d(e,{jN:function(){return f}});var r=n(699),o=n(898),i=(n(421),n(377),n(209),n(358));n(694);const s=["a8c_cookie_banner_ok","a8c_cookie_banner_view","a8c_ccpa_optout","wcadmin_storeprofiler_create_jetpack_account","wcadmin_storeprofiler_connect_store","wcadmin_storeprofiler_login_jetpack_account","wcadmin_storeprofiler_payment_login","wcadmin_storeprofiler_payment_create_account","calypso_checkout_switch_to_p_24","calypso_checkout_composite_p24_submit_clicked","wpcom_launchbar_button_click"];let c,a=Promise.resolve();function l(t){"undefined"!=typeof window&&(window._tkq=window._tkq||[],window._tkq.push(t))}"undefined"!=typeof document&&(a=(0,o.ve)("//stats.wp.com/w.js?64"));const u=new r.EventEmitter;function f(t,e){if(e=e||{},(0,i.Z)('Record event "%s" called with props %o',t,e),t.startsWith("calypso_")||t.startsWith("jetpack_")||t.startsWith("wpcom_dsp_widget_")||s.includes(t)){if(c){const t=c(e);e={...e,...t}}e=Object.fromEntries(Object.entries(e).filter((t=>{let[,e]=t;return void 0!==e}))),(0,i.Z)('Recording event "%s" with actual props %o',t,e),l(["recordEvent",t,e]),u.emit("record-event",t,e)}else(0,i.Z)('- Event name must be prefixed by "calypso_", "jetpack_", or added to `EVENT_NAME_EXCEPTIONS`')}},722:function(t,e,n){"use strict";n(792)},209:function(t,e,n){"use strict";n(4)},358:function(t,e,n){"use strict";var r=n(49),o=n.n(r);e.Z=o()("calypso:analytics")},694:function(t,e,n){"use strict";n(358)},4:function(t,e,n){"use strict";n(32)},340:function(t,e,n){"use strict";n.d(e,{Yt:function(){return f},_W:function(){return u},hg:function(){return c},lZ:function(){return a}});var r=n(49);const o=n.n(r)()("lib/load-script/callback-handler"),i=new Map;function s(){return i}function c(t){return s().has(t)}function a(t,e){const n=s();c(t)?(o(`Adding a callback for an existing script from "${t}"`),n.get(t).add(e)):(o(`Adding a callback for a new script from "${t}"`),n.set(t,new Set([e])))}function l(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=s(),r=n.get(t);if(r){o(`Executing callbacks for "${t}"`+(null===e?" with success":` with error "${e}"`)),r.forEach((t=>{"function"==typeof t&&t(e)})),n.delete(t)}}function u(){const t=this.getAttribute("src");o(`Handling successful request for "${t}"`),l(t),this.onload=null}function f(){const t=this.getAttribute("src");o(`Handling failed request for "${t}"`),l(t,new Error(`Failed to load script "${t}"`)),this.onerror=null}},606:function(t,e,n){"use strict";n.d(e,{C:function(){return c},k:function(){return a}});var r=n(49),o=n.n(r),i=n(340);const s=o()("lib/load-script/dom-operations");function c(t,e){s(`Creating script element for "${t}"`);const n=document.createElement("script");return n.src=t,n.type="text/javascript",n.onload=i._W,n.onerror=i.Yt,n.async=!0,e&&Object.entries(e).forEach((t=>{let[e,r]=t;return n[e]=r})),n}function a(t){s("Attaching element to head"),document.head.appendChild(t)}},898:function(t,e,n){"use strict";n.d(e,{ve:function(){return c}});var r=n(49),o=n.n(r),i=n(340),s=n(606);o()("package/load-script");function c(t,e,n){if(!(0,i.hg)(t)&&(0,s.k)((0,s.C)(t,n)),"function"!=typeof e)return new Promise(((e,n)=>{(0,i.lZ)(t,(t=>{null===t?e():n(t)}))}));(0,i.lZ)(t,e)}},49:function(t,e,n){e.formatArgs=function(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;e.splice(1,0,n,"color: inherit");let r=0,o=0;e[0].replace(/%[a-zA-Z%]/g,(t=>{"%%"!==t&&(r++,"%c"===t&&(o=r))})),e.splice(o,0,n)},e.save=function(t){try{t?e.storage.setItem("debug",t):e.storage.removeItem("debug")}catch(n){}},e.load=function(){let t;try{t=e.storage.getItem("debug")}catch(n){}!t&&"undefined"!=typeof process&&"env"in process&&(t=process.env.DEBUG);return t},e.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},e.storage=function(){try{return localStorage}catch(t){}}(),e.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.log=console.debug||console.log||(()=>{}),t.exports=n(632)(e);const{formatters:r}=t.exports;r.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},632:function(t,e,n){t.exports=function(t){function e(t){let n,o,i,s=null;function c(){for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];if(!c.enabled)return;const i=c,s=Number(new Date),a=s-(n||s);i.diff=a,i.prev=n,i.curr=s,n=s,r[0]=e.coerce(r[0]),"string"!=typeof r[0]&&r.unshift("%O");let l=0;r[0]=r[0].replace(/%([a-zA-Z%])/g,((t,n)=>{if("%%"===t)return"%";l++;const o=e.formatters[n];if("function"==typeof o){const e=r[l];t=o.call(i,e),r.splice(l,1),l--}return t})),e.formatArgs.call(i,r);(i.log||e.log).apply(i,r)}return c.namespace=t,c.useColors=e.useColors(),c.color=e.selectColor(t),c.extend=r,c.destroy=e.destroy,Object.defineProperty(c,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(o!==e.namespaces&&(o=e.namespaces,i=e.enabled(t)),i),set:t=>{s=t}}),"function"==typeof e.init&&e.init(c),c}function r(t,n){const r=e(this.namespace+(void 0===n?":":n)+t);return r.log=this.log,r}function o(t){return t.toString().substring(2,t.toString().length-2).replace(/\.\*\?$/,"*")}return e.debug=e,e.default=e,e.coerce=function(t){if(t instanceof Error)return t.stack||t.message;return t},e.disable=function(){const t=[...e.names.map(o),...e.skips.map(o).map((t=>"-"+t))].join(",");return e.enable(""),t},e.enable=function(t){let n;e.save(t),e.namespaces=t,e.names=[],e.skips=[];const r=("string"==typeof t?t:"").split(/[\s,]+/),o=r.length;for(n=0;n<o;n++)r[n]&&("-"===(t=r[n].replace(/\*/g,".*?"))[0]?e.skips.push(new RegExp("^"+t.slice(1)+"$")):e.names.push(new RegExp("^"+t+"$")))},e.enabled=function(t){if("*"===t[t.length-1])return!0;let n,r;for(n=0,r=e.skips.length;n<r;n++)if(e.skips[n].test(t))return!1;for(n=0,r=e.names.length;n<r;n++)if(e.names[n].test(t))return!0;return!1},e.humanize=n(881),e.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(t).forEach((n=>{e[n]=t[n]})),e.names=[],e.skips=[],e.formatters={},e.selectColor=function(t){let n=0;for(let e=0;e<t.length;e++)n=(n<<5)-n+t.charCodeAt(e),n|=0;return e.colors[Math.abs(n)%e.colors.length]},e.enable(e.load()),e}},731:function(t,e,n){"use strict";t.exports=n.p+"images/image-f40c6b2b12b942b650ea.svg"},196:function(t){"use strict";t.exports=window.React},609:function(t){"use strict";t.exports=window.wp.components},818:function(t){"use strict";t.exports=window.wp.data},701:function(t){"use strict";t.exports=window.wp.domReady},307:function(t){"use strict";t.exports=window.wp.element},736:function(t){"use strict";t.exports=window.wp.i18n},817:function(t){"use strict";t.exports=window.wp.plugins},483:function(t){"use strict";t.exports=window.wp.url}},e={};function n(r){var o=e[r];if(void 0!==o)return o.exports;var i=e[r]={exports:{}};return t[r](i,i.exports,n),i.exports}n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,{a:e}),e},n.d=function(t,e){for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},function(){var t;n.g.importScripts&&(t=n.g.location+"");var e=n.g.document;if(!t&&e&&(e.currentScript&&(t=e.currentScript.src),!t)){var r=e.getElementsByTagName("script");if(r.length)for(var o=r.length-1;o>-1&&!t;)t=r[o--].src}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=t}();var r={};!function(){"use strict";n.r(r);var t=n(307),e=(n(915),n(701)),o=n.n(e),i=n(817),s=n(93),c=n(172);n(366);o()((()=>{(0,i.registerPlugin)("wpcom-global-styles",{render:()=>(0,t.createElement)(t.Fragment,null,(0,t.createElement)(s.Z,null),(0,t.createElement)(c.Z,null))})}))}(),window.EditingToolkit=r}(); 2 2 //# sourceMappingURL=wpcom-global-styles.min.js.map -
full-site-editing/trunk/wpcom-global-styles/dist/wpcom-global-styles.rtl.css
r2947492 r3005412 1 @font-face{font-display:swap;font-family:Recoleta;font-weight:400;src:url(https://s1.wp.com/i/fonts/recoleta/400.woff2) format("woff2"),url(https://s1.wp.com/i/fonts/recoleta/400.woff) format("woff")}.wp-brand-font{font-family:"Noto Serif",Georgia,Times New Roman,Times,serif;font-weight:400}[lang*=af] .wp-brand-font,[lang*=ca] .wp-brand-font,[lang*=cs] .wp-brand-font,[lang*=da] .wp-brand-font,[lang*=de] .wp-brand-font,[lang*=en] .wp-brand-font,[lang*=es] .wp-brand-font,[lang*=eu] .wp-brand-font,[lang*=fi] .wp-brand-font,[lang*=fr] .wp-brand-font,[lang*=gl] .wp-brand-font,[lang*=hr] .wp-brand-font,[lang*=hu] .wp-brand-font,[lang*=id] .wp-brand-font,[lang*=is] .wp-brand-font,[lang*=it] .wp-brand-font,[lang*=lv] .wp-brand-font,[lang*=mt] .wp-brand-font,[lang*=nb] .wp-brand-font,[lang*=nl] .wp-brand-font,[lang*=pl] .wp-brand-font,[lang*=pt] .wp-brand-font,[lang*=ro] .wp-brand-font,[lang*=ru] .wp-brand-font,[lang*=sk] .wp-brand-font,[lang*=sl] .wp-brand-font,[lang*=sq] .wp-brand-font,[lang*=sr] .wp-brand-font,[lang*=sv] .wp-brand-font,[lang*=sw] .wp-brand-font,[lang*=tr] .wp-brand-font,[lang*=uz] .wp-brand-font{font-family:Recoleta,"Noto Serif",Georgia,Times New Roman,Times,serif}.wpcom-global-styles-modal .components-modal__content{margin-top:0;padding:0}.wpcom-global-styles-modal .components-modal__header{border-bottom-width:0;height:auto;position:absolute}.wpcom-global-styles-modal .wpcom-global-styles-modal__content{align-items:flex-start;display:flex;flex-direction:column-reverse;justify-content:flex-end}@media(min-width:600px){.wpcom-global-styles-modal .wpcom-global-styles-modal__content{flex-direction:row;justify-content:flex-start}}@media(min-width:600px)and (min-height:600px){.wpcom-global-styles-modal .wpcom-global-styles-modal__content{align-items:stretch}}.wpcom-global-styles-modal .wpcom-global-styles-modal__image,.wpcom-global-styles-modal .wpcom-global-styles-modal__text{width:100%}@media(min-width:600px){.wpcom-global-styles-modal .wpcom-global-styles-modal__image,.wpcom-global-styles-modal .wpcom-global-styles-modal__text{max-width:380px;width:auto}}.wpcom-global-styles-modal .wpcom-global-styles-modal__text{display:flex;flex-direction:column;padding:32px}@media(min-width:600px)and (min-height:600px){.wpcom-global-styles-modal .wpcom-global-styles-modal__text{padding:64px 48px}}.wpcom-global-styles-modal .wpcom-global-styles-modal__heading{font-family:Recoleta,"Noto Serif",Georgia,Times New Roman,Times,serif;font-size:1.75rem;font-weight:400;line-height:32px;margin-bottom:16px;margin-top:0}@media(min-width:600px)and (min-height:600px){.wpcom-global-styles-modal .wpcom-global-styles-modal__heading{font-size:2rem;line-height:40px}}.wpcom-global-styles-modal .wpcom-global-styles-modal__description{font-size:1rem;line-height:24px;margin-bottom:32px;margin-top:0}.wpcom-global-styles-modal .wpcom-global-styles-modal__actions{display:flex;gap:16px;justify-content:center;margin-top:auto}.wpcom-global-styles-modal .wpcom-global-styles-modal__actions .components-button{flex-grow:1;justify-content:center}.wpcom-global-styles-modal .wpcom-global-styles-modal__image{background-color:#d0cce3;display:flex;justify-content:flex-end;max-height:50vh;padding:32px 32px 32px 0}@media(min-width:600px){.wpcom-global-styles-modal .wpcom-global-styles-modal__image{max-height:70vh}}@media(min-width:600px)and (min-height:600px){.wpcom-global-styles-modal .wpcom-global-styles-modal__image{max-height:none;padding:64px 64px 64px 0}}.wpcom-global-styles-modal .wpcom-global-styles-modal__image img{width:100%}. edit-site-save-hub{border-top:none;padding-top:0}.wpcom-global-styles-notice-container{border-top:1px solid #2f2f2f;padding:24px 24px0}.wpcom-global-styles-notice{color:var(--color-text);margin:0 0 24px}.wpcom-global-styles-notice .components-notice__content{margin-left:0}.components-notice-list .components-notice__action.components-button.wpcom-global-styles-action-has-icon{display:flex}.components-notice-list .components-notice__action.components-button.wpcom-global-styles-action-has-icon:after,.components-notice-list .components-notice__action.components-button.wpcom-global-styles-action-has-icon:before{display:inline-block;height:15px;position:relative;top:1px;width:15px}.components-notice-list .components-notice__action.components-button.wpcom-global-styles-action-has-icon.is-primary:after,.components-notice-list .components-notice__action.components-button.wpcom-global-styles-action-has-icon.is-primary:before{background-color:#fff;background-color:var(--wp-components-color-accent-inverted,#fff)}.components-notice-list .components-notice__action.components-button.wpcom-global-styles-action-has-icon.is-link:after,.components-notice-list .components-notice__action.components-button.wpcom-global-styles-action-has-icon.is-link:before,.components-notice-list .components-notice__action.components-button.wpcom-global-styles-action-has-icon.is-secondary:after,.components-notice-list .components-notice__action.components-button.wpcom-global-styles-action-has-icon.is-secondary:before{background-color:#3858e9;background-color:var(--wp-components-color-accent,var(--wp-admin-theme-color,#3858e9))}.components-notice-list .components-notice__action.components-button.wpcom-global-styles-action-has-icon.wpcom-global-styles-action-is-external:after{content:"";margin-right:4px;-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='15' height='15' aria-hidden='true'%3E%3Cpath d='M18.2 17c0 .7-.6 1.2-1.2 1.2H7c-.7 0-1.2-.6-1.2-1.2V7c0-.7.6-1.2 1.2-1.2h3.2V4.2H7C5.5 4.2 4.2 5.5 4.2 7v10c0 1.5 1.2 2.8 2.8 2.8h10c1.5 0 2.8-1.2 2.8-2.8v-3.6h-1.5V17zM14.9 3v1.5h3.7l-6.4 6.4 1.1 1.1 6.4-6.4v3.7h1.5V3h-6.3z'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='15' height='15' aria-hidden='true'%3E%3Cpath d='M18.2 17c0 .7-.6 1.2-1.2 1.2H7c-.7 0-1.2-.6-1.2-1.2V7c0-.7.6-1.2 1.2-1.2h3.2V4.2H7C5.5 4.2 4.2 5.5 4.2 7v10c0 1.5 1.2 2.8 2.8 2.8h10c1.5 0 2.8-1.2 2.8-2.8v-3.6h-1.5V17zM14.9 3v1.5h3.7l-6.4 6.4 1.1 1.1 6.4-6.4v3.7h1.5V3h-6.3z'/%3E%3C/svg%3E")}.components-notice-list .components-notice__action.components-button.wpcom-global-styles-action-has-icon.wpcom-global-styles-action-is-support:before{content:"";height:14px;margin-left:4px;-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='15' height='14' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5.813 5.688a1.688 1.688 0 1 1 1.874 1.677.205.205 0 0 0-.187.197V8.5m0 .75v1.125M13.5 7a6 6 0 1 1-12 0 6 6 0 0 1 12 0Z' style='stroke:%231e1e1e' stroke-width='1.5'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='15' height='14' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5.813 5.688a1.688 1.688 0 1 1 1.874 1.677.205.205 0 0 0-.187.197V8.5m0 .75v1.125M13.5 7a6 6 0 1 1-12 0 6 6 0 0 1 12 0Z' style='stroke:%231e1e1e' stroke-width='1.5'/%3E%3C/svg%3E");width:15px}1 @font-face{font-display:swap;font-family:Recoleta;font-weight:400;src:url(https://s1.wp.com/i/fonts/recoleta/400.woff2) format("woff2"),url(https://s1.wp.com/i/fonts/recoleta/400.woff) format("woff")}.wp-brand-font{font-family:"Noto Serif",Georgia,Times New Roman,Times,serif;font-weight:400}[lang*=af] .wp-brand-font,[lang*=ca] .wp-brand-font,[lang*=cs] .wp-brand-font,[lang*=da] .wp-brand-font,[lang*=de] .wp-brand-font,[lang*=en] .wp-brand-font,[lang*=es] .wp-brand-font,[lang*=eu] .wp-brand-font,[lang*=fi] .wp-brand-font,[lang*=fr] .wp-brand-font,[lang*=gl] .wp-brand-font,[lang*=hr] .wp-brand-font,[lang*=hu] .wp-brand-font,[lang*=id] .wp-brand-font,[lang*=is] .wp-brand-font,[lang*=it] .wp-brand-font,[lang*=lv] .wp-brand-font,[lang*=mt] .wp-brand-font,[lang*=nb] .wp-brand-font,[lang*=nl] .wp-brand-font,[lang*=pl] .wp-brand-font,[lang*=pt] .wp-brand-font,[lang*=ro] .wp-brand-font,[lang*=ru] .wp-brand-font,[lang*=sk] .wp-brand-font,[lang*=sl] .wp-brand-font,[lang*=sq] .wp-brand-font,[lang*=sr] .wp-brand-font,[lang*=sv] .wp-brand-font,[lang*=sw] .wp-brand-font,[lang*=tr] .wp-brand-font,[lang*=uz] .wp-brand-font{font-family:Recoleta,"Noto Serif",Georgia,Times New Roman,Times,serif}.wpcom-global-styles-modal .components-modal__content{margin-top:0;padding:0}.wpcom-global-styles-modal .components-modal__header{border-bottom-width:0;height:auto;position:absolute}.wpcom-global-styles-modal .wpcom-global-styles-modal__content{align-items:flex-start;display:flex;flex-direction:column-reverse;justify-content:flex-end}@media(min-width:600px){.wpcom-global-styles-modal .wpcom-global-styles-modal__content{flex-direction:row;justify-content:flex-start}}@media(min-width:600px)and (min-height:600px){.wpcom-global-styles-modal .wpcom-global-styles-modal__content{align-items:stretch}}.wpcom-global-styles-modal .wpcom-global-styles-modal__image,.wpcom-global-styles-modal .wpcom-global-styles-modal__text{width:100%}@media(min-width:600px){.wpcom-global-styles-modal .wpcom-global-styles-modal__image,.wpcom-global-styles-modal .wpcom-global-styles-modal__text{max-width:380px;width:auto}}.wpcom-global-styles-modal .wpcom-global-styles-modal__text{display:flex;flex-direction:column;padding:32px}@media(min-width:600px)and (min-height:600px){.wpcom-global-styles-modal .wpcom-global-styles-modal__text{padding:64px 48px}}.wpcom-global-styles-modal .wpcom-global-styles-modal__heading{font-family:Recoleta,"Noto Serif",Georgia,Times New Roman,Times,serif;font-size:1.75rem;font-weight:400;line-height:32px;margin-bottom:16px;margin-top:0}@media(min-width:600px)and (min-height:600px){.wpcom-global-styles-modal .wpcom-global-styles-modal__heading{font-size:2rem;line-height:40px}}.wpcom-global-styles-modal .wpcom-global-styles-modal__description{font-size:1rem;line-height:24px;margin-bottom:32px;margin-top:0}.wpcom-global-styles-modal .wpcom-global-styles-modal__actions{display:flex;gap:16px;justify-content:center;margin-top:auto}.wpcom-global-styles-modal .wpcom-global-styles-modal__actions .components-button{flex-grow:1;justify-content:center}.wpcom-global-styles-modal .wpcom-global-styles-modal__image{background-color:#d0cce3;display:flex;justify-content:flex-end;max-height:50vh;padding:32px 32px 32px 0}@media(min-width:600px){.wpcom-global-styles-modal .wpcom-global-styles-modal__image{max-height:70vh}}@media(min-width:600px)and (min-height:600px){.wpcom-global-styles-modal .wpcom-global-styles-modal__image{max-height:none;padding:64px 64px 64px 0}}.wpcom-global-styles-modal .wpcom-global-styles-modal__image img{width:100%}.wpcom-global-styles-notice-container{border-top:1px solid #2f2f2f;padding:24px 24px 0}.wpcom-global-styles-notice-container+.edit-site-save-hub{border-top:none;padding-top:0}.wpcom-global-styles-notice{color:var(--color-text);margin:0 0 24px}.wpcom-global-styles-notice .components-notice__content{margin-left:0}.components-notice-list .components-notice__action.components-button.wpcom-global-styles-action-has-icon{display:flex}.components-notice-list .components-notice__action.components-button.wpcom-global-styles-action-has-icon:after,.components-notice-list .components-notice__action.components-button.wpcom-global-styles-action-has-icon:before{display:inline-block;height:15px;position:relative;top:1px;width:15px}.components-notice-list .components-notice__action.components-button.wpcom-global-styles-action-has-icon.is-primary:after,.components-notice-list .components-notice__action.components-button.wpcom-global-styles-action-has-icon.is-primary:before{background-color:#fff;background-color:var(--wp-components-color-accent-inverted,#fff)}.components-notice-list .components-notice__action.components-button.wpcom-global-styles-action-has-icon.is-link:after,.components-notice-list .components-notice__action.components-button.wpcom-global-styles-action-has-icon.is-link:before,.components-notice-list .components-notice__action.components-button.wpcom-global-styles-action-has-icon.is-secondary:after,.components-notice-list .components-notice__action.components-button.wpcom-global-styles-action-has-icon.is-secondary:before{background-color:#3858e9;background-color:var(--wp-components-color-accent,var(--wp-admin-theme-color,#3858e9))}.components-notice-list .components-notice__action.components-button.wpcom-global-styles-action-has-icon.wpcom-global-styles-action-is-external:after{content:"";margin-right:4px;-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='15' height='15' aria-hidden='true'%3E%3Cpath d='M18.2 17c0 .7-.6 1.2-1.2 1.2H7c-.7 0-1.2-.6-1.2-1.2V7c0-.7.6-1.2 1.2-1.2h3.2V4.2H7C5.5 4.2 4.2 5.5 4.2 7v10c0 1.5 1.2 2.8 2.8 2.8h10c1.5 0 2.8-1.2 2.8-2.8v-3.6h-1.5V17zM14.9 3v1.5h3.7l-6.4 6.4 1.1 1.1 6.4-6.4v3.7h1.5V3h-6.3z'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='15' height='15' aria-hidden='true'%3E%3Cpath d='M18.2 17c0 .7-.6 1.2-1.2 1.2H7c-.7 0-1.2-.6-1.2-1.2V7c0-.7.6-1.2 1.2-1.2h3.2V4.2H7C5.5 4.2 4.2 5.5 4.2 7v10c0 1.5 1.2 2.8 2.8 2.8h10c1.5 0 2.8-1.2 2.8-2.8v-3.6h-1.5V17zM14.9 3v1.5h3.7l-6.4 6.4 1.1 1.1 6.4-6.4v3.7h1.5V3h-6.3z'/%3E%3C/svg%3E")}.components-notice-list .components-notice__action.components-button.wpcom-global-styles-action-has-icon.wpcom-global-styles-action-is-support:before{content:"";height:14px;margin-left:4px;-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='15' height='14' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5.813 5.688a1.688 1.688 0 1 1 1.874 1.677.205.205 0 0 0-.187.197V8.5m0 .75v1.125M13.5 7a6 6 0 1 1-12 0 6 6 0 0 1 12 0Z' style='stroke:%231e1e1e' stroke-width='1.5'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='15' height='14' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5.813 5.688a1.688 1.688 0 1 1 1.874 1.677.205.205 0 0 0-.187.197V8.5m0 .75v1.125M13.5 7a6 6 0 1 1-12 0 6 6 0 0 1 12 0Z' style='stroke:%231e1e1e' stroke-width='1.5'/%3E%3C/svg%3E");width:15px} -
full-site-editing/trunk/wpcom-global-styles/notice.scss
r2929627 r3005412 1 .edit-site-save-hub {2 border-top: none;3 padding-top: 0;4 }5 6 1 .wpcom-global-styles-notice-container { 7 2 padding: 24px 24px 0; 8 3 border-top: 1px solid #2f2f2f; 4 // Hide the original border only when the notice is present. 5 + .edit-site-save-hub { 6 border-top: none; 7 padding-top: 0; 8 } 9 9 } 10 10 -
full-site-editing/trunk/wpcom-global-styles/notices.js
r2979885 r3005412 16 16 import './notice.scss'; 17 17 18 const GLOBAL_STYLES_VIEW_NOTICE_SELECTOR = 'wpcom-global-styles-notice-container'; 19 18 20 const trackEvent = ( eventName, isSiteEditor = true ) => 19 21 recordTracksEvent( eventName, { … … 23 25 24 26 function GlobalStylesWarningNotice() { 25 const { globalStylesInUse } = useGlobalStylesConfig();26 27 27 useEffect( () => { 28 if ( globalStylesInUse ) { 29 trackEvent( 'calypso_global_styles_gating_notice_view_canvas_show' ); 30 } 31 }, [ globalStylesInUse ] ); 32 33 if ( ! globalStylesInUse ) { 34 return null; 35 } 28 trackEvent( 'calypso_global_styles_gating_notice_view_canvas_show' ); 29 }, [] ); 36 30 37 31 const upgradeTranslation = __( … … 59 53 function GlobalStylesViewNotice() { 60 54 const { canvas } = useCanvas(); 61 62 55 const [ isRendered, setIsRendered ] = useState( false ); 56 const { globalStylesInUse } = useGlobalStylesConfig(); 63 57 64 58 useEffect( () => { 65 if ( isRendered || canvas !== 'view' ) { 59 if ( ! globalStylesInUse ) { 60 document.querySelector( `.${ GLOBAL_STYLES_VIEW_NOTICE_SELECTOR }` )?.remove(); 61 setIsRendered( false ); 62 return; 63 } 64 65 if ( isRendered ) { 66 return; 67 } 68 if ( canvas !== 'view' ) { 66 69 return; 67 70 } … … 76 79 const container = saveHub.parentNode; 77 80 const noticeContainer = document.createElement( 'div' ); 78 noticeContainer.classList.add( 'wpcom-global-styles-notice-container');81 noticeContainer.classList.add( GLOBAL_STYLES_VIEW_NOTICE_SELECTOR ); 79 82 container.insertBefore( noticeContainer, saveHub ); 80 83 … … 82 85 83 86 setIsRendered( true ); 84 }, [ isRendered, canvas ] );87 }, [ isRendered, canvas, globalStylesInUse ] ); 85 88 86 89 return null;
Note: See TracChangeset
for help on using the changeset viewer.