From 2743b9aa8d76c01629f0e6e389977c9adae77faf Mon Sep 17 00:00:00 2001 From: Amin Ramezani Date: Mon, 22 Jan 2024 13:12:40 +0330 Subject: [PATCH] Update Version 2.22.1 --- css/_boxes.scss | 23 +- css/force-dashicons.css | 1120 ++++++----- css/force-dashicons.css.map | 8 +- css/force-dashicons.scss | 3 + css/menu-editor.css | 39 +- css/menu-editor.css.map | 2 +- css/menu-editor.scss | 59 +- customizables/Controls/ColorPicker.php | 5 + customizables/Controls/Container.php | 23 + customizables/Controls/Control.php | 7 +- customizables/SampleModule.php | 2 + customizables/Settings/UserDefinedStruct.php | 4 + dist/admin-customizer-preview.bundle.js | 1183 +++++++++++ dist/admin-customizer-preview.bundle.js.map | 1 + dist/admin-customizer.bundle.js | 435 +++- dist/admin-customizer.bundle.js.map | 2 +- dist/build.manifest.json | 14 + dist/customizable.bundle.js | 2 +- dist/customizable.bundle.js.map | 2 +- dist/menu-styler-features.bundle.js | 402 ++++ dist/menu-styler-features.bundle.js.map | 1 + dist/menu-styler-ui.bundle.js | 1223 ++++++++++++ dist/menu-styler-ui.bundle.js.map | 1 + extras.php | 60 +- extras/dynamic-stylesheets/Stylesheet.php | 32 +- extras/font-awesome/scss/font-awesome.css | 3 +- extras/font-awesome/scss/font-awesome.css.map | 2 +- extras/font-awesome/scss/font-awesome.scss | 3 +- extras/ko-extensions.js | 31 +- extras/ko-extensions.js.map | 2 +- extras/ko-extensions.ts | 44 +- extras/menu-headings/ameMenuHeadingStyler.php | 62 +- .../menu-headings/menu-headings-template.php | 2 +- extras/menu-headings/menu-headings.js | 3 + extras/menu-headings/menu-headings.js.map | 2 +- extras/menu-headings/menu-headings.ts | 4 + .../admin-customizer-template.php | 122 +- .../admin-customizer/admin-customizer.css | 4 + .../admin-customizer/admin-customizer.css.map | 2 +- .../admin-customizer/admin-customizer.js | 391 +++- .../admin-customizer/admin-customizer.js.map | 2 +- .../admin-customizer/admin-customizer.php | 612 +++++- .../admin-customizer/admin-customizer.scss | 18 +- .../admin-customizer/admin-customizer.ts | 491 ++++- .../modules/admin-customizer/communicator.js | 92 +- .../admin-customizer/communicator.js.map | 2 +- .../modules/admin-customizer/communicator.ts | 95 +- .../ko-components/ame-ac-section-link.js | 3 +- .../ko-components/ame-ac-section-link.js.map | 2 +- .../ko-components/ame-ac-section-link.ts | 4 +- .../ko-components/ame-ac-section.js | 17 +- .../ko-components/ame-ac-section.js.map | 2 +- .../ko-components/ame-ac-section.ts | 24 +- .../ko-components/ame-ac-structure.js | 15 +- .../ko-components/ame-ac-structure.js.map | 2 +- .../ko-components/ame-ac-structure.ts | 15 +- .../admin-menu-colors/admin-menu-colors.js | 3 +- .../admin-menu-colors.js.map | 2 +- .../admin-menu-colors/admin-menu-colors.php | 29 +- .../admin-menu-colors/admin-menu-colors.ts | 3 +- .../admin-menu-colors/color-dialog.php | 2 +- .../dashboard-styler/dashboard-styler.php | 225 ++- extras/modules/easy-hide/easy-hide.php | 8 +- .../menu-styler/menu-styler-template.php | 2 +- extras/modules/menu-styler/menu-styler-ui.js | 1 + .../modules/menu-styler/menu-styler-ui.js.map | 2 +- extras/modules/menu-styler/menu-styler-ui.ts | 2 + extras/modules/menu-styler/menu-styler.php | 187 +- .../modules/role-editor/ameRexCapability.php | 19 + extras/modules/role-editor/ameRoleEditor.php | 10 + extras/modules/role-editor/role-editor.css | 788 +++++--- .../modules/role-editor/role-editor.css.map | 8 +- extras/modules/role-editor/role-editor.ts | 4 +- .../separator-styles/MenuSeparatorStyler.php | 3 + extras/modules/tweaks/ameJqueryTweak.php | 94 + extras/modules/tweaks/default-tweaks.php | 200 +- extras/modules/tweaks/tweaks-template.php | 2 +- extras/modules/tweaks/tweaks.css | 9 +- extras/modules/tweaks/tweaks.css.map | 2 +- extras/modules/tweaks/tweaks.php | 129 +- extras/pro-admin-helpers.js | 22 +- extras/pro-admin-helpers.js.map | 2 +- extras/pro-admin-helpers.ts | 26 +- extras/pro-admin-styles.css | 9 + extras/pro-admin-styles.css.map | 2 +- extras/pro-admin-styles.scss | 18 +- extras/pro-autoloader.php | 27 +- .../pro-customizables/assets/customizable.js | 2 +- .../assets/customizable.js.map | 2 +- .../pro-customizables/assets/customizable.ts | 1 + .../ame-box-dimensions/ame-box-dimensions.js | 7 +- .../ame-box-dimensions.js.map | 2 +- .../ame-box-dimensions/ame-box-dimensions.ts | 11 +- .../ko-components/control-base.js | 2 +- .../ko-components/control-base.js.map | 2 +- .../ko-components/control-base.ts | 2 +- extras/style-generator/CssRuleSet.php | 4 + extras/style-generator/Dsl/ArrayValue.php | 16 + extras/style-generator/Dsl/DslFunctions.php | 17 + extras/style-generator/Dsl/Expression.php | 15 + extras/style-generator/Dsl/FunctionCall.php | 20 + .../style-generator/Dsl/SettingReference.php | 5 + .../style-generator/Dsl/VariableReference.php | 4 + extras/style-generator/StyleGenerator.php | 36 + extras/style-generator/style-generator.js | 12 + extras/style-generator/style-generator.js.map | 2 +- extras/style-generator/style-generator.ts | 16 + .../webpack-registry/WebpackAssetRegistry.php | 131 ++ includes/basic-dependencies.php | 2 +- includes/editor-page.php | 472 ++++- includes/menu-editor-core.php | 74 +- includes/menu-item.php | 33 + includes/menu.php | 41 +- js/common.d.ts | 8 + js/menu-editor.d.ts | 2 +- js/menu-editor.js | 100 +- license-manager/BasicPluginLicensingUi.php | 3 +- license-manager/LicenseManager.php | 2 +- menu-editor.php | 2 +- .../access-editor/access-editor-template.php | 2 +- modules/access-editor/access-editor.js | 2 + .../plugin-visibility/plugin-visibility.php | 109 +- modules/redirector/redirector.css | 9 +- modules/redirector/redirector.css.map | 2 +- package-lock.json | 1766 +++++++++++++---- package.json | 7 +- plugin-updates/Puc/v5/PucFactory.php | 2 +- plugin-updates/Puc/v5p3/Autoloader.php | 86 + .../Puc/v5p3/DebugBar/Extension.php | 199 ++ plugin-updates/Puc/v5p3/DebugBar/Panel.php | 178 ++ .../Puc/v5p3/DebugBar/PluginExtension.php | 40 + .../Puc/v5p3/DebugBar/PluginPanel.php | 41 + .../Puc/v5p3/DebugBar/ThemePanel.php | 25 + plugin-updates/Puc/v5p3/InstalledPackage.php | 105 + plugin-updates/Puc/v5p3/Metadata.php | 162 ++ plugin-updates/Puc/v5p3/OAuthSignature.php | 102 + plugin-updates/Puc/v5p3/Plugin/Package.php | 188 ++ plugin-updates/Puc/v5p3/Plugin/PluginInfo.php | 136 ++ plugin-updates/Puc/v5p3/Plugin/Ui.php | 294 +++ plugin-updates/Puc/v5p3/Plugin/Update.php | 116 ++ .../Puc/v5p3/Plugin/UpdateChecker.php | 425 ++++ plugin-updates/Puc/v5p3/PucFactory.php | 362 ++++ plugin-updates/Puc/v5p3/Scheduler.php | 278 +++ plugin-updates/Puc/v5p3/StateStore.php | 209 ++ plugin-updates/Puc/v5p3/Theme/Package.php | 69 + plugin-updates/Puc/v5p3/Theme/Update.php | 88 + .../Puc/v5p3/Theme/UpdateChecker.php | 159 ++ plugin-updates/Puc/v5p3/Update.php | 38 + plugin-updates/Puc/v5p3/UpdateChecker.php | 1007 ++++++++++ plugin-updates/Puc/v5p3/UpgraderStatus.php | 200 ++ plugin-updates/Puc/v5p3/Utils.php | 70 + plugin-updates/Puc/v5p3/Vcs/Api.php | 379 ++++ plugin-updates/Puc/v5p3/Vcs/BaseChecker.php | 29 + plugin-updates/Puc/v5p3/Vcs/BitBucketApi.php | 272 +++ plugin-updates/Puc/v5p3/Vcs/GitHubApi.php | 467 +++++ plugin-updates/Puc/v5p3/Vcs/GitLabApi.php | 414 ++++ .../Puc/v5p3/Vcs/PluginUpdateChecker.php | 275 +++ plugin-updates/Puc/v5p3/Vcs/Reference.php | 51 + .../Puc/v5p3/Vcs/ReleaseAssetSupport.php | 83 + .../Puc/v5p3/Vcs/ReleaseFilteringFeature.php | 108 + .../Puc/v5p3/Vcs/ThemeUpdateChecker.php | 83 + .../Puc/v5p3/Vcs/VcsCheckerMethods.php | 59 + plugin-updates/README.md | 24 +- plugin-updates/composer.json | 2 +- .../languages/plugin-update-checker.pot | 12 +- plugin-updates/license.txt | 2 +- plugin-updates/load-v5p3.php | 34 + plugin-updates/plugin-update-checker.php | 4 +- readme.txt | 54 +- tests_output/CHROME_117.0.5938.92__basic.json | 1 + tests_output/CHROME_117.0.5938.92__basic.xml | 49 + .../basic/CHROME_117.0.5938.92__ecosia.json | 1 + .../basic/CHROME_117.0.5938.92__ecosia.xml | 30 + tests_output/basic/ecosia.json | 1 + tests_output/basic/ecosia.xml | 52 + tests_output/minimal_report.json | 1 + .../nightwatch-html-report/index.html | 166 ++ webpack.config.js | 25 +- 178 files changed, 16711 insertions(+), 2057 deletions(-) create mode 100644 dist/admin-customizer-preview.bundle.js create mode 100644 dist/admin-customizer-preview.bundle.js.map create mode 100644 dist/menu-styler-features.bundle.js create mode 100644 dist/menu-styler-features.bundle.js.map create mode 100644 dist/menu-styler-ui.bundle.js create mode 100644 dist/menu-styler-ui.bundle.js.map create mode 100644 extras/modules/tweaks/ameJqueryTweak.php create mode 100644 extras/webpack-registry/WebpackAssetRegistry.php create mode 100644 plugin-updates/Puc/v5p3/Autoloader.php create mode 100644 plugin-updates/Puc/v5p3/DebugBar/Extension.php create mode 100644 plugin-updates/Puc/v5p3/DebugBar/Panel.php create mode 100644 plugin-updates/Puc/v5p3/DebugBar/PluginExtension.php create mode 100644 plugin-updates/Puc/v5p3/DebugBar/PluginPanel.php create mode 100644 plugin-updates/Puc/v5p3/DebugBar/ThemePanel.php create mode 100644 plugin-updates/Puc/v5p3/InstalledPackage.php create mode 100644 plugin-updates/Puc/v5p3/Metadata.php create mode 100644 plugin-updates/Puc/v5p3/OAuthSignature.php create mode 100644 plugin-updates/Puc/v5p3/Plugin/Package.php create mode 100644 plugin-updates/Puc/v5p3/Plugin/PluginInfo.php create mode 100644 plugin-updates/Puc/v5p3/Plugin/Ui.php create mode 100644 plugin-updates/Puc/v5p3/Plugin/Update.php create mode 100644 plugin-updates/Puc/v5p3/Plugin/UpdateChecker.php create mode 100644 plugin-updates/Puc/v5p3/PucFactory.php create mode 100644 plugin-updates/Puc/v5p3/Scheduler.php create mode 100644 plugin-updates/Puc/v5p3/StateStore.php create mode 100644 plugin-updates/Puc/v5p3/Theme/Package.php create mode 100644 plugin-updates/Puc/v5p3/Theme/Update.php create mode 100644 plugin-updates/Puc/v5p3/Theme/UpdateChecker.php create mode 100644 plugin-updates/Puc/v5p3/Update.php create mode 100644 plugin-updates/Puc/v5p3/UpdateChecker.php create mode 100644 plugin-updates/Puc/v5p3/UpgraderStatus.php create mode 100644 plugin-updates/Puc/v5p3/Utils.php create mode 100644 plugin-updates/Puc/v5p3/Vcs/Api.php create mode 100644 plugin-updates/Puc/v5p3/Vcs/BaseChecker.php create mode 100644 plugin-updates/Puc/v5p3/Vcs/BitBucketApi.php create mode 100644 plugin-updates/Puc/v5p3/Vcs/GitHubApi.php create mode 100644 plugin-updates/Puc/v5p3/Vcs/GitLabApi.php create mode 100644 plugin-updates/Puc/v5p3/Vcs/PluginUpdateChecker.php create mode 100644 plugin-updates/Puc/v5p3/Vcs/Reference.php create mode 100644 plugin-updates/Puc/v5p3/Vcs/ReleaseAssetSupport.php create mode 100644 plugin-updates/Puc/v5p3/Vcs/ReleaseFilteringFeature.php create mode 100644 plugin-updates/Puc/v5p3/Vcs/ThemeUpdateChecker.php create mode 100644 plugin-updates/Puc/v5p3/Vcs/VcsCheckerMethods.php create mode 100644 plugin-updates/load-v5p3.php create mode 100644 tests_output/CHROME_117.0.5938.92__basic.json create mode 100644 tests_output/CHROME_117.0.5938.92__basic.xml create mode 100644 tests_output/basic/CHROME_117.0.5938.92__ecosia.json create mode 100644 tests_output/basic/CHROME_117.0.5938.92__ecosia.xml create mode 100644 tests_output/basic/ecosia.json create mode 100644 tests_output/basic/ecosia.xml create mode 100644 tests_output/minimal_report.json create mode 100644 tests_output/nightwatch-html-report/index.html diff --git a/css/_boxes.scss b/css/_boxes.scss index c81fb75..21551de 100644 --- a/css/_boxes.scss +++ b/css/_boxes.scss @@ -11,13 +11,15 @@ $amePostboxShadow: 0 1px 1px rgba(0, 0, 0, 0.04); margin-bottom: 20px; + border: 1px solid $borderColor; + .ws-ame-postbox-header { position: relative; font-size: 14px; margin: 0; line-height: 1.4; - border: 1px solid $borderColor; + border-bottom: 1px solid $borderColor; h3 { padding: 10px $horizontalPadding; @@ -32,7 +34,7 @@ $amePostboxShadow: 0 1px 1px rgba(0, 0, 0, 0.04); .ws-ame-postbox-toggle { color: #72777c; - background: $headerBackground; + background: transparent; display: block; font: normal 20px/1 dashicons; @@ -72,17 +74,22 @@ $amePostboxShadow: 0 1px 1px rgba(0, 0, 0, 0.04); } .ws-ame-postbox-content { - border: 1px solid $borderColor; border-top: none; padding: $horizontalPadding; } - &.ws-ame-closed-postbox .ws-ame-postbox-content { - display: none; - } + &.ws-ame-closed-postbox { + .ws-ame-postbox-content { + display: none; + } - &.ws-ame-closed-postbox .ws-ame-postbox-toggle:before { - content: '\f140'; //downward triangle + .ws-ame-postbox-toggle:before { + content: '\f140'; //downward triangle + } + + .ws-ame-postbox-header { + border-bottom: none; + } } } \ No newline at end of file diff --git a/css/force-dashicons.css b/css/force-dashicons.css index a2903f7..71481ac 100644 --- a/css/force-dashicons.css +++ b/css/force-dashicons.css @@ -12,452 +12,678 @@ /* This file was automatically generated from /wp-includes/css/dashicons.css. Last update: 2017-06-07T16:55:55+00:00 - */ } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon > .wp-menu-image::before { - font-family: "dashicons", sans-serif !important; - font-size: 20px !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon > .wp-menu-image { - background-image: none !important; - position: static; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-menu:before { - content: "\f333" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-admin-site:before { - content: "\f319" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-admin-media:before { - content: "\f104" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-admin-page:before { - content: "\f105" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-admin-comments:before { - content: "\f101" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-admin-appearance:before { - content: "\f100" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-admin-plugins:before { - content: "\f106" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-admin-users:before { - content: "\f110" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-admin-tools:before { - content: "\f107" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-admin-settings:before { - content: "\f108" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-admin-network:before { - content: "\f112" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-admin-generic:before { - content: "\f111" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-admin-home:before { - content: "\f102" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-admin-collapse:before { - content: "\f148" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-filter:before { - content: "\f536" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-admin-customizer:before { - content: "\f540" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-admin-multisite:before { - content: "\f541" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-admin-links:before, #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-format-links:before { - content: "\f103" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-admin-post:before, #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-format-standard:before { - content: "\f109" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-format-image:before { - content: "\f128" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-format-gallery:before { - content: "\f161" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-format-audio:before { - content: "\f127" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-format-video:before { - content: "\f126" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-format-chat:before { - content: "\f125" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-format-status:before { - content: "\f130" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-format-aside:before { - content: "\f123" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-format-quote:before { - content: "\f122" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-welcome-write-blog:before, #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-welcome-edit-page:before { - content: "\f119" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-welcome-add-page:before { - content: "\f133" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-welcome-view-site:before { - content: "\f115" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-welcome-widgets-menus:before { - content: "\f116" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-welcome-comments:before { - content: "\f117" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-welcome-learn-more:before { - content: "\f118" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-image-crop:before { - content: "\f165" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-image-rotate:before { - content: "\f531" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-image-rotate-left:before { - content: "\f166" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-image-rotate-right:before { - content: "\f167" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-image-flip-vertical:before { - content: "\f168" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-image-flip-horizontal:before { - content: "\f169" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-image-filter:before { - content: "\f533" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-undo:before { - content: "\f171" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-redo:before { - content: "\f172" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-editor-ul:before { - content: "\f203" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-editor-ol:before { - content: "\f204" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-editor-quote:before { - content: "\f205" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-editor-alignleft:before { - content: "\f206" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-editor-aligncenter:before { - content: "\f207" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-editor-alignright:before { - content: "\f208" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-editor-insertmore:before { - content: "\f209" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-editor-spellcheck:before { - content: "\f210" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-editor-distractionfree:before, #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-editor-expand:before { - content: "\f211" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-editor-contract:before { - content: "\f506" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-editor-kitchensink:before { - content: "\f212" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-editor-underline:before { - content: "\f213" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-editor-justify:before { - content: "\f214" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-editor-textcolor:before { - content: "\f215" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-editor-paste-word:before { - content: "\f216" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-editor-paste-text:before { - content: "\f217" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-editor-removeformatting:before { - content: "\f218" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-editor-video:before { - content: "\f219" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-editor-customchar:before { - content: "\f220" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-editor-outdent:before { - content: "\f221" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-editor-indent:before { - content: "\f222" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-editor-help:before { - content: "\f223" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-editor-strikethrough:before { - content: "\f224" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-editor-unlink:before { - content: "\f225" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-editor-rtl:before { - content: "\f320" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-editor-break:before { - content: "\f474" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-editor-code:before { - content: "\f475" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-editor-paragraph:before { - content: "\f476" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-editor-table:before { - content: "\f535" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-align-left:before { - content: "\f135" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-align-right:before { - content: "\f136" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-align-center:before { - content: "\f134" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-align-none:before { - content: "\f138" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-lock:before { - content: "\f160" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-unlock:before { - content: "\f528" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-calendar:before { - content: "\f145" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-calendar-alt:before { - content: "\f508" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-visibility:before { - content: "\f177" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-hidden:before { - content: "\f530" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-post-status:before { - content: "\f173" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-edit:before { - content: "\f464" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-post-trash:before, #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-trash:before { - content: "\f182" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-sticky:before { - content: "\f537" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-external:before { - content: "\f504" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-leftright:before { - content: "\f229" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-sort:before { - content: "\f156" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-randomize:before { - content: "\f503" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-list-view:before { - content: "\f163" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-exerpt-view:before, #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-excerpt-view:before { - content: "\f164" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-grid-view:before { - content: "\f509" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-move:before { - content: "\f545" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-hammer:before { - content: "\f308" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-art:before { - content: "\f309" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-migrate:before { - content: "\f310" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-performance:before { - content: "\f311" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-universal-access:before { - content: "\f483" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-universal-access-alt:before { - content: "\f507" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-tickets:before { - content: "\f486" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-nametag:before { - content: "\f484" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-clipboard:before { - content: "\f481" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-heart:before { - content: "\f487" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-megaphone:before { - content: "\f488" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-schedule:before { - content: "\f489" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-wordpress:before { - content: "\f120" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-wordpress-alt:before { - content: "\f324" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-pressthis:before { - content: "\f157" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-update:before { - content: "\f463" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-screenoptions:before { - content: "\f180" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-cart:before { - content: "\f174" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-feedback:before { - content: "\f175" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-cloud:before { - content: "\f176" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-translation:before { - content: "\f326" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-tag:before { - content: "\f323" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-category:before { - content: "\f318" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-archive:before { - content: "\f480" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-tagcloud:before { - content: "\f479" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-text:before { - content: "\f478" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-media-archive:before { - content: "\f501" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-media-audio:before { - content: "\f500" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-media-code:before { - content: "\f499" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-media-default:before { - content: "\f498" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-media-document:before { - content: "\f497" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-media-interactive:before { - content: "\f496" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-media-spreadsheet:before { - content: "\f495" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-media-text:before { - content: "\f491" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-media-video:before { - content: "\f490" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-playlist-audio:before { - content: "\f492" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-playlist-video:before { - content: "\f493" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-controls-play:before { - content: "\f522" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-controls-pause:before { - content: "\f523" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-controls-forward:before { - content: "\f519" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-controls-skipforward:before { - content: "\f517" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-controls-back:before { - content: "\f518" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-controls-skipback:before { - content: "\f516" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-controls-repeat:before { - content: "\f515" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-controls-volumeon:before { - content: "\f521" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-controls-volumeoff:before { - content: "\f520" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-yes:before { - content: "\f147" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-no:before { - content: "\f158" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-no-alt:before { - content: "\f335" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-plus:before { - content: "\f132" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-plus-alt:before { - content: "\f502" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-plus-alt2:before { - content: "\f543" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-minus:before { - content: "\f460" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-dismiss:before { - content: "\f153" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-marker:before { - content: "\f159" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-star-filled:before { - content: "\f155" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-star-half:before { - content: "\f459" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-star-empty:before { - content: "\f154" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-flag:before { - content: "\f227" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-info:before { - content: "\f348" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-warning:before { - content: "\f534" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-share:before { - content: "\f237" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-share1:before { - content: "\f237" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-share-alt:before { - content: "\f240" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-share-alt2:before { - content: "\f242" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-twitter:before { - content: "\f301" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-rss:before { - content: "\f303" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-email:before { - content: "\f465" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-email-alt:before { - content: "\f466" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-facebook:before { - content: "\f304" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-facebook-alt:before { - content: "\f305" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-networking:before { - content: "\f325" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-googleplus:before { - content: "\f462" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-location:before { - content: "\f230" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-location-alt:before { - content: "\f231" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-camera:before { - content: "\f306" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-images-alt:before { - content: "\f232" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-images-alt2:before { - content: "\f233" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-video-alt:before { - content: "\f234" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-video-alt2:before { - content: "\f235" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-video-alt3:before { - content: "\f236" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-vault:before { - content: "\f178" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-shield:before { - content: "\f332" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-shield-alt:before { - content: "\f334" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-sos:before { - content: "\f468" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-search:before { - content: "\f179" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-slides:before { - content: "\f181" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-analytics:before { - content: "\f183" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-chart-pie:before { - content: "\f184" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-chart-bar:before { - content: "\f185" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-chart-line:before { - content: "\f238" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-chart-area:before { - content: "\f239" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-groups:before { - content: "\f307" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-businessman:before { - content: "\f338" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-id:before { - content: "\f336" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-id-alt:before { - content: "\f337" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-products:before { - content: "\f312" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-awards:before { - content: "\f313" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-forms:before { - content: "\f314" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-testimonial:before { - content: "\f473" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-portfolio:before { - content: "\f322" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-book:before { - content: "\f330" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-book-alt:before { - content: "\f331" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-download:before { - content: "\f316" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-upload:before { - content: "\f317" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-backup:before { - content: "\f321" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-clock:before { - content: "\f469" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-lightbulb:before { - content: "\f339" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-microphone:before { - content: "\f482" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-desktop:before { - content: "\f472" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-laptop:before { - content: "\f547" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-tablet:before { - content: "\f471" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-smartphone:before { - content: "\f470" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-phone:before { - content: "\f525" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-smiley:before { - content: "\f328" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-index-card:before { - content: "\f510" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-carrot:before { - content: "\f511" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-building:before { - content: "\f512" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-store:before { - content: "\f513" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-album:before { - content: "\f514" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-palmtree:before { - content: "\f527" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-tickets-alt:before { - content: "\f524" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-money:before { - content: "\f526" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-thumbs-up:before { - content: "\f529" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-thumbs-down:before { - content: "\f542" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-layout:before { - content: "\f538" !important; } - #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-paperclip:before { - content: "\f546" !important; } + */ +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon > .wp-menu-image::before { + font-family: "dashicons", sans-serif !important; + font-size: 20px !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon > .wp-menu-image { + background-image: none !important; + position: static; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon > .wp-menu-image::before { + background-image: none !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-menu:before { + content: "\f333" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-admin-site:before { + content: "\f319" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-admin-media:before { + content: "\f104" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-admin-page:before { + content: "\f105" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-admin-comments:before { + content: "\f101" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-admin-appearance:before { + content: "\f100" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-admin-plugins:before { + content: "\f106" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-admin-users:before { + content: "\f110" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-admin-tools:before { + content: "\f107" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-admin-settings:before { + content: "\f108" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-admin-network:before { + content: "\f112" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-admin-generic:before { + content: "\f111" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-admin-home:before { + content: "\f102" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-admin-collapse:before { + content: "\f148" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-filter:before { + content: "\f536" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-admin-customizer:before { + content: "\f540" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-admin-multisite:before { + content: "\f541" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-admin-links:before, #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-format-links:before { + content: "\f103" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-admin-post:before, #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-format-standard:before { + content: "\f109" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-format-image:before { + content: "\f128" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-format-gallery:before { + content: "\f161" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-format-audio:before { + content: "\f127" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-format-video:before { + content: "\f126" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-format-chat:before { + content: "\f125" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-format-status:before { + content: "\f130" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-format-aside:before { + content: "\f123" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-format-quote:before { + content: "\f122" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-welcome-write-blog:before, #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-welcome-edit-page:before { + content: "\f119" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-welcome-add-page:before { + content: "\f133" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-welcome-view-site:before { + content: "\f115" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-welcome-widgets-menus:before { + content: "\f116" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-welcome-comments:before { + content: "\f117" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-welcome-learn-more:before { + content: "\f118" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-image-crop:before { + content: "\f165" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-image-rotate:before { + content: "\f531" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-image-rotate-left:before { + content: "\f166" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-image-rotate-right:before { + content: "\f167" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-image-flip-vertical:before { + content: "\f168" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-image-flip-horizontal:before { + content: "\f169" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-image-filter:before { + content: "\f533" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-undo:before { + content: "\f171" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-redo:before { + content: "\f172" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-editor-ul:before { + content: "\f203" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-editor-ol:before { + content: "\f204" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-editor-quote:before { + content: "\f205" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-editor-alignleft:before { + content: "\f206" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-editor-aligncenter:before { + content: "\f207" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-editor-alignright:before { + content: "\f208" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-editor-insertmore:before { + content: "\f209" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-editor-spellcheck:before { + content: "\f210" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-editor-distractionfree:before, #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-editor-expand:before { + content: "\f211" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-editor-contract:before { + content: "\f506" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-editor-kitchensink:before { + content: "\f212" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-editor-underline:before { + content: "\f213" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-editor-justify:before { + content: "\f214" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-editor-textcolor:before { + content: "\f215" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-editor-paste-word:before { + content: "\f216" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-editor-paste-text:before { + content: "\f217" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-editor-removeformatting:before { + content: "\f218" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-editor-video:before { + content: "\f219" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-editor-customchar:before { + content: "\f220" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-editor-outdent:before { + content: "\f221" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-editor-indent:before { + content: "\f222" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-editor-help:before { + content: "\f223" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-editor-strikethrough:before { + content: "\f224" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-editor-unlink:before { + content: "\f225" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-editor-rtl:before { + content: "\f320" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-editor-break:before { + content: "\f474" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-editor-code:before { + content: "\f475" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-editor-paragraph:before { + content: "\f476" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-editor-table:before { + content: "\f535" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-align-left:before { + content: "\f135" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-align-right:before { + content: "\f136" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-align-center:before { + content: "\f134" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-align-none:before { + content: "\f138" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-lock:before { + content: "\f160" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-unlock:before { + content: "\f528" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-calendar:before { + content: "\f145" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-calendar-alt:before { + content: "\f508" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-visibility:before { + content: "\f177" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-hidden:before { + content: "\f530" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-post-status:before { + content: "\f173" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-edit:before { + content: "\f464" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-post-trash:before, #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-trash:before { + content: "\f182" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-sticky:before { + content: "\f537" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-external:before { + content: "\f504" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-leftright:before { + content: "\f229" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-sort:before { + content: "\f156" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-randomize:before { + content: "\f503" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-list-view:before { + content: "\f163" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-exerpt-view:before, #adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-excerpt-view:before { + content: "\f164" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-grid-view:before { + content: "\f509" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-move:before { + content: "\f545" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-hammer:before { + content: "\f308" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-art:before { + content: "\f309" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-migrate:before { + content: "\f310" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-performance:before { + content: "\f311" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-universal-access:before { + content: "\f483" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-universal-access-alt:before { + content: "\f507" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-tickets:before { + content: "\f486" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-nametag:before { + content: "\f484" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-clipboard:before { + content: "\f481" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-heart:before { + content: "\f487" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-megaphone:before { + content: "\f488" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-schedule:before { + content: "\f489" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-wordpress:before { + content: "\f120" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-wordpress-alt:before { + content: "\f324" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-pressthis:before { + content: "\f157" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-update:before { + content: "\f463" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-screenoptions:before { + content: "\f180" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-cart:before { + content: "\f174" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-feedback:before { + content: "\f175" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-cloud:before { + content: "\f176" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-translation:before { + content: "\f326" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-tag:before { + content: "\f323" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-category:before { + content: "\f318" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-archive:before { + content: "\f480" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-tagcloud:before { + content: "\f479" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-text:before { + content: "\f478" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-media-archive:before { + content: "\f501" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-media-audio:before { + content: "\f500" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-media-code:before { + content: "\f499" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-media-default:before { + content: "\f498" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-media-document:before { + content: "\f497" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-media-interactive:before { + content: "\f496" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-media-spreadsheet:before { + content: "\f495" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-media-text:before { + content: "\f491" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-media-video:before { + content: "\f490" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-playlist-audio:before { + content: "\f492" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-playlist-video:before { + content: "\f493" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-controls-play:before { + content: "\f522" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-controls-pause:before { + content: "\f523" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-controls-forward:before { + content: "\f519" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-controls-skipforward:before { + content: "\f517" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-controls-back:before { + content: "\f518" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-controls-skipback:before { + content: "\f516" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-controls-repeat:before { + content: "\f515" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-controls-volumeon:before { + content: "\f521" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-controls-volumeoff:before { + content: "\f520" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-yes:before { + content: "\f147" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-no:before { + content: "\f158" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-no-alt:before { + content: "\f335" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-plus:before { + content: "\f132" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-plus-alt:before { + content: "\f502" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-plus-alt2:before { + content: "\f543" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-minus:before { + content: "\f460" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-dismiss:before { + content: "\f153" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-marker:before { + content: "\f159" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-star-filled:before { + content: "\f155" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-star-half:before { + content: "\f459" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-star-empty:before { + content: "\f154" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-flag:before { + content: "\f227" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-info:before { + content: "\f348" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-warning:before { + content: "\f534" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-share:before { + content: "\f237" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-share1:before { + content: "\f237" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-share-alt:before { + content: "\f240" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-share-alt2:before { + content: "\f242" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-twitter:before { + content: "\f301" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-rss:before { + content: "\f303" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-email:before { + content: "\f465" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-email-alt:before { + content: "\f466" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-facebook:before { + content: "\f304" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-facebook-alt:before { + content: "\f305" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-networking:before { + content: "\f325" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-googleplus:before { + content: "\f462" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-location:before { + content: "\f230" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-location-alt:before { + content: "\f231" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-camera:before { + content: "\f306" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-images-alt:before { + content: "\f232" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-images-alt2:before { + content: "\f233" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-video-alt:before { + content: "\f234" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-video-alt2:before { + content: "\f235" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-video-alt3:before { + content: "\f236" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-vault:before { + content: "\f178" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-shield:before { + content: "\f332" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-shield-alt:before { + content: "\f334" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-sos:before { + content: "\f468" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-search:before { + content: "\f179" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-slides:before { + content: "\f181" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-analytics:before { + content: "\f183" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-chart-pie:before { + content: "\f184" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-chart-bar:before { + content: "\f185" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-chart-line:before { + content: "\f238" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-chart-area:before { + content: "\f239" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-groups:before { + content: "\f307" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-businessman:before { + content: "\f338" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-id:before { + content: "\f336" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-id-alt:before { + content: "\f337" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-products:before { + content: "\f312" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-awards:before { + content: "\f313" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-forms:before { + content: "\f314" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-testimonial:before { + content: "\f473" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-portfolio:before { + content: "\f322" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-book:before { + content: "\f330" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-book-alt:before { + content: "\f331" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-download:before { + content: "\f316" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-upload:before { + content: "\f317" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-backup:before { + content: "\f321" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-clock:before { + content: "\f469" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-lightbulb:before { + content: "\f339" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-microphone:before { + content: "\f482" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-desktop:before { + content: "\f472" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-laptop:before { + content: "\f547" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-tablet:before { + content: "\f471" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-smartphone:before { + content: "\f470" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-phone:before { + content: "\f525" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-smiley:before { + content: "\f328" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-index-card:before { + content: "\f510" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-carrot:before { + content: "\f511" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-building:before { + content: "\f512" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-store:before { + content: "\f513" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-album:before { + content: "\f514" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-palmtree:before { + content: "\f527" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-tickets-alt:before { + content: "\f524" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-money:before { + content: "\f526" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-thumbs-up:before { + content: "\f529" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-thumbs-down:before { + content: "\f542" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-layout:before { + content: "\f538" !important; +} +#adminmenu#adminmenu#adminmenu a.ame-has-custom-dashicon .dashicons-paperclip:before { + content: "\f546" !important; +} /*# sourceMappingURL=force-dashicons.css.map */ diff --git a/css/force-dashicons.css.map b/css/force-dashicons.css.map index 845eb5e..456fb6c 100644 --- a/css/force-dashicons.css.map +++ b/css/force-dashicons.css.map @@ -1,7 +1 @@ -{ -"version": 3, -"mappings": "AAAA;;;;;;;;;EASE;AAGF,wDAAyD;ECZzD;;;IAGE;EDUD,iFAA2B;IAC1B,WAAW,EAAE,kCAAkC;IAC/C,SAAS,EAAE,eAAe;EAI3B,yEAAmB;IAClB,gBAAgB,EAAE,eAAe;IACjC,QAAQ,EAAE,MAAM;ECjBlB,+EAAuB;IAAE,OAAO,EAAE,kBAAkB;EACpD,qFAA6B;IAAE,OAAO,EAAE,kBAAkB;EAC1D,sFAA8B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,kBAAkB;EACxD,gFAAwB;IAAE,OAAO,EAAE,kBAAkB;EACrD,gFAAwB;IAAE,OAAO,EAAE,kBAAkB;EACrD,mFAA2B;IAAE,OAAO,EAAE,kBAAkB;EACxD,sFAA8B;IAAE,OAAO,EAAE,kBAAkB;EAC3D,gFAAwB;IAAE,OAAO,EAAE,kBAAkB;EACrD,oFAA4B;IAAE,OAAO,EAAE,kBAAkB;EACzD,sFAA8B;IAAE,OAAO,EAAE,kBAAkB;EAC3D,iFAAyB;IAAE,OAAO,EAAE,kBAAkB;EACtD,oFAA4B;IAAE,OAAO,EAAE,kBAAkB", -"sources": ["force-dashicons.scss","_dashicons.scss"], -"names": [], -"file": "force-dashicons.css" -} \ No newline at end of file +{"version":3,"sourceRoot":"","sources":["force-dashicons.scss","_dashicons.scss"],"names":[],"mappings":"AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;AAAA;AAYA;ACZA;AAAA;AAAA;AAAA;;ADaC;EACC;EACA;;AAID;EACC;EACA;;AAED;EACC;;ACpBF;EAAyB;;AACzB;EAA+B;;AAC/B;EAAgC;;AAChC;EAA+B;;AAC/B;EAAmC;;AACnC;EAAqC;;AACrC;EAAkC;;AAClC;EAAgC;;AAChC;EAAgC;;AAChC;EAAmC;;AACnC;EAAkC;;AAClC;EAAkC;;AAClC;EAA+B;;AAC/B;EAAmC;;AACnC;EAA2B;;AAC3B;EAAqC;;AACrC;EAAoC;;AACpC;EAAgE;;AAChE;EAAkE;;AAClE;EAAiC;;AACjC;EAAmC;;AACnC;EAAiC;;AACjC;EAAiC;;AACjC;EAAgC;;AAChC;EAAkC;;AAClC;EAAiC;;AACjC;EAAiC;;AACjC;EAA4E;;AAC5E;EAAqC;;AACrC;EAAsC;;AACtC;EAA0C;;AAC1C;EAAqC;;AACrC;EAAuC;;AACvC;EAA+B;;AAC/B;EAAiC;;AACjC;EAAsC;;AACtC;EAAuC;;AACvC;EAAwC;;AACxC;EAA0C;;AAC1C;EAAiC;;AACjC;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AC3B;EAA2B;;AAC3B;EAA+B;;AAC/B;EAA0B;;AAC1B;EAA2B;;AAC3B;EAA+B;;AAC/B;EAA2B;;AAC3B;EAA6B;;AAC7B;EAA0B;;AAC1B;EAA0B;;AAC1B;EAA6B;;AAC7B;EAAgC;;AAChC;EAA0B;;AAC1B;EAA8B;;AAC9B;EAAgC;;AAChC;EAA2B;;AAC3B;EAA8B","file":"force-dashicons.css"} \ No newline at end of file diff --git a/css/force-dashicons.scss b/css/force-dashicons.scss index 6382f12..8c35f0f 100644 --- a/css/force-dashicons.scss +++ b/css/force-dashicons.scss @@ -21,6 +21,9 @@ background-image: none !important; position: static; } + & > .wp-menu-image::before { + background-image: none !important; + } @import '_dashicons'; } \ No newline at end of file diff --git a/css/menu-editor.css b/css/menu-editor.css index db9f3f6..30d7713 100644 --- a/css/menu-editor.css +++ b/css/menu-editor.css @@ -812,6 +812,7 @@ select.ws_dropdown optgroup option { box-sizing: border-box; height: 25px; min-height: 25px; + min-width: 26px; } .ame-is-wp53-plus #ws_menu_editor .ws_select_icon { height: 28px; @@ -847,10 +848,21 @@ select.ws_dropdown optgroup option { padding: 4px 10px 11px; } #ws_icon_selector .ws_tool_tab { - padding: 4px 4px 2px; + padding: 0 4px 2px; max-height: 324px; overflow-y: auto; } +#ws_icon_selector .ws_icon_search_bar { + margin: 0 0 0 2px; + position: sticky; + top: 0; + background-color: #FDFDFD; + padding: 4px 0; +} +#ws_icon_selector .ws_no_matching_icons { + margin-left: 2px; + padding: 4px 0; +} #ws_choose_icon_from_media { margin: 2px; @@ -1104,6 +1116,7 @@ select.ws_dropdown optgroup option { display: block; float: left; margin-top: 0; + min-width: 8em; } .ws_dialog_buttons .button { @@ -1784,6 +1797,22 @@ select.ws_dropdown optgroup option { border-top: 0.3em solid #444; } +.ws_ame_has_unsaved_changes #ws_save_menu { + position: relative; +} +.ws_ame_has_unsaved_changes #ws_save_menu:before { + content: ""; + position: absolute; + top: 1px; + right: 1px; + --ame-me-calc-indicator-size: calc(9px + (var(--ame-ds-btn-radius-tr, 3px) - 3px) / 2); + width: var(--ame-me-calc-indicator-size, 9px); + height: var(--ame-me-calc-indicator-size, 9px); + background: #00e93c; + border-top-right-radius: calc(var(--ame-ds-btn-radius-tr, 3px) - 1px); + clip-path: polygon(0 0, 100% 0, 100% 100%); +} + /********************************************* Miscellaneous **********************************************/ @@ -1796,6 +1825,14 @@ select.ws_dropdown optgroup option { bottom: 40px; z-index: 100; } +#ws_sidebar_pro_ad .dashicons { + font-size: 15px; + width: unset; + height: unset; +} +#ws_sidebar_pro_ad.ame-tgc-sidebar-ad { + max-width: 280px; +} .ws-ame-icon-radio-button-group > label { display: inline-block; diff --git a/css/menu-editor.css.map b/css/menu-editor.css.map index 988351e..4bc466d 100644 --- a/css/menu-editor.css.map +++ b/css/menu-editor.css.map @@ -1 +1 @@ -{"version":3,"sourceRoot":"","sources":["menu-editor.scss","_input-group.scss","_indeterminate-checkbox.scss","_test-access-screen.scss","_main-tabs.scss"],"names":[],"mappings":";AAAA;ACAA;EACC;EACA;;AAEA;EACC;EACA;EACA;;AAGD;EACC;EACA;EACA;;;ADPF;EACC;;;AAGD;EACC;;;AAQD;EACC;EACA,OAPoB;EAQpB;EACA;EAEA;EACA;EACA;EAEA,eAb2B;EAc3B,oBAd2B;EAe3B,uBAf2B;;;AAkB5B;EACC;EACA;EACA;;;AAGD;EACC;EACA;;;AASD;EACC;EACA;EAEA;EACA;EAEA;;;AAGD;AAAA;AAAA;EAGC;;;AAGD;AAAA;EAEC;;;AAGD;AAAA;AAAA;AAGA;EACI;;;AAGJ;EACI;;;AAIH;EACC;EACA;;AAGD;EACC;EACA;EACA;EAEA;EACA;EACA;EACA;;;AAIF;EACC;;;AAGD;AAAA;AAAA;AAKA;AAAA;EAGI;EACA;EACA;EACA;;AEnHH;AAAA;EACC;EACA,OAH4C;EAU5C;EACA;EAMA;EACA;EACA;EACA;EACA;;AAGD;EACC;AAAA;IAEC,QADU;IAEV,OAFU;IAGV,aAHU;IA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A,OAPiB;EAQjB;EAEA;EACA;EAEA;EACA;;AAEA;AAAA;EACC,QAhBqB;EAiBrB;;;AAIF;EACC;EACA;;;AAGD;EACC;;;AAGD;EACC;;AAEA;EACC,YAlCqB;;;AAsCvB;AAGA;AAAA;EAGC;EACA,OANqB;EAOrB;EACA;EAEA;EACA;EAEA;EAEA;EACA;EACA;EAEA;EACA;EAEA;EACA;EACA;EACA;;;AAGD;AAAA;EAGC,QAtEsB;EAwEtB;EACA;EACA;EAEA;EACA;EACA;;AAEA;AAAA;EACC;;;AAIF;EACC;EACA;;;AAGD;EACC;;;AAGD;EACC;EACA;;;AAGD;AAAA;AAAA;AAAA;AAIA;AAAA;EAGC;EACA;EAEA;EACA;;;AAGD;EACC;EACA;EACA;EACA;;;AAGD;EACC;;;AAGD;EACC;;;AAGD;AACA;EACC;;;AAGD;AAAA;AAAA;AAGA;EACC;EACA;;;AAGD;EACC;EACA;EACA;;;AAGD;EACC;;;AAGD;EACC;EACA;;;AAGD;AAAA;AAAA;AAIA;EACC;EACA;EACA;;;AAGD;EACC;EACA;EACA;EACA;EACA;EACA;;;AAGD;AACA;EACC;;;AAGD;AACA;EACC;EACA;;;AAGD;AACA;EACC;;;AAGD;AACA;EACC;;;AAED;AACC;AAAsB;EACtB;AAAkB;EAClB;EAEA;AAA2B;EAC3B;;;AAGD;AACA;EACC;;;AAGD;AACA;EACC;EACA;EACA;EAEA;AAA2B;EAC3B;;;AAGD;AAMA;AAAA;AAAA;AAIA;EACC;EAEA;EACA;EACA;EAEA;EACA;;;AASD;EACC;EACA;EACA;EAEA;EACA;EAEA;EACA;EACA;EAEA;EACA;EAEA;EACA;EACA;;AAEA;EACC;;;AAIF;EACC;EACA;;;AAID;EACC;;;AAED;EACC;EACA;;;AAED;EACC;EACA;EACA;;;AAGD;EACC;EACA;;;AAGD;EACC;;;AAGD;AAAA;AAAA;AAIA;EACC;EACA;EAEA;EACA;EACA;EAEA;EACA;;;AAID;EACC;EACA;EACA,SAJ0B;;;AAO3B;EACC;;;AAGD;AAAA;AAAA;AAAA;AAAA;AAQA;EACC;EACA;EACA;;AAEA;EACC;EAEA;EACA;EACA;EACA;EAEA;;AAGD;EACC;EACA,qBApBwB;EAqBxB;;AAGD;EACC;;AAGD;EACC;;;AAIF;EACC;EACA;EACA,kBApCyB;;;AAyC1B;AAAA;AAAA;AAMA;EACC;EACA;EACA;EAEA;EACA;EACG;;;AAGJ;EACI;;;AAGJ;EACI;;;AAGJ;EACI;;;AAIJ;EACC;EACA;EAEA;EACA;EACA;EACA;AAEA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAGD;AACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAGD;EACC;EACA;EACA;;;AAGD;EACC;EACA;EACA;;AAEA;EACC,OAnEc;EAoEd;;;AAIF;EACI;EACA;EACA;;;AAGJ;EACC;EACA;EACA;EAEA;EACA;;;AAGD;EACC;EACA;;;AAGD;AACA;EACC;EACA;EACA;EAEG;EACA;EACH;;AAEA;EACC,QA/dqB;EAgerB,YAheqB;EAierB;;;AAIF;EACC,OA9Ge;EA+Gf;;AAEA;EACC;;AAEA;EACC;;;AAKH;AACA;EACC;EACA;EACA;EACA;;;AAOA;EACC;EACA;EAMA;;AAJA;EACC;;AAMF;EACC;EACA;EACA;;;AAIF;EACC;;;AAGD;AAAA;AAAA;AAIA;EACC;EACA;EAEA;EACA;EACA;EAEA;EACA;;;AAGD;EACC;EACA;EACA;;;AAGD;EACC;EAEA;EACA;EACA;EACA;EAEA;;;AAGD;EACC;;;AAGD;EACC;EACA;EACA;;;AAGD;EACC;;;AAGD;EACC;EACA;AAAe;EACf;EACA;EAEA;EACA;;;AAGD;EACC;EACA;EACA;EAEA;EACA;;;AAGD;EACC;EACA;;;AAGD;EACC;;;AAGD;AAAA;AAAA;AAAA;AAIA;EACC;;;AAID;AAAA;AAAA;AAIA;AAKA;EAGI;EACH;EACG,QAJgB;EAKhB,OATc;EAWd,cAVoB;EAWvB;EACG;EAEH;EACG;EACA;EACA;EAEH;;AAEA;EACC;EACA;EAEA;EACA;EAEA;EACA;EACA;;;AAIF;EACC;;;AAGD;EACI;EACA;EACA;EAEA;EACA;EACA;;;AAGJ;EACI;;;AAGJ;AAAA;AAAA;AAIA;EACC;;;AAGD;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAEG;EACA;;;AAGJ;EACI;;;AAIH;EACC;EACA;EAEA;EAEA;EACA;EACA;;AAEA;EACC;EACA;;AAGD;EACC;EACA;EACA;;AAIF;EACC;EACA;EACA;EACA;EAEA;EACA;EACA;EAEA;EACA;EAEA;EACA;EAEA;EACA;EAEA;;AAGD;EACC;EACA;;AAGD;EACC;EACA;EACA;EACA;EACA;EACA;EAEA;EACA;EACA;;AAGD;AACC;EACA;;AAQF;EACC;;;AAGD;EACC;;;AAIA;EACC;EACA;;AAGD;EACC;;AAGD;EACC;EACA;EACA;;AAEA;EACC;;AAGD;EACC;;AAGD;EACC;;AAGD;EACC;;;AAKH;EACC;EACA;;;AAGD;EACC;EACA;EACG;EACA;;;AAGJ;EACC;EACA;EACA;;;AAGD;EACC;;;AAGD;EACI;;;AAGJ;EACI;;;AAGJ;EACI;EACA;EACA;;;AAGJ;EACI;;;AAGJ;EACC;EACA;EAEA;;;AAGD;EACC;;;AAGD;EACC;EACA;EACA;;;AAGD;EACC;;;AAGD;EACI;EACA;;;AAGJ;AAAA;AAAA;AAIA;AAGA;EAEC,OAJuB;EAKvB,cAJwB;;;AAOzB;EACC;EACA;;;AAGD;EACC;EACA;;;AAGD;EACC;;AAEA;EACC;EACA;;;AAIF;EACC;EACA;EACA;EACA;;;AAGD;AAAA;EAEC;EACA;EACA;;;AAGD;AAAA;EAEC;;;AAGD;EACC;;;AAGD;AACC;AAAA;EAEA;EACA;;;AAGD;EACC;EACA;;;AAGD;EACC;EAEA;EACA;EACA;EACA;EACA;EACA;;;AAGD;EACC;EACA;EAEA;EACA;EACA;EACA;EACA;EACA;;;AAGD;EACC;;;AAGD;EACC;;;AAGD;EACC;EACA;EACA;;;AAGD;EACC;EACA;EACA;EAEA;EAEA;EACA;EACA;EACA;;;AAGD;EACC;EACA;EACA;EACA;EAEA;EACA;EAEA;EACA;EACA;;;AAGD;EACC;EACA;EACA;;;AAGD;EACC;;;AAGD;AAAA;AAAA;AAIA;AAAA;AAAA;AAGA;AAuBC;;AArBA;EACC;;AAGD;EACC;;AAGD;EACC;;AAIA;EACC;;AAED;EACC;;AAKF;EACC;;AAEA;EACC;;AAGD;EACC;;AAGD;EACC;;;AAKH;EACC;EACA;EACA;;;AAKD;EACC,cAH0B;EAI1B;EACA;EACA;;;AAGD;EACC;;AAEA;EACC,cAbyB;;AAgB1B;EACC;EACA;;AAGD;AAAA;EAEC;EACA;;AAGD;EACC;EACA;;AAGD;EACC;;AAIA;EACC;;;AAQF;EACC;EACA;EACA;EACA;;AAGD;EACC;;AAID;EACC;;AAED;EACC;;AAKA;EACC;;AAED;EACC;;;AAQF;EACC;;;AAIF;AACA;EACC;EACA;EAEA;EACA;EACA;EAEA;EACA;EAGA;EAEA;EACA;;;AAGD;EACC;EAEA;EACA;EACA;EACA;EACA;EAEA;EAEA;;;AAGD;EACC;;;AAID;EAGC,WAFgB;EAGhB,QAHgB;EAIhB,OAJgB;EAOhB;EAEA;EACA;EACA;;;AAGD;EACC;;;AAGD;AAAA;AAAA;AAQA;EAEC;EACA,SAFoB;;;AAKrB;EACC;;AAEA;EACC;EACA;EACA;EAEA;EACA;EACA;EAEA,OAtBwB;EAuBxB,QAtByB;EAwBzB;EACA;EACA;;AAGD;EACC;;AAGD;EACC;EACA;EACA;EACA;EACA;;AAGD;EACC;EAGA,KAFc;EAGd,MA7C0B;EA8C1B,OA9C0B;EAiD1B;EAEA;EACA;;AAGD;EACC;EAGA;EACA;EACA;EACA;;AAEA;EACC;EACA;EAEA;EACA;;AAGD;EACC;EACA;;AAGD;EACC;;AAGD;EACC;;AAKD;EACC;;AAGD;EACC;;AAID;EACC;;AAMD;EACC;;AAED;EACC;;AAED;EACC;;AAGD;EACC;;AAKA;EACC;;AAaH;EACC;EACA;EACA;EAEA;EACA;;AAGD;EACC;EACA;EACA;EACA;EACA;;;AAIF;EACC;EACA,OAzJ2B;EA0J3B,QA1J2B;EA4J3B;EACA;;;AAKD;AAAA;AAAA;AAIA;EACI;;;AAMJ;AAAA;AAAA;AAIA;EACC;;;AAGD;EACC;EACA;EACA;;;AAGD;EACC;EACA;EACA;EACA;;;AAGD;EACC;EACA;EACA;;;AAGD;EACC;;;AAID;EACC;;;AAKA;EACC;EACA;EACA;;;AAIF;EACC;;;AAGD;EACC;;;AAGD;EACC;EACA;EAEA;EACA;EACA;EACA;;;AAGD;EACC;EACA;EACA;EACA;EACA;EACA;EAEA;EACA;EACA;EAEA;EACA;EACA;;;AAGD;EACC;EACA;EACA;;;AAGD;EACC;;;AAGD;EACC;EACA;EACA;;;AAIA;EACC;EACA;;AAGD;EACC;EACA;;AAGD;EACC;;AAGD;EACC;EACA;;AAGD;EACC;;AAGD;EACC;EACA;EACA;EACA;EACA;EAEA;EACA;EACA;EAEA;EACA;EACA;;AAGD;EACC;;;AAIF;EAEC;EACA;;;AAGD;EACC;;AAEA;EACC;EACA;EACA;;AAGD;EACC;;AAGD;EACC;EACA;EACA;;;AAIF;AAAA;AAAA;AAGA;EACC;;;AAGD;AAAA;AAAA;AAIA;EACC;EACA;EAEA;EACA;EACA;EAEA;EACA;;AAEA;EACC;EACA;;AAGD;EAEC,aA/vCyB;EAgwCzB,gBAhwCyB;;AAmwC1B;EACC;;AAGD;EACC;;AAEA;EACC;;;AAKH;AAAA;AAAA;AAIA;EACC;EACA;EACA;;;AAIA;EACC;EACA;;AAGD;EACC;EACA;;AAGD;EACC;;;AAIF;EACC;;;AAGD;AACC;AAAA;;;AAID;AAAA;AAAA;AAIA;EACC;;;AAGD;AAAA;AAAA;AAKC;EACC;;AAGD;EACC;EACA;EACA;;AAGD;EACC;EACA;EACA;;;AAIF;AAAA;AAAA;AAIA;EACI;EAEH;EACA;EAEA;EACA;EACA;EACA;;;AAGD;EACC;EACA;EACA;EACA;EAEA;;;AAGD;EACC;EAEA;;;AAGD;EACC;;;AAGD;EACI;EACA;;;AAGJ;EACI;EACA;EACA;EAEA;EACA;EAEA;;;AAGJ;EACI;EACA;EAEA;EACA;;;AAGJ;EACI;;;AG7nEJ;AAAA;AAAA;AAIA;EACC;EACA;;;AAGD;EAEC;;;AAGD;EACC;EACA;EAEA;EACA;EACA;;;AAGD;EACC;EACA;EACA;EACA;EAEA;EACA;EACA;;;AAGD;EACC;EACA;EACA;EAEA;EACA;EACA;;;AAGD;EACC;EACA;EACA;;;AAGD;EACC;EACA;EACA;EACA;;;AAGD;EACC;EACA;EACA;;AAEA;EACC;EACA;EACA;EACA;;;AAIF;EACC;EACA;EAEA;EACA;EACA;EACA;;;AAGD;EACC;EACA;EAEA;EACA;;;AAGD;EACC;EACA;EACA;EAEA;EACA;EACA;EAEA;EACA;EACA;;;AAGD;EACC;EACA;EACA;EAEA;EACA;EACA;EACA;EAEA;EACA;EAEA;EACA;;AAEA;EACC;;;AAIF;EACC;EACA;;;AAGD;EACC;;;ACjID;AAAA;AAAA;AAKC;EACC;;AAGD;EACC;EACA;EACA;;;AAIF;;AAAA;AAAA;AAAA;AAMA;EACC;;;AAIA;EACC;;;AAIF;AAAA;AAEA;EACC","file":"menu-editor.css"} \ No newline at end of file +{"version":3,"sourceRoot":"","sources":["menu-editor.scss","_input-group.scss","_indeterminate-checkbox.scss","_test-access-screen.scss","_main-tabs.scss"],"names":[],"mappings":";AAAA;ACAA;EACC;EACA;;AAEA;EACC;EACA;EACA;;AAGD;EACC;EACA;EACA;;;ADPF;EACC;;;AAGD;EACC;;;AAQD;EACC;EACA,OAPoB;EAQpB;EACA;EAEA;EACA;EACA;EAEA,eAb2B;EAc3B,oBAd2B;EAe3B,uBAf2B;;;AAkB5B;EACC;EACA;EACA;;;AAGD;EACC;EACA;;;AASD;EACC;EACA;EAEA;EACA;EAEA;;;AAGD;AAAA;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EACA;;AAGA;EACC;EACA;EACA;EACA;EAEA;EACA;;;AAIF;EACC;;;AAGD;EACC;EACA;EACA;EACA;;;AAGD;AAAA;AAAA;AAGA;EAEC;EACA;EACA;EAEA;EACA;;AAEA;EACC;EACA;;;AAIF;AACA;EACC;EACA;EAEA;EACA;EACA;EACA;EAEA;EACA;EACA;EAEA;;AAEA;EACC;;;AAIF;EACC;;;AAGD;AAAA;AAAA;EAGC;;;AAGD;AACA;AAAA;EAEC;;;AAGD;AAIA;AAAA;EAEC;EACA;EACA,OAPiB;EAQjB;EAEA;EACA;EAEA;EACA;;AAEA;AAAA;EACC,QAhBqB;EAiBrB;;;AAIF;EACC;EACA;;;AAGD;EACC;;;AAGD;EACC;;AAEA;EACC,YAlCqB;;;AAsCvB;AAGA;AAAA;EAGC;EACA,OANqB;EAOrB;EACA;EAEA;EACA;EAEA;EAEA;EACA;EACA;EAEA;EACA;EAEA;EACA;EACA;EACA;;;AAGD;AAAA;EAGC,QAtEsB;EAwEtB;EACA;EACA;EAEA;EACA;EACA;;AAEA;AAAA;EACC;;;AAIF;EACC;EACA;;;AAGD;EACC;;;AAGD;EACC;EACA;;;AAGD;AAAA;AAAA;AAAA;AAIA;AAAA;EAGC;EACA;EAEA;EACA;;;AAGD;EACC;EACA;EACA;EACA;;;AAGD;EACC;;;AAGD;EACC;;;AAGD;AACA;EACC;;;AAGD;AAAA;AAAA;AAGA;EACC;EACA;;;AAGD;EACC;EACA;EACA;;;AAGD;EACC;;;AAGD;EACC;EACA;;;AAGD;AAAA;AAAA;AAIA;EACC;EACA;EACA;;;AAGD;EACC;EACA;EACA;EACA;EACA;EACA;;;AAGD;AACA;EACC;;;AAGD;AACA;EACC;EACA;;;AAGD;AACA;EACC;;;AAGD;AACA;EACC;;;AAED;AACC;AAAsB;EACtB;AAAkB;EAClB;EAEA;AAA2B;EAC3B;;;AAGD;AACA;EACC;;;AAGD;AACA;EACC;EACA;EACA;EAEA;AAA2B;EAC3B;;;AAGD;AAMA;AAAA;AAAA;AAIA;EACC;EAEA;EACA;EACA;EAEA;EACA;;;AASD;EACC;EACA;EACA;EAEA;EACA;EAEA;EACA;EACA;EAEA;EACA;EAEA;EACA;EACA;;AAEA;EACC;;;AAIF;EACC;EACA;;;AAID;EACC;;;AAED;EACC;EACA;;;AAED;EACC;EACA;EACA;;;AAGD;EACC;EACA;;;AAGD;EACC;;;AAGD;AAAA;AAAA;AAIA;EACC;EACA;EAEA;EACA;EACA;EAEA;EACA;;;AAID;EACC;EACA;EACA,SAJ0B;;;AAO3B;EACC;;;AAGD;AAAA;AAAA;AAAA;AAAA;AASA;EACC;EACA;EACA;;AAEA;EACC;EAEA;EACA;EACA;EACA;EAEA;;AAGD;EACC;EACA,qBArBwB;EAsBxB;;AAGD;EACC;;AAGD;EACC;;;AAIF;EACC;EACA;EACA,kBArCyB;;;AA0C1B;AAAA;AAAA;AAMA;EACC;EACA;EACA;EAEA;EACA;EACG;;;AAGJ;EACI;;;AAGJ;EACI;;;AAGJ;EACI;;;AAIJ;EACC;EACA;EAEA;EACA;EACA;EACA;AAEA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAGD;AACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAGD;EACC;EACA;EACA;;;AAGD;EACC;EACA;EACA;;AAEA;EACC,OAnEc;EAoEd;;;AAIF;EACI;EACA;EACA;;;AAGJ;EACC;EACA;EACA;EAEA;EACA;;;AAGD;EACC;EACA;;;AAGD;AACA;EACC;EACA;EACA;EAEG;EACA;EACH;EACA;;AAEA;EACC,QAjeqB;EAkerB,YAleqB;EAmerB;;;AAIF;EACC,OA/Ge;EAgHf;;AAEA;EACC;;AAEA;EACC;;;AAKH;AACA;EACC;EACA;EACA;EACA;;;AAOA;EACC;EACA;EAMA;;AAJA;EACC;;AAMF;EACC;EACA;EACA;;AAID;EACC;EACA;EACA;EACA,kBA3MwB;EA4MxB;;AAGD;EACC;EACA;;;AAIF;EACC;;;AAGD;AAAA;AAAA;AAIA;EACC;EACA;EAEA;EACA;EACA;EAEA;EACA;;;AAGD;EACC;EACA;EACA;;;AAGD;EACC;EAEA;EACA;EACA;EACA;EAEA;;;AAGD;EACC;;;AAGD;EACC;EACA;EACA;;;AAGD;EACC;;;AAGD;EACC;EACA;AAAe;EACf;EACA;EAEA;EACA;;;AAGD;EACC;EACA;EACA;EAEA;EACA;;;AAGD;EACC;EACA;;;AAGD;EACC;;;AAGD;AAAA;AAAA;AAAA;AAIA;EACC;;;AAID;AAAA;AAAA;AAIA;AAKA;EAGI;EACH;EACG,QAJgB;EAKhB,OATc;EAWd,cAVoB;EAWvB;EACG;EAEH;EACG;EACA;EACA;EAEH;;AAEA;EACC;EACA;EAEA;EACA;EAEA;EACA;EACA;;;AAIF;EACC;;;AAGD;EACI;EACA;EACA;EAEA;EACA;EACA;;;AAGJ;EACI;;;AAGJ;AAAA;AAAA;AAIA;EACC;;;AAGD;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAEG;EACA;;;AAGJ;EACI;;;AAIH;EACC;EACA;EAEA;EAEA;EACA;EACA;;AAEA;EACC;EACA;;AAGD;EACC;EACA;EACA;;AAIF;EACC;EACA;EACA;EACA;EAEA;EACA;EACA;EAEA;EACA;EAEA;EACA;EAEA;EACA;EAEA;;AAGD;EACC;EACA;;AAGD;EACC;EACA;EACA;EACA;EACA;EACA;EAEA;EACA;EACA;;AAGD;AACC;EACA;;AAQF;EACC;;;AAGD;EACC;;;AAIA;EACC;EACA;;AAGD;EACC;;AAGD;EACC;EACA;EACA;;AAEA;EACC;;AAGD;EACC;;AAGD;EACC;;AAGD;EACC;;;AAKH;EACC;EACA;;;AAGD;EACC;EACA;EACG;EACA;;;AAGJ;EACC;EACA;EACA;EAEA;;;AAGD;EACC;;;AAGD;EACI;;;AAGJ;EACI;;;AAGJ;EACI;EACA;EACA;;;AAGJ;EACI;;;AAGJ;EACC;EACA;EAEA;;;AAGD;EACC;;;AAGD;EACC;EACA;EACA;;;AAGD;EACC;;;AAGD;EACI;EACA;;;AAGJ;AAAA;AAAA;AAIA;AAGA;EAEC,OAJuB;EAKvB,cAJwB;;;AAOzB;EACC;EACA;;;AAGD;EACC;EACA;;;AAGD;EACC;;AAEA;EACC;EACA;;;AAIF;EACC;EACA;EACA;EACA;;;AAGD;AAAA;EAEC;EACA;EACA;;;AAGD;AAAA;EAEC;;;AAGD;EACC;;;AAGD;AACC;AAAA;EAEA;EACA;;;AAGD;EACC;EACA;;;AAGD;EACC;EAEA;EACA;EACA;EACA;EACA;EACA;;;AAGD;EACC;EACA;EAEA;EACA;EACA;EACA;EACA;EACA;;;AAGD;EACC;;;AAGD;EACC;;;AAGD;EACC;EACA;EACA;;;AAGD;EACC;EACA;EACA;EAEA;EAEA;EACA;EACA;EACA;;;AAGD;EACC;EACA;EACA;EACA;EAEA;EACA;EAEA;EACA;EACA;;;AAGD;EACC;EACA;EACA;;;AAGD;EACC;;;AAGD;AAAA;AAAA;AAIA;AAAA;AAAA;AAGA;AAuBC;;AArBA;EACC;;AAGD;EACC;;AAGD;EACC;;AAIA;EACC;;AAED;EACC;;AAKF;EACC;;AAEA;EACC;;AAGD;EACC;;AAGD;EACC;;;AAKH;EACC;EACA;EACA;;;AAKD;EACC,cAH0B;EAI1B;EACA;EACA;;;AAGD;EACC;;AAEA;EACC,cAbyB;;AAgB1B;EACC;EACA;;AAGD;AAAA;EAEC;EACA;;AAGD;EACC;EACA;;AAGD;EACC;;AAIA;EACC;;;AAQF;EACC;EACA;EACA;EACA;;AAGD;EACC;;AAID;EACC;;AAED;EACC;;AAKA;EACC;;AAED;EACC;;;AAQF;EACC;;;AAIF;AACA;EACC;EACA;EAEA;EACA;EACA;EAEA;EACA;EAGA;EAEA;EACA;;;AAGD;EACC;EAEA;EACA;EACA;EACA;EACA;EAEA;EAEA;;;AAGD;EACC;;;AAID;EAGC,WAFgB;EAGhB,QAHgB;EAIhB,OAJgB;EAOhB;EAEA;EACA;EACA;;;AAGD;EACC;;;AAGD;AAAA;AAAA;AAQA;EAEC;EACA,SAFoB;;;AAKrB;EACC;;AAEA;EACC;EACA;EACA;EAEA;EACA;EACA;EAEA,OAtBwB;EAuBxB,QAtByB;EAwBzB;EACA;EACA;;AAGD;EACC;;AAGD;EACC;EACA;EACA;EACA;EACA;;AAGD;EACC;EAGA,KAFc;EAGd,MA7C0B;EA8C1B,OA9C0B;EAiD1B;EAEA;EACA;;AAGD;EACC;EAGA;EACA;EACA;EACA;;AAEA;EACC;EACA;EAEA;EACA;;AAGD;EACC;EACA;;AAGD;EACC;;AAGD;EACC;;AAKD;EACC;;AAGD;EACC;;AAID;EACC;;AAMD;EACC;;AAED;EACC;;AAED;EACC;;AAGD;EACC;;AAKA;EACC;;AAaH;EACC;EACA;EACA;EAEA;EACA;;AAGD;EACC;EACA;EACA;EACA;EACA;;;AAIF;EACC;EACA,OAzJ2B;EA0J3B,QA1J2B;EA4J3B;EACA;;;AAKD;AAAA;AAAA;AAIA;EACI;;;AAMJ;AAAA;AAAA;AAIA;EACC;;;AAGD;EACC;EACA;EACA;;;AAGD;EACC;EACA;EACA;EACA;;;AAGD;EACC;EACA;EACA;;;AAGD;EACC;;;AAID;EACC;;;AAKA;EACC;EACA;EACA;;;AAIF;EACC;;;AAGD;EACC;;;AAGD;EACC;EACA;EAEA;EACA;EACA;EACA;;;AAGD;EACC;EACA;EACA;EACA;EACA;EACA;EAEA;EACA;EACA;EAEA;EACA;EACA;;;AAGD;EACC;EACA;EACA;;;AAGD;EACC;;;AAGD;EACC;EACA;EACA;;;AAIA;EACC;EACA;;AAGD;EACC;EACA;;AAGD;EACC;;AAGD;EACC;EACA;;AAGD;EACC;;AAGD;EACC;EACA;EACA;EACA;EACA;EAEA;EACA;EACA;EAEA;EACA;EACA;;AAGD;EACC;;;AAIF;EAEC;EACA;;;AAGD;EACC;;AAEA;EACC;EACA;EACA;;AAGD;EACC;;AAGD;EACC;EACA;EACA;;;AAIF;AAAA;AAAA;AAGA;EACC;;;AAGD;AAAA;AAAA;AAIA;EACC;EACA;EAEA;EACA;EACA;EAEA;EACA;;AAEA;EACC;EACA;;AAGD;EAEC,aAjxCyB;EAkxCzB,gBAlxCyB;;AAqxC1B;EACC;;AAGD;EACC;;AAEA;EACC;;;AAKH;AAAA;AAAA;AAIA;EACC;EACA;EACA;;;AAIA;EACC;EACA;;AAGD;EACC;EACA;;AAGD;EACC;;;AAIF;EACC;;;AAGD;AACC;AAAA;;;AAID;AAAA;AAAA;AAIA;EACC;;;AAGD;AAAA;AAAA;AAKC;EACC;;AAGD;EACC;EACA;EACA;;AAGD;EACC;EACA;EACA;;;AAKF;EACC;;AAMA;EACC;EACA;EACA,KANQ;EAOR,OAPQ;EASR;EAEA;EACA;EACA;EACA;EACA;;;AAKF;AAAA;AAAA;AAIA;EACI;EAEH;EACA;EAEA;EACA;EACA;EACA;;AAEA;EACC;EACA;EACA;;AAGD;EACC;;;AAIF;EACC;EACA;EACA;EACA;EAEA;;;AAGD;EACC;EAEA;;;AAGD;EACC;;;AAGD;EACI;EACA;;;AAGJ;EACI;EACA;EACA;EAEA;EACA;EAEA;;;AAGJ;EACI;EACA;EAEA;EACA;;;AAGJ;EACI;;;AGlrEJ;AAAA;AAAA;AAIA;EACC;EACA;;;AAGD;EAEC;;;AAGD;EACC;EACA;EAEA;EACA;EACA;;;AAGD;EACC;EACA;EACA;EACA;EAEA;EACA;EACA;;;AAGD;EACC;EACA;EACA;EAEA;EACA;EACA;;;AAGD;EACC;EACA;EACA;;;AAGD;EACC;EACA;EACA;EACA;;;AAGD;EACC;EACA;EACA;;AAEA;EACC;EACA;EACA;EACA;;;AAIF;EACC;EACA;EAEA;EACA;EACA;EACA;;;AAGD;EACC;EACA;EAEA;EACA;;;AAGD;EACC;EACA;EACA;EAEA;EACA;EACA;EAEA;EACA;EACA;;;AAGD;EACC;EACA;EACA;EAEA;EACA;EACA;EACA;EAEA;EACA;EAEA;EACA;;AAEA;EACC;;;AAIF;EACC;EACA;;;AAGD;EACC;;;ACjID;AAAA;AAAA;AAKC;EACC;;AAGD;EACC;EACA;EACA;;;AAIF;;AAAA;AAAA;AAAA;AAMA;EACC;;;AAIA;EACC;;;AAIF;AAAA;AAEA;EACC","file":"menu-editor.css"} \ No newline at end of file diff --git a/css/menu-editor.scss b/css/menu-editor.scss index 6f1ed82..2112cca 100644 --- a/css/menu-editor.scss +++ b/css/menu-editor.scss @@ -768,11 +768,12 @@ select.ws_dropdown optgroup option { */ $activeToolTabBackground: #FDFDFD; +$toolTabLeftMargin: 6px; .ws_tool_tab_nav { list-style: outside none none; padding: 0; - margin: 0 0 0 6px; + margin: 0 0 0 $toolTabLeftMargin; li { display: inline-block; @@ -913,6 +914,7 @@ $iconFontColor: #85888c; box-sizing: border-box; height: 25px; min-height: 25px; + min-width: 26px; .ame-is-wp53-plus & { height: $basicInputWp53Height; @@ -943,7 +945,7 @@ $iconFontColor: #85888c; } #ws_icon_selector { - $tabTopPadding: 4px; + $innerTopPadding: 4px; $tabHorizontalPadding: 4px; .ws_tool_tab_nav { @@ -958,10 +960,24 @@ $iconFontColor: #85888c; } .ws_tool_tab { - padding: $tabTopPadding $tabHorizontalPadding 2px; + padding: 0 $tabHorizontalPadding 2px; max-height: 324px; overflow-y: auto; } + + //Search bar in the icon selector (per tab) + .ws_icon_search_bar { + margin: 0 0 0 ($toolTabLeftMargin - $tabHorizontalPadding); + position: sticky; + top: 0; + background-color: $activeToolTabBackground; + padding: $innerTopPadding 0; + } + + .ws_no_matching_icons { + margin-left: ($toolTabLeftMargin - $tabHorizontalPadding); + padding: $innerTopPadding 0; + } } #ws_choose_icon_from_media { @@ -1268,6 +1284,8 @@ $colorFieldRightMargin: 5px; display: block; float: left; margin-top: 0; + + min-width: 8em; } .ws_dialog_buttons .button { @@ -2111,6 +2129,31 @@ $userSelectionPanelPadding: 10px; } } +//region Unsaved changes indicator +.ws_ame_has_unsaved_changes #ws_save_menu { + position: relative; + + $indicatorSize: 9px; + $offset: 1px; + + //Rounded triangle in the corner of the button. + &:before { + content: ''; + position: absolute; + top: $offset; + right: $offset; + + --ame-me-calc-indicator-size: calc(#{$indicatorSize} + (var(--ame-ds-btn-radius-tr, 3px) - 3px) / 2); + + width: var(--ame-me-calc-indicator-size, $indicatorSize); + height: var(--ame-me-calc-indicator-size, $indicatorSize); + background: #00e93c; + border-top-right-radius: calc(var(--ame-ds-btn-radius-tr, 3px) - #{$offset}); + clip-path: polygon(0 0, 100% 0, 100% 100%); + } +} +//endregion + /********************************************* Miscellaneous **********************************************/ @@ -2125,6 +2168,16 @@ $userSelectionPanelPadding: 10px; right: 20px; bottom: 40px; z-index: 100; + + .dashicons { + font-size: 15px; + width: unset; + height: unset; + } + + &.ame-tgc-sidebar-ad { + max-width: 280px; + } } .ws-ame-icon-radio-button-group > label { diff --git a/customizables/Controls/ColorPicker.php b/customizables/Controls/ColorPicker.php index 2043ba8..e4d075b 100644 --- a/customizables/Controls/ColorPicker.php +++ b/customizables/Controls/ColorPicker.php @@ -14,6 +14,11 @@ class ColorPicker extends ClassicControl { */ protected $mainSetting; + public function __construct($settings = [], $params = []) { + $this->hasPrimaryInput = true; + parent::__construct($settings, $params); + } + public function renderContent(Renderer $renderer) { $value = $this->getMainSettingValue(); if ( !is_string($value) ) { diff --git a/customizables/Controls/Container.php b/customizables/Controls/Container.php index 1e446e0..73001a0 100644 --- a/customizables/Controls/Container.php +++ b/customizables/Controls/Container.php @@ -55,6 +55,29 @@ public function sortChildren($compareFunction) { usort($this->children, $compareFunction); } + /** + * Recursively filter the container's children using the specified callback. + * + * The children list is replaced with the filtered list. + * + * @param callable(UiElement):bool $callback + * @return void + */ + public function recursiveFilterChildrenInPlace($callback) { + foreach ($this->children as $key => $child) { + //Depth-first traversal. + if ( $child instanceof Container ) { + $child->recursiveFilterChildrenInPlace($callback); + } + if ( $callback($child) === false ) { + unset($this->children[$key]); + } + } + + //Re-index the array. Note: array_filter() would not help much since it does not re-index the array. + $this->children = array_values($this->children); + } + /** * @return string */ diff --git a/customizables/Controls/Control.php b/customizables/Controls/Control.php index de2533c..8709527 100644 --- a/customizables/Controls/Control.php +++ b/customizables/Controls/Control.php @@ -89,7 +89,12 @@ public function __construct($settings = [], $params = []) { //of the HTML element generated by this control. if ( $this->id === '' ) { if ( isset($this->mainSetting) ) { - $this->id = preg_replace('/[^a-z\-_]+/i', '_', $this->mainSetting->getId()); + $this->id = preg_replace('/[^a-z0-9\-_]+/i', '_', $this->mainSetting->getId()); + //The ID should not start with a number because it *could* + //be used as an HTML element ID. + if ( preg_match('/^[0-9]/', $this->id) ) { + $this->id = 'c' . $this->id; + } } else { $this->id = 'ame_' . $this->type . '_' . $this->instanceNumber; } diff --git a/customizables/SampleModule.php b/customizables/SampleModule.php index 2773b37..dc50377 100644 --- a/customizables/SampleModule.php +++ b/customizables/SampleModule.php @@ -134,6 +134,7 @@ private function getInterfaceStructure() { ), $b->auto('unused_item_position') + ->asGroup() ->tooltip( "This setting controls the position of menu items that are not present in the last saved menu configuration. @@ -144,6 +145,7 @@ private function getInterfaceStructure() { ), $b->auto('deep_nesting_enabled') + ->asGroup() ->tooltip( "Caution: Experimental feature.
This feature might not work as expected, and it could cause conflicts with other plugins or themes.", diff --git a/customizables/Settings/UserDefinedStruct.php b/customizables/Settings/UserDefinedStruct.php index aa182e4..d53d035 100644 --- a/customizables/Settings/UserDefinedStruct.php +++ b/customizables/Settings/UserDefinedStruct.php @@ -12,6 +12,10 @@ public function __construct($id, StorageInterface $store = null, $params = array if ( isset($params['childGenerator']) && is_callable($params['childGenerator']) ) { $childFactory = new Builders\StructChildSettingFactory($this); + + //Children inherit the parent's tags. + $childFactory->setTags(...$this->tags); + $children = call_user_func($params['childGenerator'], $childFactory); if ( is_array($children) ) { $expectedIdPrefix = $this->getId() . '.'; diff --git a/dist/admin-customizer-preview.bundle.js b/dist/admin-customizer-preview.bundle.js new file mode 100644 index 0000000..e454516 --- /dev/null +++ b/dist/admin-customizer-preview.bundle.js @@ -0,0 +1,1183 @@ +"use strict"; +(self["wsAmeWebpackChunk"] = self["wsAmeWebpackChunk"] || []).push([["admin-customizer-preview"],{ + +/***/ "./extras/modules/admin-customizer/preview-handler.ts": +/*!************************************************************!*\ + !*** ./extras/modules/admin-customizer/preview-handler.ts ***! + \************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _pro_customizables_assets_customizable_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../pro-customizables/assets/customizable.js */ "./extras/pro-customizables/assets/customizable.js"); +/* harmony import */ var _admin_customizer_base_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./admin-customizer-base.js */ "./extras/modules/admin-customizer/admin-customizer-base.js"); +/* harmony import */ var _style_generator_style_generator_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../style-generator/style-generator.js */ "./extras/style-generator/style-generator.js"); + + + + +//Compatibility note: This script is not compatible with IE11 because it uses some +//modern JS features like the URLSearchParams class. +var AmeAdminCustomizerPreview; +(function (AmeAdminCustomizerPreview) { + var ThrottledPreviewRegistry = _pro_customizables_assets_customizable_js__WEBPACK_IMPORTED_MODULE_0__.AmeCustomizable.ThrottledPreviewRegistry; + const $ = jQuery; + class PreviewHandler extends _admin_customizer_base_js__WEBPACK_IMPORTED_MODULE_1__.AmeAdminCustomizerBase.AdminCustomizerBase { + constructor(scriptData) { + super(scriptData); + this.currentPreviewValues = {}; + this.changesetName = scriptData.changesetName; + this.previewRegistry = new ThrottledPreviewRegistry((settingId, defaultResult) => { + if (this.currentPreviewValues.hasOwnProperty(settingId)) { + return this.currentPreviewValues[settingId]; + } + //Try the script data. It should have the current value from the changeset. + if (scriptData.settings.hasOwnProperty(settingId) + && scriptData.settings[settingId].hasOwnProperty('value')) { + return scriptData.settings[settingId].value; + } + return defaultResult; + }); + this.connection = AmeAcCommunicator.connectToParent({ + 'previewSetting': (settingId, value) => { + this.currentPreviewValues[settingId] = value; + if (!this.previewRegistry.canPreview(settingId)) { + return false; + } + this.previewRegistry.queuePreview(settingId); + return true; + }, + 'getCurrentUrl': () => { + return window.location.href; + } + }, scriptData.allowedCommOrigins, scriptData.isWpDebugEnabled); + this.connection.promise.then((c) => { + if (typeof c === 'undefined') { + if (console && console.warn) { + console.warn('Connection succeeded, but the communicator is undefined. This should be impossible.'); + } + return; //This should never happen. + } + //Let the parent know the current URL. The parent might not be able to + //read it due to cross-domain restrictions, and if there are any redirects, + //the actual URL might not match the frame src that was set by the parent. + c.execute('notifyPreviewUrlChanged', window.location.href); + }); + $(() => { + this.addPreviewParamsToLinks(); + //Handle clicks on links. + $(document.body).on('click.ame-ac-preview', 'a', (event) => { + return this.handleLinkClick(event); + }); + //Block form submissions. Theme Customizer supports those, but we don't + //(at least for now). + $(document.body).on('submit.ame-ac-preview', 'form', function (event) { + event.preventDefault(); + }); + }); + //For convenience, support for StyleGenerator previews is built-in. + for (const previewConfig of (scriptData.stylePreviewConfigs || [])) { + const previewInstance = new _style_generator_style_generator_js__WEBPACK_IMPORTED_MODULE_2__.AmeStyleGenerator.Preview.StyleGeneratorPreview(previewConfig); + this.previewRegistry.registerPreviewUpdater(previewInstance.getPreviewableSettingIDs(), previewInstance); + } + } + /** + * Add preview-specific query parameters to all links. + */ + addPreviewParamsToLinks() { + const self = this; + $('a[href]').each(function () { + const element = this; + if (!(element instanceof HTMLAnchorElement)) { + return; + } + const $link = $(this); + //Don't modify internal anchors like "#abc". + if (self.isInternalAnchor($link)) { + return; + } + //Flag and skip non-previewable links. + if (!self.isPreviewableLink(element)) { + $link.addClass('ame-ac-not-previewable'); + return; + } + //Add the preview query parameter(s). + const params = new URLSearchParams(element.search); + params.set('ame-ac-preview', '1'); + params.set('ame-ac-changeset', self.changesetName); + element.search = '?' + params.toString(); + }); + } + isPreviewableLink(element) { + return this.isPreviewableUrl(element); + } + isInternalAnchor($link) { + const href = $link.attr('href'); + if (typeof href === 'undefined') { + return false; + } + return (href.substring(0, 1) === '#'); + } + handleLinkClick(event) { + const $link = $(event.target).closest('a'); + //Let anchors work as normal. + if (this.isInternalAnchor($link)) { + return; + } + //Prevent the browser from navigating to non-previewable links. + const anchorElement = $link.get(0); + if (!this.isPreviewableLink(anchorElement)) { + event.preventDefault(); + return; + } + //Tell the parent (i.e. the admin customizer) to load the link. + if (this.connection.isConnected) { + event.preventDefault(); + this.connection.execute('setPreviewUrl', anchorElement.href); + } + } + // noinspection JSUnusedGlobalSymbols Used in other modules. + registerPreviewer(settingId, callback) { + this.previewRegistry.registerPreviewCallback(settingId, callback); + } + // noinspection JSUnusedGlobalSymbols Also used in other modules. + registerPreviewUpdater(settingIds, updater) { + this.previewRegistry.registerPreviewUpdater(settingIds, updater); + } + // noinspection JSUnusedGlobalSymbols + registerRpcMethod(methodName, handler) { + this.connection.addRpcMethod(methodName, handler); + } + } + AmeAdminCustomizerPreview.PreviewHandler = PreviewHandler; + const previewHandler = new PreviewHandler(wsAmeAcPreviewData); + window['wsAdminCustomizerPreview'] = previewHandler; + $('body').trigger('adminMenuEditor:acPreviewStart', [previewHandler]); +})(AmeAdminCustomizerPreview || (AmeAdminCustomizerPreview = {})); + + +/***/ }), + +/***/ "./extras/modules/admin-customizer/admin-customizer-base.js": +/*!******************************************************************!*\ + !*** ./extras/modules/admin-customizer/admin-customizer-base.js ***! + \******************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "AmeAdminCustomizerBase": () => (/* binding */ AmeAdminCustomizerBase) +/* harmony export */ }); + +var AmeAdminCustomizerBase; +(function (AmeAdminCustomizerBase) { + class AdminCustomizerBase { + constructor(scriptData) { + this.allowedCommOrigins = scriptData.allowedCommOrigins; + if (this.allowedCommOrigins.length === 0) { + this.allowedCommOrigins = [window.location.origin]; + } + this.allowedPreviewUrls = scriptData.allowedPreviewUrls; + this.parsedAllowedUrls = this.allowedPreviewUrls.map(url => new URL(url)); + } + isPreviewableUrl(url) { + if (typeof url === 'string') { + url = new URL(url); + } + if (typeof url.protocol === 'undefined') { + return false; + } + //Only HTTP(S) links are previewable. + if ((url.protocol !== 'http:') && (url.protocol !== 'https:')) { + return false; + } + //Check against the list of allowed URLs. + for (const allowedUrl of this.parsedAllowedUrls) { + //Protocol and host must match. The path must start with the path + //of the allowed URL (possibly without a trailing slash). + if ((url.protocol === allowedUrl.protocol) && (url.host === allowedUrl.host)) { + const allowedPath = allowedUrl.pathname.replace(/\/$/, ''); + if (url.pathname.indexOf(allowedPath) === 0) { + return true; + } + } + } + return false; + } + } + AmeAdminCustomizerBase.AdminCustomizerBase = AdminCustomizerBase; +})(AmeAdminCustomizerBase || (AmeAdminCustomizerBase = {})); +//# sourceMappingURL=admin-customizer-base.js.map + +/***/ }), + +/***/ "./extras/style-generator/style-generator.js": +/*!***************************************************!*\ + !*** ./extras/style-generator/style-generator.js ***! + \***************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "AmeStyleGenerator": () => (/* binding */ AmeStyleGenerator) +/* harmony export */ }); +var AmeStyleGenerator; +(function (AmeStyleGenerator) { + const $ = jQuery; + class ValueDescriptor { + } + class ConstantValue extends ValueDescriptor { + constructor(value) { + super(); + this.value = value; + } + getValue() { + return this.value; + } + } + class ArrayValue extends ValueDescriptor { + constructor(items) { + super(); + this.items = items; + } + getValue() { + return this.items.map(item => item.getValue()); + } + getItemDescriptors() { + return this.items; + } + } + class SettingReference extends ValueDescriptor { + constructor(settingId, valueGetter) { + super(); + this.settingId = settingId; + this.valueGetter = valueGetter; + } + getValue() { + return this.valueGetter(this.settingId); + } + } + class VariableReference extends ValueDescriptor { + constructor(name, valueGetter) { + super(); + this.name = name; + this.valueGetter = valueGetter; + } + getValue() { + return this.valueGetter(this.name); + } + } + class FunctionCall extends ValueDescriptor { + constructor(args, callback) { + super(); + this.args = args; + this.callback = callback; + } + getValue() { + return this.callback(this.resolveArgs(this.args)); + } + resolveArgs(args) { + if (Array.isArray(args)) { + return args.map(arg => arg.getValue()); + } + return Object.keys(args).reduce((result, key) => { + result[key] = args[key].getValue(); + return result; + }, {}); + } + } + //endregion + function isEmptyCssValue(value) { + return (typeof value === 'undefined') || (value === '') || (value === null); + } + function convertToRgba(color, opacity = 1.0) { + color = color.trim(); + if (color === '') { + return 'transparent'; + } + //Strip the leading hash, if any. + if (color[0] === '#') { + color = color.substring(1); + } + //If the color is in the shorthand format, expand it. + if (color.length === 3) { + color = color[0] + color[0] + color[1] + color[1] + color[2] + color[2]; + } + //The color should now be in the full 6-digit format. Convert it to RGBA. + if (color.length === 6) { + const red = parseInt(color.substring(0, 2), 16); + const green = parseInt(color.substring(2, 4), 16); + const blue = parseInt(color.substring(4, 6), 16); + return `rgba(${red}, ${green}, ${blue}, ${opacity})`; + } + //The color may be invalid, or it's not in a hex format we recognize. + return color; + } + function uniqueArrayValues(array) { + return array.filter((value, index) => array.indexOf(value) === index); + } + function constrain(value, min, max) { + return Math.min(Math.max(value, min), max); + } + function modifyHexColorAsHsl(args, operation) { + const color = args.color || ''; + if (isEmptyCssValue(color)) { + return ''; + } + const hue = args.hue || null; + const saturation = args.saturation || null; + const lightness = args.lightness || null; + if ((hue === null) && (saturation === null) && (lightness === null)) { + return color; + } + let output = $.Color(color); + output = operation(output, hue, saturation, lightness); + return output.toHexString(); + } + // noinspection JSUnusedGlobalSymbols -- Used dynamically by declaration generators received from the server. + const builtinFunctions = { + simpleProperty: function (args) { + if (isEmptyCssValue(args.value)) { + return []; + } + return [args.name + ': ' + args.value + ';']; + }, + formatLength: function (args) { + if (isEmptyCssValue(args.value)) { + return ''; + } + //Normalize numeric values. For example, while JS accepts "1." as a number, + //"1.px" is not a valid CSS length value, so it should be converted to "1px". + const numericValue = parseFloat(String(args.value)); + if (isNaN(numericValue)) { + return ''; + } + return '' + numericValue + (args.unit || ''); + }, + shadow: function (args) { + const mode = args.mode || 'default'; + const color = args.color || ''; + if (mode === 'default') { + return []; + } + if ((mode === 'none') || (color === '') || (color === null) || (color === 'transparent')) { + return ['box-shadow: none;']; + } + if (mode !== 'custom') { + return []; + } + const components = []; + if (args.inset) { + components.push('inset'); + } + const horizontal = args['offset-x'] || 0; + const vertical = args['offset-y'] || 0; + const blur = args.blur || 0; + const spread = args.spread || 0; + components.push(`${horizontal}px ${vertical}px ${blur}px ${spread}px`); + const colorOpacity = args.colorOpacity || 1.0; + if (colorOpacity < 1.0) { + components.push(convertToRgba(color, colorOpacity)); + } + else { + components.push(color); + } + return [`box-shadow: ${components.join(' ')};`]; + }, + boxSides: function (args) { + if (typeof args.cssPropertyPrefix !== 'string') { + throw new Error('Invalid config for the boxSides generator: missing cssPropertyPrefix'); + } + const compositeValue = args.value || {}; + const unit = compositeValue.unit || ''; + const declarations = []; + for (const side of ['top', 'right', 'bottom', 'left']) { + const value = compositeValue[side]; + if (isEmptyCssValue(value)) { + continue; + } + const property = args.cssPropertyPrefix + side; + declarations.push(`${property}: ${value}${unit};`); + } + return declarations; + }, + firstNonEmpty(args) { + for (const arg of args) { + if (!isEmptyCssValue(arg)) { + return arg; + } + } + return null; + }, + /** + * Take a HEX color, convert it to HSL to edit its components, + * then convert back to HEX. + * + * @param args + */ + editHexAsHsl: function (args) { + return modifyHexColorAsHsl(args, (color, hue, saturation, lightness) => { + if (hue !== null) { + color = color.hue(hue); + } + if (saturation !== null) { + color = color.saturation(saturation); + } + if (lightness !== null) { + color = color.lightness(lightness); + } + return color; + }); + }, + adjustHexAsHsl: function (args) { + return modifyHexColorAsHsl(args, (color, hue, saturation, lightness) => { + if (hue !== null) { + color = color.hue(constrain(color.hue() + hue, 0, 360)); + } + if (saturation !== null) { + color = color.saturation(constrain(color.saturation() + saturation, 0, 1.0)); + } + if (lightness !== null) { + color = color.lightness(constrain(color.lightness() + lightness, 0, 1.0)); + } + return color; + }); + }, + mixColors: function (args) { + const color1 = args.color1 || ''; + const color2 = args.color2 || ''; + if (isEmptyCssValue(color1) || isEmptyCssValue(color2)) { + return ''; + } + const weight = args.weight || 50; + if (weight <= 0) { + return color2; + } + else if (weight >= 100) { + return color1; + } + return $.Color(color2).transition($.Color(color1), weight / 100).toHexString(); + }, + changeLightness: function (args) { + const color = args.color || ''; + if (isEmptyCssValue(color)) { + return ''; + } + const amount = args.amount || 0; + if (amount === 0) { + return color; + } + let output = $.Color(color); + //Amount is a number between 0 and 100, while lightness is between 0.0 and 1.0. + let newLightness = output.lightness() + (amount / 100); + //Clamp to 0.0 - 1.0. + newLightness = constrain(newLightness, 0.0, 1.0); + return output.lightness(newLightness).toHexString(); + }, + darken: function (args) { + const color = args.color || ''; + const amount = args.amount || 0; + return builtinFunctions.changeLightness({ color, amount: -Math.abs(amount) }); + }, + lighten: function (args) { + const color = args.color || ''; + const amount = args.amount || 0; + return builtinFunctions.changeLightness({ color, amount: Math.abs(amount) }); + }, + compare: function (args) { + const value1 = args.value1; + const value2 = args.value2; + const operator = args.op; + const thenResult = (typeof args.thenResult !== 'undefined') ? args.thenResult : true; + const elseResult = (typeof args.elseResult !== 'undefined') ? args.elseResult : null; + let result; + switch (operator) { + case '==': + result = value1 == value2; + break; + case '!=': + result = value1 != value2; + break; + case '>': + result = value1 > value2; + break; + case '>=': + result = value1 >= value2; + break; + case '<': + result = value1 < value2; + break; + case '<=': + result = value1 <= value2; + break; + default: + throw new Error(`Unknown operator: ${operator}`); + } + return result ? thenResult : elseResult; + }, + ifTruthy: function (args) { + const value = args.value; + const thenResult = (typeof args.thenResult !== 'undefined') ? args.thenResult : true; + const elseResult = (typeof args.elseResult !== 'undefined') ? args.elseResult : null; + return value ? thenResult : elseResult; + }, + ifSome: function (args) { + const values = args.values; + const thenResult = args.thenResult; + const elseResult = (typeof args.elseResult !== 'undefined') ? args.elseResult : null; + for (const value of values) { + if (!!value) { + return thenResult; + } + } + return elseResult; + }, + ifAll: function (args) { + const values = args.values; + const thenResult = args.thenResult; + const elseResult = args.elseResult !== undefined ? args.elseResult : null; + if (!values || (values.length === 0)) { + return elseResult; + } + for (const value of values) { + if (!value) { + return elseResult; + } + } + return thenResult; + }, + ifImageSettingContainsImage: function (args) { + const thenResult = args.thenResult !== undefined ? args.thenResult : true; + const elseResult = args.elseResult !== undefined ? args.elseResult : null; + if ((typeof args.value !== 'object') || !args.value) { + return elseResult; + } + const image = args.value; + const hasAttachment = !!image.attachmentId; + const hasExternalUrl = !!image.externalUrl; + const hasImage = hasAttachment || hasExternalUrl; + return hasImage ? thenResult : elseResult; + } + }; + let Preview; + (function (Preview) { + const $ = jQuery; + function isConditionalAtRuleConfig(config) { + if ((typeof config !== 'object') || (config === null)) { + return false; + } + const configAsRecord = config; + return ((typeof configAsRecord['t'] === 'string') + && (configAsRecord['t'] === 'conditionalAtRule') + && (typeof configAsRecord['identifier'] === 'string')); + } + function isRuleSetConfig(config) { + return ((config !== null) + && (Array.isArray(config['selectors'])) + && (Array.isArray(config['generators']))); + } + const inactiveSettingMarker = { '_ame_inactive_setting': true }; + class PreviewSession { + constructor(config) { + this.settings = {}; + this.valueReaders = new Set(); + this.notFound = {}; + this.variables = {}; + this.styleBlocks = []; + this.stylesheetsToDisable = []; + this.stylesheetWasEnabled = {}; + /** + * Whether this is the first time the preview is being updated. + * This is set to false after preview() is called for the first time. + */ + this._isBeforeFirstUpdate = true; + //Optimization: Create bound getters once instead of every time we need + //to create a setting or variable reference. + this.settingValueGetter = this.getSettingPreviewValue.bind(this); + this.variableValueGetter = (variableName) => { + if (variableName in this.variables) { + return this.variables[variableName].getValue(); + } + return null; + }; + //Optionally, disable already generated custom stylesheets while the preview + //is active to prevent old settings from interfering with the preview of new settings. + if (Array.isArray(config.stylesheetsToDisable)) { + this.stylesheetsToDisable = config.stylesheetsToDisable; + } + //Variables + for (const variableName in config.variables) { + if (!config.variables.hasOwnProperty(variableName)) { + continue; + } + this.variables[variableName] = this.createValueDescriptor(config.variables[variableName], true); + } + //CSS statement groups + for (const conditionConfig of config.statementGroups) { + const statements = this.createCssStatements(conditionConfig.statements); + if (statements.length < 1) { + continue; + } + const condition = this.createValueDescriptor(conditionConfig.expression, true); + const usedSettingIds = this.getSettingIdsUsedBy(condition); + const conditionCallback = () => { + //For performance, conditions that reference settings should + //only be checked when at least one setting is active. + if (usedSettingIds.length > 0) { + if (!usedSettingIds.some((id) => this.isSettingActive(id))) { + return false; + } + } + const isTruthy = condition.getValue(); + return !!isTruthy; //Convert to boolean. + }; + this.styleBlocks.push(new PreviewStyleBlock(statements, conditionCallback)); + } + } + createValueDescriptor(data, allowUnknownVariables = false) { + switch (data.t) { + case 'constant': + return new ConstantValue(data.value); + case 'array': + return new ArrayValue(data.items.map((valueData) => this.createValueDescriptor(valueData, allowUnknownVariables))); + case 'setting': + this.registerPreviewableSettingId(data.id); + return new SettingReference(data.id, this.settingValueGetter); + case 'var': + if (!this.variables.hasOwnProperty(data.name) && !allowUnknownVariables) { + throw new Error('Unknown variable: ' + data.name); + } + return new VariableReference(data.name, this.variableValueGetter); + case 'funcCall': + let functionName; + if (data.name in builtinFunctions) { + functionName = data.name; + } + else { + throw new Error('Unknown function: ' + data.name); + } + const func = builtinFunctions[functionName]; + //Initialize the function arguments. + let args; + if (Array.isArray(data.args)) { + args = data.args.map(arg => this.createValueDescriptor(arg, allowUnknownVariables)); + } + else { + args = {}; + for (const argName in data.args) { + if (!data.args.hasOwnProperty(argName)) { + continue; + } + args[argName] = this.createValueDescriptor(data.args[argName], allowUnknownVariables); + } + } + // @ts-ignore - Can't really statically check this since the values come from the server. + return new FunctionCall(args, func); + } + } + /** + * Get the IDs of all settings that are referenced by the given descriptor. + * + * @param descriptor + * @private + */ + getSettingIdsUsedBy(descriptor) { + if (descriptor instanceof SettingReference) { + return [descriptor.settingId]; + } + if (descriptor instanceof ArrayValue) { + let result = []; + for (const item of descriptor.getItemDescriptors()) { + result = result.concat(this.getSettingIdsUsedBy(item)); + } + return uniqueArrayValues(result); + } + if (descriptor instanceof FunctionCall) { + let result = []; + const args = descriptor.args; + if (Array.isArray(args)) { + for (const arg of args) { + result = result.concat(this.getSettingIdsUsedBy(arg)); + } + } + else { + for (const argName in args) { + if (args.hasOwnProperty(argName)) { + result = result.concat(this.getSettingIdsUsedBy(args[argName])); + } + } + } + return uniqueArrayValues(result); + } + if (descriptor instanceof VariableReference) { + const varDef = this.getVariableDefinition(descriptor.name); + if (varDef === null) { + return []; + } + return this.getSettingIdsUsedBy(varDef); + } + return []; + } + getVariableDefinition(variableName) { + if (!this.variables.hasOwnProperty(variableName)) { + return null; + } + return this.variables[variableName]; + } + createCssStatements(configs) { + let results = []; + for (const config of configs) { + if (isRuleSetConfig(config)) { + results.push(this.createRuleSetFromConfig(config)); + } + else if (isConditionalAtRuleConfig(config)) { + results.push(new ConditionalAtRule(config.identifier, config.condition, (typeof config.nestedStatements === 'undefined') + ? [] + : this.createCssStatements(config.nestedStatements))); + } + else { + console.error('Unknown CSS statement type: ', config); + } + } + return results; + } + createRuleSetFromConfig(config, parent = null) { + const generatorWrappers = this.makeGeneratorWrappers(config.generators); + const ruleSet = new CssRuleSet(config.selectors, generatorWrappers, parent); + const nestedRuleSets = this.createNestedRuleSets(config.nestedStatements, ruleSet); + ruleSet.setNestedRuleSets(nestedRuleSets); + return ruleSet; + } + createNestedRuleSets(configs, parent = null) { + let results = []; + if (!configs) { + return results; + } + for (const config of configs) { + if (!isRuleSetConfig(config)) { + throw new Error('A CSS rule set can only contain other rule sets, not other types of statements.'); + } + results.push(this.createRuleSetFromConfig(config, parent)); + } + return results; + } + getPreviewableSettingIDs() { + return Object.keys(this.settings); + } + preview(settingId, value, otherSettingReader) { + if (this._isBeforeFirstUpdate) { + this._isBeforeFirstUpdate = false; + this.disableAssociatedStylesheets(); + } + this.valueReaders.add(otherSettingReader); + if (!this.settings.hasOwnProperty(settingId)) { + this.settings[settingId] = ko.observable(value); + } + else { + this.settings[settingId](value); + } + } + dispose() { + //Dispose of all style blocks. + for (const block of this.styleBlocks) { + block.dispose(); + } + this.reEnableAssociatedStylesheets(); + } + disableAssociatedStylesheets() { + for (const stylesheetSelector of this.stylesheetsToDisable) { + const $link = $(stylesheetSelector); + if ($link.length > 0) { + this.stylesheetWasEnabled[stylesheetSelector] = $link.prop('disabled'); + $link.prop('disabled', true); + } + } + } + reEnableAssociatedStylesheets() { + for (const stylesheetSelector of this.stylesheetsToDisable) { + const $link = $(stylesheetSelector); + if (($link.length > 0) && this.stylesheetWasEnabled.hasOwnProperty(stylesheetSelector)) { + $link.prop('disabled', this.stylesheetWasEnabled[stylesheetSelector]); + } + } + } + isSettingActive(settingId) { + if (this.settings.hasOwnProperty(settingId)) { + return this.settings[settingId]() !== inactiveSettingMarker; + } + return false; + } + getSettingPreviewValue(settingId) { + if (!this.settings.hasOwnProperty(settingId)) { + const value = this.getSettingFromReaders(settingId); + this.settings[settingId] = ko.observable(value).extend({ deferred: true }); + } + const observable = this.settings[settingId]; + let value = observable(); + if (value === inactiveSettingMarker) { + value = this.getSettingFromReaders(settingId); + observable(value); + } + return value; + } + getSettingFromReaders(settingId) { + for (const reader of this.valueReaders) { + const value = reader(settingId, this.notFound); + if (value !== this.notFound) { + return value; + } + } + throw new Error('Setting not found for preview: ' + settingId); + } + makeGeneratorWrappers(generatorConfigs) { + let generatorWrappers = []; + for (const generatorConfig of generatorConfigs) { + const wrapper = this.makeDeclarationGeneratorWrapper(generatorConfig); + if (wrapper !== null) { + generatorWrappers.push(wrapper); + } + } + return generatorWrappers; + } + makeDeclarationGeneratorWrapper(config) { + const generator = this.createValueDescriptor(config); + return new DeclarationGeneratorWrapper(generator, this); + } + registerPreviewableSettingId(settingId) { + if (!this.settings.hasOwnProperty(settingId)) { + this.settings[settingId] = ko.observable(inactiveSettingMarker); + } + } + get isBeforeFirstUpdate() { + return this._isBeforeFirstUpdate; + } + } + /** + * Preview manager for the style generator. + * + * This is a thin wrapper around the PreviewSession class. It initializes the session + * as needed and destroys it when the preview is cleared. This makes it simpler to manage + * active settings, style blocks, and CSS rule-sets: instead of having to carefully + * track dependencies and deactivate/reactivate them in the right order whenever the preview + * is disabled/enabled, we can just destroy the session and start over. + */ + class StyleGeneratorPreview { + constructor(config) { + this.config = config; + this.currentSession = null; + } + getOrCreateSession() { + if (this.currentSession === null) { + this.currentSession = new PreviewSession(this.config); + } + return this.currentSession; + } + getPreviewableSettingIDs() { + return this.getOrCreateSession().getPreviewableSettingIDs(); + } + preview(settingId, value, otherSettingReader) { + const session = this.getOrCreateSession(); + const shouldPreviewAll = (this.config.previewAllOnFirstUpdate && session.isBeforeFirstUpdate); + session.preview(settingId, value, otherSettingReader); + if (shouldPreviewAll) { + //Preview all registered settings the first time the preview is updated. + const notFound = {}; + for (const otherId of session.getPreviewableSettingIDs()) { + const otherValue = otherSettingReader(otherId, notFound); + if ((otherId !== settingId) && (otherValue !== notFound)) { + session.preview(otherId, otherValue, otherSettingReader); + } + } + } + } + clearPreview() { + if (this.currentSession !== null) { + this.currentSession.dispose(); + this.currentSession = null; + } + } + } + Preview.StyleGeneratorPreview = StyleGeneratorPreview; + class DeclarationGeneratorWrapper { + constructor(generator, settingSource) { + this.generator = generator; + this.settingSource = settingSource; + //Introspect the generator and see which settings it uses. + //This will be useful to determine if the generator is active. + this.usedSettingIds = DeclarationGeneratorWrapper.findReferencedSettingIds(generator, settingSource); + this.cssDeclarations = ko.computed({ + read: () => this.getDeclarations(), + deferEvaluation: true, + }).extend({ deferred: true }); + } + /** + * Recursively find all settings used by a value descriptor (such as a function call). + * + * @param {ValueDescriptor} thing + * @param variableSource Needed to get variable definitions and not just the final values. + */ + static findReferencedSettingIds(thing, variableSource) { + let settingIds = []; + if (thing instanceof SettingReference) { + settingIds.push(thing.settingId); + } + else if (thing instanceof FunctionCall) { + if (Array.isArray(thing.args)) { + for (const arg of thing.args) { + settingIds = settingIds.concat(DeclarationGeneratorWrapper.findReferencedSettingIds(arg, variableSource)); + } + } + else { + for (const key in thing.args) { + settingIds = settingIds.concat(DeclarationGeneratorWrapper.findReferencedSettingIds(thing.args[key], variableSource)); + } + } + } + else if (thing instanceof VariableReference) { + const value = variableSource.getVariableDefinition(thing.name); + if (value !== null) { + settingIds = settingIds.concat(DeclarationGeneratorWrapper.findReferencedSettingIds(value, variableSource)); + } + } + return settingIds; + } + isActive() { + //Check if any of the input settings are active. + let hasSettingLookups = false; + for (const settingId of this.usedSettingIds) { + hasSettingLookups = true; + if (this.settingSource.isSettingActive(settingId)) { + return true; + } + } + //If there are no input settings, the generator is always active: it just + //generates a fixed declaration. + return !hasSettingLookups; + } + getDeclarations() { + return this.generator.getValue(); + } + dispose() { + this.cssDeclarations.dispose(); + } + } + class CssStatement { + constructor() { + this.cssText = ko.computed({ + read: () => this.generateCss(), + deferEvaluation: true, + }).extend({ deferred: true }); + } + dispose() { + //Dispose the CSS text observable. + this.cssText.dispose(); + } + } + class CssRuleSet extends CssStatement { + constructor(selectors, declarationSources, parent = null) { + super(); + this.declarationSources = declarationSources; + this.nestedRuleSets = ko.observableArray([]); + if (parent === null) { + this.effectiveSelectors = selectors; + } + else { + this.effectiveSelectors = CssRuleSet.combineSelectors(selectors, parent.effectiveSelectors); + } + this.selectorText = this.effectiveSelectors.join(', '); + } + static combineSelectors(selectors, parentSelectors) { + const combinedSelectors = []; + for (const selector of selectors) { + if (selector === '') { + continue; + } + if (selector.includes('&')) { + //Insert the parent selectors into the current selector at the position of the "&". + for (const parentSelector of parentSelectors) { + combinedSelectors.push(selector.replace('&', parentSelector.trim())); + } + } + else { + //Just append the current selector to the parent selectors. + for (const parentSelector of parentSelectors) { + combinedSelectors.push(`${parentSelector} ${selector}`); + } + } + } + return combinedSelectors; + } + setNestedRuleSets(ruleSets) { + //Dispose the old rule sets that are not part of the new list. + for (const oldRuleSet of this.nestedRuleSets()) { + if (ruleSets.indexOf(oldRuleSet) === -1) { + oldRuleSet.dispose(); + } + } + this.nestedRuleSets(ruleSets); + } + generateCss() { + const declarations = this.getDeclarations(); + const nestedRuleSetParts = []; + for (const ruleSet of this.nestedRuleSets()) { + if (ruleSet.isActive()) { + nestedRuleSetParts.push(ruleSet.cssText()); + } + } + let css = ''; + if (declarations.length > 0) { + css += this.selectorText + ' {\n\t' + declarations.join('\n\t') + '\n}\n'; + } + if (nestedRuleSetParts.length > 0) { + css += nestedRuleSetParts.join('\n'); + } + return css; + } + isActive() { + for (const source of this.declarationSources) { + if (source.isActive()) { + return true; + } + } + for (const ruleSet of this.nestedRuleSets()) { + if (ruleSet.isActive()) { + return true; + } + } + return false; + } + getDeclarations() { + const declarations = []; + for (const source of this.declarationSources) { + if (source.isActive()) { + declarations.push(...source.cssDeclarations()); + } + } + return declarations; + } + dispose() { + //Dispose declaration sources. + for (const source of this.declarationSources) { + source.dispose(); + } + //Dispose nested rule sets. + for (const ruleSet of this.nestedRuleSets()) { + ruleSet.dispose(); + } + super.dispose(); + } + } + class ConditionalAtRule extends CssStatement { + constructor(identifier, condition, nestedStatements) { + super(); + this.identifier = identifier; + this.condition = condition; + this.nestedStatements = nestedStatements; + } + generateCss() { + const pieces = []; + for (const statement of this.nestedStatements) { + const css = statement.cssText(); + if (css !== '') { + pieces.push(css); + } + } + if (pieces.length === 0) { + return ''; + } + return this.getAtRuleText() + ' {\n\t' + pieces.join('\n\t') + '\n}'; + } + getAtRuleText() { + return '@' + this.identifier + ' ' + this.condition; + } + isActive() { + for (const statement of this.nestedStatements) { + if (statement.isActive()) { + return true; + } + } + return false; + } + dispose() { + //Dispose nested statements. + for (const statement of this.nestedStatements) { + statement.dispose(); + } + super.dispose(); + } + } + class PreviewStyleBlock { + constructor(statements, condition = null) { + this.statements = statements; + this.condition = condition; + this.$styleElement = null; + this.cssText = ko.computed({ + read: () => { + if ((condition !== null) && !condition()) { + return ''; + } + let pieces = []; + for (const statement of this.statements) { + if (statement.isActive()) { + const css = statement.cssText(); + if (css !== '') { + pieces.push(css); + } + } + } + if (pieces.length === 0) { + return ''; + } + return pieces.join('\n'); + }, + deferEvaluation: true, + }).extend({ deferred: true }); + this.updateStyleElement(this.cssText()); + this.cssChangeSubscription = this.cssText.subscribe((cssText) => { + this.updateStyleElement(cssText); + }); + } + updateStyleElement(cssText) { + if (cssText === '') { + if (this.$styleElement) { + this.$styleElement.remove(); + this.$styleElement = null; + } + return; + } + if (!this.$styleElement) { + this.$styleElement = $('').appendTo('head'); + } + this.$styleElement.text(cssText); + } + clear() { + if (this.$styleElement) { + this.$styleElement.remove(); + this.$styleElement = null; + } + } + dispose() { + //Stop listening for CSS changes. + this.cssChangeSubscription.dispose(); + this.cssText.dispose(); + //Dispose rule sets. + for (const ruleset of this.statements) { + ruleset.dispose(); + } + //Remove the style element. + this.clear(); + } + } + })(Preview = AmeStyleGenerator.Preview || (AmeStyleGenerator.Preview = {})); +})(AmeStyleGenerator || (AmeStyleGenerator = {})); +//# sourceMappingURL=style-generator.js.map + +/***/ }) + +}, +/******/ __webpack_require__ => { // webpackRuntimeModules +/******/ var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) +/******/ __webpack_require__.O(0, ["customizable"], () => (__webpack_exec__("./extras/modules/admin-customizer/preview-handler.ts"))); +/******/ var __webpack_exports__ = __webpack_require__.O(); +/******/ } +]); +//# sourceMappingURL=admin-customizer-preview.bundle.js.map \ No newline at end of file diff --git a/dist/admin-customizer-preview.bundle.js.map b/dist/admin-customizer-preview.bundle.js.map new file mode 100644 index 0000000..bdc98fc --- /dev/null +++ b/dist/admin-customizer-preview.bundle.js.map @@ -0,0 +1 @@ +{"version":3,"file":"admin-customizer-preview.bundle.js","mappings":";;;;;;;;;;;;;AAAa;AAEkE;AACb;AACS;AAI3E,kFAAkF;AAClF,oDAAoD;AAEpD,IAAU,yBAAyB,CAkLlC;AAlLD,WAAU,yBAAyB;IAClC,IAAO,wBAAwB,GAAG,+GAAwC,CAAC;IAC3E,MAAM,CAAC,GAAG,MAAM,CAAC;IAMjB,MAAa,cAAe,SAAQ,iGAA0C;QAO7E,YAAY,UAA6B;YACxC,KAAK,CAAC,UAAU,CAAC,CAAC;YAHF,yBAAoB,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A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,wDAAwD;AACzD;;;;;;;;;;;;;;ACvCO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,IAAI;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,IAAI,IAAI,MAAM,IAAI,KAAK,IAAI,QAAQ;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sDAAsD;AACtD,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,WAAW,KAAK,SAAS,KAAK,KAAK,KAAK,OAAO;AAC9E;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,sBAAsB;AACzD,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,SAAS,IAAI,MAAM,EAAE,MAAM;AAChE;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,sDAAsD,kCAAkC;AACxF,SAAS;AACT;AACA;AACA;AACA,sDAAsD,iCAAiC;AACvF,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yDAAyD,SAAS;AAClE;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6EAA6E,gBAAgB;AAC7F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,WAAW,gBAAgB;AAC5C;AACA;AACA;AACA;AACA,uBAAuB,iBAAiB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,WAAW,gBAAgB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sDAAsD,gBAAgB,EAAE,SAAS;AACjF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,wCAAwC;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,kCAAkC;AACnF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA,iBAAiB,WAAW,gBAAgB;AAC5C;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,wEAAwE;AAC7E,CAAC,8CAA8C;AAC/C","sources":["webpack:///./extras/modules/admin-customizer/preview-handler.ts","webpack:///./extras/modules/admin-customizer/admin-customizer-base.js","webpack:///./extras/style-generator/style-generator.js"],"sourcesContent":["'use strict';\n\nimport {AmeCustomizable} from '../../pro-customizables/assets/customizable.js';\nimport {AmeAdminCustomizerBase} from './admin-customizer-base.js';\nimport {AmeStyleGenerator} from '../../style-generator/style-generator.js';\n\ndeclare var wsAmeAcPreviewData: AmeAdminCustomizerPreview.PreviewScriptData;\n\n//Compatibility note: This script is not compatible with IE11 because it uses some\n//modern JS features like the URLSearchParams class.\n\nnamespace AmeAdminCustomizerPreview {\n\timport ThrottledPreviewRegistry = AmeCustomizable.ThrottledPreviewRegistry;\n\tconst $ = jQuery;\n\n\texport interface PreviewScriptData extends AmeAdminCustomizerBase.ScriptData {\n\t\tstylePreviewConfigs?: AmeStyleGenerator.Preview.StyleGeneratorPreviewConfig[];\n\t}\n\n\texport class PreviewHandler extends AmeAdminCustomizerBase.AdminCustomizerBase {\n\t\tprivate readonly changesetName: string;\n\t\tprivate readonly connection: ReturnType;\n\n\t\tprivate readonly previewRegistry: ThrottledPreviewRegistry;\n\t\tprivate readonly currentPreviewValues: Record = {};\n\n\t\tconstructor(scriptData: PreviewScriptData) {\n\t\t\tsuper(scriptData);\n\t\t\tthis.changesetName = scriptData.changesetName;\n\n\t\t\tthis.previewRegistry = new ThrottledPreviewRegistry(\n\t\t\t\t(settingId: string, defaultResult: any) => {\n\t\t\t\t\tif (this.currentPreviewValues.hasOwnProperty(settingId)) {\n\t\t\t\t\t\treturn this.currentPreviewValues[settingId];\n\t\t\t\t\t}\n\t\t\t\t\t//Try the script data. It should have the current value from the changeset.\n\t\t\t\t\tif (\n\t\t\t\t\t\tscriptData.settings.hasOwnProperty(settingId)\n\t\t\t\t\t\t&& scriptData.settings[settingId].hasOwnProperty('value')\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn scriptData.settings[settingId].value;\n\t\t\t\t\t}\n\t\t\t\t\treturn defaultResult;\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tthis.connection = AmeAcCommunicator.connectToParent(\n\t\t\t\t{\n\t\t\t\t\t'previewSetting': (settingId: string, value: any) => {\n\t\t\t\t\t\tthis.currentPreviewValues[settingId] = value;\n\n\t\t\t\t\t\tif (!this.previewRegistry.canPreview(settingId)) {\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis.previewRegistry.queuePreview(settingId);\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t},\n\t\t\t\t\t'getCurrentUrl': () => {\n\t\t\t\t\t\treturn window.location.href;\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tscriptData.allowedCommOrigins,\n\t\t\t\tscriptData.isWpDebugEnabled\n\t\t\t);\n\n\t\t\tthis.connection.promise.then((c) => {\n\t\t\t\tif (typeof c === 'undefined') {\n\t\t\t\t\tif (console && console.warn) {\n\t\t\t\t\t\tconsole.warn('Connection succeeded, but the communicator is undefined. This should be impossible.');\n\t\t\t\t\t}\n\t\t\t\t\treturn; //This should never happen.\n\t\t\t\t}\n\n\t\t\t\t//Let the parent know the current URL. The parent might not be able to\n\t\t\t\t//read it due to cross-domain restrictions, and if there are any redirects,\n\t\t\t\t//the actual URL might not match the frame src that was set by the parent.\n\t\t\t\tc.execute('notifyPreviewUrlChanged', window.location.href);\n\t\t\t});\n\n\t\t\t$(() => {\n\t\t\t\tthis.addPreviewParamsToLinks();\n\n\t\t\t\t//Handle clicks on links.\n\t\t\t\t$(document.body).on('click.ame-ac-preview', 'a', (event) => {\n\t\t\t\t\treturn this.handleLinkClick(event);\n\t\t\t\t});\n\n\t\t\t\t//Block form submissions. Theme Customizer supports those, but we don't\n\t\t\t\t//(at least for now).\n\t\t\t\t$(document.body).on('submit.ame-ac-preview', 'form', function (event) {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t});\n\t\t\t});\n\n\t\t\t//For convenience, support for StyleGenerator previews is built-in.\n\t\t\tfor (const previewConfig of (scriptData.stylePreviewConfigs || [])) {\n\t\t\t\tconst previewInstance = new AmeStyleGenerator.Preview.StyleGeneratorPreview(previewConfig);\n\t\t\t\tthis.previewRegistry.registerPreviewUpdater(\n\t\t\t\t\tpreviewInstance.getPreviewableSettingIDs(),\n\t\t\t\t\tpreviewInstance\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Add preview-specific query parameters to all links.\n\t\t */\n\t\taddPreviewParamsToLinks() {\n\t\t\tconst self = this;\n\t\t\t$('a[href]').each(function (this: HTMLElement) {\n\t\t\t\tconst element = this;\n\t\t\t\tif (!(element instanceof HTMLAnchorElement)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst $link = $(this);\n\n\t\t\t\t//Don't modify internal anchors like \"#abc\".\n\t\t\t\tif (self.isInternalAnchor($link)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t//Flag and skip non-previewable links.\n\t\t\t\tif (!self.isPreviewableLink(element)) {\n\t\t\t\t\t$link.addClass('ame-ac-not-previewable');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t//Add the preview query parameter(s).\n\t\t\t\tconst params = new URLSearchParams(element.search);\n\t\t\t\tparams.set('ame-ac-preview', '1');\n\t\t\t\tparams.set('ame-ac-changeset', self.changesetName);\n\t\t\t\telement.search = '?' + params.toString();\n\t\t\t});\n\t\t}\n\n\t\tisPreviewableLink(element: HTMLAnchorElement): boolean {\n\t\t\treturn this.isPreviewableUrl(element);\n\t\t}\n\n\t\tisInternalAnchor($link: JQuery): boolean {\n\t\t\tconst href = $link.attr('href');\n\t\t\tif (typeof href === 'undefined') {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn (href.substring(0, 1) === '#');\n\t\t}\n\n\t\thandleLinkClick(event: JQueryEventObject) {\n\t\t\tconst $link = $(event.target).closest('a');\n\n\t\t\t//Let anchors work as normal.\n\t\t\tif (this.isInternalAnchor($link)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t//Prevent the browser from navigating to non-previewable links.\n\t\t\tconst anchorElement = $link.get(0) as HTMLAnchorElement;\n\t\t\tif (!this.isPreviewableLink(anchorElement)) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t//Tell the parent (i.e. the admin customizer) to load the link.\n\t\t\tif (this.connection.isConnected) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tthis.connection.execute('setPreviewUrl', anchorElement.href);\n\t\t\t}\n\t\t}\n\n\t\t// noinspection JSUnusedGlobalSymbols Used in other modules.\n\t\tregisterPreviewer(settingId: string, callback: (newValue: any) => void) {\n\t\t\tthis.previewRegistry.registerPreviewCallback(settingId, callback);\n\t\t}\n\n\t\t// noinspection JSUnusedGlobalSymbols Also used in other modules.\n\t\tregisterPreviewUpdater(settingIds: string[], updater: AmeCustomizable.PreviewUpdater) {\n\t\t\tthis.previewRegistry.registerPreviewUpdater(settingIds, updater);\n\t\t}\n\n\t\t// noinspection JSUnusedGlobalSymbols\n\t\tregisterRpcMethod(methodName: string, handler: (...args: any) => any) {\n\t\t\tthis.connection.addRpcMethod(methodName, handler);\n\t\t}\n\t}\n\n\tconst previewHandler = new PreviewHandler(wsAmeAcPreviewData);\n\twindow['wsAdminCustomizerPreview'] = previewHandler;\n\n\t$('body').trigger('adminMenuEditor:acPreviewStart', [previewHandler]);\n}\n\ndeclare global {\n\tinterface Window {\n\t\twsAdminCustomizerPreview: AmeAdminCustomizerPreview.PreviewHandler;\n\t}\n}","'use strict';\r\nexport var AmeAdminCustomizerBase;\r\n(function (AmeAdminCustomizerBase) {\r\n class AdminCustomizerBase {\r\n constructor(scriptData) {\r\n this.allowedCommOrigins = scriptData.allowedCommOrigins;\r\n if (this.allowedCommOrigins.length === 0) {\r\n this.allowedCommOrigins = [window.location.origin];\r\n }\r\n this.allowedPreviewUrls = scriptData.allowedPreviewUrls;\r\n this.parsedAllowedUrls = this.allowedPreviewUrls.map(url => new URL(url));\r\n }\r\n isPreviewableUrl(url) {\r\n if (typeof url === 'string') {\r\n url = new URL(url);\r\n }\r\n if (typeof url.protocol === 'undefined') {\r\n return false;\r\n }\r\n //Only HTTP(S) links are previewable.\r\n if ((url.protocol !== 'http:') && (url.protocol !== 'https:')) {\r\n return false;\r\n }\r\n //Check against the list of allowed URLs.\r\n for (const allowedUrl of this.parsedAllowedUrls) {\r\n //Protocol and host must match. The path must start with the path\r\n //of the allowed URL (possibly without a trailing slash).\r\n if ((url.protocol === allowedUrl.protocol) && (url.host === allowedUrl.host)) {\r\n const allowedPath = allowedUrl.pathname.replace(/\\/$/, '');\r\n if (url.pathname.indexOf(allowedPath) === 0) {\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n }\r\n }\r\n AmeAdminCustomizerBase.AdminCustomizerBase = AdminCustomizerBase;\r\n})(AmeAdminCustomizerBase || (AmeAdminCustomizerBase = {}));\r\n//# sourceMappingURL=admin-customizer-base.js.map","export var AmeStyleGenerator;\r\n(function (AmeStyleGenerator) {\r\n const $ = jQuery;\r\n class ValueDescriptor {\r\n }\r\n class ConstantValue extends ValueDescriptor {\r\n constructor(value) {\r\n super();\r\n this.value = value;\r\n }\r\n getValue() {\r\n return this.value;\r\n }\r\n }\r\n class ArrayValue extends ValueDescriptor {\r\n constructor(items) {\r\n super();\r\n this.items = items;\r\n }\r\n getValue() {\r\n return this.items.map(item => item.getValue());\r\n }\r\n getItemDescriptors() {\r\n return this.items;\r\n }\r\n }\r\n class SettingReference extends ValueDescriptor {\r\n constructor(settingId, valueGetter) {\r\n super();\r\n this.settingId = settingId;\r\n this.valueGetter = valueGetter;\r\n }\r\n getValue() {\r\n return this.valueGetter(this.settingId);\r\n }\r\n }\r\n class VariableReference extends ValueDescriptor {\r\n constructor(name, valueGetter) {\r\n super();\r\n this.name = name;\r\n this.valueGetter = valueGetter;\r\n }\r\n getValue() {\r\n return this.valueGetter(this.name);\r\n }\r\n }\r\n class FunctionCall extends ValueDescriptor {\r\n constructor(args, callback) {\r\n super();\r\n this.args = args;\r\n this.callback = callback;\r\n }\r\n getValue() {\r\n return this.callback(this.resolveArgs(this.args));\r\n }\r\n resolveArgs(args) {\r\n if (Array.isArray(args)) {\r\n return args.map(arg => arg.getValue());\r\n }\r\n return Object.keys(args).reduce((result, key) => {\r\n result[key] = args[key].getValue();\r\n return result;\r\n }, {});\r\n }\r\n }\r\n //endregion\r\n function isEmptyCssValue(value) {\r\n return (typeof value === 'undefined') || (value === '') || (value === null);\r\n }\r\n function convertToRgba(color, opacity = 1.0) {\r\n color = color.trim();\r\n if (color === '') {\r\n return 'transparent';\r\n }\r\n //Strip the leading hash, if any.\r\n if (color[0] === '#') {\r\n color = color.substring(1);\r\n }\r\n //If the color is in the shorthand format, expand it.\r\n if (color.length === 3) {\r\n color = color[0] + color[0] + color[1] + color[1] + color[2] + color[2];\r\n }\r\n //The color should now be in the full 6-digit format. Convert it to RGBA.\r\n if (color.length === 6) {\r\n const red = parseInt(color.substring(0, 2), 16);\r\n const green = parseInt(color.substring(2, 4), 16);\r\n const blue = parseInt(color.substring(4, 6), 16);\r\n return `rgba(${red}, ${green}, ${blue}, ${opacity})`;\r\n }\r\n //The color may be invalid, or it's not in a hex format we recognize.\r\n return color;\r\n }\r\n function uniqueArrayValues(array) {\r\n return array.filter((value, index) => array.indexOf(value) === index);\r\n }\r\n function constrain(value, min, max) {\r\n return Math.min(Math.max(value, min), max);\r\n }\r\n function modifyHexColorAsHsl(args, operation) {\r\n const color = args.color || '';\r\n if (isEmptyCssValue(color)) {\r\n return '';\r\n }\r\n const hue = args.hue || null;\r\n const saturation = args.saturation || null;\r\n const lightness = args.lightness || null;\r\n if ((hue === null) && (saturation === null) && (lightness === null)) {\r\n return color;\r\n }\r\n let output = $.Color(color);\r\n output = operation(output, hue, saturation, lightness);\r\n return output.toHexString();\r\n }\r\n // noinspection JSUnusedGlobalSymbols -- Used dynamically by declaration generators received from the server.\r\n const builtinFunctions = {\r\n simpleProperty: function (args) {\r\n if (isEmptyCssValue(args.value)) {\r\n return [];\r\n }\r\n return [args.name + ': ' + args.value + ';'];\r\n },\r\n formatLength: function (args) {\r\n if (isEmptyCssValue(args.value)) {\r\n return '';\r\n }\r\n //Normalize numeric values. For example, while JS accepts \"1.\" as a number,\r\n //\"1.px\" is not a valid CSS length value, so it should be converted to \"1px\".\r\n const numericValue = parseFloat(String(args.value));\r\n if (isNaN(numericValue)) {\r\n return '';\r\n }\r\n return '' + numericValue + (args.unit || '');\r\n },\r\n shadow: function (args) {\r\n const mode = args.mode || 'default';\r\n const color = args.color || '';\r\n if (mode === 'default') {\r\n return [];\r\n }\r\n if ((mode === 'none') || (color === '') || (color === null) || (color === 'transparent')) {\r\n return ['box-shadow: none;'];\r\n }\r\n if (mode !== 'custom') {\r\n return [];\r\n }\r\n const components = [];\r\n if (args.inset) {\r\n components.push('inset');\r\n }\r\n const horizontal = args['offset-x'] || 0;\r\n const vertical = args['offset-y'] || 0;\r\n const blur = args.blur || 0;\r\n const spread = args.spread || 0;\r\n components.push(`${horizontal}px ${vertical}px ${blur}px ${spread}px`);\r\n const colorOpacity = args.colorOpacity || 1.0;\r\n if (colorOpacity < 1.0) {\r\n components.push(convertToRgba(color, colorOpacity));\r\n }\r\n else {\r\n components.push(color);\r\n }\r\n return [`box-shadow: ${components.join(' ')};`];\r\n },\r\n boxSides: function (args) {\r\n if (typeof args.cssPropertyPrefix !== 'string') {\r\n throw new Error('Invalid config for the boxSides generator: missing cssPropertyPrefix');\r\n }\r\n const compositeValue = args.value || {};\r\n const unit = compositeValue.unit || '';\r\n const declarations = [];\r\n for (const side of ['top', 'right', 'bottom', 'left']) {\r\n const value = compositeValue[side];\r\n if (isEmptyCssValue(value)) {\r\n continue;\r\n }\r\n const property = args.cssPropertyPrefix + side;\r\n declarations.push(`${property}: ${value}${unit};`);\r\n }\r\n return declarations;\r\n },\r\n firstNonEmpty(args) {\r\n for (const arg of args) {\r\n if (!isEmptyCssValue(arg)) {\r\n return arg;\r\n }\r\n }\r\n return null;\r\n },\r\n /**\r\n * Take a HEX color, convert it to HSL to edit its components,\r\n * then convert back to HEX.\r\n *\r\n * @param args\r\n */\r\n editHexAsHsl: function (args) {\r\n return modifyHexColorAsHsl(args, (color, hue, saturation, lightness) => {\r\n if (hue !== null) {\r\n color = color.hue(hue);\r\n }\r\n if (saturation !== null) {\r\n color = color.saturation(saturation);\r\n }\r\n if (lightness !== null) {\r\n color = color.lightness(lightness);\r\n }\r\n return color;\r\n });\r\n },\r\n adjustHexAsHsl: function (args) {\r\n return modifyHexColorAsHsl(args, (color, hue, saturation, lightness) => {\r\n if (hue !== null) {\r\n color = color.hue(constrain(color.hue() + hue, 0, 360));\r\n }\r\n if (saturation !== null) {\r\n color = color.saturation(constrain(color.saturation() + saturation, 0, 1.0));\r\n }\r\n if (lightness !== null) {\r\n color = color.lightness(constrain(color.lightness() + lightness, 0, 1.0));\r\n }\r\n return color;\r\n });\r\n },\r\n mixColors: function (args) {\r\n const color1 = args.color1 || '';\r\n const color2 = args.color2 || '';\r\n if (isEmptyCssValue(color1) || isEmptyCssValue(color2)) {\r\n return '';\r\n }\r\n const weight = args.weight || 50;\r\n if (weight <= 0) {\r\n return color2;\r\n }\r\n else if (weight >= 100) {\r\n return color1;\r\n }\r\n return $.Color(color2).transition($.Color(color1), weight / 100).toHexString();\r\n },\r\n changeLightness: function (args) {\r\n const color = args.color || '';\r\n if (isEmptyCssValue(color)) {\r\n return '';\r\n }\r\n const amount = args.amount || 0;\r\n if (amount === 0) {\r\n return color;\r\n }\r\n let output = $.Color(color);\r\n //Amount is a number between 0 and 100, while lightness is between 0.0 and 1.0.\r\n let newLightness = output.lightness() + (amount / 100);\r\n //Clamp to 0.0 - 1.0.\r\n newLightness = constrain(newLightness, 0.0, 1.0);\r\n return output.lightness(newLightness).toHexString();\r\n },\r\n darken: function (args) {\r\n const color = args.color || '';\r\n const amount = args.amount || 0;\r\n return builtinFunctions.changeLightness({ color, amount: -Math.abs(amount) });\r\n },\r\n lighten: function (args) {\r\n const color = args.color || '';\r\n const amount = args.amount || 0;\r\n return builtinFunctions.changeLightness({ color, amount: Math.abs(amount) });\r\n },\r\n compare: function (args) {\r\n const value1 = args.value1;\r\n const value2 = args.value2;\r\n const operator = args.op;\r\n const thenResult = (typeof args.thenResult !== 'undefined') ? args.thenResult : true;\r\n const elseResult = (typeof args.elseResult !== 'undefined') ? args.elseResult : null;\r\n let result;\r\n switch (operator) {\r\n case '==':\r\n result = value1 == value2;\r\n break;\r\n case '!=':\r\n result = value1 != value2;\r\n break;\r\n case '>':\r\n result = value1 > value2;\r\n break;\r\n case '>=':\r\n result = value1 >= value2;\r\n break;\r\n case '<':\r\n result = value1 < value2;\r\n break;\r\n case '<=':\r\n result = value1 <= value2;\r\n break;\r\n default:\r\n throw new Error(`Unknown operator: ${operator}`);\r\n }\r\n return result ? thenResult : elseResult;\r\n },\r\n ifTruthy: function (args) {\r\n const value = args.value;\r\n const thenResult = (typeof args.thenResult !== 'undefined') ? args.thenResult : true;\r\n const elseResult = (typeof args.elseResult !== 'undefined') ? args.elseResult : null;\r\n return value ? thenResult : elseResult;\r\n },\r\n ifSome: function (args) {\r\n const values = args.values;\r\n const thenResult = args.thenResult;\r\n const elseResult = (typeof args.elseResult !== 'undefined') ? args.elseResult : null;\r\n for (const value of values) {\r\n if (!!value) {\r\n return thenResult;\r\n }\r\n }\r\n return elseResult;\r\n },\r\n ifAll: function (args) {\r\n const values = args.values;\r\n const thenResult = args.thenResult;\r\n const elseResult = args.elseResult !== undefined ? args.elseResult : null;\r\n if (!values || (values.length === 0)) {\r\n return elseResult;\r\n }\r\n for (const value of values) {\r\n if (!value) {\r\n return elseResult;\r\n }\r\n }\r\n return thenResult;\r\n },\r\n ifImageSettingContainsImage: function (args) {\r\n const thenResult = args.thenResult !== undefined ? args.thenResult : true;\r\n const elseResult = args.elseResult !== undefined ? args.elseResult : null;\r\n if ((typeof args.value !== 'object') || !args.value) {\r\n return elseResult;\r\n }\r\n const image = args.value;\r\n const hasAttachment = !!image.attachmentId;\r\n const hasExternalUrl = !!image.externalUrl;\r\n const hasImage = hasAttachment || hasExternalUrl;\r\n return hasImage ? thenResult : elseResult;\r\n }\r\n };\r\n let Preview;\r\n (function (Preview) {\r\n const $ = jQuery;\r\n function isConditionalAtRuleConfig(config) {\r\n if ((typeof config !== 'object') || (config === null)) {\r\n return false;\r\n }\r\n const configAsRecord = config;\r\n return ((typeof configAsRecord['t'] === 'string')\r\n && (configAsRecord['t'] === 'conditionalAtRule')\r\n && (typeof configAsRecord['identifier'] === 'string'));\r\n }\r\n function isRuleSetConfig(config) {\r\n return ((config !== null)\r\n && (Array.isArray(config['selectors']))\r\n && (Array.isArray(config['generators'])));\r\n }\r\n const inactiveSettingMarker = { '_ame_inactive_setting': true };\r\n class PreviewSession {\r\n constructor(config) {\r\n this.settings = {};\r\n this.valueReaders = new Set();\r\n this.notFound = {};\r\n this.variables = {};\r\n this.styleBlocks = [];\r\n this.stylesheetsToDisable = [];\r\n this.stylesheetWasEnabled = {};\r\n /**\r\n * Whether this is the first time the preview is being updated.\r\n * This is set to false after preview() is called for the first time.\r\n */\r\n this._isBeforeFirstUpdate = true;\r\n //Optimization: Create bound getters once instead of every time we need\r\n //to create a setting or variable reference.\r\n this.settingValueGetter = this.getSettingPreviewValue.bind(this);\r\n this.variableValueGetter = (variableName) => {\r\n if (variableName in this.variables) {\r\n return this.variables[variableName].getValue();\r\n }\r\n return null;\r\n };\r\n //Optionally, disable already generated custom stylesheets while the preview\r\n //is active to prevent old settings from interfering with the preview of new settings.\r\n if (Array.isArray(config.stylesheetsToDisable)) {\r\n this.stylesheetsToDisable = config.stylesheetsToDisable;\r\n }\r\n //Variables\r\n for (const variableName in config.variables) {\r\n if (!config.variables.hasOwnProperty(variableName)) {\r\n continue;\r\n }\r\n this.variables[variableName] = this.createValueDescriptor(config.variables[variableName], true);\r\n }\r\n //CSS statement groups\r\n for (const conditionConfig of config.statementGroups) {\r\n const statements = this.createCssStatements(conditionConfig.statements);\r\n if (statements.length < 1) {\r\n continue;\r\n }\r\n const condition = this.createValueDescriptor(conditionConfig.expression, true);\r\n const usedSettingIds = this.getSettingIdsUsedBy(condition);\r\n const conditionCallback = () => {\r\n //For performance, conditions that reference settings should\r\n //only be checked when at least one setting is active.\r\n if (usedSettingIds.length > 0) {\r\n if (!usedSettingIds.some((id) => this.isSettingActive(id))) {\r\n return false;\r\n }\r\n }\r\n const isTruthy = condition.getValue();\r\n return !!isTruthy; //Convert to boolean.\r\n };\r\n this.styleBlocks.push(new PreviewStyleBlock(statements, conditionCallback));\r\n }\r\n }\r\n createValueDescriptor(data, allowUnknownVariables = false) {\r\n switch (data.t) {\r\n case 'constant':\r\n return new ConstantValue(data.value);\r\n case 'array':\r\n return new ArrayValue(data.items.map((valueData) => this.createValueDescriptor(valueData, allowUnknownVariables)));\r\n case 'setting':\r\n this.registerPreviewableSettingId(data.id);\r\n return new SettingReference(data.id, this.settingValueGetter);\r\n case 'var':\r\n if (!this.variables.hasOwnProperty(data.name) && !allowUnknownVariables) {\r\n throw new Error('Unknown variable: ' + data.name);\r\n }\r\n return new VariableReference(data.name, this.variableValueGetter);\r\n case 'funcCall':\r\n let functionName;\r\n if (data.name in builtinFunctions) {\r\n functionName = data.name;\r\n }\r\n else {\r\n throw new Error('Unknown function: ' + data.name);\r\n }\r\n const func = builtinFunctions[functionName];\r\n //Initialize the function arguments.\r\n let args;\r\n if (Array.isArray(data.args)) {\r\n args = data.args.map(arg => this.createValueDescriptor(arg, allowUnknownVariables));\r\n }\r\n else {\r\n args = {};\r\n for (const argName in data.args) {\r\n if (!data.args.hasOwnProperty(argName)) {\r\n continue;\r\n }\r\n args[argName] = this.createValueDescriptor(data.args[argName], allowUnknownVariables);\r\n }\r\n }\r\n // @ts-ignore - Can't really statically check this since the values come from the server.\r\n return new FunctionCall(args, func);\r\n }\r\n }\r\n /**\r\n * Get the IDs of all settings that are referenced by the given descriptor.\r\n *\r\n * @param descriptor\r\n * @private\r\n */\r\n getSettingIdsUsedBy(descriptor) {\r\n if (descriptor instanceof SettingReference) {\r\n return [descriptor.settingId];\r\n }\r\n if (descriptor instanceof ArrayValue) {\r\n let result = [];\r\n for (const item of descriptor.getItemDescriptors()) {\r\n result = result.concat(this.getSettingIdsUsedBy(item));\r\n }\r\n return uniqueArrayValues(result);\r\n }\r\n if (descriptor instanceof FunctionCall) {\r\n let result = [];\r\n const args = descriptor.args;\r\n if (Array.isArray(args)) {\r\n for (const arg of args) {\r\n result = result.concat(this.getSettingIdsUsedBy(arg));\r\n }\r\n }\r\n else {\r\n for (const argName in args) {\r\n if (args.hasOwnProperty(argName)) {\r\n result = result.concat(this.getSettingIdsUsedBy(args[argName]));\r\n }\r\n }\r\n }\r\n return uniqueArrayValues(result);\r\n }\r\n if (descriptor instanceof VariableReference) {\r\n const varDef = this.getVariableDefinition(descriptor.name);\r\n if (varDef === null) {\r\n return [];\r\n }\r\n return this.getSettingIdsUsedBy(varDef);\r\n }\r\n return [];\r\n }\r\n getVariableDefinition(variableName) {\r\n if (!this.variables.hasOwnProperty(variableName)) {\r\n return null;\r\n }\r\n return this.variables[variableName];\r\n }\r\n createCssStatements(configs) {\r\n let results = [];\r\n for (const config of configs) {\r\n if (isRuleSetConfig(config)) {\r\n results.push(this.createRuleSetFromConfig(config));\r\n }\r\n else if (isConditionalAtRuleConfig(config)) {\r\n results.push(new ConditionalAtRule(config.identifier, config.condition, (typeof config.nestedStatements === 'undefined')\r\n ? []\r\n : this.createCssStatements(config.nestedStatements)));\r\n }\r\n else {\r\n console.error('Unknown CSS statement type: ', config);\r\n }\r\n }\r\n return results;\r\n }\r\n createRuleSetFromConfig(config, parent = null) {\r\n const generatorWrappers = this.makeGeneratorWrappers(config.generators);\r\n const ruleSet = new CssRuleSet(config.selectors, generatorWrappers, parent);\r\n const nestedRuleSets = this.createNestedRuleSets(config.nestedStatements, ruleSet);\r\n ruleSet.setNestedRuleSets(nestedRuleSets);\r\n return ruleSet;\r\n }\r\n createNestedRuleSets(configs, parent = null) {\r\n let results = [];\r\n if (!configs) {\r\n return results;\r\n }\r\n for (const config of configs) {\r\n if (!isRuleSetConfig(config)) {\r\n throw new Error('A CSS rule set can only contain other rule sets, not other types of statements.');\r\n }\r\n results.push(this.createRuleSetFromConfig(config, parent));\r\n }\r\n return results;\r\n }\r\n getPreviewableSettingIDs() {\r\n return Object.keys(this.settings);\r\n }\r\n preview(settingId, value, otherSettingReader) {\r\n if (this._isBeforeFirstUpdate) {\r\n this._isBeforeFirstUpdate = false;\r\n this.disableAssociatedStylesheets();\r\n }\r\n this.valueReaders.add(otherSettingReader);\r\n if (!this.settings.hasOwnProperty(settingId)) {\r\n this.settings[settingId] = ko.observable(value);\r\n }\r\n else {\r\n this.settings[settingId](value);\r\n }\r\n }\r\n dispose() {\r\n //Dispose of all style blocks.\r\n for (const block of this.styleBlocks) {\r\n block.dispose();\r\n }\r\n this.reEnableAssociatedStylesheets();\r\n }\r\n disableAssociatedStylesheets() {\r\n for (const stylesheetSelector of this.stylesheetsToDisable) {\r\n const $link = $(stylesheetSelector);\r\n if ($link.length > 0) {\r\n this.stylesheetWasEnabled[stylesheetSelector] = $link.prop('disabled');\r\n $link.prop('disabled', true);\r\n }\r\n }\r\n }\r\n reEnableAssociatedStylesheets() {\r\n for (const stylesheetSelector of this.stylesheetsToDisable) {\r\n const $link = $(stylesheetSelector);\r\n if (($link.length > 0) && this.stylesheetWasEnabled.hasOwnProperty(stylesheetSelector)) {\r\n $link.prop('disabled', this.stylesheetWasEnabled[stylesheetSelector]);\r\n }\r\n }\r\n }\r\n isSettingActive(settingId) {\r\n if (this.settings.hasOwnProperty(settingId)) {\r\n return this.settings[settingId]() !== inactiveSettingMarker;\r\n }\r\n return false;\r\n }\r\n getSettingPreviewValue(settingId) {\r\n if (!this.settings.hasOwnProperty(settingId)) {\r\n const value = this.getSettingFromReaders(settingId);\r\n this.settings[settingId] = ko.observable(value).extend({ deferred: true });\r\n }\r\n const observable = this.settings[settingId];\r\n let value = observable();\r\n if (value === inactiveSettingMarker) {\r\n value = this.getSettingFromReaders(settingId);\r\n observable(value);\r\n }\r\n return value;\r\n }\r\n getSettingFromReaders(settingId) {\r\n for (const reader of this.valueReaders) {\r\n const value = reader(settingId, this.notFound);\r\n if (value !== this.notFound) {\r\n return value;\r\n }\r\n }\r\n throw new Error('Setting not found for preview: ' + settingId);\r\n }\r\n makeGeneratorWrappers(generatorConfigs) {\r\n let generatorWrappers = [];\r\n for (const generatorConfig of generatorConfigs) {\r\n const wrapper = this.makeDeclarationGeneratorWrapper(generatorConfig);\r\n if (wrapper !== null) {\r\n generatorWrappers.push(wrapper);\r\n }\r\n }\r\n return generatorWrappers;\r\n }\r\n makeDeclarationGeneratorWrapper(config) {\r\n const generator = this.createValueDescriptor(config);\r\n return new DeclarationGeneratorWrapper(generator, this);\r\n }\r\n registerPreviewableSettingId(settingId) {\r\n if (!this.settings.hasOwnProperty(settingId)) {\r\n this.settings[settingId] = ko.observable(inactiveSettingMarker);\r\n }\r\n }\r\n get isBeforeFirstUpdate() {\r\n return this._isBeforeFirstUpdate;\r\n }\r\n }\r\n /**\r\n * Preview manager for the style generator.\r\n *\r\n * This is a thin wrapper around the PreviewSession class. It initializes the session\r\n * as needed and destroys it when the preview is cleared. This makes it simpler to manage\r\n * active settings, style blocks, and CSS rule-sets: instead of having to carefully\r\n * track dependencies and deactivate/reactivate them in the right order whenever the preview\r\n * is disabled/enabled, we can just destroy the session and start over.\r\n */\r\n class StyleGeneratorPreview {\r\n constructor(config) {\r\n this.config = config;\r\n this.currentSession = null;\r\n }\r\n getOrCreateSession() {\r\n if (this.currentSession === null) {\r\n this.currentSession = new PreviewSession(this.config);\r\n }\r\n return this.currentSession;\r\n }\r\n getPreviewableSettingIDs() {\r\n return this.getOrCreateSession().getPreviewableSettingIDs();\r\n }\r\n preview(settingId, value, otherSettingReader) {\r\n const session = this.getOrCreateSession();\r\n const shouldPreviewAll = (this.config.previewAllOnFirstUpdate && session.isBeforeFirstUpdate);\r\n session.preview(settingId, value, otherSettingReader);\r\n if (shouldPreviewAll) {\r\n //Preview all registered settings the first time the preview is updated.\r\n const notFound = {};\r\n for (const otherId of session.getPreviewableSettingIDs()) {\r\n const otherValue = otherSettingReader(otherId, notFound);\r\n if ((otherId !== settingId) && (otherValue !== notFound)) {\r\n session.preview(otherId, otherValue, otherSettingReader);\r\n }\r\n }\r\n }\r\n }\r\n clearPreview() {\r\n if (this.currentSession !== null) {\r\n this.currentSession.dispose();\r\n this.currentSession = null;\r\n }\r\n }\r\n }\r\n Preview.StyleGeneratorPreview = StyleGeneratorPreview;\r\n class DeclarationGeneratorWrapper {\r\n constructor(generator, settingSource) {\r\n this.generator = generator;\r\n this.settingSource = settingSource;\r\n //Introspect the generator and see which settings it uses.\r\n //This will be useful to determine if the generator is active.\r\n this.usedSettingIds = DeclarationGeneratorWrapper.findReferencedSettingIds(generator, settingSource);\r\n this.cssDeclarations = ko.computed({\r\n read: () => this.getDeclarations(),\r\n deferEvaluation: true,\r\n }).extend({ deferred: true });\r\n }\r\n /**\r\n * Recursively find all settings used by a value descriptor (such as a function call).\r\n *\r\n * @param {ValueDescriptor} thing\r\n * @param variableSource Needed to get variable definitions and not just the final values.\r\n */\r\n static findReferencedSettingIds(thing, variableSource) {\r\n let settingIds = [];\r\n if (thing instanceof SettingReference) {\r\n settingIds.push(thing.settingId);\r\n }\r\n else if (thing instanceof FunctionCall) {\r\n if (Array.isArray(thing.args)) {\r\n for (const arg of thing.args) {\r\n settingIds = settingIds.concat(DeclarationGeneratorWrapper.findReferencedSettingIds(arg, variableSource));\r\n }\r\n }\r\n else {\r\n for (const key in thing.args) {\r\n settingIds = settingIds.concat(DeclarationGeneratorWrapper.findReferencedSettingIds(thing.args[key], variableSource));\r\n }\r\n }\r\n }\r\n else if (thing instanceof VariableReference) {\r\n const value = variableSource.getVariableDefinition(thing.name);\r\n if (value !== null) {\r\n settingIds = settingIds.concat(DeclarationGeneratorWrapper.findReferencedSettingIds(value, variableSource));\r\n }\r\n }\r\n return settingIds;\r\n }\r\n isActive() {\r\n //Check if any of the input settings are active.\r\n let hasSettingLookups = false;\r\n for (const settingId of this.usedSettingIds) {\r\n hasSettingLookups = true;\r\n if (this.settingSource.isSettingActive(settingId)) {\r\n return true;\r\n }\r\n }\r\n //If there are no input settings, the generator is always active: it just\r\n //generates a fixed declaration.\r\n return !hasSettingLookups;\r\n }\r\n getDeclarations() {\r\n return this.generator.getValue();\r\n }\r\n dispose() {\r\n this.cssDeclarations.dispose();\r\n }\r\n }\r\n class CssStatement {\r\n constructor() {\r\n this.cssText = ko.computed({\r\n read: () => this.generateCss(),\r\n deferEvaluation: true,\r\n }).extend({ deferred: true });\r\n }\r\n dispose() {\r\n //Dispose the CSS text observable.\r\n this.cssText.dispose();\r\n }\r\n }\r\n class CssRuleSet extends CssStatement {\r\n constructor(selectors, declarationSources, parent = null) {\r\n super();\r\n this.declarationSources = declarationSources;\r\n this.nestedRuleSets = ko.observableArray([]);\r\n if (parent === null) {\r\n this.effectiveSelectors = selectors;\r\n }\r\n else {\r\n this.effectiveSelectors = CssRuleSet.combineSelectors(selectors, parent.effectiveSelectors);\r\n }\r\n this.selectorText = this.effectiveSelectors.join(', ');\r\n }\r\n static combineSelectors(selectors, parentSelectors) {\r\n const combinedSelectors = [];\r\n for (const selector of selectors) {\r\n if (selector === '') {\r\n continue;\r\n }\r\n if (selector.includes('&')) {\r\n //Insert the parent selectors into the current selector at the position of the \"&\".\r\n for (const parentSelector of parentSelectors) {\r\n combinedSelectors.push(selector.replace('&', parentSelector.trim()));\r\n }\r\n }\r\n else {\r\n //Just append the current selector to the parent selectors.\r\n for (const parentSelector of parentSelectors) {\r\n combinedSelectors.push(`${parentSelector} ${selector}`);\r\n }\r\n }\r\n }\r\n return combinedSelectors;\r\n }\r\n setNestedRuleSets(ruleSets) {\r\n //Dispose the old rule sets that are not part of the new list.\r\n for (const oldRuleSet of this.nestedRuleSets()) {\r\n if (ruleSets.indexOf(oldRuleSet) === -1) {\r\n oldRuleSet.dispose();\r\n }\r\n }\r\n this.nestedRuleSets(ruleSets);\r\n }\r\n generateCss() {\r\n const declarations = this.getDeclarations();\r\n const nestedRuleSetParts = [];\r\n for (const ruleSet of this.nestedRuleSets()) {\r\n if (ruleSet.isActive()) {\r\n nestedRuleSetParts.push(ruleSet.cssText());\r\n }\r\n }\r\n let css = '';\r\n if (declarations.length > 0) {\r\n css += this.selectorText + ' {\\n\\t' + declarations.join('\\n\\t') + '\\n}\\n';\r\n }\r\n if (nestedRuleSetParts.length > 0) {\r\n css += nestedRuleSetParts.join('\\n');\r\n }\r\n return css;\r\n }\r\n isActive() {\r\n for (const source of this.declarationSources) {\r\n if (source.isActive()) {\r\n return true;\r\n }\r\n }\r\n for (const ruleSet of this.nestedRuleSets()) {\r\n if (ruleSet.isActive()) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n getDeclarations() {\r\n const declarations = [];\r\n for (const source of this.declarationSources) {\r\n if (source.isActive()) {\r\n declarations.push(...source.cssDeclarations());\r\n }\r\n }\r\n return declarations;\r\n }\r\n dispose() {\r\n //Dispose declaration sources.\r\n for (const source of this.declarationSources) {\r\n source.dispose();\r\n }\r\n //Dispose nested rule sets.\r\n for (const ruleSet of this.nestedRuleSets()) {\r\n ruleSet.dispose();\r\n }\r\n super.dispose();\r\n }\r\n }\r\n class ConditionalAtRule extends CssStatement {\r\n constructor(identifier, condition, nestedStatements) {\r\n super();\r\n this.identifier = identifier;\r\n this.condition = condition;\r\n this.nestedStatements = nestedStatements;\r\n }\r\n generateCss() {\r\n const pieces = [];\r\n for (const statement of this.nestedStatements) {\r\n const css = statement.cssText();\r\n if (css !== '') {\r\n pieces.push(css);\r\n }\r\n }\r\n if (pieces.length === 0) {\r\n return '';\r\n }\r\n return this.getAtRuleText() + ' {\\n\\t' + pieces.join('\\n\\t') + '\\n}';\r\n }\r\n getAtRuleText() {\r\n return '@' + this.identifier + ' ' + this.condition;\r\n }\r\n isActive() {\r\n for (const statement of this.nestedStatements) {\r\n if (statement.isActive()) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n dispose() {\r\n //Dispose nested statements.\r\n for (const statement of this.nestedStatements) {\r\n statement.dispose();\r\n }\r\n super.dispose();\r\n }\r\n }\r\n class PreviewStyleBlock {\r\n constructor(statements, condition = null) {\r\n this.statements = statements;\r\n this.condition = condition;\r\n this.$styleElement = null;\r\n this.cssText = ko.computed({\r\n read: () => {\r\n if ((condition !== null) && !condition()) {\r\n return '';\r\n }\r\n let pieces = [];\r\n for (const statement of this.statements) {\r\n if (statement.isActive()) {\r\n const css = statement.cssText();\r\n if (css !== '') {\r\n pieces.push(css);\r\n }\r\n }\r\n }\r\n if (pieces.length === 0) {\r\n return '';\r\n }\r\n return pieces.join('\\n');\r\n },\r\n deferEvaluation: true,\r\n }).extend({ deferred: true });\r\n this.updateStyleElement(this.cssText());\r\n this.cssChangeSubscription = this.cssText.subscribe((cssText) => {\r\n this.updateStyleElement(cssText);\r\n });\r\n }\r\n updateStyleElement(cssText) {\r\n if (cssText === '') {\r\n if (this.$styleElement) {\r\n this.$styleElement.remove();\r\n this.$styleElement = null;\r\n }\r\n return;\r\n }\r\n if (!this.$styleElement) {\r\n this.$styleElement = $('').appendTo('head');\r\n }\r\n this.$styleElement.text(cssText);\r\n }\r\n clear() {\r\n if (this.$styleElement) {\r\n this.$styleElement.remove();\r\n this.$styleElement = null;\r\n }\r\n }\r\n dispose() {\r\n //Stop listening for CSS changes.\r\n this.cssChangeSubscription.dispose();\r\n this.cssText.dispose();\r\n //Dispose rule sets.\r\n for (const ruleset of this.statements) {\r\n ruleset.dispose();\r\n }\r\n //Remove the style element.\r\n this.clear();\r\n }\r\n }\r\n })(Preview = AmeStyleGenerator.Preview || (AmeStyleGenerator.Preview = {}));\r\n})(AmeStyleGenerator || (AmeStyleGenerator = {}));\r\n//# sourceMappingURL=style-generator.js.map"],"names":[],"sourceRoot":""} \ No newline at end of file diff --git a/dist/admin-customizer.bundle.js b/dist/admin-customizer.bundle.js index 4f45982..96b25e8 100644 --- a/dist/admin-customizer.bundle.js +++ b/dist/admin-customizer.bundle.js @@ -4150,6 +4150,8 @@ var AmeAdminCustomizer; this.sentSettings = {}; this.currentChangesetRequest = null; this.saveTriggerTimeoutId = null; + this.underlyingMetadata = ko.observable(null); + this.metadataHasChanged = ko.observable(false); this.exclusiveOperation = ko.observable(false); const self = this; this.currentChangeset = ko.observable(new Changeset(changesetName, changesetItemCount, changesetStatus)); @@ -4157,16 +4159,44 @@ var AmeAdminCustomizer; var _a; return ((_a = self.currentChangeset()) === null || _a === void 0 ? void 0 : _a.name()) || ''; }); + this.adminThemeMetadata = ko.computed({ + read: () => this.underlyingMetadata(), + write: (newValue) => { + const oldValue = this.underlyingMetadata.peek(); + if (!_.isEqual(newValue, oldValue)) { + this.underlyingMetadata(newValue); + this.metadataHasChanged(true); + } + } + }); //Automatically save the changeset when any settings change. const totalChangeCount = ko.pureComputed(() => { const changeset = self.currentChangeset(); return (changeset ? changeset.currentSessionChanges() : 0); }); - totalChangeCount.subscribe(_.debounce((counter) => { - if (counter > 0) { + const debouncedSaveTrigger = _.debounce(() => { + //Only save if there are changes. This may look like a duplicate check, + //but it's not: the totalChangeCount() may change between the time + //the debounced function is called and the time this code is executed. + // + //Also save if the metadata has changed, but only if the changeset + //is not empty. Saving a changeset with only metadata is not useful. + if ((totalChangeCount() > 0) + || (this.metadataHasChanged() && this.currentChangeset().isNonEmpty())) { self.queueChangesetUpdate(); } - }, 3000, { leading: true, trailing: true })); + }, 3000, { leading: true, trailing: true }); + totalChangeCount.subscribe((counter) => { + if (counter > 0) { + debouncedSaveTrigger(); + } + }); + //Also save when theme metadata changes. + this.metadataHasChanged.subscribe((hasChanged) => { + if (hasChanged) { + debouncedSaveTrigger(); + } + }); this.isExclusiveOperationInProgress = ko.pureComputed(() => { return self.exclusiveOperation(); }); @@ -4212,7 +4242,7 @@ var AmeAdminCustomizer; saveChangeset(status = null) { var _a; //Do nothing if there are no changes. - if (_.isEmpty(this.pendingSettings) && (status === null)) { + if (_.isEmpty(this.pendingSettings) && (status === null) && !this.metadataHasChanged()) { return $.Deferred().reject(new Error('There are no changes to save.')).promise(); } if (this.isExclusiveOperationInProgress()) { @@ -4232,7 +4262,7 @@ var AmeAdminCustomizer; const requestData = { action: 'ws_ame_ac_save_changeset', _ajax_nonce: this.saveChangesetNonce, - changeset: (_a = savedChangeset === null || savedChangeset === void 0 ? void 0 : savedChangeset.name) !== null && _a !== void 0 ? _a : '', + changeset: (_a = (savedChangeset === null || savedChangeset === void 0 ? void 0 : savedChangeset.name())) !== null && _a !== void 0 ? _a : '', modified: JSON.stringify(modifiedSettings), }; if (status !== null) { @@ -4242,6 +4272,13 @@ var AmeAdminCustomizer; if (!(savedChangeset === null || savedChangeset === void 0 ? void 0 : savedChangeset.hasName())) { requestData['createNew'] = 1; } + //Also send the metadata if it has changed. + const metadataWasChanged = this.metadataHasChanged(); + if (metadataWasChanged) { + const metadata = this.adminThemeMetadata(); + requestData['adminThemeMetadata'] = JSON.stringify(metadata); + } + this.metadataHasChanged(false); const request = $.ajax({ url: this.ajaxUrl, method: 'POST', @@ -4281,9 +4318,10 @@ var AmeAdminCustomizer; if (!savedChangeset) { return; } - //Store the returned changeset name in case a new changeset was created. - if (!savedChangeset.hasName()) { - const newName = _.get(serverResponse, ['data', 'changeset']); + //Store the returned changeset name in case a new changeset was created + //or an existing changeset was forked due to permissions. + const newName = _.get(serverResponse, ['data', 'changeset']); + if (!savedChangeset.hasName() || (newName !== savedChangeset.name())) { if (typeof newName === 'string') { savedChangeset.name(newName); } @@ -4384,7 +4422,7 @@ var AmeAdminCustomizer; /** * Get any unsaved setting changes. * - * @returns An object mapping setting IDs to their modified values. + * @returns Object An object mapping setting IDs to their modified values. */ get unsavedChanges() { //Include both pending settings and sent settings. Sent settings @@ -4442,6 +4480,10 @@ var AmeAdminCustomizer; }); return request; } + addInitialThemeMetadata(metadata) { + this.underlyingMetadata(metadata); + this.metadataHasChanged(false); + } } class Changeset { constructor(name = '', knownItemCount = 0, initialStatus = '') { @@ -4461,6 +4503,15 @@ var AmeAdminCustomizer; this.fixedContentStatuses = { 'publish': true, 'trash': true, 'future': true }; this.wasPublished = ko.observable(false); this.name = ko.observable(name); + this.name.subscribe((newName) => { + //In theory, the type system should ensure that the name is always a string, + //but that only works on the TS side. I've previously run into a bug where + //a null value was sent from the server. Let's add a check here to make it + //easier to spot bugs like that in the future. + if ((typeof newName !== 'string')) { + throw new Error('Changeset name must always be a string, found ' + (typeof newName)); + } + }); this.knownItemCount = ko.observable(knownItemCount); this.status = ko.observable(initialStatus !== null && initialStatus !== void 0 ? initialStatus : ''); } @@ -4475,6 +4526,7 @@ var AmeAdminCustomizer; return (this.currentSessionChanges() > 0) || (this.knownItemCount() > 0); } } + const TemporaryChangesetName = 'temporary000'; //Note: Must match the value used in PHP. //region Admin theme const UrlOrEmpty = _zod_lib_index_js__WEBPACK_IMPORTED_MODULE_11__["default"].union([ _zod_lib_index_js__WEBPACK_IMPORTED_MODULE_11__["default"].string().url().max(1000), @@ -4496,6 +4548,7 @@ var AmeAdminCustomizer; authorUrl: UrlOrEmpty.optional(), requiredWpVersion: _zod_lib_index_js__WEBPACK_IMPORTED_MODULE_11__["default"].string().max(30).default('4.7').optional(), testedWpVersion: _zod_lib_index_js__WEBPACK_IMPORTED_MODULE_11__["default"].string().max(30).optional(), + wasEverConfirmed: _zod_lib_index_js__WEBPACK_IMPORTED_MODULE_11__["default"].boolean().default(false).optional(), }); const AdminThemeSettings = _zod_lib_index_js__WEBPACK_IMPORTED_MODULE_11__["default"].record( //Key type @@ -4547,7 +4600,7 @@ var AmeAdminCustomizer; } class ObservableThemeMetadata { constructor(metadata) { - var _a, _b, _c, _d, _e, _f, _g, _h; + var _a, _b, _c, _d, _e, _f, _g, _h, _j; this.pluginName = observableWithZodValidation(metadata.pluginName, AdminThemeMetadata.shape.pluginName); this.shortDescription = observableWithZodValidation(metadata.shortDescription, AdminThemeMetadata.shape.shortDescription); this.pluginSlug = observableWithZodValidation((_a = metadata.pluginSlug) !== null && _a !== void 0 ? _a : '', AdminThemeMetadata.shape.pluginSlug); @@ -4558,6 +4611,7 @@ var AmeAdminCustomizer; this.authorUrl = observableWithZodValidation((_f = metadata.authorUrl) !== null && _f !== void 0 ? _f : '', AdminThemeMetadata.shape.authorUrl); this.requiredWpVersion = observableWithZodValidation((_g = metadata.requiredWpVersion) !== null && _g !== void 0 ? _g : '', AdminThemeMetadata.shape.requiredWpVersion); this.testedWpVersion = observableWithZodValidation((_h = metadata.testedWpVersion) !== null && _h !== void 0 ? _h : '', AdminThemeMetadata.shape.testedWpVersion); + this.wasEverConfirmed = observableWithZodValidation((_j = metadata.wasEverConfirmed) !== null && _j !== void 0 ? _j : false, AdminThemeMetadata.shape.wasEverConfirmed); } toObject() { return { @@ -4571,6 +4625,7 @@ var AmeAdminCustomizer; authorUrl: this.authorUrl(), requiredWpVersion: this.requiredWpVersion(), testedWpVersion: this.testedWpVersion(), + wasEverConfirmed: this.wasEverConfirmed() }; } isValid() { @@ -4584,15 +4639,23 @@ var AmeAdminCustomizer; && this.authorName.ameIsValid() && this.authorUrl.ameIsValid() && this.requiredWpVersion.ameIsValid() - && this.testedWpVersion.ameIsValid(); + && this.testedWpVersion.ameIsValid() + && this.wasEverConfirmed.ameIsValid(); } } + let MetadataDialogMode; + (function (MetadataDialogMode) { + MetadataDialogMode[MetadataDialogMode["Download"] = 0] = "Download"; + MetadataDialogMode[MetadataDialogMode["Edit"] = 1] = "Edit"; + })(MetadataDialogMode || (MetadataDialogMode = {})); class DownloadThemeDialog extends AmeBaseKnockoutDialog { - constructor(getChangesetName, savePendingChangesetData) { + constructor(getChangesetName, savePendingChangesetData, metadataObservable, customAdminThemeTexts) { super(); this.getChangesetName = getChangesetName; this.savePendingChangesetData = savePendingChangesetData; + this.metadataObservable = metadataObservable; this.isOperationInProgress = ko.observable(false); + this.mode = ko.observable(MetadataDialogMode.Download); this.autoCancelButton = true; this.advancedOptionsVisible = ko.observable(false); this.helpVisible = ko.observable(false); @@ -4602,11 +4665,21 @@ var AmeAdminCustomizer; this.cleanupCurrentDownload = () => { }; this.options.minWidth = 400; - this.meta = ko.observable(new ObservableThemeMetadata(AdminThemeMetadata.parse({ - pluginName: 'Custom Admin Theme', - shortDescription: 'A custom admin theme generated using the Admin Menu Editor Pro plugin.', - pluginVersion: '1.0', - }))); + this.adminThemeTexts = Object.assign({ + generatorCreditPhrase: 'generated using the Admin Menu Editor Pro plugin.', + standalonePluginNote: 'The result is a standalone plugin that you can use without Admin Menu Editor Pro.', + }, customAdminThemeTexts); + let initialMetadata = metadataObservable(); + if (initialMetadata === null) { + initialMetadata = this.getSampleMetadata(); + } + this.meta = ko.observable(new ObservableThemeMetadata(initialMetadata)); + this.confirmButtonLabel = ko.computed(() => { + if (this.mode() === MetadataDialogMode.Download) { + return 'Download Admin Theme'; + } + return 'OK'; + }); this.isConfirmButtonEnabled = ko.computed(() => { if (this.isOperationInProgress()) { return false; @@ -4626,9 +4699,32 @@ var AmeAdminCustomizer; this.helpToggleLabel = ko.pureComputed(() => { return this.helpVisible() ? 'Hide info' : 'How it works'; }); + //Hide the help container in download mode. + this.helpContainerVisible = ko.pureComputed(() => { + return this.mode() === MetadataDialogMode.Download; + }); + this.mode.subscribe((newMode) => { + if (newMode === MetadataDialogMode.Download) { + this.title('Generate admin theme'); + } + else if (newMode === MetadataDialogMode.Edit) { + this.title('Edit admin theme properties'); + } + }); } - getConfirmButtonLabel() { - return 'Download Admin Theme'; + getSampleMetadata() { + return AdminThemeMetadata.parse({ + pluginName: 'Custom Admin Theme', + shortDescription: 'A custom admin theme ' + this.adminThemeTexts.generatorCreditPhrase, + pluginVersion: '1.0', + }); + } + onOpen(event, ui) { + let latestMetadata = this.metadataObservable(); + if (latestMetadata === null) { + latestMetadata = this.getSampleMetadata(); + } + this.meta(new ObservableThemeMetadata(latestMetadata)); } toggleAdvancedOptions() { this.advancedOptionsVisible(!this.advancedOptionsVisible()); @@ -4637,12 +4733,6 @@ var AmeAdminCustomizer; this.helpVisible(!this.helpVisible()); } onConfirm(event) { - //Sanity checks. - const changesetName = this.getChangesetName(); - if (changesetName === '') { - alert('Error: The changeset has not been saved yet (name is empty).'); - return; - } if (!this.meta().isValid()) { //This should never happen because the confirm button is disabled //when the metadata is invalid. @@ -4650,6 +4740,35 @@ var AmeAdminCustomizer; return; } const metadata = this.meta().toObject(); + metadata.wasEverConfirmed = true; + this.metadataObservable(metadata); + if (this.mode() === MetadataDialogMode.Edit) { + //That's all we need to do in edit mode. + this.isOpen(false); + return; + } + this.triggerDownloadWithErrorReporting(metadata); + } + triggerDownloadWithErrorReporting(metadata) { + if (this.isOperationInProgress()) { + alert('Error: Another operation is already in progress.'); + return; + } + this.triggerDownload(metadata) + .fail((error) => { + if (error !== '') { + alert('Error: ' + error); + } + }); + } + triggerDownload(metadata) { + const deferred = $.Deferred(); + //Sanity checks. + //Download mode still requires a saved changeset. + const changesetName = this.getChangesetName(); + if (changesetName === '') { + return deferred.reject('The changeset has not been saved yet (name is empty).').promise(); + } this.isOperationInProgress(true); const $form = $('#ame-ac-theme-download-request-form'); const $frame = $('#ame-ac-theme-download-frame'); @@ -4675,8 +4794,8 @@ var AmeAdminCustomizer; } }; const timeoutTimer = setTimeout(() => { + deferred.reject('The download operation timed out.'); cleanup(); - alert('Error: The download operation timed out.'); }, requestTimeoutMs); this.savePendingChangesetData().then(() => { if (isCancelledOrDone) { @@ -4690,7 +4809,7 @@ var AmeAdminCustomizer; const cookieName = ('ameAcFileDownload_' + new Date().getTime() + '_' - + Math.round(Math.random() * 10000) //No dots allowed these cookie names. + + Math.round(Math.random() * 10000) //No dots allowed in these cookie names. ); this.downloadCookieName(cookieName); //Clear the frame to prevent the old response from being read. @@ -4711,10 +4830,12 @@ var AmeAdminCustomizer; $.removeCookie(cookieName); //Close the dialog when the download starts. this.isOpen(false); + deferred.resolve(); return; } if ((new Date()).getTime() - requestStartTime > requestTimeoutMs) { cleanup(); + deferred.reject('The download operation timed out.'); } }, 1000); $frame.on('load.ameAcDownloadAdminTheme', () => { @@ -4723,7 +4844,7 @@ var AmeAdminCustomizer; const response = JSON.parse(responseText); cleanup(); if ((response === null) || (typeof response !== 'object')) { - alert('Error: Received an invalid response from the server.'); + deferred.reject('Received an invalid response from the server.'); } else { if (!response.success) { @@ -4734,22 +4855,26 @@ var AmeAdminCustomizer; else { errorMessage = 'An unknown error occurred on the server.'; } - alert(errorMessage); + deferred.reject(errorMessage); } else { //This should never happen in practice. - alert('Error: The server did not start the download correctly.'); + deferred.reject('The server did not start the download correctly.'); } } }); $form.trigger('submit'); }, () => { if (isCancelledOrDone) { + if (deferred.state() === 'pending') { + deferred.reject(''); //No error message; the user probably cancelled the operation. + } return; } cleanup(); - alert('Error: Could not save the changeset data before generating an admin theme.'); + deferred.reject('Could not save the changeset data before generating an admin theme.'); }); + return deferred.promise(); } onClose(event, ui) { this.cleanupCurrentDownload(); @@ -4866,6 +4991,20 @@ var AmeAdminCustomizer; $element.on(transitionEvents, transitionEndCallback); } } + /** + * Whether to ask for confirmation when the user tries to exit the customizer. + */ + let ExitPromptMode; + (function (ExitPromptMode) { + /** + * Ask if there are unsaved changes. + */ + ExitPromptMode[ExitPromptMode["UnsavedChanges"] = 1] = "UnsavedChanges"; + /** + * Ask if the current changeset hasn't been published yet. + */ + ExitPromptMode[ExitPromptMode["UnpublishedChanges"] = 2] = "UnpublishedChanges"; + })(ExitPromptMode || (ExitPromptMode = {})); class AdminCustomizer extends _admin_customizer_base_js__WEBPACK_IMPORTED_MODULE_8__.AmeAdminCustomizerBase.AdminCustomizerBase { constructor(scriptData) { super(scriptData); @@ -4895,6 +5034,17 @@ var AmeAdminCustomizer; this.settings.add(unserializeSetting(id, data)); } }); + if (scriptData.changesetThemeMetadata) { + this.settings.addInitialThemeMetadata(scriptData.changesetThemeMetadata); + } + this.customBasePath = scriptData.customBasePath || null; + this.consoleLoggingEnabled = scriptData.isWpDebugEnabled || false; + if ((typeof scriptData.exitPromptMode === 'number') && (scriptData.exitPromptMode in ExitPromptMode)) { + this.exitPromptMode = scriptData.exitPromptMode; + } + else { + this.exitPromptMode = ExitPromptMode.UnpublishedChanges; + } let sectionIdCounter = 0; this.interfaceStructure = unserializeUiElement(scriptData.interfaceStructure, this.settings.get.bind(this.settings), (data) => { switch (data.t) { @@ -4922,19 +5072,69 @@ var AmeAdminCustomizer; } } }); - //Add the changeset name to the URL (if not already present). + //Remove the reload parameter from the URL. It is only used to avoid + //caching issues, and is not needed otherwise. const currentUrl = new URL(window.location.href); - if (currentUrl.searchParams.get('ame-ac-changeset') !== this.settings.changesetName()) { - currentUrl.searchParams.set('ame-ac-changeset', this.settings.changesetName()); + if (currentUrl.searchParams.get('_ame-ac-reload') !== null) { + currentUrl.searchParams.delete('_ame-ac-reload'); + window.history.replaceState({}, '', currentUrl.href); + } + //Also remove the "request new changeset" parameter. + if (currentUrl.searchParams.get('_ame-ac-new-changeset') !== null) { + currentUrl.searchParams.delete('_ame-ac-new-changeset'); window.history.replaceState({}, '', currentUrl.href); } - //When the changeset name changes, also change the URL. Discourage navigating - //to the old URL (no pushState()) because the name is only expected to change - //when the old changeset becomes invalid (e.g. it's deleted or published). + const changesetPathTemplate = scriptData.changesetPathTemplate; + const changesetPlaceholder = '{changeset}'; + function addChangesetToUrl(currentUrl, changesetName) { + const url = new URL(currentUrl); + if (changesetPathTemplate) { + url.pathname = changesetPathTemplate.replace(changesetPlaceholder, changesetName); + //With a custom path, the "page" parameter that points to the AC + //admin page is not necessary and would be confusing. + url.searchParams.delete('page'); + //When the changeset name is stored in the path, the "ame-ac-changeset" + //parameter is no longer needed, and could be out of sync with the path. + url.searchParams.delete('ame-ac-changeset'); + } + else { + url.searchParams.set('ame-ac-changeset', changesetName); + } + return url; + } + function getChangesetFromUrl(url) { + var _a; + const parsedUrl = new URL(url); + if (changesetPathTemplate) { + function escapeRegExp(input) { + return input.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); + } + const placeholderStart = changesetPathTemplate.indexOf(changesetPlaceholder); + const placeholderEnd = placeholderStart + changesetPlaceholder.length; + const changesetPathTemplateRegex = new RegExp('^' + escapeRegExp(changesetPathTemplate.slice(0, placeholderStart)) + + '([^a-zA-Z0-9]+)' + + escapeRegExp(changesetPathTemplate.slice(placeholderEnd))); + const match = parsedUrl.pathname.match(changesetPathTemplateRegex); + return match ? match[1] : ''; + } + else { + return (_a = parsedUrl.searchParams.get('ame-ac-changeset')) !== null && _a !== void 0 ? _a : ''; + } + } + //Add the changeset name to the URL (if not already present). + if (getChangesetFromUrl(window.location.href) !== this.settings.changesetName()) { + const newUrl = addChangesetToUrl(window.location.href, this.settings.changesetName()); + window.history.replaceState({}, '', newUrl.href); + } + //When the changeset name changes, also change the URL. this.settings.changesetName.subscribe((changesetName) => { - const url = new URL(window.location.href); - url.searchParams.set('ame-ac-changeset', changesetName); - window.history.replaceState({}, '', url.href); + const url = addChangesetToUrl(window.location.href, changesetName); + if (scriptData.changesetPushStateEnabled) { + window.history.pushState({}, '', url.href); + } + else { + window.history.replaceState({}, '', url.href); + } }); this.$saveButton = $('#ame-ac-apply-changes'); //The save button should be enabled when: @@ -5018,7 +5218,7 @@ var AmeAdminCustomizer; return this.isImporting() || this.isDiscardingChanges(); }); //Initialize the "download admin theme" dialog. - this.downloadThemeDialog = new DownloadThemeDialog(() => this.settings.getCurrentChangeset().name(), () => this.settings.savePendingSettings()); + this.downloadThemeDialog = new DownloadThemeDialog(() => this.settings.getCurrentChangeset().name(), () => this.settings.savePendingSettings(), this.settings.adminThemeMetadata, scriptData); //Toggle available extra actions based on changeset status. this.importActionEnabled = ko.pureComputed(() => { const changeset = this.settings.getCurrentChangeset(); @@ -5043,7 +5243,13 @@ var AmeAdminCustomizer; } }); this.downloadThemeActionEnabled = ko.pureComputed(() => { - return !this.settings.isExclusiveOperationInProgress(); + return (!this.settings.isExclusiveOperationInProgress() + && !this.downloadThemeDialog.isOperationInProgress() + //The changeset must already be saved for the download to work, + //which means it should have a name. + && (this.settings.getCurrentChangeset().name() !== '') + //The changeset should probably be non-empty. + && this.settings.getCurrentChangeset().isNonEmpty()); }); this.downloadThemeActionEnabled.subscribe((isEnabled) => { if (this.$extraActionMenu) { @@ -5121,14 +5327,25 @@ var AmeAdminCustomizer; this.previewConnection.execute('previewSetting', setting.id, newValue); } else { + let reason = 'Unknown'; + if (!setting.supportsPostMessage) { + reason = 'Setting "' + setting.id + '" does not support postMessage'; + } + else if (!this.previewConnection) { + reason = 'No preview connection'; + } + else if (!this.previewConnection.isConnected) { + reason = 'Preview connection is not connected'; + } + this.log('Reloading the preview frame because: ' + reason); throttledReloadPreview(); } }); const registerUnloadPrompt = () => { //Ask for confirmation when the user tries to leave the page and the changeset - //has unpublished changes. + //has unpublished/unsaved changes. $(window).on('beforeunload.ame-ac-exit-confirm', (event) => { - if (this.hasUnpublishedChanges()) { + if (this.isExitPromptNeeded()) { event.preventDefault(); //Note: The confirmation prompt will only be displayed if the user //has interacted with the page (e.g. clicked something). @@ -5211,7 +5428,12 @@ var AmeAdminCustomizer; //Ensure that the changeset used in the preview matches the current //changeset and preview is enabled. This is just a precaution. Normally, //the preview script automatically changes link URLs. - parsedUrl.searchParams.set('ame-ac-changeset', this.settings.changesetName()); + let changesetName = this.settings.changesetName(); + if (changesetName === '') { + //Use a special value if the changeset hasn't been saved yet. + changesetName = TemporaryChangesetName; + } + parsedUrl.searchParams.set('ame-ac-changeset', changesetName); parsedUrl.searchParams.set('ame-ac-preview', '1'); this.hasPendingPreviewReload = false; //Reloading now, so no longer pending. this.isFrameLoading = true; @@ -5219,7 +5441,7 @@ var AmeAdminCustomizer; if (simulateFormSubmission) { const formData = { action: 'ws_ame_ac_refresh_preview_frame', - "ame-ac-changeset": this.settings.changesetName(), + "ame-ac-changeset": changesetName, modified: JSON.stringify(unsavedChanges), nonce: this.refreshPreviewNonce }; @@ -5334,7 +5556,7 @@ var AmeAdminCustomizer; return this.previewConnection.execute(methodName, ...args); } confirmExit() { - if (this.hasUnpublishedChanges()) { + if (this.isExitPromptNeeded()) { if (window.confirm(this.exitPromptMessage)) { //Remove the confirmation prompt that appears when leaving the page. //We don't want to show two prompts. @@ -5345,12 +5567,23 @@ var AmeAdminCustomizer; } return true; } - hasUnpublishedChanges() { + isExitPromptNeeded() { const changeset = this.settings.getCurrentChangeset(); - return (changeset.isNonEmpty() - && !changeset.wasPublished() - && (changeset.status() !== 'trash') //Can't publish a trashed changeset. - ); + //No need to save anything if the changeset is empty. + if (!changeset.isNonEmpty()) { + return false; + } + switch (this.exitPromptMode) { + case ExitPromptMode.UnpublishedChanges: + return (!changeset.wasPublished() + && (changeset.status() !== 'trash') //Can't publish a trashed changeset. + ); + case ExitPromptMode.UnsavedChanges: + const unsavedChanges = this.settings.unsavedChanges; + return !_.isEmpty(unsavedChanges); + default: + return false; + } } // noinspection JSUnusedGlobalSymbols -- Used in the Knockout template. toggleExtraActionMenu() { @@ -5399,13 +5632,35 @@ var AmeAdminCustomizer; //Stop listening for clicks outside the menu. $(document).off('mousedown.ameAcExtraMenuHide'); } + openMetadataDialog(mode) { + this.downloadThemeDialog.mode(mode); + this.downloadThemeDialog.isOpen(true); + this.isImportReportVisible(false); + this.hideExtraActionMenu(); + } actionOpenDownloadDialog() { if (!this.downloadThemeActionEnabled()) { return; } - this.downloadThemeDialog.isOpen(true); - this.isImportReportVisible(false); - this.hideExtraActionMenu(); + this.openMetadataDialog(MetadataDialogMode.Download); + } + // noinspection JSUnusedGlobalSymbols -- Used in another plugin. + actionEditOrDownloadTheme() { + if (!this.downloadThemeActionEnabled()) { + return; + } + //If the user hasn't confirmed the theme metadata yet, show the dialog. + const metadata = this.settings.adminThemeMetadata(); + if ((metadata === null) || !metadata.wasEverConfirmed) { + this.openMetadataDialog(MetadataDialogMode.Download); + } + else { + this.downloadThemeDialog.triggerDownloadWithErrorReporting(metadata); + } + } + // noinspection JSUnusedGlobalSymbols -- Used in another plugin. + actionOpenMetadataDialog() { + this.openMetadataDialog(MetadataDialogMode.Edit); } actionOpenImportDialog() { if (!this.importActionEnabled()) { @@ -5434,13 +5689,22 @@ var AmeAdminCustomizer; this.settings.trashChangeset() .then(() => { //Reload the customizer with a new changeset. - //First, to get the customizer's base URL, get the current URL - //and remove all query parameters except "page". const url = new URL(window.location.href); - const page = url.searchParams.get('page'); - url.search = ''; - url.searchParams.set('page', page || 'ame-admin-customizer'); - //Don't need the hash either. + if (this.customBasePath) { + url.pathname = this.customBasePath; + url.search = ''; + } + else { + //To get the customizer's base URL, get the current URL + //and remove all query parameters except "page". + const page = url.searchParams.get('page'); + url.search = ''; + url.searchParams.set('page', page || 'ame-admin-customizer'); + } + //Notify the customizer that we definitely want a new changeset; + //don't try to load a draft. + url.searchParams.set('_ame-ac-new-changeset', '1'); + //Don't need the hash. url.hash = ''; //Add a random parameter to force a reload. url.searchParams.set('_ame-ac-reload', Math.random().toString(36).substring(7)); @@ -5587,6 +5851,11 @@ var AmeAdminCustomizer; dismissImportReport() { this.isImportReportVisible(false); } + log(message) { + if (this.consoleLoggingEnabled && console && console.log) { + console.log(message); + } + } } AmeAdminCustomizer.AdminCustomizer = AdminCustomizer; })(AmeAdminCustomizer || (AmeAdminCustomizer = {})); @@ -5860,13 +6129,14 @@ class AmeAcSectionLink extends _pro_customizables_ko_components_control_base_js_ throw new Error('The uiElement parameter is required for AmeAcSectionLink'); } this.targetElementId = _ame_ac_section_js__WEBPACK_IMPORTED_MODULE_2__.AmeAcSection.getSectionElementId(this.uiElement); + this.elementId = _ame_ac_section_js__WEBPACK_IMPORTED_MODULE_2__.AmeAcSection.getSectionLinkElementId(this.uiElement); } getExpectedUiElementType() { return Section; } } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_pro_customizables_ko_components_control_base_js__WEBPACK_IMPORTED_MODULE_0__.createComponentConfig)(AmeAcSectionLink, ` - `)); @@ -5908,7 +6178,15 @@ class AmeAcSection extends _pro_customizables_ko_components_control_base_js__WEB } //To keep the header text alignment consistent when navigating between sections, //let's show something even if there are no breadcrumbs. - const emptyBreadcrumbText = 'Admin Menu Editor Pro'; + const defaultEmptyBreadcrumbText = 'Admin Menu Editor Pro'; + //Let other modules change the default text. + let filteredEmptyBreadcrumbText = null; + if (wp && wp.hooks && wp.hooks.applyFilters) { + filteredEmptyBreadcrumbText = wp.hooks.applyFilters('adminMenuEditor.ac.emptyBreadcrumbText', defaultEmptyBreadcrumbText); + } + const emptyBreadcrumbText = ((typeof filteredEmptyBreadcrumbText === 'string') + ? filteredEmptyBreadcrumbText + : defaultEmptyBreadcrumbText); this.breadcrumbText = ko.pureComputed(() => { if (this.breadcrumbs === null) { return emptyBreadcrumbText; @@ -5957,7 +6235,12 @@ class AmeAcSection extends _pro_customizables_ko_components_control_base_js__WEB } } static getSectionElementId(section) { - const prefix = 'ame-ac-section-'; + return AmeAcSection.generateSectionElementId(section, 'ame-ac-section-'); + } + static getSectionLinkElementId(section) { + return AmeAcSection.generateSectionElementId(section, 'ame-ac-slink-'); + } + static generateSectionElementId(section, prefix) { if (section.id) { return prefix + section.id; } @@ -6039,15 +6322,18 @@ class AmeAcStructure extends _pro_customizables_ko_components_control_base_js__W constructor(params, $element) { var _a; super(params, $element); - this.allSections = []; + this.allNavigationSections = []; const rootSection = new Section({ t: 'section', id: 'structure-root', title: (_a = this.structure.title) !== null && _a !== void 0 ? _a : 'Root', }, this.structure.children); - //Recursively collect all sections. + //Recursively collect all navigable sections. Don't include content + //sections: their parents will output them, not this component. function collectChildSections(section, accumulator = []) { - accumulator.push(section); + if (section.preferredRole === 'navigation') { + accumulator.push(section); + } for (const child of section.children) { if (child instanceof Section) { collectChildSections(child, accumulator); @@ -6055,17 +6341,17 @@ class AmeAcStructure extends _pro_customizables_ko_components_control_base_js__W } return accumulator; } - this.allSections = collectChildSections(rootSection); + this.allNavigationSections = collectChildSections(rootSection); //Give the breadcrumb list to each section, if available. if (typeof params.breadcrumbs !== 'undefined') { - for (const section of this.allSections) { + for (const section of this.allNavigationSections) { section.componentParams.breadcrumbs = params.breadcrumbs; } } } } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_pro_customizables_ko_components_control_base_js__WEBPACK_IMPORTED_MODULE_0__.createRendererComponentConfig)(AmeAcStructure, ` - + `)); @@ -6158,6 +6444,10 @@ class AmeBoxDimensions extends _control_base_js__WEBPACK_IMPORTED_MODULE_0__.KoS super(params, $element); this.inputIdPrefix = '_ame-box-dimensions-c-input-' + (nextId++); this.unitElementId = '_ame-box-dimensions-c-unit-' + (nextId++); + this.wrapperAttributes = {}; + if ((typeof params.id === 'string') && (params.id !== '')) { + this.wrapperAttributes['id'] = '_ame-box-dimensions-w-' + params.id; + } if ((typeof params['dimensionNames'] !== 'undefined') && Array.isArray(params['dimensionNames'])) { this.dimensionsInOrder = params['dimensionNames']; } @@ -6398,7 +6688,8 @@ class AmeBoxDimensions extends _control_base_js__WEBPACK_IMPORTED_MODULE_0__.KoS } } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_control_base_js__WEBPACK_IMPORTED_MODULE_0__.createControlComponentConfig)(AmeBoxDimensions, ` -
+
val;\n function assertIs(_arg) { }\n util.assertIs = assertIs;\n function assertNever(_x) {\n throw new Error();\n }\n util.assertNever = assertNever;\n util.arrayToEnum = (items) => {\n const obj = {};\n for (const item of items) {\n obj[item] = item;\n }\n return obj;\n };\n util.getValidEnumValues = (obj) => {\n const validKeys = util.objectKeys(obj).filter((k) => typeof obj[obj[k]] !== \"number\");\n const filtered = {};\n for (const k of validKeys) {\n filtered[k] = obj[k];\n }\n return util.objectValues(filtered);\n };\n util.objectValues = (obj) => {\n return util.objectKeys(obj).map(function (e) {\n return obj[e];\n });\n };\n util.objectKeys = typeof Object.keys === \"function\" // eslint-disable-line ban/ban\n ? (obj) => Object.keys(obj) // eslint-disable-line ban/ban\n : (object) => {\n const keys = [];\n for (const key in object) {\n if (Object.prototype.hasOwnProperty.call(object, key)) {\n keys.push(key);\n }\n }\n return keys;\n };\n util.find = (arr, checker) => {\n for (const item of arr) {\n if (checker(item))\n return item;\n }\n return undefined;\n };\n util.isInteger = typeof Number.isInteger === \"function\"\n ? (val) => Number.isInteger(val) // eslint-disable-line ban/ban\n : (val) => typeof val === \"number\" && isFinite(val) && Math.floor(val) === val;\n function joinValues(array, separator = \" | \") {\n return array\n .map((val) => (typeof val === \"string\" ? `'${val}'` : val))\n .join(separator);\n }\n util.joinValues = joinValues;\n util.jsonStringifyReplacer = (_, value) => {\n if (typeof value === \"bigint\") {\n return value.toString();\n }\n return value;\n };\n})(util || (util = {}));\nvar objectUtil;\n(function (objectUtil) {\n objectUtil.mergeShapes = (first, second) => {\n return {\n ...first,\n ...second, // second overwrites first\n };\n };\n})(objectUtil || (objectUtil = {}));\nconst ZodParsedType = util.arrayToEnum([\n \"string\",\n \"nan\",\n \"number\",\n \"integer\",\n \"float\",\n \"boolean\",\n \"date\",\n \"bigint\",\n \"symbol\",\n \"function\",\n \"undefined\",\n \"null\",\n \"array\",\n \"object\",\n \"unknown\",\n \"promise\",\n \"void\",\n \"never\",\n \"map\",\n \"set\",\n]);\nconst getParsedType = (data) => {\n const t = typeof data;\n switch (t) {\n case \"undefined\":\n return ZodParsedType.undefined;\n case \"string\":\n return ZodParsedType.string;\n case \"number\":\n return isNaN(data) ? ZodParsedType.nan : ZodParsedType.number;\n case \"boolean\":\n return ZodParsedType.boolean;\n case \"function\":\n return ZodParsedType.function;\n case \"bigint\":\n return ZodParsedType.bigint;\n case \"symbol\":\n return ZodParsedType.symbol;\n case \"object\":\n if (Array.isArray(data)) {\n return ZodParsedType.array;\n }\n if (data === null) {\n return ZodParsedType.null;\n }\n if (data.then &&\n typeof data.then === \"function\" &&\n data.catch &&\n typeof data.catch === \"function\") {\n return ZodParsedType.promise;\n }\n if (typeof Map !== \"undefined\" && data instanceof Map) {\n return ZodParsedType.map;\n }\n if (typeof Set !== \"undefined\" && data instanceof Set) {\n return ZodParsedType.set;\n }\n if (typeof Date !== \"undefined\" && data instanceof Date) {\n return ZodParsedType.date;\n }\n return ZodParsedType.object;\n default:\n return ZodParsedType.unknown;\n }\n};\n\nconst ZodIssueCode = util.arrayToEnum([\n \"invalid_type\",\n \"invalid_literal\",\n \"custom\",\n \"invalid_union\",\n \"invalid_union_discriminator\",\n \"invalid_enum_value\",\n \"unrecognized_keys\",\n \"invalid_arguments\",\n \"invalid_return_type\",\n \"invalid_date\",\n \"invalid_string\",\n \"too_small\",\n \"too_big\",\n \"invalid_intersection_types\",\n \"not_multiple_of\",\n \"not_finite\",\n]);\nconst quotelessJson = (obj) => {\n const json = JSON.stringify(obj, null, 2);\n return json.replace(/\"([^\"]+)\":/g, \"$1:\");\n};\nclass ZodError extends Error {\n constructor(issues) {\n super();\n this.issues = [];\n this.addIssue = (sub) => {\n this.issues = [...this.issues, sub];\n };\n this.addIssues = (subs = []) => {\n this.issues = [...this.issues, ...subs];\n };\n const actualProto = new.target.prototype;\n if (Object.setPrototypeOf) {\n // eslint-disable-next-line ban/ban\n Object.setPrototypeOf(this, actualProto);\n }\n else {\n this.__proto__ = actualProto;\n }\n this.name = \"ZodError\";\n this.issues = issues;\n }\n get errors() {\n return this.issues;\n }\n format(_mapper) {\n const mapper = _mapper ||\n function (issue) {\n return issue.message;\n };\n const fieldErrors = { _errors: [] };\n const processError = (error) => {\n for (const issue of error.issues) {\n if (issue.code === \"invalid_union\") {\n issue.unionErrors.map(processError);\n }\n else if (issue.code === \"invalid_return_type\") {\n processError(issue.returnTypeError);\n }\n else if (issue.code === \"invalid_arguments\") {\n processError(issue.argumentsError);\n }\n else if (issue.path.length === 0) {\n fieldErrors._errors.push(mapper(issue));\n }\n else {\n let curr = fieldErrors;\n let i = 0;\n while (i < issue.path.length) {\n const el = issue.path[i];\n const terminal = i === issue.path.length - 1;\n if (!terminal) {\n curr[el] = curr[el] || { _errors: [] };\n // if (typeof el === \"string\") {\n // curr[el] = curr[el] || { _errors: [] };\n // } else if (typeof el === \"number\") {\n // const errorArray: any = [];\n // errorArray._errors = [];\n // curr[el] = curr[el] || errorArray;\n // }\n }\n else {\n curr[el] = curr[el] || { _errors: [] };\n curr[el]._errors.push(mapper(issue));\n }\n curr = curr[el];\n i++;\n }\n }\n }\n };\n processError(this);\n return fieldErrors;\n }\n toString() {\n return this.message;\n }\n get message() {\n return JSON.stringify(this.issues, util.jsonStringifyReplacer, 2);\n }\n get isEmpty() {\n return this.issues.length === 0;\n }\n flatten(mapper = (issue) => issue.message) {\n const fieldErrors = {};\n const formErrors = [];\n for (const sub of this.issues) {\n if (sub.path.length > 0) {\n fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || [];\n fieldErrors[sub.path[0]].push(mapper(sub));\n }\n else {\n formErrors.push(mapper(sub));\n }\n }\n return { formErrors, fieldErrors };\n }\n get formErrors() {\n return this.flatten();\n }\n}\nZodError.create = (issues) => {\n const error = new ZodError(issues);\n return error;\n};\n\nconst errorMap = (issue, _ctx) => {\n let message;\n switch (issue.code) {\n case ZodIssueCode.invalid_type:\n if (issue.received === ZodParsedType.undefined) {\n message = \"Required\";\n }\n else {\n message = `Expected ${issue.expected}, received ${issue.received}`;\n }\n break;\n case ZodIssueCode.invalid_literal:\n message = `Invalid literal value, expected ${JSON.stringify(issue.expected, util.jsonStringifyReplacer)}`;\n break;\n case ZodIssueCode.unrecognized_keys:\n message = `Unrecognized key(s) in object: ${util.joinValues(issue.keys, \", \")}`;\n break;\n case ZodIssueCode.invalid_union:\n message = `Invalid input`;\n break;\n case ZodIssueCode.invalid_union_discriminator:\n message = `Invalid discriminator value. Expected ${util.joinValues(issue.options)}`;\n break;\n case ZodIssueCode.invalid_enum_value:\n message = `Invalid enum value. Expected ${util.joinValues(issue.options)}, received '${issue.received}'`;\n break;\n case ZodIssueCode.invalid_arguments:\n message = `Invalid function arguments`;\n break;\n case ZodIssueCode.invalid_return_type:\n message = `Invalid function return type`;\n break;\n case ZodIssueCode.invalid_date:\n message = `Invalid date`;\n break;\n case ZodIssueCode.invalid_string:\n if (typeof issue.validation === \"object\") {\n if (\"includes\" in issue.validation) {\n message = `Invalid input: must include \"${issue.validation.includes}\"`;\n if (typeof issue.validation.position === \"number\") {\n message = `${message} at one or more positions greater than or equal to ${issue.validation.position}`;\n }\n }\n else if (\"startsWith\" in issue.validation) {\n message = `Invalid input: must start with \"${issue.validation.startsWith}\"`;\n }\n else if (\"endsWith\" in issue.validation) {\n message = `Invalid input: must end with \"${issue.validation.endsWith}\"`;\n }\n else {\n util.assertNever(issue.validation);\n }\n }\n else if (issue.validation !== \"regex\") {\n message = `Invalid ${issue.validation}`;\n }\n else {\n message = \"Invalid\";\n }\n break;\n case ZodIssueCode.too_small:\n if (issue.type === \"array\")\n message = `Array must contain ${issue.exact ? \"exactly\" : issue.inclusive ? `at least` : `more than`} ${issue.minimum} element(s)`;\n else if (issue.type === \"string\")\n message = `String must contain ${issue.exact ? \"exactly\" : issue.inclusive ? `at least` : `over`} ${issue.minimum} character(s)`;\n else if (issue.type === \"number\")\n message = `Number must be ${issue.exact\n ? `exactly equal to `\n : issue.inclusive\n ? `greater than or equal to `\n : `greater than `}${issue.minimum}`;\n else if (issue.type === \"date\")\n message = `Date must be ${issue.exact\n ? `exactly equal to `\n : issue.inclusive\n ? `greater than or equal to `\n : `greater than `}${new Date(Number(issue.minimum))}`;\n else\n message = \"Invalid input\";\n break;\n case ZodIssueCode.too_big:\n if (issue.type === \"array\")\n message = `Array must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `less than`} ${issue.maximum} element(s)`;\n else if (issue.type === \"string\")\n message = `String must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `under`} ${issue.maximum} character(s)`;\n else if (issue.type === \"number\")\n message = `Number must be ${issue.exact\n ? `exactly`\n : issue.inclusive\n ? `less than or equal to`\n : `less than`} ${issue.maximum}`;\n else if (issue.type === \"bigint\")\n message = `BigInt must be ${issue.exact\n ? `exactly`\n : issue.inclusive\n ? `less than or equal to`\n : `less than`} ${issue.maximum}`;\n else if (issue.type === \"date\")\n message = `Date must be ${issue.exact\n ? `exactly`\n : issue.inclusive\n ? `smaller than or equal to`\n : `smaller than`} ${new Date(Number(issue.maximum))}`;\n else\n message = \"Invalid input\";\n break;\n case ZodIssueCode.custom:\n message = `Invalid input`;\n break;\n case ZodIssueCode.invalid_intersection_types:\n message = `Intersection results could not be merged`;\n break;\n case ZodIssueCode.not_multiple_of:\n message = `Number must be a multiple of ${issue.multipleOf}`;\n break;\n case ZodIssueCode.not_finite:\n message = \"Number must be finite\";\n break;\n default:\n message = _ctx.defaultError;\n util.assertNever(issue);\n }\n return { message };\n};\n\nlet overrideErrorMap = errorMap;\nfunction setErrorMap(map) {\n overrideErrorMap = map;\n}\nfunction getErrorMap() {\n return overrideErrorMap;\n}\n\nconst makeIssue = (params) => {\n const { data, path, errorMaps, issueData } = params;\n const fullPath = [...path, ...(issueData.path || [])];\n const fullIssue = {\n ...issueData,\n path: fullPath,\n };\n let errorMessage = \"\";\n const maps = errorMaps\n .filter((m) => !!m)\n .slice()\n .reverse();\n for (const map of maps) {\n errorMessage = map(fullIssue, { data, defaultError: errorMessage }).message;\n }\n return {\n ...issueData,\n path: fullPath,\n message: issueData.message || errorMessage,\n };\n};\nconst EMPTY_PATH = [];\nfunction addIssueToContext(ctx, issueData) {\n const issue = makeIssue({\n issueData: issueData,\n data: ctx.data,\n path: ctx.path,\n errorMaps: [\n ctx.common.contextualErrorMap,\n ctx.schemaErrorMap,\n getErrorMap(),\n errorMap, // then global default map\n ].filter((x) => !!x),\n });\n ctx.common.issues.push(issue);\n}\nclass ParseStatus {\n constructor() {\n this.value = \"valid\";\n }\n dirty() {\n if (this.value === \"valid\")\n this.value = \"dirty\";\n }\n abort() {\n if (this.value !== \"aborted\")\n this.value = \"aborted\";\n }\n static mergeArray(status, results) {\n const arrayValue = [];\n for (const s of results) {\n if (s.status === \"aborted\")\n return INVALID;\n if (s.status === \"dirty\")\n status.dirty();\n arrayValue.push(s.value);\n }\n return { status: status.value, value: arrayValue };\n }\n static async mergeObjectAsync(status, pairs) {\n const syncPairs = [];\n for (const pair of pairs) {\n syncPairs.push({\n key: await pair.key,\n value: await pair.value,\n });\n }\n return ParseStatus.mergeObjectSync(status, syncPairs);\n }\n static mergeObjectSync(status, pairs) {\n const finalObject = {};\n for (const pair of pairs) {\n const { key, value } = pair;\n if (key.status === \"aborted\")\n return INVALID;\n if (value.status === \"aborted\")\n return INVALID;\n if (key.status === \"dirty\")\n status.dirty();\n if (value.status === \"dirty\")\n status.dirty();\n if (typeof value.value !== \"undefined\" || pair.alwaysSet) {\n finalObject[key.value] = value.value;\n }\n }\n return { status: status.value, value: finalObject };\n }\n}\nconst INVALID = Object.freeze({\n status: \"aborted\",\n});\nconst DIRTY = (value) => ({ status: \"dirty\", value });\nconst OK = (value) => ({ status: \"valid\", value });\nconst isAborted = (x) => x.status === \"aborted\";\nconst isDirty = (x) => x.status === \"dirty\";\nconst isValid = (x) => x.status === \"valid\";\nconst isAsync = (x) => typeof Promise !== \"undefined\" && x instanceof Promise;\n\nvar errorUtil;\n(function (errorUtil) {\n errorUtil.errToObj = (message) => typeof message === \"string\" ? { message } : message || {};\n errorUtil.toString = (message) => typeof message === \"string\" ? message : message === null || message === void 0 ? void 0 : message.message;\n})(errorUtil || (errorUtil = {}));\n\nclass ParseInputLazyPath {\n constructor(parent, value, path, key) {\n this._cachedPath = [];\n this.parent = parent;\n this.data = value;\n this._path = path;\n this._key = key;\n }\n get path() {\n if (!this._cachedPath.length) {\n if (this._key instanceof Array) {\n this._cachedPath.push(...this._path, ...this._key);\n }\n else {\n this._cachedPath.push(...this._path, this._key);\n }\n }\n return this._cachedPath;\n }\n}\nconst handleResult = (ctx, result) => {\n if (isValid(result)) {\n return { success: true, data: result.value };\n }\n else {\n if (!ctx.common.issues.length) {\n throw new Error(\"Validation failed but no issues detected.\");\n }\n return {\n success: false,\n get error() {\n if (this._error)\n return this._error;\n const error = new ZodError(ctx.common.issues);\n this._error = error;\n return this._error;\n },\n };\n }\n};\nfunction processCreateParams(params) {\n if (!params)\n return {};\n const { errorMap, invalid_type_error, required_error, description } = params;\n if (errorMap && (invalid_type_error || required_error)) {\n throw new Error(`Can't use \"invalid_type_error\" or \"required_error\" in conjunction with custom error map.`);\n }\n if (errorMap)\n return { errorMap: errorMap, description };\n const customMap = (iss, ctx) => {\n if (iss.code !== \"invalid_type\")\n return { message: ctx.defaultError };\n if (typeof ctx.data === \"undefined\") {\n return { message: required_error !== null && required_error !== void 0 ? required_error : ctx.defaultError };\n }\n return { message: invalid_type_error !== null && invalid_type_error !== void 0 ? invalid_type_error : ctx.defaultError };\n };\n return { errorMap: customMap, description };\n}\nclass ZodType {\n constructor(def) {\n /** Alias of safeParseAsync */\n this.spa = this.safeParseAsync;\n this._def = def;\n this.parse = this.parse.bind(this);\n this.safeParse = this.safeParse.bind(this);\n this.parseAsync = this.parseAsync.bind(this);\n this.safeParseAsync = this.safeParseAsync.bind(this);\n this.spa = this.spa.bind(this);\n this.refine = this.refine.bind(this);\n this.refinement = this.refinement.bind(this);\n this.superRefine = this.superRefine.bind(this);\n this.optional = this.optional.bind(this);\n this.nullable = this.nullable.bind(this);\n this.nullish = this.nullish.bind(this);\n this.array = this.array.bind(this);\n this.promise = this.promise.bind(this);\n this.or = this.or.bind(this);\n this.and = this.and.bind(this);\n this.transform = this.transform.bind(this);\n this.brand = this.brand.bind(this);\n this.default = this.default.bind(this);\n this.catch = this.catch.bind(this);\n this.describe = this.describe.bind(this);\n this.pipe = this.pipe.bind(this);\n this.isNullable = this.isNullable.bind(this);\n this.isOptional = this.isOptional.bind(this);\n }\n get description() {\n return this._def.description;\n }\n _getType(input) {\n return getParsedType(input.data);\n }\n _getOrReturnCtx(input, ctx) {\n return (ctx || {\n common: input.parent.common,\n data: input.data,\n parsedType: getParsedType(input.data),\n schemaErrorMap: this._def.errorMap,\n path: input.path,\n parent: input.parent,\n });\n }\n _processInputParams(input) {\n return {\n status: new ParseStatus(),\n ctx: {\n common: input.parent.common,\n data: input.data,\n parsedType: getParsedType(input.data),\n schemaErrorMap: this._def.errorMap,\n path: input.path,\n parent: input.parent,\n },\n };\n }\n _parseSync(input) {\n const result = this._parse(input);\n if (isAsync(result)) {\n throw new Error(\"Synchronous parse encountered promise.\");\n }\n return result;\n }\n _parseAsync(input) {\n const result = this._parse(input);\n return Promise.resolve(result);\n }\n parse(data, params) {\n const result = this.safeParse(data, params);\n if (result.success)\n return result.data;\n throw result.error;\n }\n safeParse(data, params) {\n var _a;\n const ctx = {\n common: {\n issues: [],\n async: (_a = params === null || params === void 0 ? void 0 : params.async) !== null && _a !== void 0 ? _a : false,\n contextualErrorMap: params === null || params === void 0 ? void 0 : params.errorMap,\n },\n path: (params === null || params === void 0 ? void 0 : params.path) || [],\n schemaErrorMap: this._def.errorMap,\n parent: null,\n data,\n parsedType: getParsedType(data),\n };\n const result = this._parseSync({ data, path: ctx.path, parent: ctx });\n return handleResult(ctx, result);\n }\n async parseAsync(data, params) {\n const result = await this.safeParseAsync(data, params);\n if (result.success)\n return result.data;\n throw result.error;\n }\n async safeParseAsync(data, params) {\n const ctx = {\n common: {\n issues: [],\n contextualErrorMap: params === null || params === void 0 ? void 0 : params.errorMap,\n async: true,\n },\n path: (params === null || params === void 0 ? void 0 : params.path) || [],\n schemaErrorMap: this._def.errorMap,\n parent: null,\n data,\n parsedType: getParsedType(data),\n };\n const maybeAsyncResult = this._parse({ data, path: ctx.path, parent: ctx });\n const result = await (isAsync(maybeAsyncResult)\n ? maybeAsyncResult\n : Promise.resolve(maybeAsyncResult));\n return handleResult(ctx, result);\n }\n refine(check, message) {\n const getIssueProperties = (val) => {\n if (typeof message === \"string\" || typeof message === \"undefined\") {\n return { message };\n }\n else if (typeof message === \"function\") {\n return message(val);\n }\n else {\n return message;\n }\n };\n return this._refinement((val, ctx) => {\n const result = check(val);\n const setError = () => ctx.addIssue({\n code: ZodIssueCode.custom,\n ...getIssueProperties(val),\n });\n if (typeof Promise !== \"undefined\" && result instanceof Promise) {\n return result.then((data) => {\n if (!data) {\n setError();\n return false;\n }\n else {\n return true;\n }\n });\n }\n if (!result) {\n setError();\n return false;\n }\n else {\n return true;\n }\n });\n }\n refinement(check, refinementData) {\n return this._refinement((val, ctx) => {\n if (!check(val)) {\n ctx.addIssue(typeof refinementData === \"function\"\n ? refinementData(val, ctx)\n : refinementData);\n return false;\n }\n else {\n return true;\n }\n });\n }\n _refinement(refinement) {\n return new ZodEffects({\n schema: this,\n typeName: ZodFirstPartyTypeKind.ZodEffects,\n effect: { type: \"refinement\", refinement },\n });\n }\n superRefine(refinement) {\n return this._refinement(refinement);\n }\n optional() {\n return ZodOptional.create(this, this._def);\n }\n nullable() {\n return ZodNullable.create(this, this._def);\n }\n nullish() {\n return this.nullable().optional();\n }\n array() {\n return ZodArray.create(this, this._def);\n }\n promise() {\n return ZodPromise.create(this, this._def);\n }\n or(option) {\n return ZodUnion.create([this, option], this._def);\n }\n and(incoming) {\n return ZodIntersection.create(this, incoming, this._def);\n }\n transform(transform) {\n return new ZodEffects({\n ...processCreateParams(this._def),\n schema: this,\n typeName: ZodFirstPartyTypeKind.ZodEffects,\n effect: { type: \"transform\", transform },\n });\n }\n default(def) {\n const defaultValueFunc = typeof def === \"function\" ? def : () => def;\n return new ZodDefault({\n ...processCreateParams(this._def),\n innerType: this,\n defaultValue: defaultValueFunc,\n typeName: ZodFirstPartyTypeKind.ZodDefault,\n });\n }\n brand() {\n return new ZodBranded({\n typeName: ZodFirstPartyTypeKind.ZodBranded,\n type: this,\n ...processCreateParams(this._def),\n });\n }\n catch(def) {\n const catchValueFunc = typeof def === \"function\" ? def : () => def;\n return new ZodCatch({\n ...processCreateParams(this._def),\n innerType: this,\n catchValue: catchValueFunc,\n typeName: ZodFirstPartyTypeKind.ZodCatch,\n });\n }\n describe(description) {\n const This = this.constructor;\n return new This({\n ...this._def,\n description,\n });\n }\n pipe(target) {\n return ZodPipeline.create(this, target);\n }\n isOptional() {\n return this.safeParse(undefined).success;\n }\n isNullable() {\n return this.safeParse(null).success;\n }\n}\nconst cuidRegex = /^c[^\\s-]{8,}$/i;\nconst cuid2Regex = /^[a-z][a-z0-9]*$/;\nconst ulidRegex = /[0-9A-HJKMNP-TV-Z]{26}/;\nconst uuidRegex = /^([a-f0-9]{8}-[a-f0-9]{4}-[1-5][a-f0-9]{3}-[a-f0-9]{4}-[a-f0-9]{12}|00000000-0000-0000-0000-000000000000)$/i;\n// from https://stackoverflow.com/a/46181/1550155\n// old version: too slow, didn't support unicode\n// const emailRegex = /^((([a-z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+(\\.([a-z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+)*)|((\\x22)((((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(([\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f]|\\x21|[\\x23-\\x5b]|[\\x5d-\\x7e]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(\\\\([\\x01-\\x09\\x0b\\x0c\\x0d-\\x7f]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]))))*(((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(\\x22)))@((([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\\.)+(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))$/i;\n//old email regex\n// const emailRegex = /^(([^<>()[\\].,;:\\s@\"]+(\\.[^<>()[\\].,;:\\s@\"]+)*)|(\".+\"))@((?!-)([^<>()[\\].,;:\\s@\"]+\\.)+[^<>()[\\].,;:\\s@\"]{1,})[^-<>()[\\].,;:\\s@\"]$/i;\n// eslint-disable-next-line\nconst emailRegex = /^(([^<>()[\\]\\\\.,;:\\s@\\\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\\\"]+)*)|(\\\".+\\\"))@((\\[(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\\])|(\\[IPv6:(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))\\])|([A-Za-z0-9]([A-Za-z0-9-]*[A-Za-z0-9])*(\\.[A-Za-z]{2,})+))$/;\n// from https://thekevinscott.com/emojis-in-javascript/#writing-a-regular-expression\nconst emojiRegex = /^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$/u;\nconst ipv4Regex = /^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/;\nconst ipv6Regex = /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/;\n// Adapted from https://stackoverflow.com/a/3143231\nconst datetimeRegex = (args) => {\n if (args.precision) {\n if (args.offset) {\n return new RegExp(`^\\\\d{4}-\\\\d{2}-\\\\d{2}T\\\\d{2}:\\\\d{2}:\\\\d{2}\\\\.\\\\d{${args.precision}}(([+-]\\\\d{2}(:?\\\\d{2})?)|Z)$`);\n }\n else {\n return new RegExp(`^\\\\d{4}-\\\\d{2}-\\\\d{2}T\\\\d{2}:\\\\d{2}:\\\\d{2}\\\\.\\\\d{${args.precision}}Z$`);\n }\n }\n else if (args.precision === 0) {\n if (args.offset) {\n return new RegExp(`^\\\\d{4}-\\\\d{2}-\\\\d{2}T\\\\d{2}:\\\\d{2}:\\\\d{2}(([+-]\\\\d{2}(:?\\\\d{2})?)|Z)$`);\n }\n else {\n return new RegExp(`^\\\\d{4}-\\\\d{2}-\\\\d{2}T\\\\d{2}:\\\\d{2}:\\\\d{2}Z$`);\n }\n }\n else {\n if (args.offset) {\n return new RegExp(`^\\\\d{4}-\\\\d{2}-\\\\d{2}T\\\\d{2}:\\\\d{2}:\\\\d{2}(\\\\.\\\\d+)?(([+-]\\\\d{2}(:?\\\\d{2})?)|Z)$`);\n }\n else {\n return new RegExp(`^\\\\d{4}-\\\\d{2}-\\\\d{2}T\\\\d{2}:\\\\d{2}:\\\\d{2}(\\\\.\\\\d+)?Z$`);\n }\n }\n};\nfunction isValidIP(ip, version) {\n if ((version === \"v4\" || !version) && ipv4Regex.test(ip)) {\n return true;\n }\n if ((version === \"v6\" || !version) && ipv6Regex.test(ip)) {\n return true;\n }\n return false;\n}\nclass ZodString extends ZodType {\n constructor() {\n super(...arguments);\n this._regex = (regex, validation, message) => this.refinement((data) => regex.test(data), {\n validation,\n code: ZodIssueCode.invalid_string,\n ...errorUtil.errToObj(message),\n });\n /**\n * @deprecated Use z.string().min(1) instead.\n * @see {@link ZodString.min}\n */\n this.nonempty = (message) => this.min(1, errorUtil.errToObj(message));\n this.trim = () => new ZodString({\n ...this._def,\n checks: [...this._def.checks, { kind: \"trim\" }],\n });\n this.toLowerCase = () => new ZodString({\n ...this._def,\n checks: [...this._def.checks, { kind: \"toLowerCase\" }],\n });\n this.toUpperCase = () => new ZodString({\n ...this._def,\n checks: [...this._def.checks, { kind: \"toUpperCase\" }],\n });\n }\n _parse(input) {\n if (this._def.coerce) {\n input.data = String(input.data);\n }\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.string) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.string,\n received: ctx.parsedType,\n }\n //\n );\n return INVALID;\n }\n const status = new ParseStatus();\n let ctx = undefined;\n for (const check of this._def.checks) {\n if (check.kind === \"min\") {\n if (input.data.length < check.value) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n minimum: check.value,\n type: \"string\",\n inclusive: true,\n exact: false,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"max\") {\n if (input.data.length > check.value) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n maximum: check.value,\n type: \"string\",\n inclusive: true,\n exact: false,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"length\") {\n const tooBig = input.data.length > check.value;\n const tooSmall = input.data.length < check.value;\n if (tooBig || tooSmall) {\n ctx = this._getOrReturnCtx(input, ctx);\n if (tooBig) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n maximum: check.value,\n type: \"string\",\n inclusive: true,\n exact: true,\n message: check.message,\n });\n }\n else if (tooSmall) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n minimum: check.value,\n type: \"string\",\n inclusive: true,\n exact: true,\n message: check.message,\n });\n }\n status.dirty();\n }\n }\n else if (check.kind === \"email\") {\n if (!emailRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"email\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"emoji\") {\n if (!emojiRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"emoji\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"uuid\") {\n if (!uuidRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"uuid\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"cuid\") {\n if (!cuidRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"cuid\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"cuid2\") {\n if (!cuid2Regex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"cuid2\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"ulid\") {\n if (!ulidRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"ulid\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"url\") {\n try {\n new URL(input.data);\n }\n catch (_a) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"url\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"regex\") {\n check.regex.lastIndex = 0;\n const testResult = check.regex.test(input.data);\n if (!testResult) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"regex\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"trim\") {\n input.data = input.data.trim();\n }\n else if (check.kind === \"includes\") {\n if (!input.data.includes(check.value, check.position)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_string,\n validation: { includes: check.value, position: check.position },\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"toLowerCase\") {\n input.data = input.data.toLowerCase();\n }\n else if (check.kind === \"toUpperCase\") {\n input.data = input.data.toUpperCase();\n }\n else if (check.kind === \"startsWith\") {\n if (!input.data.startsWith(check.value)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_string,\n validation: { startsWith: check.value },\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"endsWith\") {\n if (!input.data.endsWith(check.value)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_string,\n validation: { endsWith: check.value },\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"datetime\") {\n const regex = datetimeRegex(check);\n if (!regex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_string,\n validation: \"datetime\",\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"ip\") {\n if (!isValidIP(input.data, check.version)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"ip\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else {\n util.assertNever(check);\n }\n }\n return { status: status.value, value: input.data };\n }\n _addCheck(check) {\n return new ZodString({\n ...this._def,\n checks: [...this._def.checks, check],\n });\n }\n email(message) {\n return this._addCheck({ kind: \"email\", ...errorUtil.errToObj(message) });\n }\n url(message) {\n return this._addCheck({ kind: \"url\", ...errorUtil.errToObj(message) });\n }\n emoji(message) {\n return this._addCheck({ kind: \"emoji\", ...errorUtil.errToObj(message) });\n }\n uuid(message) {\n return this._addCheck({ kind: \"uuid\", ...errorUtil.errToObj(message) });\n }\n cuid(message) {\n return this._addCheck({ kind: \"cuid\", ...errorUtil.errToObj(message) });\n }\n cuid2(message) {\n return this._addCheck({ kind: \"cuid2\", ...errorUtil.errToObj(message) });\n }\n ulid(message) {\n return this._addCheck({ kind: \"ulid\", ...errorUtil.errToObj(message) });\n }\n ip(options) {\n return this._addCheck({ kind: \"ip\", ...errorUtil.errToObj(options) });\n }\n datetime(options) {\n var _a;\n if (typeof options === \"string\") {\n return this._addCheck({\n kind: \"datetime\",\n precision: null,\n offset: false,\n message: options,\n });\n }\n return this._addCheck({\n kind: \"datetime\",\n precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === \"undefined\" ? null : options === null || options === void 0 ? void 0 : options.precision,\n offset: (_a = options === null || options === void 0 ? void 0 : options.offset) !== null && _a !== void 0 ? _a : false,\n ...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message),\n });\n }\n regex(regex, message) {\n return this._addCheck({\n kind: \"regex\",\n regex: regex,\n ...errorUtil.errToObj(message),\n });\n }\n includes(value, options) {\n return this._addCheck({\n kind: \"includes\",\n value: value,\n position: options === null || options === void 0 ? void 0 : options.position,\n ...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message),\n });\n }\n startsWith(value, message) {\n return this._addCheck({\n kind: \"startsWith\",\n value: value,\n ...errorUtil.errToObj(message),\n });\n }\n endsWith(value, message) {\n return this._addCheck({\n kind: \"endsWith\",\n value: value,\n ...errorUtil.errToObj(message),\n });\n }\n min(minLength, message) {\n return this._addCheck({\n kind: \"min\",\n value: minLength,\n ...errorUtil.errToObj(message),\n });\n }\n max(maxLength, message) {\n return this._addCheck({\n kind: \"max\",\n value: maxLength,\n ...errorUtil.errToObj(message),\n });\n }\n length(len, message) {\n return this._addCheck({\n kind: \"length\",\n value: len,\n ...errorUtil.errToObj(message),\n });\n }\n get isDatetime() {\n return !!this._def.checks.find((ch) => ch.kind === \"datetime\");\n }\n get isEmail() {\n return !!this._def.checks.find((ch) => ch.kind === \"email\");\n }\n get isURL() {\n return !!this._def.checks.find((ch) => ch.kind === \"url\");\n }\n get isEmoji() {\n return !!this._def.checks.find((ch) => ch.kind === \"emoji\");\n }\n get isUUID() {\n return !!this._def.checks.find((ch) => ch.kind === \"uuid\");\n }\n get isCUID() {\n return !!this._def.checks.find((ch) => ch.kind === \"cuid\");\n }\n get isCUID2() {\n return !!this._def.checks.find((ch) => ch.kind === \"cuid2\");\n }\n get isULID() {\n return !!this._def.checks.find((ch) => ch.kind === \"ulid\");\n }\n get isIP() {\n return !!this._def.checks.find((ch) => ch.kind === \"ip\");\n }\n get minLength() {\n let min = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"min\") {\n if (min === null || ch.value > min)\n min = ch.value;\n }\n }\n return min;\n }\n get maxLength() {\n let max = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"max\") {\n if (max === null || ch.value < max)\n max = ch.value;\n }\n }\n return max;\n }\n}\nZodString.create = (params) => {\n var _a;\n return new ZodString({\n checks: [],\n typeName: ZodFirstPartyTypeKind.ZodString,\n coerce: (_a = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a !== void 0 ? _a : false,\n ...processCreateParams(params),\n });\n};\n// https://stackoverflow.com/questions/3966484/why-does-modulus-operator-return-fractional-number-in-javascript/31711034#31711034\nfunction floatSafeRemainder(val, step) {\n const valDecCount = (val.toString().split(\".\")[1] || \"\").length;\n const stepDecCount = (step.toString().split(\".\")[1] || \"\").length;\n const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;\n const valInt = parseInt(val.toFixed(decCount).replace(\".\", \"\"));\n const stepInt = parseInt(step.toFixed(decCount).replace(\".\", \"\"));\n return (valInt % stepInt) / Math.pow(10, decCount);\n}\nclass ZodNumber extends ZodType {\n constructor() {\n super(...arguments);\n this.min = this.gte;\n this.max = this.lte;\n this.step = this.multipleOf;\n }\n _parse(input) {\n if (this._def.coerce) {\n input.data = Number(input.data);\n }\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.number) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.number,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n let ctx = undefined;\n const status = new ParseStatus();\n for (const check of this._def.checks) {\n if (check.kind === \"int\") {\n if (!util.isInteger(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: \"integer\",\n received: \"float\",\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"min\") {\n const tooSmall = check.inclusive\n ? input.data < check.value\n : input.data <= check.value;\n if (tooSmall) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n minimum: check.value,\n type: \"number\",\n inclusive: check.inclusive,\n exact: false,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"max\") {\n const tooBig = check.inclusive\n ? input.data > check.value\n : input.data >= check.value;\n if (tooBig) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n maximum: check.value,\n type: \"number\",\n inclusive: check.inclusive,\n exact: false,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"multipleOf\") {\n if (floatSafeRemainder(input.data, check.value) !== 0) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.not_multiple_of,\n multipleOf: check.value,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"finite\") {\n if (!Number.isFinite(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.not_finite,\n message: check.message,\n });\n status.dirty();\n }\n }\n else {\n util.assertNever(check);\n }\n }\n return { status: status.value, value: input.data };\n }\n gte(value, message) {\n return this.setLimit(\"min\", value, true, errorUtil.toString(message));\n }\n gt(value, message) {\n return this.setLimit(\"min\", value, false, errorUtil.toString(message));\n }\n lte(value, message) {\n return this.setLimit(\"max\", value, true, errorUtil.toString(message));\n }\n lt(value, message) {\n return this.setLimit(\"max\", value, false, errorUtil.toString(message));\n }\n setLimit(kind, value, inclusive, message) {\n return new ZodNumber({\n ...this._def,\n checks: [\n ...this._def.checks,\n {\n kind,\n value,\n inclusive,\n message: errorUtil.toString(message),\n },\n ],\n });\n }\n _addCheck(check) {\n return new ZodNumber({\n ...this._def,\n checks: [...this._def.checks, check],\n });\n }\n int(message) {\n return this._addCheck({\n kind: \"int\",\n message: errorUtil.toString(message),\n });\n }\n positive(message) {\n return this._addCheck({\n kind: \"min\",\n value: 0,\n inclusive: false,\n message: errorUtil.toString(message),\n });\n }\n negative(message) {\n return this._addCheck({\n kind: \"max\",\n value: 0,\n inclusive: false,\n message: errorUtil.toString(message),\n });\n }\n nonpositive(message) {\n return this._addCheck({\n kind: \"max\",\n value: 0,\n inclusive: true,\n message: errorUtil.toString(message),\n });\n }\n nonnegative(message) {\n return this._addCheck({\n kind: \"min\",\n value: 0,\n inclusive: true,\n message: errorUtil.toString(message),\n });\n }\n multipleOf(value, message) {\n return this._addCheck({\n kind: \"multipleOf\",\n value: value,\n message: errorUtil.toString(message),\n });\n }\n finite(message) {\n return this._addCheck({\n kind: \"finite\",\n message: errorUtil.toString(message),\n });\n }\n safe(message) {\n return this._addCheck({\n kind: \"min\",\n inclusive: true,\n value: Number.MIN_SAFE_INTEGER,\n message: errorUtil.toString(message),\n })._addCheck({\n kind: \"max\",\n inclusive: true,\n value: Number.MAX_SAFE_INTEGER,\n message: errorUtil.toString(message),\n });\n }\n get minValue() {\n let min = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"min\") {\n if (min === null || ch.value > min)\n min = ch.value;\n }\n }\n return min;\n }\n get maxValue() {\n let max = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"max\") {\n if (max === null || ch.value < max)\n max = ch.value;\n }\n }\n return max;\n }\n get isInt() {\n return !!this._def.checks.find((ch) => ch.kind === \"int\" ||\n (ch.kind === \"multipleOf\" && util.isInteger(ch.value)));\n }\n get isFinite() {\n let max = null, min = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"finite\" ||\n ch.kind === \"int\" ||\n ch.kind === \"multipleOf\") {\n return true;\n }\n else if (ch.kind === \"min\") {\n if (min === null || ch.value > min)\n min = ch.value;\n }\n else if (ch.kind === \"max\") {\n if (max === null || ch.value < max)\n max = ch.value;\n }\n }\n return Number.isFinite(min) && Number.isFinite(max);\n }\n}\nZodNumber.create = (params) => {\n return new ZodNumber({\n checks: [],\n typeName: ZodFirstPartyTypeKind.ZodNumber,\n coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,\n ...processCreateParams(params),\n });\n};\nclass ZodBigInt extends ZodType {\n constructor() {\n super(...arguments);\n this.min = this.gte;\n this.max = this.lte;\n }\n _parse(input) {\n if (this._def.coerce) {\n input.data = BigInt(input.data);\n }\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.bigint) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.bigint,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n let ctx = undefined;\n const status = new ParseStatus();\n for (const check of this._def.checks) {\n if (check.kind === \"min\") {\n const tooSmall = check.inclusive\n ? input.data < check.value\n : input.data <= check.value;\n if (tooSmall) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n type: \"bigint\",\n minimum: check.value,\n inclusive: check.inclusive,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"max\") {\n const tooBig = check.inclusive\n ? input.data > check.value\n : input.data >= check.value;\n if (tooBig) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n type: \"bigint\",\n maximum: check.value,\n inclusive: check.inclusive,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"multipleOf\") {\n if (input.data % check.value !== BigInt(0)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.not_multiple_of,\n multipleOf: check.value,\n message: check.message,\n });\n status.dirty();\n }\n }\n else {\n util.assertNever(check);\n }\n }\n return { status: status.value, value: input.data };\n }\n gte(value, message) {\n return this.setLimit(\"min\", value, true, errorUtil.toString(message));\n }\n gt(value, message) {\n return this.setLimit(\"min\", value, false, errorUtil.toString(message));\n }\n lte(value, message) {\n return this.setLimit(\"max\", value, true, errorUtil.toString(message));\n }\n lt(value, message) {\n return this.setLimit(\"max\", value, false, errorUtil.toString(message));\n }\n setLimit(kind, value, inclusive, message) {\n return new ZodBigInt({\n ...this._def,\n checks: [\n ...this._def.checks,\n {\n kind,\n value,\n inclusive,\n message: errorUtil.toString(message),\n },\n ],\n });\n }\n _addCheck(check) {\n return new ZodBigInt({\n ...this._def,\n checks: [...this._def.checks, check],\n });\n }\n positive(message) {\n return this._addCheck({\n kind: \"min\",\n value: BigInt(0),\n inclusive: false,\n message: errorUtil.toString(message),\n });\n }\n negative(message) {\n return this._addCheck({\n kind: \"max\",\n value: BigInt(0),\n inclusive: false,\n message: errorUtil.toString(message),\n });\n }\n nonpositive(message) {\n return this._addCheck({\n kind: \"max\",\n value: BigInt(0),\n inclusive: true,\n message: errorUtil.toString(message),\n });\n }\n nonnegative(message) {\n return this._addCheck({\n kind: \"min\",\n value: BigInt(0),\n inclusive: true,\n message: errorUtil.toString(message),\n });\n }\n multipleOf(value, message) {\n return this._addCheck({\n kind: \"multipleOf\",\n value,\n message: errorUtil.toString(message),\n });\n }\n get minValue() {\n let min = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"min\") {\n if (min === null || ch.value > min)\n min = ch.value;\n }\n }\n return min;\n }\n get maxValue() {\n let max = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"max\") {\n if (max === null || ch.value < max)\n max = ch.value;\n }\n }\n return max;\n }\n}\nZodBigInt.create = (params) => {\n var _a;\n return new ZodBigInt({\n checks: [],\n typeName: ZodFirstPartyTypeKind.ZodBigInt,\n coerce: (_a = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a !== void 0 ? _a : false,\n ...processCreateParams(params),\n });\n};\nclass ZodBoolean extends ZodType {\n _parse(input) {\n if (this._def.coerce) {\n input.data = Boolean(input.data);\n }\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.boolean) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.boolean,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n return OK(input.data);\n }\n}\nZodBoolean.create = (params) => {\n return new ZodBoolean({\n typeName: ZodFirstPartyTypeKind.ZodBoolean,\n coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,\n ...processCreateParams(params),\n });\n};\nclass ZodDate extends ZodType {\n _parse(input) {\n if (this._def.coerce) {\n input.data = new Date(input.data);\n }\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.date) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.date,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n if (isNaN(input.data.getTime())) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_date,\n });\n return INVALID;\n }\n const status = new ParseStatus();\n let ctx = undefined;\n for (const check of this._def.checks) {\n if (check.kind === \"min\") {\n if (input.data.getTime() < check.value) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n message: check.message,\n inclusive: true,\n exact: false,\n minimum: check.value,\n type: \"date\",\n });\n status.dirty();\n }\n }\n else if (check.kind === \"max\") {\n if (input.data.getTime() > check.value) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n message: check.message,\n inclusive: true,\n exact: false,\n maximum: check.value,\n type: \"date\",\n });\n status.dirty();\n }\n }\n else {\n util.assertNever(check);\n }\n }\n return {\n status: status.value,\n value: new Date(input.data.getTime()),\n };\n }\n _addCheck(check) {\n return new ZodDate({\n ...this._def,\n checks: [...this._def.checks, check],\n });\n }\n min(minDate, message) {\n return this._addCheck({\n kind: \"min\",\n value: minDate.getTime(),\n message: errorUtil.toString(message),\n });\n }\n max(maxDate, message) {\n return this._addCheck({\n kind: \"max\",\n value: maxDate.getTime(),\n message: errorUtil.toString(message),\n });\n }\n get minDate() {\n let min = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"min\") {\n if (min === null || ch.value > min)\n min = ch.value;\n }\n }\n return min != null ? new Date(min) : null;\n }\n get maxDate() {\n let max = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"max\") {\n if (max === null || ch.value < max)\n max = ch.value;\n }\n }\n return max != null ? new Date(max) : null;\n }\n}\nZodDate.create = (params) => {\n return new ZodDate({\n checks: [],\n coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,\n typeName: ZodFirstPartyTypeKind.ZodDate,\n ...processCreateParams(params),\n });\n};\nclass ZodSymbol extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.symbol) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.symbol,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n return OK(input.data);\n }\n}\nZodSymbol.create = (params) => {\n return new ZodSymbol({\n typeName: ZodFirstPartyTypeKind.ZodSymbol,\n ...processCreateParams(params),\n });\n};\nclass ZodUndefined extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.undefined) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.undefined,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n return OK(input.data);\n }\n}\nZodUndefined.create = (params) => {\n return new ZodUndefined({\n typeName: ZodFirstPartyTypeKind.ZodUndefined,\n ...processCreateParams(params),\n });\n};\nclass ZodNull extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.null) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.null,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n return OK(input.data);\n }\n}\nZodNull.create = (params) => {\n return new ZodNull({\n typeName: ZodFirstPartyTypeKind.ZodNull,\n ...processCreateParams(params),\n });\n};\nclass ZodAny extends ZodType {\n constructor() {\n super(...arguments);\n // to prevent instances of other classes from extending ZodAny. this causes issues with catchall in ZodObject.\n this._any = true;\n }\n _parse(input) {\n return OK(input.data);\n }\n}\nZodAny.create = (params) => {\n return new ZodAny({\n typeName: ZodFirstPartyTypeKind.ZodAny,\n ...processCreateParams(params),\n });\n};\nclass ZodUnknown extends ZodType {\n constructor() {\n super(...arguments);\n // required\n this._unknown = true;\n }\n _parse(input) {\n return OK(input.data);\n }\n}\nZodUnknown.create = (params) => {\n return new ZodUnknown({\n typeName: ZodFirstPartyTypeKind.ZodUnknown,\n ...processCreateParams(params),\n });\n};\nclass ZodNever extends ZodType {\n _parse(input) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.never,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n}\nZodNever.create = (params) => {\n return new ZodNever({\n typeName: ZodFirstPartyTypeKind.ZodNever,\n ...processCreateParams(params),\n });\n};\nclass ZodVoid extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.undefined) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.void,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n return OK(input.data);\n }\n}\nZodVoid.create = (params) => {\n return new ZodVoid({\n typeName: ZodFirstPartyTypeKind.ZodVoid,\n ...processCreateParams(params),\n });\n};\nclass ZodArray extends ZodType {\n _parse(input) {\n const { ctx, status } = this._processInputParams(input);\n const def = this._def;\n if (ctx.parsedType !== ZodParsedType.array) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.array,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n if (def.exactLength !== null) {\n const tooBig = ctx.data.length > def.exactLength.value;\n const tooSmall = ctx.data.length < def.exactLength.value;\n if (tooBig || tooSmall) {\n addIssueToContext(ctx, {\n code: tooBig ? ZodIssueCode.too_big : ZodIssueCode.too_small,\n minimum: (tooSmall ? def.exactLength.value : undefined),\n maximum: (tooBig ? def.exactLength.value : undefined),\n type: \"array\",\n inclusive: true,\n exact: true,\n message: def.exactLength.message,\n });\n status.dirty();\n }\n }\n if (def.minLength !== null) {\n if (ctx.data.length < def.minLength.value) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n minimum: def.minLength.value,\n type: \"array\",\n inclusive: true,\n exact: false,\n message: def.minLength.message,\n });\n status.dirty();\n }\n }\n if (def.maxLength !== null) {\n if (ctx.data.length > def.maxLength.value) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n maximum: def.maxLength.value,\n type: \"array\",\n inclusive: true,\n exact: false,\n message: def.maxLength.message,\n });\n status.dirty();\n }\n }\n if (ctx.common.async) {\n return Promise.all([...ctx.data].map((item, i) => {\n return def.type._parseAsync(new ParseInputLazyPath(ctx, item, ctx.path, i));\n })).then((result) => {\n return ParseStatus.mergeArray(status, result);\n });\n }\n const result = [...ctx.data].map((item, i) => {\n return def.type._parseSync(new ParseInputLazyPath(ctx, item, ctx.path, i));\n });\n return ParseStatus.mergeArray(status, result);\n }\n get element() {\n return this._def.type;\n }\n min(minLength, message) {\n return new ZodArray({\n ...this._def,\n minLength: { value: minLength, message: errorUtil.toString(message) },\n });\n }\n max(maxLength, message) {\n return new ZodArray({\n ...this._def,\n maxLength: { value: maxLength, message: errorUtil.toString(message) },\n });\n }\n length(len, message) {\n return new ZodArray({\n ...this._def,\n exactLength: { value: len, message: errorUtil.toString(message) },\n });\n }\n nonempty(message) {\n return this.min(1, message);\n }\n}\nZodArray.create = (schema, params) => {\n return new ZodArray({\n type: schema,\n minLength: null,\n maxLength: null,\n exactLength: null,\n typeName: ZodFirstPartyTypeKind.ZodArray,\n ...processCreateParams(params),\n });\n};\nfunction deepPartialify(schema) {\n if (schema instanceof ZodObject) {\n const newShape = {};\n for (const key in schema.shape) {\n const fieldSchema = schema.shape[key];\n newShape[key] = ZodOptional.create(deepPartialify(fieldSchema));\n }\n return new ZodObject({\n ...schema._def,\n shape: () => newShape,\n });\n }\n else if (schema instanceof ZodArray) {\n return new ZodArray({\n ...schema._def,\n type: deepPartialify(schema.element),\n });\n }\n else if (schema instanceof ZodOptional) {\n return ZodOptional.create(deepPartialify(schema.unwrap()));\n }\n else if (schema instanceof ZodNullable) {\n return ZodNullable.create(deepPartialify(schema.unwrap()));\n }\n else if (schema instanceof ZodTuple) {\n return ZodTuple.create(schema.items.map((item) => deepPartialify(item)));\n }\n else {\n return schema;\n }\n}\nclass ZodObject extends ZodType {\n constructor() {\n super(...arguments);\n this._cached = null;\n /**\n * @deprecated In most cases, this is no longer needed - unknown properties are now silently stripped.\n * If you want to pass through unknown properties, use `.passthrough()` instead.\n */\n this.nonstrict = this.passthrough;\n // extend<\n // Augmentation extends ZodRawShape,\n // NewOutput extends util.flatten<{\n // [k in keyof Augmentation | keyof Output]: k extends keyof Augmentation\n // ? Augmentation[k][\"_output\"]\n // : k extends keyof Output\n // ? Output[k]\n // : never;\n // }>,\n // NewInput extends util.flatten<{\n // [k in keyof Augmentation | keyof Input]: k extends keyof Augmentation\n // ? Augmentation[k][\"_input\"]\n // : k extends keyof Input\n // ? Input[k]\n // : never;\n // }>\n // >(\n // augmentation: Augmentation\n // ): ZodObject<\n // extendShape,\n // UnknownKeys,\n // Catchall,\n // NewOutput,\n // NewInput\n // > {\n // return new ZodObject({\n // ...this._def,\n // shape: () => ({\n // ...this._def.shape(),\n // ...augmentation,\n // }),\n // }) as any;\n // }\n /**\n * @deprecated Use `.extend` instead\n * */\n this.augment = this.extend;\n }\n _getCached() {\n if (this._cached !== null)\n return this._cached;\n const shape = this._def.shape();\n const keys = util.objectKeys(shape);\n return (this._cached = { shape, keys });\n }\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.object) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.object,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n const { status, ctx } = this._processInputParams(input);\n const { shape, keys: shapeKeys } = this._getCached();\n const extraKeys = [];\n if (!(this._def.catchall instanceof ZodNever &&\n this._def.unknownKeys === \"strip\")) {\n for (const key in ctx.data) {\n if (!shapeKeys.includes(key)) {\n extraKeys.push(key);\n }\n }\n }\n const pairs = [];\n for (const key of shapeKeys) {\n const keyValidator = shape[key];\n const value = ctx.data[key];\n pairs.push({\n key: { status: \"valid\", value: key },\n value: keyValidator._parse(new ParseInputLazyPath(ctx, value, ctx.path, key)),\n alwaysSet: key in ctx.data,\n });\n }\n if (this._def.catchall instanceof ZodNever) {\n const unknownKeys = this._def.unknownKeys;\n if (unknownKeys === \"passthrough\") {\n for (const key of extraKeys) {\n pairs.push({\n key: { status: \"valid\", value: key },\n value: { status: \"valid\", value: ctx.data[key] },\n });\n }\n }\n else if (unknownKeys === \"strict\") {\n if (extraKeys.length > 0) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.unrecognized_keys,\n keys: extraKeys,\n });\n status.dirty();\n }\n }\n else if (unknownKeys === \"strip\") ;\n else {\n throw new Error(`Internal ZodObject error: invalid unknownKeys value.`);\n }\n }\n else {\n // run catchall validation\n const catchall = this._def.catchall;\n for (const key of extraKeys) {\n const value = ctx.data[key];\n pairs.push({\n key: { status: \"valid\", value: key },\n value: catchall._parse(new ParseInputLazyPath(ctx, value, ctx.path, key) //, ctx.child(key), value, getParsedType(value)\n ),\n alwaysSet: key in ctx.data,\n });\n }\n }\n if (ctx.common.async) {\n return Promise.resolve()\n .then(async () => {\n const syncPairs = [];\n for (const pair of pairs) {\n const key = await pair.key;\n syncPairs.push({\n key,\n value: await pair.value,\n alwaysSet: pair.alwaysSet,\n });\n }\n return syncPairs;\n })\n .then((syncPairs) => {\n return ParseStatus.mergeObjectSync(status, syncPairs);\n });\n }\n else {\n return ParseStatus.mergeObjectSync(status, pairs);\n }\n }\n get shape() {\n return this._def.shape();\n }\n strict(message) {\n errorUtil.errToObj;\n return new ZodObject({\n ...this._def,\n unknownKeys: \"strict\",\n ...(message !== undefined\n ? {\n errorMap: (issue, ctx) => {\n var _a, _b, _c, _d;\n const defaultError = (_c = (_b = (_a = this._def).errorMap) === null || _b === void 0 ? void 0 : _b.call(_a, issue, ctx).message) !== null && _c !== void 0 ? _c : ctx.defaultError;\n if (issue.code === \"unrecognized_keys\")\n return {\n message: (_d = errorUtil.errToObj(message).message) !== null && _d !== void 0 ? _d : defaultError,\n };\n return {\n message: defaultError,\n };\n },\n }\n : {}),\n });\n }\n strip() {\n return new ZodObject({\n ...this._def,\n unknownKeys: \"strip\",\n });\n }\n passthrough() {\n return new ZodObject({\n ...this._def,\n unknownKeys: \"passthrough\",\n });\n }\n // const AugmentFactory =\n // (def: Def) =>\n // (\n // augmentation: Augmentation\n // ): ZodObject<\n // extendShape, Augmentation>,\n // Def[\"unknownKeys\"],\n // Def[\"catchall\"]\n // > => {\n // return new ZodObject({\n // ...def,\n // shape: () => ({\n // ...def.shape(),\n // ...augmentation,\n // }),\n // }) as any;\n // };\n extend(augmentation) {\n return new ZodObject({\n ...this._def,\n shape: () => ({\n ...this._def.shape(),\n ...augmentation,\n }),\n });\n }\n /**\n * Prior to zod@1.0.12 there was a bug in the\n * inferred type of merged objects. Please\n * upgrade if you are experiencing issues.\n */\n merge(merging) {\n const merged = new ZodObject({\n unknownKeys: merging._def.unknownKeys,\n catchall: merging._def.catchall,\n shape: () => ({\n ...this._def.shape(),\n ...merging._def.shape(),\n }),\n typeName: ZodFirstPartyTypeKind.ZodObject,\n });\n return merged;\n }\n // merge<\n // Incoming extends AnyZodObject,\n // Augmentation extends Incoming[\"shape\"],\n // NewOutput extends {\n // [k in keyof Augmentation | keyof Output]: k extends keyof Augmentation\n // ? Augmentation[k][\"_output\"]\n // : k extends keyof Output\n // ? Output[k]\n // : never;\n // },\n // NewInput extends {\n // [k in keyof Augmentation | keyof Input]: k extends keyof Augmentation\n // ? Augmentation[k][\"_input\"]\n // : k extends keyof Input\n // ? Input[k]\n // : never;\n // }\n // >(\n // merging: Incoming\n // ): ZodObject<\n // extendShape>,\n // Incoming[\"_def\"][\"unknownKeys\"],\n // Incoming[\"_def\"][\"catchall\"],\n // NewOutput,\n // NewInput\n // > {\n // const merged: any = new ZodObject({\n // unknownKeys: merging._def.unknownKeys,\n // catchall: merging._def.catchall,\n // shape: () =>\n // objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),\n // typeName: ZodFirstPartyTypeKind.ZodObject,\n // }) as any;\n // return merged;\n // }\n setKey(key, schema) {\n return this.augment({ [key]: schema });\n }\n // merge(\n // merging: Incoming\n // ): //ZodObject = (merging) => {\n // ZodObject<\n // extendShape>,\n // Incoming[\"_def\"][\"unknownKeys\"],\n // Incoming[\"_def\"][\"catchall\"]\n // > {\n // // const mergedShape = objectUtil.mergeShapes(\n // // this._def.shape(),\n // // merging._def.shape()\n // // );\n // const merged: any = new ZodObject({\n // unknownKeys: merging._def.unknownKeys,\n // catchall: merging._def.catchall,\n // shape: () =>\n // objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),\n // typeName: ZodFirstPartyTypeKind.ZodObject,\n // }) as any;\n // return merged;\n // }\n catchall(index) {\n return new ZodObject({\n ...this._def,\n catchall: index,\n });\n }\n pick(mask) {\n const shape = {};\n util.objectKeys(mask).forEach((key) => {\n if (mask[key] && this.shape[key]) {\n shape[key] = this.shape[key];\n }\n });\n return new ZodObject({\n ...this._def,\n shape: () => shape,\n });\n }\n omit(mask) {\n const shape = {};\n util.objectKeys(this.shape).forEach((key) => {\n if (!mask[key]) {\n shape[key] = this.shape[key];\n }\n });\n return new ZodObject({\n ...this._def,\n shape: () => shape,\n });\n }\n /**\n * @deprecated\n */\n deepPartial() {\n return deepPartialify(this);\n }\n partial(mask) {\n const newShape = {};\n util.objectKeys(this.shape).forEach((key) => {\n const fieldSchema = this.shape[key];\n if (mask && !mask[key]) {\n newShape[key] = fieldSchema;\n }\n else {\n newShape[key] = fieldSchema.optional();\n }\n });\n return new ZodObject({\n ...this._def,\n shape: () => newShape,\n });\n }\n required(mask) {\n const newShape = {};\n util.objectKeys(this.shape).forEach((key) => {\n if (mask && !mask[key]) {\n newShape[key] = this.shape[key];\n }\n else {\n const fieldSchema = this.shape[key];\n let newField = fieldSchema;\n while (newField instanceof ZodOptional) {\n newField = newField._def.innerType;\n }\n newShape[key] = newField;\n }\n });\n return new ZodObject({\n ...this._def,\n shape: () => newShape,\n });\n }\n keyof() {\n return createZodEnum(util.objectKeys(this.shape));\n }\n}\nZodObject.create = (shape, params) => {\n return new ZodObject({\n shape: () => shape,\n unknownKeys: \"strip\",\n catchall: ZodNever.create(),\n typeName: ZodFirstPartyTypeKind.ZodObject,\n ...processCreateParams(params),\n });\n};\nZodObject.strictCreate = (shape, params) => {\n return new ZodObject({\n shape: () => shape,\n unknownKeys: \"strict\",\n catchall: ZodNever.create(),\n typeName: ZodFirstPartyTypeKind.ZodObject,\n ...processCreateParams(params),\n });\n};\nZodObject.lazycreate = (shape, params) => {\n return new ZodObject({\n shape,\n unknownKeys: \"strip\",\n catchall: ZodNever.create(),\n typeName: ZodFirstPartyTypeKind.ZodObject,\n ...processCreateParams(params),\n });\n};\nclass ZodUnion extends ZodType {\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n const options = this._def.options;\n function handleResults(results) {\n // return first issue-free validation if it exists\n for (const result of results) {\n if (result.result.status === \"valid\") {\n return result.result;\n }\n }\n for (const result of results) {\n if (result.result.status === \"dirty\") {\n // add issues from dirty option\n ctx.common.issues.push(...result.ctx.common.issues);\n return result.result;\n }\n }\n // return invalid\n const unionErrors = results.map((result) => new ZodError(result.ctx.common.issues));\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_union,\n unionErrors,\n });\n return INVALID;\n }\n if (ctx.common.async) {\n return Promise.all(options.map(async (option) => {\n const childCtx = {\n ...ctx,\n common: {\n ...ctx.common,\n issues: [],\n },\n parent: null,\n };\n return {\n result: await option._parseAsync({\n data: ctx.data,\n path: ctx.path,\n parent: childCtx,\n }),\n ctx: childCtx,\n };\n })).then(handleResults);\n }\n else {\n let dirty = undefined;\n const issues = [];\n for (const option of options) {\n const childCtx = {\n ...ctx,\n common: {\n ...ctx.common,\n issues: [],\n },\n parent: null,\n };\n const result = option._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: childCtx,\n });\n if (result.status === \"valid\") {\n return result;\n }\n else if (result.status === \"dirty\" && !dirty) {\n dirty = { result, ctx: childCtx };\n }\n if (childCtx.common.issues.length) {\n issues.push(childCtx.common.issues);\n }\n }\n if (dirty) {\n ctx.common.issues.push(...dirty.ctx.common.issues);\n return dirty.result;\n }\n const unionErrors = issues.map((issues) => new ZodError(issues));\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_union,\n unionErrors,\n });\n return INVALID;\n }\n }\n get options() {\n return this._def.options;\n }\n}\nZodUnion.create = (types, params) => {\n return new ZodUnion({\n options: types,\n typeName: ZodFirstPartyTypeKind.ZodUnion,\n ...processCreateParams(params),\n });\n};\n/////////////////////////////////////////////////////\n/////////////////////////////////////////////////////\n////////// //////////\n////////// ZodDiscriminatedUnion //////////\n////////// //////////\n/////////////////////////////////////////////////////\n/////////////////////////////////////////////////////\nconst getDiscriminator = (type) => {\n if (type instanceof ZodLazy) {\n return getDiscriminator(type.schema);\n }\n else if (type instanceof ZodEffects) {\n return getDiscriminator(type.innerType());\n }\n else if (type instanceof ZodLiteral) {\n return [type.value];\n }\n else if (type instanceof ZodEnum) {\n return type.options;\n }\n else if (type instanceof ZodNativeEnum) {\n // eslint-disable-next-line ban/ban\n return Object.keys(type.enum);\n }\n else if (type instanceof ZodDefault) {\n return getDiscriminator(type._def.innerType);\n }\n else if (type instanceof ZodUndefined) {\n return [undefined];\n }\n else if (type instanceof ZodNull) {\n return [null];\n }\n else {\n return null;\n }\n};\nclass ZodDiscriminatedUnion extends ZodType {\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n if (ctx.parsedType !== ZodParsedType.object) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.object,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n const discriminator = this.discriminator;\n const discriminatorValue = ctx.data[discriminator];\n const option = this.optionsMap.get(discriminatorValue);\n if (!option) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_union_discriminator,\n options: Array.from(this.optionsMap.keys()),\n path: [discriminator],\n });\n return INVALID;\n }\n if (ctx.common.async) {\n return option._parseAsync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n });\n }\n else {\n return option._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n });\n }\n }\n get discriminator() {\n return this._def.discriminator;\n }\n get options() {\n return this._def.options;\n }\n get optionsMap() {\n return this._def.optionsMap;\n }\n /**\n * The constructor of the discriminated union schema. Its behaviour is very similar to that of the normal z.union() constructor.\n * However, it only allows a union of objects, all of which need to share a discriminator property. This property must\n * have a different value for each object in the union.\n * @param discriminator the name of the discriminator property\n * @param types an array of object schemas\n * @param params\n */\n static create(discriminator, options, params) {\n // Get all the valid discriminator values\n const optionsMap = new Map();\n // try {\n for (const type of options) {\n const discriminatorValues = getDiscriminator(type.shape[discriminator]);\n if (!discriminatorValues) {\n throw new Error(`A discriminator value for key \\`${discriminator}\\` could not be extracted from all schema options`);\n }\n for (const value of discriminatorValues) {\n if (optionsMap.has(value)) {\n throw new Error(`Discriminator property ${String(discriminator)} has duplicate value ${String(value)}`);\n }\n optionsMap.set(value, type);\n }\n }\n return new ZodDiscriminatedUnion({\n typeName: ZodFirstPartyTypeKind.ZodDiscriminatedUnion,\n discriminator,\n options,\n optionsMap,\n ...processCreateParams(params),\n });\n }\n}\nfunction mergeValues(a, b) {\n const aType = getParsedType(a);\n const bType = getParsedType(b);\n if (a === b) {\n return { valid: true, data: a };\n }\n else if (aType === ZodParsedType.object && bType === ZodParsedType.object) {\n const bKeys = util.objectKeys(b);\n const sharedKeys = util\n .objectKeys(a)\n .filter((key) => bKeys.indexOf(key) !== -1);\n const newObj = { ...a, ...b };\n for (const key of sharedKeys) {\n const sharedValue = mergeValues(a[key], b[key]);\n if (!sharedValue.valid) {\n return { valid: false };\n }\n newObj[key] = sharedValue.data;\n }\n return { valid: true, data: newObj };\n }\n else if (aType === ZodParsedType.array && bType === ZodParsedType.array) {\n if (a.length !== b.length) {\n return { valid: false };\n }\n const newArray = [];\n for (let index = 0; index < a.length; index++) {\n const itemA = a[index];\n const itemB = b[index];\n const sharedValue = mergeValues(itemA, itemB);\n if (!sharedValue.valid) {\n return { valid: false };\n }\n newArray.push(sharedValue.data);\n }\n return { valid: true, data: newArray };\n }\n else if (aType === ZodParsedType.date &&\n bType === ZodParsedType.date &&\n +a === +b) {\n return { valid: true, data: a };\n }\n else {\n return { valid: false };\n }\n}\nclass ZodIntersection extends ZodType {\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n const handleParsed = (parsedLeft, parsedRight) => {\n if (isAborted(parsedLeft) || isAborted(parsedRight)) {\n return INVALID;\n }\n const merged = mergeValues(parsedLeft.value, parsedRight.value);\n if (!merged.valid) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_intersection_types,\n });\n return INVALID;\n }\n if (isDirty(parsedLeft) || isDirty(parsedRight)) {\n status.dirty();\n }\n return { status: status.value, value: merged.data };\n };\n if (ctx.common.async) {\n return Promise.all([\n this._def.left._parseAsync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n }),\n this._def.right._parseAsync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n }),\n ]).then(([left, right]) => handleParsed(left, right));\n }\n else {\n return handleParsed(this._def.left._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n }), this._def.right._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n }));\n }\n }\n}\nZodIntersection.create = (left, right, params) => {\n return new ZodIntersection({\n left: left,\n right: right,\n typeName: ZodFirstPartyTypeKind.ZodIntersection,\n ...processCreateParams(params),\n });\n};\nclass ZodTuple extends ZodType {\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n if (ctx.parsedType !== ZodParsedType.array) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.array,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n if (ctx.data.length < this._def.items.length) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n minimum: this._def.items.length,\n inclusive: true,\n exact: false,\n type: \"array\",\n });\n return INVALID;\n }\n const rest = this._def.rest;\n if (!rest && ctx.data.length > this._def.items.length) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n maximum: this._def.items.length,\n inclusive: true,\n exact: false,\n type: \"array\",\n });\n status.dirty();\n }\n const items = [...ctx.data]\n .map((item, itemIndex) => {\n const schema = this._def.items[itemIndex] || this._def.rest;\n if (!schema)\n return null;\n return schema._parse(new ParseInputLazyPath(ctx, item, ctx.path, itemIndex));\n })\n .filter((x) => !!x); // filter nulls\n if (ctx.common.async) {\n return Promise.all(items).then((results) => {\n return ParseStatus.mergeArray(status, results);\n });\n }\n else {\n return ParseStatus.mergeArray(status, items);\n }\n }\n get items() {\n return this._def.items;\n }\n rest(rest) {\n return new ZodTuple({\n ...this._def,\n rest,\n });\n }\n}\nZodTuple.create = (schemas, params) => {\n if (!Array.isArray(schemas)) {\n throw new Error(\"You must pass an array of schemas to z.tuple([ ... ])\");\n }\n return new ZodTuple({\n items: schemas,\n typeName: ZodFirstPartyTypeKind.ZodTuple,\n rest: null,\n ...processCreateParams(params),\n });\n};\nclass ZodRecord extends ZodType {\n get keySchema() {\n return this._def.keyType;\n }\n get valueSchema() {\n return this._def.valueType;\n }\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n if (ctx.parsedType !== ZodParsedType.object) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.object,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n const pairs = [];\n const keyType = this._def.keyType;\n const valueType = this._def.valueType;\n for (const key in ctx.data) {\n pairs.push({\n key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, key)),\n value: valueType._parse(new ParseInputLazyPath(ctx, ctx.data[key], ctx.path, key)),\n });\n }\n if (ctx.common.async) {\n return ParseStatus.mergeObjectAsync(status, pairs);\n }\n else {\n return ParseStatus.mergeObjectSync(status, pairs);\n }\n }\n get element() {\n return this._def.valueType;\n }\n static create(first, second, third) {\n if (second instanceof ZodType) {\n return new ZodRecord({\n keyType: first,\n valueType: second,\n typeName: ZodFirstPartyTypeKind.ZodRecord,\n ...processCreateParams(third),\n });\n }\n return new ZodRecord({\n keyType: ZodString.create(),\n valueType: first,\n typeName: ZodFirstPartyTypeKind.ZodRecord,\n ...processCreateParams(second),\n });\n }\n}\nclass ZodMap extends ZodType {\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n if (ctx.parsedType !== ZodParsedType.map) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.map,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n const keyType = this._def.keyType;\n const valueType = this._def.valueType;\n const pairs = [...ctx.data.entries()].map(([key, value], index) => {\n return {\n key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, [index, \"key\"])),\n value: valueType._parse(new ParseInputLazyPath(ctx, value, ctx.path, [index, \"value\"])),\n };\n });\n if (ctx.common.async) {\n const finalMap = new Map();\n return Promise.resolve().then(async () => {\n for (const pair of pairs) {\n const key = await pair.key;\n const value = await pair.value;\n if (key.status === \"aborted\" || value.status === \"aborted\") {\n return INVALID;\n }\n if (key.status === \"dirty\" || value.status === \"dirty\") {\n status.dirty();\n }\n finalMap.set(key.value, value.value);\n }\n return { status: status.value, value: finalMap };\n });\n }\n else {\n const finalMap = new Map();\n for (const pair of pairs) {\n const key = pair.key;\n const value = pair.value;\n if (key.status === \"aborted\" || value.status === \"aborted\") {\n return INVALID;\n }\n if (key.status === \"dirty\" || value.status === \"dirty\") {\n status.dirty();\n }\n finalMap.set(key.value, value.value);\n }\n return { status: status.value, value: finalMap };\n }\n }\n}\nZodMap.create = (keyType, valueType, params) => {\n return new ZodMap({\n valueType,\n keyType,\n typeName: ZodFirstPartyTypeKind.ZodMap,\n ...processCreateParams(params),\n });\n};\nclass ZodSet extends ZodType {\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n if (ctx.parsedType !== ZodParsedType.set) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.set,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n const def = this._def;\n if (def.minSize !== null) {\n if (ctx.data.size < def.minSize.value) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n minimum: def.minSize.value,\n type: \"set\",\n inclusive: true,\n exact: false,\n message: def.minSize.message,\n });\n status.dirty();\n }\n }\n if (def.maxSize !== null) {\n if (ctx.data.size > def.maxSize.value) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n maximum: def.maxSize.value,\n type: \"set\",\n inclusive: true,\n exact: false,\n message: def.maxSize.message,\n });\n status.dirty();\n }\n }\n const valueType = this._def.valueType;\n function finalizeSet(elements) {\n const parsedSet = new Set();\n for (const element of elements) {\n if (element.status === \"aborted\")\n return INVALID;\n if (element.status === \"dirty\")\n status.dirty();\n parsedSet.add(element.value);\n }\n return { status: status.value, value: parsedSet };\n }\n const elements = [...ctx.data.values()].map((item, i) => valueType._parse(new ParseInputLazyPath(ctx, item, ctx.path, i)));\n if (ctx.common.async) {\n return Promise.all(elements).then((elements) => finalizeSet(elements));\n }\n else {\n return finalizeSet(elements);\n }\n }\n min(minSize, message) {\n return new ZodSet({\n ...this._def,\n minSize: { value: minSize, message: errorUtil.toString(message) },\n });\n }\n max(maxSize, message) {\n return new ZodSet({\n ...this._def,\n maxSize: { value: maxSize, message: errorUtil.toString(message) },\n });\n }\n size(size, message) {\n return this.min(size, message).max(size, message);\n }\n nonempty(message) {\n return this.min(1, message);\n }\n}\nZodSet.create = (valueType, params) => {\n return new ZodSet({\n valueType,\n minSize: null,\n maxSize: null,\n typeName: ZodFirstPartyTypeKind.ZodSet,\n ...processCreateParams(params),\n });\n};\nclass ZodFunction extends ZodType {\n constructor() {\n super(...arguments);\n this.validate = this.implement;\n }\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n if (ctx.parsedType !== ZodParsedType.function) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.function,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n function makeArgsIssue(args, error) {\n return makeIssue({\n data: args,\n path: ctx.path,\n errorMaps: [\n ctx.common.contextualErrorMap,\n ctx.schemaErrorMap,\n getErrorMap(),\n errorMap,\n ].filter((x) => !!x),\n issueData: {\n code: ZodIssueCode.invalid_arguments,\n argumentsError: error,\n },\n });\n }\n function makeReturnsIssue(returns, error) {\n return makeIssue({\n data: returns,\n path: ctx.path,\n errorMaps: [\n ctx.common.contextualErrorMap,\n ctx.schemaErrorMap,\n getErrorMap(),\n errorMap,\n ].filter((x) => !!x),\n issueData: {\n code: ZodIssueCode.invalid_return_type,\n returnTypeError: error,\n },\n });\n }\n const params = { errorMap: ctx.common.contextualErrorMap };\n const fn = ctx.data;\n if (this._def.returns instanceof ZodPromise) {\n return OK(async (...args) => {\n const error = new ZodError([]);\n const parsedArgs = await this._def.args\n .parseAsync(args, params)\n .catch((e) => {\n error.addIssue(makeArgsIssue(args, e));\n throw error;\n });\n const result = await fn(...parsedArgs);\n const parsedReturns = await this._def.returns._def.type\n .parseAsync(result, params)\n .catch((e) => {\n error.addIssue(makeReturnsIssue(result, e));\n throw error;\n });\n return parsedReturns;\n });\n }\n else {\n return OK((...args) => {\n const parsedArgs = this._def.args.safeParse(args, params);\n if (!parsedArgs.success) {\n throw new ZodError([makeArgsIssue(args, parsedArgs.error)]);\n }\n const result = fn(...parsedArgs.data);\n const parsedReturns = this._def.returns.safeParse(result, params);\n if (!parsedReturns.success) {\n throw new ZodError([makeReturnsIssue(result, parsedReturns.error)]);\n }\n return parsedReturns.data;\n });\n }\n }\n parameters() {\n return this._def.args;\n }\n returnType() {\n return this._def.returns;\n }\n args(...items) {\n return new ZodFunction({\n ...this._def,\n args: ZodTuple.create(items).rest(ZodUnknown.create()),\n });\n }\n returns(returnType) {\n return new ZodFunction({\n ...this._def,\n returns: returnType,\n });\n }\n implement(func) {\n const validatedFunc = this.parse(func);\n return validatedFunc;\n }\n strictImplement(func) {\n const validatedFunc = this.parse(func);\n return validatedFunc;\n }\n static create(args, returns, params) {\n return new ZodFunction({\n args: (args\n ? args\n : ZodTuple.create([]).rest(ZodUnknown.create())),\n returns: returns || ZodUnknown.create(),\n typeName: ZodFirstPartyTypeKind.ZodFunction,\n ...processCreateParams(params),\n });\n }\n}\nclass ZodLazy extends ZodType {\n get schema() {\n return this._def.getter();\n }\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n const lazySchema = this._def.getter();\n return lazySchema._parse({ data: ctx.data, path: ctx.path, parent: ctx });\n }\n}\nZodLazy.create = (getter, params) => {\n return new ZodLazy({\n getter: getter,\n typeName: ZodFirstPartyTypeKind.ZodLazy,\n ...processCreateParams(params),\n });\n};\nclass ZodLiteral extends ZodType {\n _parse(input) {\n if (input.data !== this._def.value) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n received: ctx.data,\n code: ZodIssueCode.invalid_literal,\n expected: this._def.value,\n });\n return INVALID;\n }\n return { status: \"valid\", value: input.data };\n }\n get value() {\n return this._def.value;\n }\n}\nZodLiteral.create = (value, params) => {\n return new ZodLiteral({\n value: value,\n typeName: ZodFirstPartyTypeKind.ZodLiteral,\n ...processCreateParams(params),\n });\n};\nfunction createZodEnum(values, params) {\n return new ZodEnum({\n values: values,\n typeName: ZodFirstPartyTypeKind.ZodEnum,\n ...processCreateParams(params),\n });\n}\nclass ZodEnum extends ZodType {\n _parse(input) {\n if (typeof input.data !== \"string\") {\n const ctx = this._getOrReturnCtx(input);\n const expectedValues = this._def.values;\n addIssueToContext(ctx, {\n expected: util.joinValues(expectedValues),\n received: ctx.parsedType,\n code: ZodIssueCode.invalid_type,\n });\n return INVALID;\n }\n if (this._def.values.indexOf(input.data) === -1) {\n const ctx = this._getOrReturnCtx(input);\n const expectedValues = this._def.values;\n addIssueToContext(ctx, {\n received: ctx.data,\n code: ZodIssueCode.invalid_enum_value,\n options: expectedValues,\n });\n return INVALID;\n }\n return OK(input.data);\n }\n get options() {\n return this._def.values;\n }\n get enum() {\n const enumValues = {};\n for (const val of this._def.values) {\n enumValues[val] = val;\n }\n return enumValues;\n }\n get Values() {\n const enumValues = {};\n for (const val of this._def.values) {\n enumValues[val] = val;\n }\n return enumValues;\n }\n get Enum() {\n const enumValues = {};\n for (const val of this._def.values) {\n enumValues[val] = val;\n }\n return enumValues;\n }\n extract(values) {\n return ZodEnum.create(values);\n }\n exclude(values) {\n return ZodEnum.create(this.options.filter((opt) => !values.includes(opt)));\n }\n}\nZodEnum.create = createZodEnum;\nclass ZodNativeEnum extends ZodType {\n _parse(input) {\n const nativeEnumValues = util.getValidEnumValues(this._def.values);\n const ctx = this._getOrReturnCtx(input);\n if (ctx.parsedType !== ZodParsedType.string &&\n ctx.parsedType !== ZodParsedType.number) {\n const expectedValues = util.objectValues(nativeEnumValues);\n addIssueToContext(ctx, {\n expected: util.joinValues(expectedValues),\n received: ctx.parsedType,\n code: ZodIssueCode.invalid_type,\n });\n return INVALID;\n }\n if (nativeEnumValues.indexOf(input.data) === -1) {\n const expectedValues = util.objectValues(nativeEnumValues);\n addIssueToContext(ctx, {\n received: ctx.data,\n code: ZodIssueCode.invalid_enum_value,\n options: expectedValues,\n });\n return INVALID;\n }\n return OK(input.data);\n }\n get enum() {\n return this._def.values;\n }\n}\nZodNativeEnum.create = (values, params) => {\n return new ZodNativeEnum({\n values: values,\n typeName: ZodFirstPartyTypeKind.ZodNativeEnum,\n ...processCreateParams(params),\n });\n};\nclass ZodPromise extends ZodType {\n unwrap() {\n return this._def.type;\n }\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n if (ctx.parsedType !== ZodParsedType.promise &&\n ctx.common.async === false) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.promise,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n const promisified = ctx.parsedType === ZodParsedType.promise\n ? ctx.data\n : Promise.resolve(ctx.data);\n return OK(promisified.then((data) => {\n return this._def.type.parseAsync(data, {\n path: ctx.path,\n errorMap: ctx.common.contextualErrorMap,\n });\n }));\n }\n}\nZodPromise.create = (schema, params) => {\n return new ZodPromise({\n type: schema,\n typeName: ZodFirstPartyTypeKind.ZodPromise,\n ...processCreateParams(params),\n });\n};\nclass ZodEffects extends ZodType {\n innerType() {\n return this._def.schema;\n }\n sourceType() {\n return this._def.schema._def.typeName === ZodFirstPartyTypeKind.ZodEffects\n ? this._def.schema.sourceType()\n : this._def.schema;\n }\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n const effect = this._def.effect || null;\n if (effect.type === \"preprocess\") {\n const processed = effect.transform(ctx.data);\n if (ctx.common.async) {\n return Promise.resolve(processed).then((processed) => {\n return this._def.schema._parseAsync({\n data: processed,\n path: ctx.path,\n parent: ctx,\n });\n });\n }\n else {\n return this._def.schema._parseSync({\n data: processed,\n path: ctx.path,\n parent: ctx,\n });\n }\n }\n const checkCtx = {\n addIssue: (arg) => {\n addIssueToContext(ctx, arg);\n if (arg.fatal) {\n status.abort();\n }\n else {\n status.dirty();\n }\n },\n get path() {\n return ctx.path;\n },\n };\n checkCtx.addIssue = checkCtx.addIssue.bind(checkCtx);\n if (effect.type === \"refinement\") {\n const executeRefinement = (acc\n // effect: RefinementEffect\n ) => {\n const result = effect.refinement(acc, checkCtx);\n if (ctx.common.async) {\n return Promise.resolve(result);\n }\n if (result instanceof Promise) {\n throw new Error(\"Async refinement encountered during synchronous parse operation. Use .parseAsync instead.\");\n }\n return acc;\n };\n if (ctx.common.async === false) {\n const inner = this._def.schema._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n });\n if (inner.status === \"aborted\")\n return INVALID;\n if (inner.status === \"dirty\")\n status.dirty();\n // return value is ignored\n executeRefinement(inner.value);\n return { status: status.value, value: inner.value };\n }\n else {\n return this._def.schema\n ._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx })\n .then((inner) => {\n if (inner.status === \"aborted\")\n return INVALID;\n if (inner.status === \"dirty\")\n status.dirty();\n return executeRefinement(inner.value).then(() => {\n return { status: status.value, value: inner.value };\n });\n });\n }\n }\n if (effect.type === \"transform\") {\n if (ctx.common.async === false) {\n const base = this._def.schema._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n });\n if (!isValid(base))\n return base;\n const result = effect.transform(base.value, checkCtx);\n if (result instanceof Promise) {\n throw new Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);\n }\n return { status: status.value, value: result };\n }\n else {\n return this._def.schema\n ._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx })\n .then((base) => {\n if (!isValid(base))\n return base;\n return Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({ status: status.value, value: result }));\n });\n }\n }\n util.assertNever(effect);\n }\n}\nZodEffects.create = (schema, effect, params) => {\n return new ZodEffects({\n schema,\n typeName: ZodFirstPartyTypeKind.ZodEffects,\n effect,\n ...processCreateParams(params),\n });\n};\nZodEffects.createWithPreprocess = (preprocess, schema, params) => {\n return new ZodEffects({\n schema,\n effect: { type: \"preprocess\", transform: preprocess },\n typeName: ZodFirstPartyTypeKind.ZodEffects,\n ...processCreateParams(params),\n });\n};\nclass ZodOptional extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType === ZodParsedType.undefined) {\n return OK(undefined);\n }\n return this._def.innerType._parse(input);\n }\n unwrap() {\n return this._def.innerType;\n }\n}\nZodOptional.create = (type, params) => {\n return new ZodOptional({\n innerType: type,\n typeName: ZodFirstPartyTypeKind.ZodOptional,\n ...processCreateParams(params),\n });\n};\nclass ZodNullable extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType === ZodParsedType.null) {\n return OK(null);\n }\n return this._def.innerType._parse(input);\n }\n unwrap() {\n return this._def.innerType;\n }\n}\nZodNullable.create = (type, params) => {\n return new ZodNullable({\n innerType: type,\n typeName: ZodFirstPartyTypeKind.ZodNullable,\n ...processCreateParams(params),\n });\n};\nclass ZodDefault extends ZodType {\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n let data = ctx.data;\n if (ctx.parsedType === ZodParsedType.undefined) {\n data = this._def.defaultValue();\n }\n return this._def.innerType._parse({\n data,\n path: ctx.path,\n parent: ctx,\n });\n }\n removeDefault() {\n return this._def.innerType;\n }\n}\nZodDefault.create = (type, params) => {\n return new ZodDefault({\n innerType: type,\n typeName: ZodFirstPartyTypeKind.ZodDefault,\n defaultValue: typeof params.default === \"function\"\n ? params.default\n : () => params.default,\n ...processCreateParams(params),\n });\n};\nclass ZodCatch extends ZodType {\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n // newCtx is used to not collect issues from inner types in ctx\n const newCtx = {\n ...ctx,\n common: {\n ...ctx.common,\n issues: [],\n },\n };\n const result = this._def.innerType._parse({\n data: newCtx.data,\n path: newCtx.path,\n parent: {\n ...newCtx,\n },\n });\n if (isAsync(result)) {\n return result.then((result) => {\n return {\n status: \"valid\",\n value: result.status === \"valid\"\n ? result.value\n : this._def.catchValue({\n get error() {\n return new ZodError(newCtx.common.issues);\n },\n input: newCtx.data,\n }),\n };\n });\n }\n else {\n return {\n status: \"valid\",\n value: result.status === \"valid\"\n ? result.value\n : this._def.catchValue({\n get error() {\n return new ZodError(newCtx.common.issues);\n },\n input: newCtx.data,\n }),\n };\n }\n }\n removeCatch() {\n return this._def.innerType;\n }\n}\nZodCatch.create = (type, params) => {\n return new ZodCatch({\n innerType: type,\n typeName: ZodFirstPartyTypeKind.ZodCatch,\n catchValue: typeof params.catch === \"function\" ? params.catch : () => params.catch,\n ...processCreateParams(params),\n });\n};\nclass ZodNaN extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.nan) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.nan,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n return { status: \"valid\", value: input.data };\n }\n}\nZodNaN.create = (params) => {\n return new ZodNaN({\n typeName: ZodFirstPartyTypeKind.ZodNaN,\n ...processCreateParams(params),\n });\n};\nconst BRAND = Symbol(\"zod_brand\");\nclass ZodBranded extends ZodType {\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n const data = ctx.data;\n return this._def.type._parse({\n data,\n path: ctx.path,\n parent: ctx,\n });\n }\n unwrap() {\n return this._def.type;\n }\n}\nclass ZodPipeline extends ZodType {\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n if (ctx.common.async) {\n const handleAsync = async () => {\n const inResult = await this._def.in._parseAsync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n });\n if (inResult.status === \"aborted\")\n return INVALID;\n if (inResult.status === \"dirty\") {\n status.dirty();\n return DIRTY(inResult.value);\n }\n else {\n return this._def.out._parseAsync({\n data: inResult.value,\n path: ctx.path,\n parent: ctx,\n });\n }\n };\n return handleAsync();\n }\n else {\n const inResult = this._def.in._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n });\n if (inResult.status === \"aborted\")\n return INVALID;\n if (inResult.status === \"dirty\") {\n status.dirty();\n return {\n status: \"dirty\",\n value: inResult.value,\n };\n }\n else {\n return this._def.out._parseSync({\n data: inResult.value,\n path: ctx.path,\n parent: ctx,\n });\n }\n }\n }\n static create(a, b) {\n return new ZodPipeline({\n in: a,\n out: b,\n typeName: ZodFirstPartyTypeKind.ZodPipeline,\n });\n }\n}\nconst custom = (check, params = {}, \n/*\n * @deprecated\n *\n * Pass `fatal` into the params object instead:\n *\n * ```ts\n * z.string().custom((val) => val.length > 5, { fatal: false })\n * ```\n *\n */\nfatal) => {\n if (check)\n return ZodAny.create().superRefine((data, ctx) => {\n var _a, _b;\n if (!check(data)) {\n const p = typeof params === \"function\"\n ? params(data)\n : typeof params === \"string\"\n ? { message: params }\n : params;\n const _fatal = (_b = (_a = p.fatal) !== null && _a !== void 0 ? _a : fatal) !== null && _b !== void 0 ? _b : true;\n const p2 = typeof p === \"string\" ? { message: p } : p;\n ctx.addIssue({ code: \"custom\", ...p2, fatal: _fatal });\n }\n });\n return ZodAny.create();\n};\nconst late = {\n object: ZodObject.lazycreate,\n};\nvar ZodFirstPartyTypeKind;\n(function (ZodFirstPartyTypeKind) {\n ZodFirstPartyTypeKind[\"ZodString\"] = \"ZodString\";\n ZodFirstPartyTypeKind[\"ZodNumber\"] = \"ZodNumber\";\n ZodFirstPartyTypeKind[\"ZodNaN\"] = \"ZodNaN\";\n ZodFirstPartyTypeKind[\"ZodBigInt\"] = \"ZodBigInt\";\n ZodFirstPartyTypeKind[\"ZodBoolean\"] = \"ZodBoolean\";\n ZodFirstPartyTypeKind[\"ZodDate\"] = \"ZodDate\";\n ZodFirstPartyTypeKind[\"ZodSymbol\"] = \"ZodSymbol\";\n ZodFirstPartyTypeKind[\"ZodUndefined\"] = \"ZodUndefined\";\n ZodFirstPartyTypeKind[\"ZodNull\"] = \"ZodNull\";\n ZodFirstPartyTypeKind[\"ZodAny\"] = \"ZodAny\";\n ZodFirstPartyTypeKind[\"ZodUnknown\"] = \"ZodUnknown\";\n ZodFirstPartyTypeKind[\"ZodNever\"] = \"ZodNever\";\n ZodFirstPartyTypeKind[\"ZodVoid\"] = \"ZodVoid\";\n ZodFirstPartyTypeKind[\"ZodArray\"] = \"ZodArray\";\n ZodFirstPartyTypeKind[\"ZodObject\"] = \"ZodObject\";\n ZodFirstPartyTypeKind[\"ZodUnion\"] = \"ZodUnion\";\n ZodFirstPartyTypeKind[\"ZodDiscriminatedUnion\"] = \"ZodDiscriminatedUnion\";\n ZodFirstPartyTypeKind[\"ZodIntersection\"] = \"ZodIntersection\";\n ZodFirstPartyTypeKind[\"ZodTuple\"] = \"ZodTuple\";\n ZodFirstPartyTypeKind[\"ZodRecord\"] = \"ZodRecord\";\n ZodFirstPartyTypeKind[\"ZodMap\"] = \"ZodMap\";\n ZodFirstPartyTypeKind[\"ZodSet\"] = \"ZodSet\";\n ZodFirstPartyTypeKind[\"ZodFunction\"] = \"ZodFunction\";\n ZodFirstPartyTypeKind[\"ZodLazy\"] = \"ZodLazy\";\n ZodFirstPartyTypeKind[\"ZodLiteral\"] = \"ZodLiteral\";\n ZodFirstPartyTypeKind[\"ZodEnum\"] = \"ZodEnum\";\n ZodFirstPartyTypeKind[\"ZodEffects\"] = \"ZodEffects\";\n ZodFirstPartyTypeKind[\"ZodNativeEnum\"] = \"ZodNativeEnum\";\n ZodFirstPartyTypeKind[\"ZodOptional\"] = \"ZodOptional\";\n ZodFirstPartyTypeKind[\"ZodNullable\"] = \"ZodNullable\";\n ZodFirstPartyTypeKind[\"ZodDefault\"] = \"ZodDefault\";\n ZodFirstPartyTypeKind[\"ZodCatch\"] = \"ZodCatch\";\n ZodFirstPartyTypeKind[\"ZodPromise\"] = \"ZodPromise\";\n ZodFirstPartyTypeKind[\"ZodBranded\"] = \"ZodBranded\";\n ZodFirstPartyTypeKind[\"ZodPipeline\"] = \"ZodPipeline\";\n})(ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {}));\nconst instanceOfType = (\n// const instanceOfType = any>(\ncls, params = {\n message: `Input not instance of ${cls.name}`,\n}) => custom((data) => data instanceof cls, params);\nconst stringType = ZodString.create;\nconst numberType = ZodNumber.create;\nconst nanType = ZodNaN.create;\nconst bigIntType = ZodBigInt.create;\nconst booleanType = ZodBoolean.create;\nconst dateType = ZodDate.create;\nconst symbolType = ZodSymbol.create;\nconst undefinedType = ZodUndefined.create;\nconst nullType = ZodNull.create;\nconst anyType = ZodAny.create;\nconst unknownType = ZodUnknown.create;\nconst neverType = ZodNever.create;\nconst voidType = ZodVoid.create;\nconst arrayType = ZodArray.create;\nconst objectType = ZodObject.create;\nconst strictObjectType = ZodObject.strictCreate;\nconst unionType = ZodUnion.create;\nconst discriminatedUnionType = ZodDiscriminatedUnion.create;\nconst intersectionType = ZodIntersection.create;\nconst tupleType = ZodTuple.create;\nconst recordType = ZodRecord.create;\nconst mapType = ZodMap.create;\nconst setType = ZodSet.create;\nconst functionType = ZodFunction.create;\nconst lazyType = ZodLazy.create;\nconst literalType = ZodLiteral.create;\nconst enumType = ZodEnum.create;\nconst nativeEnumType = ZodNativeEnum.create;\nconst promiseType = ZodPromise.create;\nconst effectsType = ZodEffects.create;\nconst optionalType = ZodOptional.create;\nconst nullableType = ZodNullable.create;\nconst preprocessType = ZodEffects.createWithPreprocess;\nconst pipelineType = ZodPipeline.create;\nconst ostring = () => stringType().optional();\nconst onumber = () => numberType().optional();\nconst oboolean = () => booleanType().optional();\nconst coerce = {\n string: ((arg) => ZodString.create({ ...arg, coerce: true })),\n number: ((arg) => ZodNumber.create({ ...arg, coerce: true })),\n boolean: ((arg) => ZodBoolean.create({\n ...arg,\n coerce: true,\n })),\n bigint: ((arg) => ZodBigInt.create({ ...arg, coerce: true })),\n date: ((arg) => ZodDate.create({ ...arg, coerce: true })),\n};\nconst NEVER = INVALID;\n\nvar z = /*#__PURE__*/Object.freeze({\n __proto__: null,\n defaultErrorMap: errorMap,\n setErrorMap: setErrorMap,\n getErrorMap: getErrorMap,\n makeIssue: makeIssue,\n EMPTY_PATH: EMPTY_PATH,\n addIssueToContext: addIssueToContext,\n ParseStatus: ParseStatus,\n INVALID: INVALID,\n DIRTY: DIRTY,\n OK: OK,\n isAborted: isAborted,\n isDirty: isDirty,\n isValid: isValid,\n isAsync: isAsync,\n get util () { return util; },\n get objectUtil () { return objectUtil; },\n ZodParsedType: ZodParsedType,\n getParsedType: getParsedType,\n ZodType: ZodType,\n ZodString: ZodString,\n ZodNumber: ZodNumber,\n ZodBigInt: ZodBigInt,\n ZodBoolean: ZodBoolean,\n ZodDate: ZodDate,\n ZodSymbol: ZodSymbol,\n ZodUndefined: ZodUndefined,\n ZodNull: ZodNull,\n ZodAny: ZodAny,\n ZodUnknown: ZodUnknown,\n ZodNever: ZodNever,\n ZodVoid: ZodVoid,\n ZodArray: ZodArray,\n ZodObject: ZodObject,\n ZodUnion: ZodUnion,\n ZodDiscriminatedUnion: ZodDiscriminatedUnion,\n ZodIntersection: ZodIntersection,\n ZodTuple: ZodTuple,\n ZodRecord: ZodRecord,\n ZodMap: ZodMap,\n ZodSet: ZodSet,\n ZodFunction: ZodFunction,\n ZodLazy: ZodLazy,\n ZodLiteral: ZodLiteral,\n ZodEnum: ZodEnum,\n ZodNativeEnum: ZodNativeEnum,\n ZodPromise: ZodPromise,\n ZodEffects: ZodEffects,\n ZodTransformer: ZodEffects,\n ZodOptional: ZodOptional,\n ZodNullable: ZodNullable,\n ZodDefault: ZodDefault,\n ZodCatch: ZodCatch,\n ZodNaN: ZodNaN,\n BRAND: BRAND,\n ZodBranded: ZodBranded,\n ZodPipeline: ZodPipeline,\n custom: custom,\n Schema: ZodType,\n ZodSchema: ZodType,\n late: late,\n get ZodFirstPartyTypeKind () { return ZodFirstPartyTypeKind; },\n coerce: coerce,\n any: anyType,\n array: arrayType,\n bigint: bigIntType,\n boolean: booleanType,\n date: dateType,\n discriminatedUnion: discriminatedUnionType,\n effect: effectsType,\n 'enum': enumType,\n 'function': functionType,\n 'instanceof': instanceOfType,\n intersection: intersectionType,\n lazy: lazyType,\n literal: literalType,\n map: mapType,\n nan: nanType,\n nativeEnum: nativeEnumType,\n never: neverType,\n 'null': nullType,\n nullable: nullableType,\n number: numberType,\n object: objectType,\n oboolean: oboolean,\n onumber: onumber,\n optional: optionalType,\n ostring: ostring,\n pipeline: pipelineType,\n preprocess: preprocessType,\n promise: promiseType,\n record: recordType,\n set: setType,\n strictObject: strictObjectType,\n string: stringType,\n symbol: symbolType,\n transformer: effectsType,\n tuple: tupleType,\n 'undefined': undefinedType,\n union: unionType,\n unknown: unknownType,\n 'void': voidType,\n NEVER: NEVER,\n ZodIssueCode: ZodIssueCode,\n quotelessJson: quotelessJson,\n ZodError: ZodError\n});\n\nexport { BRAND, DIRTY, EMPTY_PATH, INVALID, NEVER, OK, ParseStatus, ZodType as Schema, ZodAny, ZodArray, ZodBigInt, ZodBoolean, ZodBranded, ZodCatch, ZodDate, ZodDefault, ZodDiscriminatedUnion, ZodEffects, ZodEnum, ZodError, ZodFirstPartyTypeKind, ZodFunction, ZodIntersection, ZodIssueCode, ZodLazy, ZodLiteral, ZodMap, ZodNaN, ZodNativeEnum, ZodNever, ZodNull, ZodNullable, ZodNumber, ZodObject, ZodOptional, ZodParsedType, ZodPipeline, ZodPromise, ZodRecord, ZodType as ZodSchema, ZodSet, ZodString, ZodSymbol, ZodEffects as ZodTransformer, ZodTuple, ZodType, ZodUndefined, ZodUnion, ZodUnknown, ZodVoid, addIssueToContext, anyType as any, arrayType as array, bigIntType as bigint, booleanType as boolean, coerce, custom, dateType as date, z as default, errorMap as defaultErrorMap, discriminatedUnionType as discriminatedUnion, effectsType as effect, enumType as enum, functionType as function, getErrorMap, getParsedType, instanceOfType as instanceof, intersectionType as intersection, isAborted, isAsync, isDirty, isValid, late, lazyType as lazy, literalType as literal, makeIssue, mapType as map, nanType as nan, nativeEnumType as nativeEnum, neverType as never, nullType as null, nullableType as nullable, numberType as number, objectType as object, objectUtil, oboolean, onumber, optionalType as optional, ostring, pipelineType as pipeline, preprocessType as preprocess, promiseType as promise, quotelessJson, recordType as record, setType as set, setErrorMap, strictObjectType as strictObject, stringType as string, symbolType as symbol, effectsType as transformer, tupleType as tuple, undefinedType as undefined, unionType as union, unknownType as unknown, util, voidType as void, z };\n","'use strict';\n\n/// \n/// \n/// \n\nimport {AmeCustomizable, AmeCustomizableViewModel} from '../../pro-customizables/assets/customizable.js';\nimport {registerBaseComponents} from '../../pro-customizables/ko-components/ame-components.js';\nimport AmeAcStructure from './ko-components/ame-ac-structure.js';\nimport AmeAcSection from './ko-components/ame-ac-section.js';\nimport AmeAcSectionLink from './ko-components/ame-ac-section-link.js';\nimport AmeAcControl from './ko-components/ame-ac-control.js';\nimport AmeAcControlGroup from './ko-components/ame-ac-control-group.js';\nimport AmeAcContentSection from './ko-components/ame-ac-content-section.js';\nimport {AmeAdminCustomizerBase} from './admin-customizer-base.js';\nimport AmeAcSeparator from './ko-components/ame-ac-separator.js';\nimport AmeAcValidationErrors from './ko-components/ame-ac-validation-errors.js';\nimport z, {ZodError, ZodType} from '../../zod/lib/index.js';\n\ndeclare var wsAmeLodash: _.LoDashStatic;\ndeclare const wsAmeAdminCustomizerData: AmeAdminCustomizer.ScriptData;\n\nexport namespace AmeAdminCustomizer {\n\timport Setting = AmeCustomizable.Setting;\n\timport SettingCollection = AmeCustomizable.SettingCollection;\n\timport InterfaceStructureData = AmeCustomizable.InterfaceStructureData;\n\timport InterfaceStructure = AmeCustomizable.InterfaceStructure;\n\timport unserializeUiElement = AmeCustomizable.unserializeUiElement;\n\timport unserializeSetting = AmeCustomizable.unserializeSetting;\n\timport AnySpecificElementData = AmeCustomizable.AnySpecificElementData;\n\timport CustomizableVmInterface = AmeCustomizableViewModel.CustomizableVmInterface;\n\n\tconst $ = jQuery;\n\tconst _ = wsAmeLodash;\n\n\tregisterBaseComponents();\n\tko.components.register('ame-ac-structure', AmeAcStructure);\n\tko.components.register('ame-ac-section', AmeAcSection);\n\tko.components.register('ame-ac-section-link', AmeAcSectionLink);\n\tko.components.register('ame-ac-content-section', AmeAcContentSection);\n\tko.components.register('ame-ac-control-group', AmeAcControlGroup);\n\tko.components.register('ame-ac-control', AmeAcControl);\n\tko.components.register('ame-ac-separator', AmeAcSeparator);\n\tko.components.register('ame-ac-validation-errors', AmeAcValidationErrors);\n\n\texport interface ScriptData extends AmeAdminCustomizerBase.ScriptData {\n\t\tajaxUrl: string;\n\t\tsaveChangesetNonce: string;\n\t\ttrashChangesetNonce: string;\n\t\tchangesetItemCount: number;\n\t\tchangesetStatus: string;\n\t\trefreshPreviewNonce: string;\n\t\tinitialPreviewUrl: string;\n\t\tinterfaceStructure: InterfaceStructureData;\n\t}\n\n\tconst reducedMotionQuery = window.matchMedia('(prefers-reduced-motion: reduce)');\n\tlet prefersReducedMotion = reducedMotionQuery && reducedMotionQuery.matches;\n\treducedMotionQuery.addEventListener('change', () => {\n\t\tprefersReducedMotion = reducedMotionQuery.matches;\n\t});\n\n\tclass CustomizerSettingsCollection extends SettingCollection {\n\t\t/**\n\t\t * Settings that have changed since the last save attempt.\n\t\t */\n\t\tprivate pendingSettings: Record = {};\n\t\t/**\n\t\t * Settings that in the process of being sent to the server to be saved.\n\t\t * They might not be saved yet.\n\t\t */\n\t\tprivate sentSettings: Record = {};\n\t\tprivate currentChangesetRequest: JQueryXHR | null = null;\n\t\tprivate saveTriggerTimeoutId: null | ReturnType = null;\n\n\t\tprivate readonly currentChangeset: KnockoutObservable;\n\n\t\tpublic readonly changesetName: KnockoutComputed;\n\n\t\tpublic readonly isExclusiveOperationInProgress: KnockoutComputed;\n\t\tprivate readonly exclusiveOperation: KnockoutObservable = ko.observable(false);\n\n\t\tconstructor(\n\t\t\tpublic readonly ajaxUrl: string,\n\t\t\tpublic readonly saveChangesetNonce: string,\n\t\t\tpublic readonly trashChangesetNonce: string,\n\t\t\tchangesetName: string,\n\t\t\tchangesetItemCount: number = 0,\n\t\t\tchangesetStatus: string | null = null\n\t\t) {\n\t\t\tsuper();\n\t\t\tconst self = this;\n\n\t\t\tthis.currentChangeset = ko.observable(\n\t\t\t\tnew Changeset(changesetName, changesetItemCount, changesetStatus)\n\t\t\t);\n\t\t\tthis.changesetName = ko.pureComputed(() => {\n\t\t\t\treturn (self.currentChangeset()?.name()) || '';\n\t\t\t});\n\n\t\t\t//Automatically save the changeset when any settings change.\n\t\t\tconst totalChangeCount = ko.pureComputed(() => {\n\t\t\t\tconst changeset = self.currentChangeset();\n\t\t\t\treturn (changeset ? changeset.currentSessionChanges() : 0);\n\t\t\t});\n\t\t\ttotalChangeCount.subscribe(_.debounce(\n\t\t\t\t(counter) => {\n\t\t\t\t\tif (counter > 0) {\n\t\t\t\t\t\tself.queueChangesetUpdate()\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t3000,\n\t\t\t\t{leading: true, trailing: true}\n\t\t\t));\n\n\t\t\tthis.isExclusiveOperationInProgress = ko.pureComputed(() => {\n\t\t\t\treturn self.exclusiveOperation();\n\t\t\t});\n\n\t\t\t//Keep track of unsaved changes and changesets.\n\t\t\tthis.addChangeListener((setting: Setting) => {\n\t\t\t\tthis.pendingSettings[setting.id] = setting;\n\n\t\t\t\tlet changeset = this.currentChangeset();\n\t\t\t\t//If the current changeset cannot be modified, create a new one\n\t\t\t\t//for the changed setting(s).\n\t\t\t\tif (!changeset?.canBeModified()) {\n\t\t\t\t\tchangeset = new Changeset();\n\t\t\t\t\tthis.currentChangeset(changeset);\n\t\t\t\t}\n\t\t\t\t//Track the number of changes in the current session.\n\t\t\t\tchangeset.currentSessionChanges(changeset.currentSessionChanges() + 1);\n\t\t\t});\n\t\t}\n\n\t\tqueueChangesetUpdate(delay: number = 0) {\n\t\t\tif (delay > 0) {\n\t\t\t\tif (this.saveTriggerTimeoutId !== null) {\n\t\t\t\t\t//Replace the existing timeout with a new one.\n\t\t\t\t\tclearTimeout(this.saveTriggerTimeoutId);\n\t\t\t\t}\n\t\t\t\tthis.saveTriggerTimeoutId = setTimeout(() => {\n\t\t\t\t\tthis.saveTriggerTimeoutId = null;\n\t\t\t\t\tthis.queueChangesetUpdate(0);\n\t\t\t\t}, delay);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (this.saveTriggerTimeoutId !== null) {\n\t\t\t\treturn; //Another timeout is already waiting.\n\t\t\t}\n\n\t\t\tif (this.currentChangesetRequest !== null) {\n\t\t\t\t//There's an in-progress request, so wait until it's done.\n\t\t\t\tthis.currentChangesetRequest.always(() => {\n\t\t\t\t\t//Wait a bit to avoid hammering the server.\n\t\t\t\t\tthis.queueChangesetUpdate(1000);\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.saveChangeset();\n\t\t}\n\n\t\tprivate saveChangeset(status: string | null = null): JQueryPromise {\n\t\t\t//Do nothing if there are no changes.\n\t\t\tif (_.isEmpty(this.pendingSettings) && (status === null)) {\n\t\t\t\treturn $.Deferred().reject(new Error('There are no changes to save.')).promise();\n\t\t\t}\n\n\t\t\tif (this.isExclusiveOperationInProgress()) {\n\t\t\t\treturn $.Deferred().reject(\n\t\t\t\t\tnew Error('Another exclusive changeset operation is in progress.')\n\t\t\t\t).promise();\n\t\t\t}\n\n\t\t\tlet isExclusiveRequest = (status === 'publish') || (status === 'trash');\n\t\t\tif (isExclusiveRequest) {\n\t\t\t\tthis.exclusiveOperation(true);\n\t\t\t}\n\n\t\t\tconst savedChangeset = this.currentChangeset();\n\n\t\t\t//Keep a local copy of the settings in case something changes instance\n\t\t\t//properties while the request is in progress (should never happen).\n\t\t\tconst settingsToSend = this.pendingSettings;\n\t\t\tthis.sentSettings = settingsToSend;\n\t\t\tthis.pendingSettings = {};\n\n\t\t\tconst modifiedSettings = _.mapValues(settingsToSend, setting => setting.value());\n\t\t\tconst requestData: Record = {\n\t\t\t\taction: 'ws_ame_ac_save_changeset',\n\t\t\t\t_ajax_nonce: this.saveChangesetNonce,\n\t\t\t\tchangeset: savedChangeset?.name ?? '',\n\t\t\t\tmodified: JSON.stringify(modifiedSettings),\n\t\t\t};\n\t\t\tif (status !== null) {\n\t\t\t\trequestData['status'] = status;\n\t\t\t}\n\t\t\t//If the changeset doesn't have a name, it is new.\n\t\t\tif (!savedChangeset?.hasName()) {\n\t\t\t\trequestData['createNew'] = 1;\n\t\t\t}\n\n\t\t\tconst request = $.ajax({\n\t\t\t\turl: this.ajaxUrl,\n\t\t\t\tmethod: 'POST',\n\t\t\t\tdata: requestData,\n\t\t\t\tdataType: 'json',\n\t\t\t\ttimeout: 20000,\n\t\t\t});\n\t\t\tthis.currentChangesetRequest = request;\n\n\t\t\tinterface ServerValidationResults {\n\t\t\t\t[settingId: string]: {\n\t\t\t\t\tisValid: boolean;\n\t\t\t\t\terrors: Array<{ code: string; message: string; }>;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst self = this;\n\n\t\t\tfunction storeValidationResultsFrom(serverResponse: any) {\n\t\t\t\tconst results: ServerValidationResults = _.get(\n\t\t\t\t\tserverResponse,\n\t\t\t\t\t['data', 'validationResults']\n\t\t\t\t);\n\t\t\t\tif (typeof results !== 'object') {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tfor (const settingId in results) {\n\t\t\t\t\tconst setting = self.get(settingId);\n\t\t\t\t\tif (!setting.isDefined()) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!modifiedSettings.hasOwnProperty(settingId)) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tconst sentValue = modifiedSettings[settingId];\n\n\t\t\t\t\tconst state = results[settingId];\n\t\t\t\t\tif (state.isValid) {\n\t\t\t\t\t\tsetting.get().clearValidationErrorsForValue(sentValue);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t//Since the server response is not fully validated, some typeof checks\n\t\t\t\t\t\t//are still useful.\n\t\t\t\t\t\t// noinspection SuspiciousTypeOfGuard\n\t\t\t\t\t\tsetting.get().addValidationErrorsForValue(\n\t\t\t\t\t\t\tsentValue,\n\t\t\t\t\t\t\t_.filter(state.errors, error => (typeof error.message === 'string'))\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunction storeChangesetDetailsFrom(serverResponse: any) {\n\t\t\t\tif (!savedChangeset) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t//Store the returned changeset name in case a new changeset was created.\n\t\t\t\tif (!savedChangeset.hasName()) {\n\t\t\t\t\tconst newName = _.get(serverResponse, ['data', 'changeset']);\n\t\t\t\t\tif (typeof newName === 'string') {\n\t\t\t\t\t\tsavedChangeset.name(newName);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//Store the changeset status.\n\t\t\t\tconst newStatus = _.get(serverResponse, ['data', 'changesetStatus']);\n\t\t\t\tif (typeof newStatus === 'string') {\n\t\t\t\t\tsavedChangeset.status(newStatus);\n\t\t\t\t}\n\n\t\t\t\t//Store the number of changes in the changeset.\n\t\t\t\tconst newChangeCount = _.get(serverResponse, ['data', 'changesetItemCount']);\n\t\t\t\tif (typeof newChangeCount === 'number') {\n\t\t\t\t\tsavedChangeset.knownItemCount(newChangeCount);\n\t\t\t\t}\n\n\t\t\t\t//Was the changeset published? Because changesets are typically moved\n\t\t\t\t//to trash after publishing, \"status\" might be \"trash\" instead of \"publish\",\n\t\t\t\t//but we still want to know if it was successfully published.\n\t\t\t\tconst wasPublished = _.get(serverResponse, ['data', 'changesetWasPublished'], null);\n\t\t\t\tif (wasPublished) {\n\t\t\t\t\tsavedChangeset.wasPublished(wasPublished);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\trequest.done(function (response) {\n\t\t\t\tstoreChangesetDetailsFrom(response);\n\t\t\t\tstoreValidationResultsFrom(response);\n\n\t\t\t\t//After successfully publishing a changeset, it has no more\n\t\t\t\t//unsaved changes.\n\t\t\t\tconst isPublished =\n\t\t\t\t\t(savedChangeset.status() === 'publish')\n\t\t\t\t\t|| (savedChangeset.status() === 'future')\n\t\t\t\t\t|| (savedChangeset.wasPublished());\n\t\t\t\tif (isPublished) {\n\t\t\t\t\tsavedChangeset.currentSessionChanges(0);\n\t\t\t\t}\n\n\t\t\t\t//After a changeset is published or trashed, it can no longer\n\t\t\t\t//be edited. We may be able to replace it with a new changeset\n\t\t\t\t//that was created on the server.\n\t\t\t\tif (!self.currentChangeset().canBeModified()) {\n\t\t\t\t\tconst nextChangeset = _.get(response, ['data', 'nextChangeset']);\n\t\t\t\t\tif ((typeof nextChangeset === 'string') && (nextChangeset !== '')) {\n\t\t\t\t\t\tself.currentChangeset(new Changeset(nextChangeset));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\n\t\t\trequest.fail((requestObject: JQueryXHR) => {\n\t\t\t\tif (typeof requestObject.responseJSON === 'object') {\n\t\t\t\t\tstoreValidationResultsFrom(requestObject.responseJSON);\n\t\t\t\t\tstoreChangesetDetailsFrom(requestObject.responseJSON);\n\t\t\t\t}\n\n\t\t\t\t//Add the unsaved settings back to the pending list.\n\t\t\t\tfor (const id in settingsToSend) {\n\t\t\t\t\t//Keep only settings that still exist.\n\t\t\t\t\tif (this.get(id).isDefined()) {\n\t\t\t\t\t\tthis.pendingSettings[id] = settingsToSend[id];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t//We don't automatically retry because the problem might be something\n\t\t\t\t//that doesn't get better on its own, like missing permissions.\n\t\t\t});\n\n\t\t\trequest.always(() => {\n\t\t\t\tthis.currentChangesetRequest = null;\n\t\t\t\tthis.sentSettings = {};\n\t\t\t\tif (isExclusiveRequest) {\n\t\t\t\t\tthis.exclusiveOperation(false);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\treturn request;\n\t\t}\n\n\t\tpublic savePendingSettings(timeout: number = 20): JQueryPromise {\n\t\t\tif (this.isExclusiveOperationInProgress()) {\n\t\t\t\t//Wait for the exclusive operation to finish.\n\t\t\t\tconst deferred = $.Deferred();\n\t\t\t\tconst result = deferred.then(() => this.doSavePendingSettings());\n\n\t\t\t\tconst startTime = Date.now();\n\t\t\t\tconst timer = setInterval(() => {\n\t\t\t\t\tif (!this.isExclusiveOperationInProgress()) {\n\t\t\t\t\t\tclearInterval(timer);\n\t\t\t\t\t\tdeferred.resolve();\n\t\t\t\t\t} else if ((Date.now() - startTime) > timeout) {\n\t\t\t\t\t\tclearInterval(timer);\n\t\t\t\t\t\tdeferred.reject(new Error('Exclusive operation timed out.'));\n\t\t\t\t\t}\n\t\t\t\t}, 200);\n\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\treturn this.doSavePendingSettings();\n\t\t}\n\n\t\tprivate doSavePendingSettings(): JQueryPromise {\n\t\t\t//If there are no changes, we don't need to do anything.\n\t\t\tif (_.isEmpty(this.pendingSettings)) {\n\t\t\t\treturn $.Deferred().resolve().promise();\n\t\t\t}\n\t\t\treturn this.saveChangeset();\n\t\t}\n\n\t\tpublic getCurrentChangeset(): Changeset {\n\t\t\treturn this.currentChangeset();\n\t\t}\n\n\t\t/**\n\t\t * Get any unsaved setting changes.\n\t\t *\n\t\t * @returns An object mapping setting IDs to their modified values.\n\t\t */\n\t\tpublic get unsavedChanges(): Record {\n\t\t\t//Include both pending settings and sent settings. Sent settings\n\t\t\t//might not be saved yet.\n\t\t\tlet unsavedSettings: Record = {};\n\t\t\t_.defaults(unsavedSettings, this.pendingSettings, this.sentSettings);\n\n\t\t\treturn _.mapValues(unsavedSettings, setting => setting.value());\n\t\t}\n\n\t\tpublic publishChangeset(): JQueryPromise {\n\t\t\tif (this.isExclusiveOperationInProgress()) {\n\t\t\t\treturn $.Deferred()\n\t\t\t\t\t.reject(new Error('Another exclusive changeset operation is already in progress.'))\n\t\t\t\t\t.promise();\n\t\t\t}\n\t\t\treturn this.saveChangeset('publish');\n\t\t}\n\n\t\tpublic trashChangeset(): JQueryPromise {\n\t\t\tif (this.isExclusiveOperationInProgress()) {\n\t\t\t\treturn $.Deferred()\n\t\t\t\t\t.reject(new Error('Another exclusive changeset operation is already in progress.'))\n\t\t\t\t\t.promise();\n\t\t\t}\n\n\t\t\tconst changeset = this.currentChangeset();\n\t\t\tif (!changeset.hasName()) {\n\t\t\t\t//The changeset hasn't been saved yet, so we can just mark it as trashed.\n\t\t\t\tchangeset.status('trash');\n\t\t\t\tchangeset.currentSessionChanges(0);\n\n\t\t\t\t//It's a success of sorts.\n\t\t\t\treturn $.Deferred().resolve(true).promise();\n\t\t\t}\n\n\t\t\tthis.exclusiveOperation(true);\n\n\t\t\tconst requestData: Record = {\n\t\t\t\taction: 'ws_ame_ac_trash_changeset',\n\t\t\t\t_ajax_nonce: this.trashChangesetNonce,\n\t\t\t\tchangeset: changeset.name\n\t\t\t};\n\n\t\t\tconst request = $.ajax({\n\t\t\t\turl: this.ajaxUrl,\n\t\t\t\tmethod: 'POST',\n\t\t\t\tdata: requestData,\n\t\t\t\tdataType: 'json',\n\t\t\t\ttimeout: 20000,\n\t\t\t});\n\t\t\tthis.currentChangesetRequest = request;\n\n\t\t\trequest.done(function () {\n\t\t\t\tchangeset.status('trash');\n\t\t\t\tchangeset.currentSessionChanges(0);\n\t\t\t});\n\n\t\t\t//Unfortunately, jQuery doesn't seem to allow us to create a custom\n\t\t\t//error object and pass it to other handlers, so code that uses this\n\t\t\t//method will have to parse the error response itself.\n\n\t\t\trequest.always(() => {\n\t\t\t\tthis.currentChangesetRequest = null;\n\t\t\t\tthis.exclusiveOperation(false);\n\t\t\t});\n\n\t\t\treturn request;\n\t\t}\n\t}\n\n\tclass Changeset {\n\t\tpublic readonly name: KnockoutObservable;\n\t\tpublic readonly knownItemCount: KnockoutObservable;\n\t\tpublic readonly status: KnockoutObservable;\n\n\t\t/**\n\t\t * The number of times settings have been changed in this changeset\n\t\t * during the current customizer session.\n\t\t *\n\t\t * Note that this is not the same as the number settings in the changeset:\n\t\t * if the same setting is changed X times, this counter will increase by X,\n\t\t * but the changeset will still only have one entry for that setting.\n\t\t */\n\t\tpublic readonly currentSessionChanges: KnockoutObservable = ko.observable(0);\n\n\t\t/**\n\t\t * Once a changeset has been published or deleted, its contents can't be modified any more.\n\t\t * @private\n\t\t */\n\t\tprivate readonly fixedContentStatuses: Record =\n\t\t\t{'publish': true, 'trash': true, 'future': true};\n\n\t\tpublic readonly wasPublished: KnockoutObservable = ko.observable(false);\n\n\t\tconstructor(name: string = '', knownItemCount: number = 0, initialStatus: string | null = '') {\n\t\t\tthis.name = ko.observable(name);\n\t\t\tthis.knownItemCount = ko.observable(knownItemCount);\n\t\t\tthis.status = ko.observable(initialStatus ?? '');\n\t\t}\n\n\t\tpublic hasName(): boolean {\n\t\t\tconst name = this.name();\n\t\t\treturn (name !== '');\n\t\t}\n\n\t\tpublic canBeModified(): boolean {\n\t\t\treturn !this.fixedContentStatuses.hasOwnProperty(this.status());\n\t\t}\n\n\t\tpublic isNonEmpty(): boolean {\n\t\t\treturn (this.currentSessionChanges() > 0) || (this.knownItemCount() > 0)\n\t\t}\n\t}\n\n\t//region Admin theme\n\tconst UrlOrEmpty = z.union([\n\t\tz.string().url().max(1000),\n\t\tz.literal('')\n\t]);\n\n\tconst AdminThemeMetadata = z.object({\n\t\tpluginName: z.string().max(100),\n\t\tshortDescription: z.string().max(500),\n\n\t\tpluginSlug: z.string().max(64).toLowerCase().default('')\n\t\t\t.refine(\n\t\t\t\tfunction (input: string) {\n\t\t\t\t\t//Only allow alphanumeric characters, underscores, and dashes.\n\t\t\t\t\t//Empty string is allowed.\n\t\t\t\t\treturn /^[a-z0-9_-]*$/.test(input);\n\t\t\t\t},\n\t\t\t\t{message: 'The slug can only contain letters (a-z), numbers, underscores, and dashes.'}\n\t\t\t),\n\t\tidentifierPrefix: z.string().max(20).optional(),\n\n\t\tpluginVersion: z.string().default('1.0').optional(),\n\t\tpluginUrl: UrlOrEmpty.optional(),\n\t\tauthorName: z.string().max(100).optional(),\n\t\tauthorUrl: UrlOrEmpty.optional(),\n\t\trequiredWpVersion: z.string().max(30).default('4.7').optional(),\n\t\ttestedWpVersion: z.string().max(30).optional(),\n\t});\n\n\ttype AdminThemeMetadata = z.infer;\n\n\tconst AdminThemeSettings = z.record(\n\t\t//Key type\n\t\tz.string().min(1),\n\t\t//Value type\n\t\tz.any()\n\t);\n\n\tclass AdminThemeImportReport {\n\t\tpublic totalSettings: number = 0;\n\t\tpublic importedSettings: number = 0;\n\t\tpublic invalidSettings: number = 0;\n\t\tpublic skippedSettings: number = 0;\n\t\tpublic differentImportedSettings: number = 0;\n\n\t\tpublic readonly pluginName: string;\n\n\t\tconstructor(\n\t\t\tpublic readonly fileName: string,\n\t\t\tpublic readonly metadata: AdminThemeMetadata\n\t\t) {\n\t\t\tthis.pluginName = metadata.pluginName || '(Unnamed)';\n\t\t}\n\t}\n\n\tinterface WithZodValidationResults extends ObservableValidationFields {\n\t\tameZodValidationError: KnockoutObservable;\n\t}\n\n\ttype ZodValidatedObservable = KnockoutComputed & WithZodValidationResults;\n\n\tfunction observableWithZodValidation>(\n\t\tvalue: z.output,\n\t\tschema: S\n\t): ZodValidatedObservable> {\n\t\tconst underlyingObservable = ko.observable(value);\n\n\t\tconst observable: ZodValidatedObservable = ko.pureComputed({\n\t\t\tread: underlyingObservable,\n\t\t\twrite: (newValue: T) => {\n\t\t\t\tconst validationResult = schema.safeParse(newValue);\n\t\t\t\tif (validationResult.success) {\n\t\t\t\t\tunderlyingObservable(validationResult.data);\n\t\t\t\t\tobservable.ameZodValidationError(null);\n\t\t\t\t\tobservable.ameValidationErrors([]);\n\t\t\t\t} else {\n\t\t\t\t\tobservable.ameZodValidationError(validationResult.error);\n\t\t\t\t\t//Convert Zod issues to ObservableValidationErrors.\n\t\t\t\t\tobservable.ameValidationErrors(validationResult.error.issues.map(issue => {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tcode: issue.code,\n\t\t\t\t\t\t\tmessage: issue.message\n\t\t\t\t\t\t} satisfies ObservableValidationError;\n\t\t\t\t\t}));\n\t\t\t\t}\n\t\t\t}\n\t\t}) as ZodValidatedObservable;\n\n\t\tobservable.ameZodValidationError = ko.observable(null);\n\t\tobservable.ameValidationErrors = ko.observable([] as ObservableValidationError[]);\n\t\tobservable.ameIsValid = ko.pureComputed(() => {\n\t\t\tconst errors = observable.ameValidationErrors();\n\t\t\treturn !errors || errors.length === 0;\n\t\t});\n\n\t\treturn observable;\n\t}\n\n\tclass ObservableThemeMetadata {\n\t\tpublic readonly pluginName: ZodValidatedObservable;\n\t\tpublic readonly shortDescription: ZodValidatedObservable;\n\t\tpublic readonly pluginSlug: ZodValidatedObservable;\n\t\tpublic readonly identifierPrefix: ZodValidatedObservable;\n\t\tpublic readonly pluginVersion: ZodValidatedObservable;\n\t\tpublic readonly pluginUrl: ZodValidatedObservable;\n\t\tpublic readonly authorName: ZodValidatedObservable;\n\t\tpublic readonly authorUrl: ZodValidatedObservable;\n\t\tpublic readonly requiredWpVersion: ZodValidatedObservable;\n\t\tpublic readonly testedWpVersion: ZodValidatedObservable;\n\n\t\tconstructor(metadata: AdminThemeMetadata) {\n\t\t\tthis.pluginName = observableWithZodValidation(\n\t\t\t\tmetadata.pluginName,\n\t\t\t\tAdminThemeMetadata.shape.pluginName\n\t\t\t);\n\t\t\tthis.shortDescription = observableWithZodValidation(\n\t\t\t\tmetadata.shortDescription,\n\t\t\t\tAdminThemeMetadata.shape.shortDescription\n\t\t\t);\n\n\t\t\tthis.pluginSlug = observableWithZodValidation(\n\t\t\t\tmetadata.pluginSlug ?? '',\n\t\t\t\tAdminThemeMetadata.shape.pluginSlug\n\t\t\t);\n\t\t\tthis.identifierPrefix = observableWithZodValidation(\n\t\t\t\tmetadata.identifierPrefix ?? '',\n\t\t\t\tAdminThemeMetadata.shape.identifierPrefix\n\t\t\t);\n\n\t\t\tthis.pluginVersion = observableWithZodValidation(\n\t\t\t\tmetadata.pluginVersion ?? '',\n\t\t\t\tAdminThemeMetadata.shape.pluginVersion\n\t\t\t);\n\t\t\tthis.pluginUrl = observableWithZodValidation(\n\t\t\t\tmetadata.pluginUrl ?? '',\n\t\t\t\tAdminThemeMetadata.shape.pluginUrl\n\t\t\t);\n\t\t\tthis.authorName = observableWithZodValidation(\n\t\t\t\tmetadata.authorName ?? '',\n\t\t\t\tAdminThemeMetadata.shape.authorName\n\t\t\t);\n\t\t\tthis.authorUrl = observableWithZodValidation(\n\t\t\t\tmetadata.authorUrl ?? '',\n\t\t\t\tAdminThemeMetadata.shape.authorUrl\n\t\t\t);\n\t\t\tthis.requiredWpVersion = observableWithZodValidation(\n\t\t\t\tmetadata.requiredWpVersion ?? '',\n\t\t\t\tAdminThemeMetadata.shape.requiredWpVersion\n\t\t\t);\n\t\t\tthis.testedWpVersion = observableWithZodValidation(\n\t\t\t\tmetadata.testedWpVersion ?? '',\n\t\t\t\tAdminThemeMetadata.shape.testedWpVersion\n\t\t\t);\n\t\t}\n\n\t\tpublic toObject(): AdminThemeMetadata {\n\t\t\treturn {\n\t\t\t\tpluginName: this.pluginName(),\n\t\t\t\tshortDescription: this.shortDescription(),\n\t\t\t\tpluginSlug: this.pluginSlug(),\n\t\t\t\tidentifierPrefix: this.identifierPrefix(),\n\t\t\t\tpluginVersion: this.pluginVersion(),\n\t\t\t\tpluginUrl: this.pluginUrl(),\n\t\t\t\tauthorName: this.authorName(),\n\t\t\t\tauthorUrl: this.authorUrl(),\n\t\t\t\trequiredWpVersion: this.requiredWpVersion(),\n\t\t\t\ttestedWpVersion: this.testedWpVersion(),\n\t\t\t};\n\t\t}\n\n\t\tisValid(): boolean {\n\t\t\t//This seems really inelegant, but I can't think of a better way to do it.\n\t\t\treturn this.pluginName.ameIsValid()\n\t\t\t\t&& this.shortDescription.ameIsValid()\n\t\t\t\t&& this.pluginSlug.ameIsValid()\n\t\t\t\t&& this.identifierPrefix.ameIsValid()\n\t\t\t\t&& this.pluginVersion.ameIsValid()\n\t\t\t\t&& this.pluginUrl.ameIsValid()\n\t\t\t\t&& this.authorName.ameIsValid()\n\t\t\t\t&& this.authorUrl.ameIsValid()\n\t\t\t\t&& this.requiredWpVersion.ameIsValid()\n\t\t\t\t&& this.testedWpVersion.ameIsValid();\n\t\t}\n\t}\n\n\tclass DownloadThemeDialog extends AmeBaseKnockoutDialog {\n\t\tpublic readonly meta: KnockoutObservable;\n\t\tpublic readonly areFieldsEditable: KnockoutComputed;\n\t\tpublic readonly isOperationInProgress: KnockoutObservable = ko.observable(false);\n\n\t\tautoCancelButton: boolean = true;\n\t\tisConfirmButtonEnabled: KnockoutObservable;\n\n\t\tadvancedOptionsVisible: KnockoutObservable = ko.observable(false);\n\t\tadvancedOptionsToggleLabel: KnockoutComputed;\n\n\t\thelpVisible: KnockoutObservable = ko.observable(false);\n\t\thelpToggleLabel: KnockoutComputed;\n\n\t\tchangesetName: KnockoutObservable = ko.observable('');\n\t\tmetadataJson: KnockoutObservable = ko.observable('');\n\t\tdownloadCookieName: KnockoutObservable = ko.observable('');\n\n\t\tprivate cleanupCurrentDownload: () => void = () => {\n\t\t};\n\n\t\tconstructor(\n\t\t\tprivate readonly getChangesetName: () => string,\n\t\t\tprivate readonly savePendingChangesetData: () => JQueryPromise,\n\t\t) {\n\t\t\tsuper();\n\t\t\tthis.options.minWidth = 400;\n\n\t\t\tthis.meta = ko.observable(new ObservableThemeMetadata(AdminThemeMetadata.parse({\n\t\t\t\tpluginName: 'Custom Admin Theme',\n\t\t\t\tshortDescription: 'A custom admin theme generated using the Admin Menu Editor Pro plugin.',\n\t\t\t\tpluginVersion: '1.0',\n\t\t\t})));\n\n\t\t\tthis.isConfirmButtonEnabled = ko.computed(() => {\n\t\t\t\tif (this.isOperationInProgress()) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tif (getChangesetName() === '') {\n\t\t\t\t\t//To generate an admin theme, the changeset must have already been saved.\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\treturn this.meta().isValid();\n\t\t\t});\n\n\t\t\tthis.areFieldsEditable = ko.computed(() => {\n\t\t\t\treturn !this.isOperationInProgress();\n\t\t\t});\n\n\t\t\tthis.advancedOptionsToggleLabel = ko.pureComputed((): string => {\n\t\t\t\treturn this.advancedOptionsVisible() ? 'Fewer options' : 'More options';\n\t\t\t});\n\t\t\tthis.helpToggleLabel = ko.pureComputed((): string => {\n\t\t\t\treturn this.helpVisible() ? 'Hide info' : 'How it works';\n\t\t\t});\n\t\t}\n\n\t\tprotected getConfirmButtonLabel(): string | null {\n\t\t\treturn 'Download Admin Theme';\n\t\t}\n\n\t\ttoggleAdvancedOptions(): void {\n\t\t\tthis.advancedOptionsVisible(!this.advancedOptionsVisible());\n\t\t}\n\n\t\ttoggleHelp(): void {\n\t\t\tthis.helpVisible(!this.helpVisible());\n\t\t}\n\n\t\tonConfirm(event: JQueryEventObject) {\n\t\t\t//Sanity checks.\n\t\t\tconst changesetName = this.getChangesetName();\n\t\t\tif (changesetName === '') {\n\t\t\t\talert('Error: The changeset has not been saved yet (name is empty).');\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (!this.meta().isValid()) {\n\t\t\t\t//This should never happen because the confirm button is disabled\n\t\t\t\t//when the metadata is invalid.\n\t\t\t\talert('Error: The admin theme details are not valid.');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst metadata = this.meta().toObject();\n\n\t\t\tthis.isOperationInProgress(true);\n\n\t\t\tconst $form = $('#ame-ac-theme-download-request-form');\n\t\t\tconst $frame = $('#ame-ac-theme-download-frame');\n\n\t\t\t//Cancel the operation and re-enable buttons if the request takes too long.\n\t\t\tlet isCancelledOrDone: boolean = false;\n\t\t\tconst requestTimeoutMs = 30000;\n\t\t\tconst requestStartTime = (new Date()).getTime();\n\t\t\tlet statusCheckInterval: ReturnType | null = null;\n\n\t\t\tconst cleanup = this.cleanupCurrentDownload = () => {\n\t\t\t\tisCancelledOrDone = true;\n\n\t\t\t\t$frame.off('load.ameAcDownloadAdminTheme');\n\t\t\t\tif (timeoutTimer) {\n\t\t\t\t\tclearTimeout(timeoutTimer);\n\t\t\t\t}\n\t\t\t\tif (statusCheckInterval) {\n\t\t\t\t\tclearInterval(statusCheckInterval);\n\t\t\t\t}\n\t\t\t\t$frame.attr('src', 'about:blank');\n\n\t\t\t\tthis.isOperationInProgress(false);\n\n\t\t\t\tif (this.cleanupCurrentDownload === cleanup) {\n\t\t\t\t\tthis.cleanupCurrentDownload = () => {\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst timeoutTimer = setTimeout(() => {\n\t\t\t\tcleanup();\n\t\t\t\talert('Error: The download operation timed out.');\n\t\t\t}, requestTimeoutMs);\n\n\t\t\tthis.savePendingChangesetData().then(\n\t\t\t\t() => {\n\t\t\t\t\tif (isCancelledOrDone) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.changesetName(changesetName);\n\t\t\t\t\tthis.metadataJson(JSON.stringify(metadata));\n\n\t\t\t\t\t//The server will set a cookie with a unique name that can be used\n\t\t\t\t\t//to check if the download has been initiated. Note that the user\n\t\t\t\t\t//can still cancel the download.\n\t\t\t\t\tconst cookieName = ('ameAcFileDownload_'\n\t\t\t\t\t\t+ new Date().getTime()\n\t\t\t\t\t\t+ '_'\n\t\t\t\t\t\t+ Math.round(Math.random() * 10000) //No dots allowed these cookie names.\n\t\t\t\t\t);\n\t\t\t\t\tthis.downloadCookieName(cookieName);\n\n\t\t\t\t\t//Clear the frame to prevent the old response from being read.\n\t\t\t\t\t$frame.attr('src', 'about:blank');\n\t\t\t\t\ttry {\n\t\t\t\t\t\t$frame.contents().find('body').html('');\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t//Ignore but log cross-origin errors. These should not happen in practice.\n\t\t\t\t\t\tif (console && console.error) {\n\t\t\t\t\t\t\tconsole.error(e);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tstatusCheckInterval = setInterval(() => {\n\t\t\t\t\t\tconst cookieValue = $.cookie(cookieName);\n\t\t\t\t\t\tif (cookieValue) {\n\t\t\t\t\t\t\tcleanup();\n\t\t\t\t\t\t\t$.removeCookie(cookieName);\n\n\t\t\t\t\t\t\t//Close the dialog when the download starts.\n\t\t\t\t\t\t\tthis.isOpen(false);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ((new Date()).getTime() - requestStartTime > requestTimeoutMs) {\n\t\t\t\t\t\t\tcleanup();\n\t\t\t\t\t\t}\n\t\t\t\t\t}, 1000);\n\n\t\t\t\t\t$frame.on('load.ameAcDownloadAdminTheme', () => {\n\t\t\t\t\t\t//Get the response from the frame. It should be JSON displayed as text.\n\t\t\t\t\t\tconst responseText = String($frame.contents().text()).trim();\n\t\t\t\t\t\tconst response = JSON.parse(responseText);\n\n\t\t\t\t\t\tcleanup();\n\n\t\t\t\t\t\tif ((response === null) || (typeof response !== 'object')) {\n\t\t\t\t\t\t\talert('Error: Received an invalid response from the server.');\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif (!response.success) {\n\t\t\t\t\t\t\t\tlet errorMessage;\n\t\t\t\t\t\t\t\tif (response.data.message) {\n\t\t\t\t\t\t\t\t\terrorMessage = response.data.message;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\terrorMessage = 'An unknown error occurred on the server.';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\talert(errorMessage);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t//This should never happen in practice.\n\t\t\t\t\t\t\t\talert('Error: The server did not start the download correctly.');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\t$form.trigger('submit');\n\t\t\t\t},\n\t\t\t\t() => {\n\t\t\t\t\tif (isCancelledOrDone) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tcleanup();\n\t\t\t\t\talert('Error: Could not save the changeset data before generating an admin theme.')\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\n\t\tonClose(event: JQueryEventObject, ui: any) {\n\t\t\tthis.cleanupCurrentDownload();\n\t\t}\n\t}\n\n\t//endregion\n\n\tclass SectionNavigation {\n\t\tprivate sectionNavStack: KnockoutObservableArray = ko.observableArray([] as string[]);\n\t\tprivate $sectionList: JQuery;\n\n\t\tpublic readonly breadcrumbs: KnockoutObservable;\n\n\t\tconstructor() {\n\t\t\tthis.$sectionList = $('#ame-ac-container-collection');\n\n\t\t\tthis.$sectionList.on('click', '.ame-ac-section-link', (event) => {\n\t\t\t\tevent.preventDefault()\n\n\t\t\t\tif (event.currentTarget === null) {\n\t\t\t\t\treturn; //Shouldn't happen in practice, but let's satisfy the type checker.\n\t\t\t\t}\n\n\t\t\t\tconst targetId = $(event.currentTarget).data('target-id');\n\t\t\t\tif (targetId) {\n\t\t\t\t\tthis.navigateToSection(targetId);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tthis.$sectionList.on('click', '.ame-ac-section-back-button', (event) => {\n\t\t\t\tevent.preventDefault()\n\t\t\t\tthis.navigateBack();\n\t\t\t});\n\n\t\t\tthis.breadcrumbs = ko.pureComputed(() => {\n\t\t\t\treturn this.sectionNavStack()\n\t\t\t\t\t.map((sectionId) => $('#' + sectionId))\n\t\t\t\t\t.filter(($section) => $section.length > 0)\n\t\t\t\t\t.map(($section) => {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\ttitle: $section.find('.ame-ac-section-title .ame-ac-section-own-title')\n\t\t\t\t\t\t\t\t.first().text()\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t});\n\t\t}\n\n\t\tnavigateToSection(sectionElementId: string) {\n\t\t\tconst $section = $('#' + sectionElementId);\n\t\t\tif ($section.length === 0) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ($section.hasClass('ame-ac-current-section')) {\n\t\t\t\treturn; //Already on this section.\n\t\t\t}\n\n\t\t\t//If the requested section is in the navigation stack, navigate back\n\t\t\t//to it instead of putting more sections on the stack.\n\t\t\tconst stackIndex = this.sectionNavStack.indexOf(sectionElementId);\n\t\t\tif (stackIndex !== -1) {\n\t\t\t\twhile (this.sectionNavStack().length > stackIndex) {\n\t\t\t\t\tthis.navigateBack();\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst $previousSection = this.$sectionList.find('.ame-ac-current-section');\n\t\t\tif ($previousSection.length > 0) {\n\t\t\t\tthis.expectTransition($previousSection, '.ame-ac-section');\n\t\t\t\t$previousSection\n\t\t\t\t\t.removeClass('ame-ac-current-section')\n\t\t\t\t\t.addClass('ame-ac-previous-section');\n\t\t\t\tthis.sectionNavStack.push($previousSection.attr('id'));\n\n\t\t\t\t$previousSection.trigger('adminMenuEditor:leaveSection');\n\t\t\t}\n\n\t\t\tthis.expectTransition($section, '.ame-ac-section');\n\t\t\t$section.addClass('ame-ac-current-section');\n\n\t\t\t$section.trigger('adminMenuEditor:enterSection');\n\t\t}\n\n\t\tnavigateBack() {\n\t\t\tif (this.sectionNavStack().length < 1) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst $newCurrentSection = $('#' + this.sectionNavStack.pop());\n\t\t\tif ($newCurrentSection.length === 0) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst $oldCurrentSection = this.$sectionList.find('.ame-ac-current-section');\n\t\t\tthis.expectTransition($oldCurrentSection, '.ame-ac-section');\n\t\t\t$oldCurrentSection.removeClass('ame-ac-current-section ame-ac-previous-section');\n\t\t\t$oldCurrentSection.trigger('adminMenuEditor:leaveSection');\n\n\t\t\tconst $oldPreviousSection = this.$sectionList.find('.ame-ac-previous-section');\n\t\t\t$oldPreviousSection.removeClass('ame-ac-previous-section');\n\n\t\t\t//Show the new current section.\n\t\t\tthis.expectTransition($newCurrentSection, '.ame-ac-section');\n\t\t\t$newCurrentSection.addClass('ame-ac-current-section');\n\t\t\t$newCurrentSection.trigger('adminMenuEditor:enterSection');\n\n\t\t\t//The next section in the stack becomes the previous section.\n\t\t\tif (this.sectionNavStack().length > 0) {\n\t\t\t\tthis.$sectionList.find('#' + this.sectionNavStack()[this.sectionNavStack().length - 1])\n\t\t\t\t\t.addClass('ame-ac-previous-section');\n\t\t\t}\n\t\t}\n\n\t\t//Add a special class to sections when they have an active CSS transition.\n\t\t//This is used to keep both sections visible while the previous section\n\t\t//slides out and the next section slides in.\n\t\texpectTransition($element: JQuery, requiredSelector: string) {\n\t\t\tif (prefersReducedMotion) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ($element.data('ameHasTransitionEvents')) {\n\t\t\t\treturn; //Event handler(s) already added.\n\t\t\t}\n\n\t\t\tconst transitionEvents = 'transitionend transitioncancel';\n\n\t\t\t$element.addClass('ame-ac-transitioning');\n\n\t\t\tfunction transitionEndCallback(event: JQueryEventObject) {\n\t\t\t\t//Ignore events that bubble from child elements.\n\t\t\t\tif (!$(event.target).is(requiredSelector)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t$element\n\t\t\t\t\t.off(transitionEvents, transitionEndCallback)\n\t\t\t\t\t.data('ameHasTransitionEvents', null)\n\t\t\t\t\t.removeClass('ame-ac-transitioning');\n\t\t\t}\n\n\t\t\t$element.data('ameHasTransitionEvents', true);\n\t\t\t$element.on(transitionEvents, transitionEndCallback);\n\t\t}\n\t}\n\n\texport interface NavigationBreadcrumb {\n\t\ttitle: string;\n\t}\n\n\texport class AdminCustomizer extends AmeAdminCustomizerBase.AdminCustomizerBase implements CustomizableVmInterface {\n\t\tprivate readonly exitPromptMessage = 'Unsaved changes will be lost if you navigate away from this page.';\n\t\t//Admin themes generated by this plugin should be fairly small.\n\t\tprivate readonly maxImportFileSize = 500 * 1024;\n\n\t\tsectionNavigation: SectionNavigation;\n\t\tsettings: CustomizerSettingsCollection;\n\t\tpublic readonly interfaceStructure: InterfaceStructure;\n\n\t\tprivate readonly $previewFrame: JQuery;\n\n\t\t/**\n\t\t * Preview frame URL.\n\t\t */\n\t\tprivate currentPreviewUrl: string | null = null;\n\t\t/**\n\t\t * The default preview URL that can be used when the current frame URL cannot be detected.\n\t\t */\n\t\tprivate readonly initialPreviewUrl: string;\n\t\tprivate previewConnection: ReturnType | null = null;\n\t\tprivate readonly refreshPreviewNonce: string;\n\n\t\tprivate readonly $saveButton: JQuery;\n\n\t\tpublic readonly downloadThemeDialog: DownloadThemeDialog;\n\t\tprivate $extraActionMenu: JQuery | null = null;\n\t\tprivate $extraActionButton: JQuery | null = null;\n\n\t\tprivate $importFileInput: JQuery | null = null;\n\t\tprivate isImporting: KnockoutObservable = ko.observable(false);\n\t\tprivate lastImportReport: KnockoutObservable = ko.observable(null);\n\t\tprivate isImportReportVisible: KnockoutObservable = ko.observable(true);\n\n\t\tprivate isDiscardingChanges: KnockoutObservable = ko.observable(false);\n\n\t\tpublic readonly isGeneralOverlayVisible: KnockoutObservable;\n\n\t\tprivate readonly importActionEnabled: KnockoutComputed;\n\t\tprivate readonly discardChangesActionEnabled: KnockoutComputed;\n\t\tprivate readonly downloadThemeActionEnabled: KnockoutComputed;\n\n\t\tconstructor(scriptData: ScriptData) {\n\t\t\tsuper(scriptData);\n\n\t\t\tthis.settings = new CustomizerSettingsCollection(\n\t\t\t\tscriptData.ajaxUrl,\n\t\t\t\tscriptData.saveChangesetNonce,\n\t\t\t\tscriptData.trashChangesetNonce,\n\t\t\t\tscriptData.changesetName,\n\t\t\t\tscriptData.changesetItemCount,\n\t\t\t\tscriptData.changesetStatus\n\t\t\t);\n\t\t\t_.forOwn(scriptData.settings, (data, id) => {\n\t\t\t\tif (typeof id === 'string') {\n\t\t\t\t\tthis.settings.add(unserializeSetting(id, data));\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tlet sectionIdCounter = 0;\n\n\t\t\tthis.interfaceStructure = unserializeUiElement(\n\t\t\t\tscriptData.interfaceStructure,\n\t\t\t\tthis.settings.get.bind(this.settings),\n\t\t\t\t(data: AnySpecificElementData) => {\n\t\t\t\t\tswitch (data.t) {\n\t\t\t\t\t\tcase 'section':\n\t\t\t\t\t\t\tdata.component = 'ame-ac-section';\n\t\t\t\t\t\t\t//All sections must have unique IDs for navigation to work.\n\t\t\t\t\t\t\tif (!data.id) {\n\t\t\t\t\t\t\t\tdata.id = 'autoID-' + (++sectionIdCounter);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'control-group':\n\t\t\t\t\t\t\tdata.component = 'ame-ac-control-group';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'control':\n\t\t\t\t\t\t\t//Tell controls that use number inputs to position the popup\n\t\t\t\t\t\t\t//slider within the customizer sidebar.\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t(data.component === 'ame-number-input')\n\t\t\t\t\t\t\t\t|| (data.component === 'ame-box-dimensions')\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tdata.params = data.params || {};\n\t\t\t\t\t\t\t\tdata.params.popupSliderWithin = '#ame-ac-sidebar-content';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t//Replace regular separators with AC-specific ones.\n\t\t\t\t\t\t\tif (data.component === 'ame-horizontal-separator') {\n\t\t\t\t\t\t\t\tdata.component = 'ame-ac-separator';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t//Add the changeset name to the URL (if not already present).\n\t\t\tconst currentUrl = new URL(window.location.href);\n\t\t\tif (currentUrl.searchParams.get('ame-ac-changeset') !== this.settings.changesetName()) {\n\t\t\t\tcurrentUrl.searchParams.set('ame-ac-changeset', this.settings.changesetName());\n\t\t\t\twindow.history.replaceState({}, '', currentUrl.href);\n\t\t\t}\n\n\t\t\t//When the changeset name changes, also change the URL. Discourage navigating\n\t\t\t//to the old URL (no pushState()) because the name is only expected to change\n\t\t\t//when the old changeset becomes invalid (e.g. it's deleted or published).\n\t\t\tthis.settings.changesetName.subscribe((changesetName) => {\n\t\t\t\tconst url = new URL(window.location.href);\n\t\t\t\turl.searchParams.set('ame-ac-changeset', changesetName);\n\t\t\t\twindow.history.replaceState({}, '', url.href);\n\t\t\t});\n\n\t\t\tthis.$saveButton = $('#ame-ac-apply-changes');\n\n\t\t\t//The save button should be enabled when:\n\t\t\t// - There are non-zero changes in the current changeset.\n\t\t\t// - All settings are valid.\n\t\t\t// - The changeset is not in the process of being published, deleted, etc.\n\t\t\t// - The contents of the changeset can be modified (e.g. not already published).\n\t\t\tconst isSaveButtonEnabled = ko.pureComputed(() => {\n\t\t\t\tconst changeset = this.settings.getCurrentChangeset();\n\t\t\t\treturn (\n\t\t\t\t\tchangeset.isNonEmpty()\n\t\t\t\t\t&& changeset.canBeModified()\n\t\t\t\t\t&& !this.settings.isExclusiveOperationInProgress()\n\t\t\t\t\t&& !this.settings.hasValidationErrors()\n\t\t\t\t);\n\t\t\t});\n\t\t\t//Update button state when the customizer loads.\n\t\t\tthis.$saveButton.prop('disabled', !isSaveButtonEnabled());\n\t\t\t//And also on changes.\n\t\t\tisSaveButtonEnabled.subscribe((isEnabled) => {\n\t\t\t\tthis.$saveButton.prop('disabled', !isEnabled);\n\t\t\t\t//Change the text back to the default when the button is enabled.\n\t\t\t\tif (isEnabled) {\n\t\t\t\t\tthis.$saveButton.val(this.$saveButton.data('default-text') ?? 'Save Changes');\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t//Handle the \"Save Changes\" button.\n\t\t\tthis.$saveButton.on('click', () => {\n\t\t\t\t//Show the spinner.\n\t\t\t\tconst $spinner = $('#ame-ac-primary-actions .spinner');\n\t\t\t\t$spinner.css('visibility', 'visible').show();\n\n\t\t\t\tconst publishFailNoticeId = 'ame-ac-publish-failed-notice';\n\t\t\t\t//Remove the previous error notification, if any.\n\t\t\t\t$('#' + publishFailNoticeId).remove();\n\n\t\t\t\tconst promise = this.settings.publishChangeset();\n\n\t\t\t\tpromise.fail((error) => {\n\t\t\t\t\t//Show a dismissible error notification.\n\t\t\t\t\tlet message = 'An unexpected error occurred while saving changes.';\n\t\t\t\t\tif (typeof error === 'string') {\n\t\t\t\t\t\tmessage = error;\n\t\t\t\t\t} else if (error instanceof Error) {\n\t\t\t\t\t\tmessage = error.message;\n\t\t\t\t\t} else if (typeof error.responseJSON === 'object') {\n\t\t\t\t\t\tmessage = _.get(error.responseJSON, ['data', 'message'], message);\n\t\t\t\t\t}\n\n\t\t\t\t\tconst $notice = $('
')\n\t\t\t\t\t\t.attr('id', publishFailNoticeId)\n\t\t\t\t\t\t.addClass('notice notice-error is-dismissible')\n\t\t\t\t\t\t.text(message);\n\n\t\t\t\t\t//WordPress won't automatically add the dismiss button to a dynamically\n\t\t\t\t\t//generated notice like this, so we have to do it.\n\t\t\t\t\t$notice.append(\n\t\t\t\t\t\t$('')\n\t\t\t\t\t\t\t.append('Dismiss this notice')\n\t\t\t\t\t\t\t.on('click', (event) => {\n\t\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\t\t$notice.remove(); //Not as fancy as WP does it.\n\t\t\t\t\t\t\t})\n\t\t\t\t\t);\n\n\t\t\t\t\tconst $container = $('#ame-ac-global-notification-area');\n\t\t\t\t\t$container.append($notice);\n\t\t\t\t})\n\n\t\t\t\tpromise.done(() => {\n\t\t\t\t\tthis.$saveButton.val(this.$saveButton.data('published-text') ?? 'Saved');\n\n\t\t\t\t\t//The preview could be stale. For example, the color scheme module\n\t\t\t\t\t//switches between \"actual\" and \"preview\" color schemes dynamically,\n\t\t\t\t\t//but the \"actual\" scheme could change after applying new settings.\n\t\t\t\t\t//Let's reload the preview frame to make sure it's up-to-date.\n\t\t\t\t\tthis.queuePreviewFrameReload();\n\t\t\t\t});\n\n\t\t\t\tpromise.always(() => {\n\t\t\t\t\t$spinner.css('visibility', 'hidden');\n\t\t\t\t});\n\t\t\t});\n\n\t\t\t//Prevent the user from interacting with settings while the changeset is being modified.\n\t\t\tthis.settings.isExclusiveOperationInProgress.subscribe((isInProgress) => {\n\t\t\t\t$('#ame-ac-sidebar-blocker-overlay').toggle(isInProgress);\n\t\t\t});\n\n\t\t\t//Show a general overlay with a progress spinner while something is happening.\n\t\t\tthis.isGeneralOverlayVisible = ko.pureComputed(() => {\n\t\t\t\treturn this.isImporting() || this.isDiscardingChanges();\n\t\t\t});\n\n\t\t\t//Initialize the \"download admin theme\" dialog.\n\t\t\tthis.downloadThemeDialog = new DownloadThemeDialog(\n\t\t\t\t() => this.settings.getCurrentChangeset().name(),\n\t\t\t\t() => this.settings.savePendingSettings()\n\t\t\t);\n\n\t\t\t//Toggle available extra actions based on changeset status.\n\t\t\tthis.importActionEnabled = ko.pureComputed(() => {\n\t\t\t\tconst changeset = this.settings.getCurrentChangeset();\n\t\t\t\treturn changeset && changeset.canBeModified()\n\t\t\t\t\t&& !this.settings.isExclusiveOperationInProgress();\n\t\t\t});\n\t\t\tthis.importActionEnabled.subscribe((isEnabled) => {\n\t\t\t\tif (this.$extraActionMenu) {\n\t\t\t\t\tthis.$extraActionMenu.find('.ame-ac-import-theme-action')\n\t\t\t\t\t\t.toggleClass('ui-state-disabled', !isEnabled);\n\t\t\t\t}\n\t\t\t});\n\t\t\tthis.discardChangesActionEnabled = ko.pureComputed(() => {\n\t\t\t\tconst changeset = this.settings.getCurrentChangeset();\n\t\t\t\treturn changeset && changeset.isNonEmpty() && changeset.canBeModified()\n\t\t\t\t\t&& !this.settings.isExclusiveOperationInProgress()\n\t\t\t});\n\t\t\tthis.discardChangesActionEnabled.subscribe((isEnabled) => {\n\t\t\t\tif (this.$extraActionMenu) {\n\t\t\t\t\tthis.$extraActionMenu.find('.ame-ac-discard-changes-action')\n\t\t\t\t\t\t.toggleClass('ui-state-disabled', !isEnabled);\n\t\t\t\t}\n\t\t\t});\n\t\t\tthis.downloadThemeActionEnabled = ko.pureComputed(() => {\n\t\t\t\treturn !this.settings.isExclusiveOperationInProgress();\n\t\t\t});\n\t\t\tthis.downloadThemeActionEnabled.subscribe((isEnabled) => {\n\t\t\t\tif (this.$extraActionMenu) {\n\t\t\t\t\tthis.$extraActionMenu.find('.ame-ac-download-theme-action')\n\t\t\t\t\t\t.toggleClass('ui-state-disabled', !isEnabled);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tthis.sectionNavigation = new SectionNavigation();\n\n\t\t\t//Set up the preview frame.\n\t\t\tthis.$previewFrame = $('iframe#ame-ac-preview');\n\n\t\t\tthis.initialPreviewUrl = scriptData.initialPreviewUrl;\n\t\t\tthis.refreshPreviewNonce = scriptData.refreshPreviewNonce;\n\n\t\t\tthis.$previewFrame.on('load', () => {\n\t\t\t\tthis.isFrameLoading = false;\n\n\t\t\t\t//The URL that was actually loaded might not match the one that\n\t\t\t\t//was requested (e.g. because there was a redirect).\n\t\t\t\tthis.currentPreviewUrl = null;\n\n\t\t\t\t//Close the previous postMessage connection.\n\t\t\t\tif (this.previewConnection) {\n\t\t\t\t\tthis.previewConnection.disconnect();\n\t\t\t\t\tthis.previewConnection = null;\n\t\t\t\t}\n\n\t\t\t\tconst frame = this.$previewFrame.get(0) as HTMLIFrameElement;\n\t\t\t\tif (!frame || !(frame instanceof HTMLIFrameElement)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t//Try to get the preview URL from the iframe.\n\t\t\t\ttry {\n\t\t\t\t\tconst url = frame.contentWindow?.location.href;\n\t\t\t\t\tif (url) {\n\t\t\t\t\t\tthis.currentPreviewUrl = url;\n\t\t\t\t\t}\n\t\t\t\t} catch (e) {\n\t\t\t\t\t//We can't get the URL directly, probably because it's a cross-origin iframe.\n\t\t\t\t}\n\n\t\t\t\tthis.previewConnection = AmeAcCommunicator.connectToChild(\n\t\t\t\t\tframe,\n\t\t\t\t\t{\n\t\t\t\t\t\t'setPreviewUrl': (url: string) => {\n\t\t\t\t\t\t\tif (this.isPreviewableUrl(url)) {\n\t\t\t\t\t\t\t\tthis.previewUrl = url;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\t'notifyPreviewUrlChanged': (url: string) => {\n\t\t\t\t\t\t\tthis.currentPreviewUrl = url;\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tthis.allowedCommOrigins,\n\t\t\t\t\tscriptData.isWpDebugEnabled\n\t\t\t\t);\n\n\t\t\t\tthis.previewConnection.promise.then((connection) => {\n\t\t\t\t\tif (typeof connection === 'undefined') {\n\t\t\t\t\t\t//This should never happen, but the type checker doesn't know that.\n\t\t\t\t\t\tthrow new Error('Unexpected error: Connection apparently succeeded, but the connection object is undefined');\n\t\t\t\t\t}\n\n\t\t\t\t\tconnection.execute('getCurrentUrl').then((url) => {\n\t\t\t\t\t\tif (url && (typeof url === 'string')) {\n\t\t\t\t\t\t\tthis.currentPreviewUrl = url;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\t//Notify other scripts that the preview frame is loaded and\n\t\t\t\t\t//the postMessage connection is ready for use.\n\t\t\t\t\t$('body').trigger('adminMenuEditor:acPreviewConnectionReady');\n\t\t\t\t});\n\t\t\t});\n\n\t\t\tthis.previewUrl = this.initialPreviewUrl;\n\n\t\t\t//Notify other scripts. This lets them register custom controls and so on.\n\t\t\t$('#ame-ac-admin-customizer').trigger('adminMenuEditor:acRegister', [this]);\n\n\t\t\tconst throttledReloadPreview = _.throttle(\n\t\t\t\t() => {\n\t\t\t\t\tthis.queuePreviewFrameReload();\n\t\t\t\t},\n\t\t\t\t1000, //The reload method does its own throttling, so we use a low wait time here.\n\t\t\t\t{leading: true, trailing: true}\n\t\t\t);\n\n\t\t\t//Refresh the preview when any setting changes.\n\t\t\tthis.settings.addChangeListener((setting, newValue) => {\n\t\t\t\tif (\n\t\t\t\t\tsetting.supportsPostMessage\n\t\t\t\t\t&& this.previewConnection\n\t\t\t\t\t&& this.previewConnection.isConnected\n\t\t\t\t) {\n\t\t\t\t\tthis.previewConnection.execute('previewSetting', setting.id, newValue);\n\t\t\t\t} else {\n\t\t\t\t\tthrottledReloadPreview();\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tconst registerUnloadPrompt = () => {\n\t\t\t\t//Ask for confirmation when the user tries to leave the page and the changeset\n\t\t\t\t//has unpublished changes.\n\t\t\t\t$(window).on('beforeunload.ame-ac-exit-confirm', (event) => {\n\t\t\t\t\tif (this.hasUnpublishedChanges()) {\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t//Note: The confirmation prompt will only be displayed if the user\n\t\t\t\t\t\t//has interacted with the page (e.g. clicked something).\n\n\t\t\t\t\t\t//As of this writing, MDN says that some browsers still don't support triggering\n\t\t\t\t\t\t//an \"unsaved changes\" prompt with event.preventDefault(). You need to set\n\t\t\t\t\t\t//event.returnValue to a string or return a string from the event handler.\n\t\t\t\t\t\t//Modern browsers will ignore the content and display their own generic message.\n\t\t\t\t\t\treturn this.exitPromptMessage;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t/*\n\t\t\t Allegedly, registering a beforeunload handler can cause the browser to\n\t\t\t disable some optimizations, so let's only do it when the user changes\n\t\t\t something or the changeset already contains some changes.\n\t\t\t */\n\t\t\tif (this.settings.getCurrentChangeset().isNonEmpty()) {\n\t\t\t\tregisterUnloadPrompt();\n\t\t\t} else {\n\t\t\t\tconst listenerId = this.settings.addChangeListener(() => {\n\t\t\t\t\t//Remove the listener after it has been triggered once.\n\t\t\t\t\tthis.settings.removeChangeListener(listenerId);\n\t\t\t\t\tregisterUnloadPrompt();\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\tgetSettingObservable(settingId: string, defaultValue: any): KnockoutObservable {\n\t\t\t//Let's just implement this temporarily while working on refactoring this\n\t\t\t//stuff to use KO components.\n\t\t\treturn this.settings\n\t\t\t\t.get(settingId)\n\t\t\t\t.map(setting => setting.value)\n\t\t\t\t.getOrElse(ko.observable(defaultValue));\n\t\t}\n\n\t\tgetAllSettingValues(): Record {\n\t\t\tthrow new Error('Method not implemented.');\n\t\t}\n\n\t\tget previewUrl(): string | null {\n\t\t\treturn this.currentPreviewUrl;\n\t\t}\n\n\t\tset previewUrl(url: string | null) {\n\t\t\tif (url === this.currentPreviewUrl) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t//The URL starts out as null, but it cannot be set to NULL again after\n\t\t\t//the preview frame has been loaded.\n\t\t\tif (url === null) {\n\t\t\t\tthrow new Error('Cannot directly set preview URL to null');\n\t\t\t}\n\n\t\t\tif (this.isPreviewableUrl(url)) {\n\t\t\t\tthis.navigatePreviewFrame(url);\n\t\t\t}\n\t\t}\n\n\t\tprivate navigatePreviewFrame(url: string | null = null, forceReload: boolean = false) {\n\t\t\tconst oldUrl = this.previewUrl;\n\t\t\tif (url === null) {\n\t\t\t\turl = oldUrl ?? this.initialPreviewUrl;\n\t\t\t}\n\n\t\t\tconst isSameUrl = (oldUrl === url);\n\t\t\tif (isSameUrl && !forceReload) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t//If there are any unsaved changes, let's include them in the preview by simulating\n\t\t\t//a form submission and sending the changes as form data. The server-side component\n\t\t\t//will merge these changes with existing changeset data.\n\t\t\tconst unsavedChanges = this.settings.unsavedChanges;\n\t\t\tconst simulateFormSubmission = !_.isEmpty(unsavedChanges);\n\n\t\t\tconst parsedUrl = new URL(url);\n\n\t\t\t//If we're not using form submission, add a special parameter\n\t\t\t//to the URL to force a refresh.\n\t\t\tconst refreshParam = '_ame-ac-refresh-trigger';\n\t\t\tif (isSameUrl && !simulateFormSubmission) {\n\t\t\t\tparsedUrl.searchParams.set(refreshParam, Date.now() + '_' + Math.random());\n\t\t\t} else {\n\t\t\t\t//Otherwise, remove the parameter just to be safe.\n\t\t\t\tparsedUrl.searchParams.delete(refreshParam);\n\t\t\t}\n\n\t\t\t//Ensure that the changeset used in the preview matches the current\n\t\t\t//changeset and preview is enabled. This is just a precaution. Normally,\n\t\t\t//the preview script automatically changes link URLs.\n\t\t\tparsedUrl.searchParams.set('ame-ac-changeset', this.settings.changesetName());\n\t\t\tparsedUrl.searchParams.set('ame-ac-preview', '1');\n\n\t\t\tthis.hasPendingPreviewReload = false; //Reloading now, so no longer pending.\n\t\t\tthis.isFrameLoading = true;\n\n\t\t\t//console.info('navigatePreviewFrame: Navigating to ' + parsedUrl.href);\n\t\t\tif (simulateFormSubmission) {\n\t\t\t\tconst formData = {\n\t\t\t\t\taction: 'ws_ame_ac_refresh_preview_frame',\n\t\t\t\t\t\"ame-ac-changeset\": this.settings.changesetName(),\n\t\t\t\t\tmodified: JSON.stringify(unsavedChanges),\n\t\t\t\t\tnonce: this.refreshPreviewNonce\n\t\t\t\t}\n\n\t\t\t\tconst $form = $('
')\n\t\t\t\t\t.attr('method', 'post')\n\t\t\t\t\t.attr('action', parsedUrl.href)\n\t\t\t\t\t.attr('target', 'ame-ac-preview-frame')\n\t\t\t\t\t.appendTo('body');\n\n\t\t\t\tlet key: keyof typeof formData;\n\t\t\t\tfor (key in formData) {\n\t\t\t\t\tconst value = formData[key];\n\t\t\t\t\t$('')\n\t\t\t\t\t\t.attr('type', 'hidden')\n\t\t\t\t\t\t.attr('name', key)\n\t\t\t\t\t\t.val(value)\n\t\t\t\t\t\t.appendTo($form);\n\t\t\t\t}\n\n\t\t\t\tthis.currentPreviewUrl = parsedUrl.href;\n\t\t\t\t$form.trigger('submit');\n\t\t\t\t$form.remove();\n\t\t\t} else {\n\t\t\t\tthis.currentPreviewUrl = parsedUrl.href;\n\t\t\t\tthis.$previewFrame.attr('src', this.currentPreviewUrl);\n\t\t\t}\n\t\t}\n\n\t\tprivate _isFrameLoading: boolean = false;\n\t\tprivate frameLoadingTimeoutId: number | null = null;\n\t\tprivate lastPreviewLoadTimestamp: Date = new Date(0);\n\n\t\tprivate reloadWaitTimeoutId: number | null = null;\n\t\tprivate hasPendingPreviewReload: boolean = false;\n\n\t\tprivate set isFrameLoading(isLoading: boolean) {\n\t\t\tconst wasLoadingBefore = this._isFrameLoading;\n\t\t\tif (!isLoading && (isLoading === wasLoadingBefore)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t//In some circumstances, we may start to load a new URL before\n\t\t\t//the previous one has finished loading. This is valid and should\n\t\t\t//reset the load timeout.\n\n\t\t\t$('#ame-ac-preview-refresh-indicator').toggleClass('ame-ac-show-indicator', isLoading);\n\t\t\tif (this.frameLoadingTimeoutId) {\n\t\t\t\tclearTimeout(this.frameLoadingTimeoutId);\n\t\t\t\tthis.frameLoadingTimeoutId = null;\n\t\t\t}\n\n\t\t\tif (isLoading) {\n\t\t\t\t//As a precaution, we'll assume that if the frame doesn't load in a reasonable\n\t\t\t\t//time, it will never finish loading.\n\t\t\t\tthis.frameLoadingTimeoutId = window.setTimeout(() => {\n\t\t\t\t\tif (this.isFrameLoading) {\n\t\t\t\t\t\tthis.isFrameLoading = false;\n\t\t\t\t\t}\n\t\t\t\t}, 20000);\n\t\t\t}\n\t\t\tthis._isFrameLoading = isLoading;\n\n\t\t\tif (wasLoadingBefore && !isLoading) {\n\t\t\t\tthis.lastPreviewLoadTimestamp = new Date();\n\t\t\t}\n\n\t\t\t//Once the frame is loaded, trigger any pending reload.\n\t\t\tif (!isLoading && this.hasPendingPreviewReload) {\n\t\t\t\tthis.hasPendingPreviewReload = false;\n\t\t\t\tthis.queuePreviewFrameReload();\n\t\t\t}\n\t\t}\n\n\t\tpublic get isFrameLoading(): boolean {\n\t\t\treturn this._isFrameLoading;\n\t\t}\n\n\t\tprivate queuePreviewFrameReload() {\n\t\t\tif (this.reloadWaitTimeoutId) {\n\t\t\t\treturn; //The frame will reload soon.\n\t\t\t}\n\n\t\t\tif (this.isFrameLoading) {\n\t\t\t\tthis.hasPendingPreviewReload = true;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t//To avoid stressing the server, wait at least X ms after the last\n\t\t\t//load completes before reloading the frame.\n\t\t\tconst reloadWaitTime = 2000;\n\t\t\tconst now = new Date();\n\t\t\tconst timeSinceLastLoad = now.getTime() - this.lastPreviewLoadTimestamp.getTime();\n\t\t\tif (timeSinceLastLoad < reloadWaitTime) {\n\t\t\t\tthis.reloadWaitTimeoutId = window.setTimeout(() => {\n\t\t\t\t\tthis.reloadWaitTimeoutId = null;\n\t\t\t\t\tthis.queuePreviewFrameReload();\n\t\t\t\t}, reloadWaitTime - timeSinceLastLoad);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t//Actually reload the frame.\n\t\t\tthis.navigatePreviewFrame(null, true);\n\t\t}\n\n\t\tonBindingsApplied(rootElement: HTMLElement) {\n\t\t\t//Navigate to the root section. In the current implementation this can't happen\n\t\t\t//until bindings have been applied, so it's not part of the constructor.\n\t\t\tthis.navigateToRootSection();\n\n\t\t\t//Initialize the action menu.\n\t\t\tthis.$extraActionButton = jQuery('#ame-ac-extra-actions-trigger', rootElement);\n\t\t\tthis.$extraActionMenu = jQuery('#ame-ac-extra-actions-menu', rootElement).menu();\n\n\t\t\t//Update menu states.\n\t\t\tthis.importActionEnabled.notifySubscribers(this.importActionEnabled());\n\t\t\tthis.discardChangesActionEnabled.notifySubscribers(this.discardChangesActionEnabled());\n\n\t\t\t//Get the file picker.\n\t\t\tthis.$importFileInput = jQuery('#ame-ac-import-admin-theme-file', rootElement);\n\t\t}\n\n\t\tnavigateToRootSection() {\n\t\t\tthis.sectionNavigation.navigateToSection('ame-ac-section-structure-root');\n\t\t}\n\n\t\t// noinspection JSUnusedGlobalSymbols -- Used in at least one add-on.\n\t\t/**\n\t\t * Execute an RPC method in the preview frame.\n\t\t *\n\t\t * @param {string} methodName\n\t\t * @param {*} args\n\t\t */\n\t\texecuteRpcMethod(methodName: string, ...args: any): JQueryPromise {\n\t\t\tif (!this.previewConnection || !this.previewConnection.isConnected) {\n\t\t\t\treturn $.Deferred().reject('The preview frame is not connected.').promise();\n\t\t\t}\n\t\t\treturn this.previewConnection.execute(methodName, ...args);\n\t\t}\n\n\t\tconfirmExit() {\n\t\t\tif (this.hasUnpublishedChanges()) {\n\t\t\t\tif (window.confirm(this.exitPromptMessage)) {\n\t\t\t\t\t//Remove the confirmation prompt that appears when leaving the page.\n\t\t\t\t\t//We don't want to show two prompts.\n\t\t\t\t\t$(window).off('beforeunload.ame-ac-exit-confirm');\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\n\t\tprivate hasUnpublishedChanges(): boolean {\n\t\t\tconst changeset = this.settings.getCurrentChangeset();\n\t\t\treturn (\n\t\t\t\tchangeset.isNonEmpty()\n\t\t\t\t&& !changeset.wasPublished()\n\t\t\t\t&& (changeset.status() !== 'trash') //Can't publish a trashed changeset.\n\t\t\t);\n\t\t}\n\n\t\t// noinspection JSUnusedGlobalSymbols -- Used in the Knockout template.\n\t\ttoggleExtraActionMenu() {\n\t\t\tif (!this.$extraActionMenu) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.$extraActionMenu.toggle();\n\n\t\t\tif (this.$extraActionMenu.is(':visible')) {\n\t\t\t\t//Position the menu below the button.\n\t\t\t\tconst $button = $('#ame-ac-extra-actions-trigger');\n\t\t\t\tthis.$extraActionMenu.position({\n\t\t\t\t\tmy: 'right top',\n\t\t\t\t\tat: 'right bottom',\n\t\t\t\t\tof: $button,\n\t\t\t\t\tcollision: 'flipfit'\n\t\t\t\t});\n\n\t\t\t\t//Hide the menu when the user clicks outside the menu or the button.\n\t\t\t\t$(document).on('mousedown.ameAcExtraMenuHide', this.handleClickOutsideActionMenu.bind(this));\n\t\t\t} else {\n\t\t\t\t//Remove the click listener if it's still active.\n\t\t\t\t$(document).off('mousedown.ameAcExtraMenuHide');\n\t\t\t}\n\t\t}\n\n\t\thandleClickOutsideActionMenu(event: JQueryEventObject) {\n\t\t\tif (\n\t\t\t\t!this.$extraActionMenu\n\t\t\t\t|| !this.$extraActionMenu.is(':visible')\n\t\t\t\t|| !this.$extraActionButton\n\t\t\t) {\n\t\t\t\t//The event listener should not be active if the menu is not visible.\n\t\t\t\t$(document).off('mousedown.ameAcExtraMenuHide');\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst menuElement = this.$extraActionMenu.get(0);\n\t\t\tconst buttonElement = this.$extraActionButton.get(0);\n\t\t\tconst isClickOutsideMenu = !menuElement.contains(event.target);\n\t\t\tconst isClickOutsideButton = !buttonElement.contains(event.target);\n\n\t\t\tif (isClickOutsideMenu && isClickOutsideButton) {\n\t\t\t\tthis.hideExtraActionMenu();\n\t\t\t}\n\t\t}\n\n\t\tprivate hideExtraActionMenu() {\n\t\t\tif (!this.$extraActionMenu) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.$extraActionMenu.hide();\n\t\t\t//Stop listening for clicks outside the menu.\n\t\t\t$(document).off('mousedown.ameAcExtraMenuHide');\n\t\t}\n\n\t\tactionOpenDownloadDialog() {\n\t\t\tif (!this.downloadThemeActionEnabled()) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.downloadThemeDialog.isOpen(true);\n\t\t\tthis.isImportReportVisible(false);\n\t\t\tthis.hideExtraActionMenu();\n\t\t}\n\n\t\tactionOpenImportDialog() {\n\t\t\tif (!this.importActionEnabled()) {\n\t\t\t\t//Can't import if there is no changeset or the changeset can't be edited.\n\t\t\t\t//The menu item should be disabled in this case, but we'll check anyway.\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tthis.hideExtraActionMenu();\n\n\t\t\t//Allow the default action to proceed, which will open the file picker.\n\t\t\treturn true;\n\t\t}\n\n\t\tactionDiscardChanges() {\n\t\t\tif (!this.discardChangesActionEnabled()) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.hideExtraActionMenu();\n\n\t\t\tif (this.settings.isExclusiveOperationInProgress()) {\n\t\t\t\talert('Another operation is in progress. Please wait for it to complete before discarding changes.');\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (!confirm('Are you sure you want to discard your unsaved changes?')) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.isImportReportVisible(false);\n\t\t\tthis.isDiscardingChanges(true);\n\n\t\t\tthis.settings.trashChangeset()\n\t\t\t\t.then(() => {\n\t\t\t\t\t//Reload the customizer with a new changeset.\n\n\t\t\t\t\t//First, to get the customizer's base URL, get the current URL\n\t\t\t\t\t//and remove all query parameters except \"page\".\n\t\t\t\t\tconst url = new URL(window.location.href);\n\t\t\t\t\tconst page = url.searchParams.get('page');\n\t\t\t\t\turl.search = '';\n\t\t\t\t\turl.searchParams.set('page', page || 'ame-admin-customizer');\n\t\t\t\t\t//Don't need the hash either.\n\t\t\t\t\turl.hash = '';\n\n\t\t\t\t\t//Add a random parameter to force a reload.\n\t\t\t\t\turl.searchParams.set('_ame-ac-reload', Math.random().toString(36).substring(7));\n\n\t\t\t\t\t//Navigate to the new URL.\n\t\t\t\t\twindow.location.href = url.toString();\n\n\t\t\t\t\t//Note that the isDiscardingChanges flag is not reset here,\n\t\t\t\t\t//so the progress overlay will stay visible until the page reloads.\n\t\t\t\t})\n\t\t\t\t.fail((requestObject) => {\n\t\t\t\t\tlet message: string = requestObject.statusText || 'Unknown error.';\n\n\t\t\t\t\tif (typeof requestObject.responseJSON === 'object') {\n\t\t\t\t\t\tconst customMessage = _.get(requestObject.responseJSON, ['data', 'message']);\n\t\t\t\t\t\tif (typeof customMessage === 'string') {\n\t\t\t\t\t\t\tmessage = customMessage;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\talert('Error: ' + message);\n\t\t\t\t\tthis.isDiscardingChanges(false);\n\t\t\t\t});\n\t\t}\n\n\t\thandleImportFileSelection() {\n\t\t\tif (!this.$importFileInput) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst fileInput = this.$importFileInput.get(0) as HTMLInputElement;\n\t\t\tif (!fileInput || !fileInput.files || (fileInput.files.length < 1)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t//Get the first file. Normally, there should only be one.\n\t\t\tconst selectedFile = fileInput.files.item(0);\n\t\t\tif (!selectedFile) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t//Limit the file size.\n\t\t\tif (selectedFile.size > this.maxImportFileSize) {\n\t\t\t\talert(\n\t\t\t\t\t'Error: The selected file is too large. The maximum file size is '\n\t\t\t\t\t+ Math.round(this.maxImportFileSize / 1024) + ' KiB'\n\t\t\t\t);\n\t\t\t\t//Clear the file input.\n\t\t\t\tthis.$importFileInput.val('');\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.isImporting(true);\n\t\t\tthis.lastImportReport(null);\n\n\t\t\tJSZip.loadAsync(selectedFile).then(\n\t\t\t\t(zip) => {\n\t\t\t\t\tconst metadataFileRegex = /^([\\\\/]?[a-zA-Z0-9_-]+[\\\\/])metadata\\.json$/;\n\t\t\t\t\tconst foundMetadataFiles = zip.file(metadataFileRegex);\n\t\t\t\t\tif (!foundMetadataFiles || (foundMetadataFiles.length < 1)) {\n\t\t\t\t\t\tthrow new Error('The selected file is not an admin theme generated by this tool.');\n\t\t\t\t\t}\n\t\t\t\t\tconst metadataFile = foundMetadataFiles[0];\n\n\t\t\t\t\t//Get the directory name and separator from the metadata file path.\n\t\t\t\t\t//The prefix will usually be something like \"admin-theme-slug/\".\n\t\t\t\t\tconst matches = metadataFileRegex.exec(metadataFile.name);\n\t\t\t\t\tlet directoryPrefix: string;\n\t\t\t\t\tif (!matches || (matches.length < 2)) {\n\t\t\t\t\t\tthrow new Error('The directory structure of this ZIP file is not recognized.');\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdirectoryPrefix = matches[1];\n\t\t\t\t\t}\n\n\t\t\t\t\tconst settingsFile = zip.file(directoryPrefix + 'settings.json');\n\t\t\t\t\tif (!settingsFile) {\n\t\t\t\t\t\tthrow new Error('The selected ZIP file is missing a settings.json file.');\n\t\t\t\t\t}\n\n\t\t\t\t\t//Read both files.\n\t\t\t\t\treturn Promise.all([\n\t\t\t\t\t\tmetadataFile.async('string'),\n\t\t\t\t\t\tsettingsFile.async('string')\n\t\t\t\t\t]);\n\t\t\t\t},\n\t\t\t\t(error) => {\n\t\t\t\t\tconst errorMessage = error.message || error;\n\t\t\t\t\tthrow new Error('Error reading \"' + selectedFile.name + '\": ' + errorMessage);\n\t\t\t\t}\n\t\t\t).then((fileContents) => {\n\t\t\t\tif (!fileContents) {\n\t\t\t\t\tthrow new Error('Failed to read settings and metadata from the ZIP file.');\n\t\t\t\t}\n\n\t\t\t\tconst metadata = this.parseImportedAdminThemeFile(\n\t\t\t\t\tfileContents[0],\n\t\t\t\t\t'metadata.json',\n\t\t\t\t\tAdminThemeMetadata\n\t\t\t\t);\n\t\t\t\tconst settings = this.parseImportedAdminThemeFile(\n\t\t\t\t\tfileContents[1],\n\t\t\t\t\t'settings.json',\n\t\t\t\t\tAdminThemeSettings\n\t\t\t\t);\n\t\t\t\tconst report = new AdminThemeImportReport(selectedFile.name, metadata);\n\n\t\t\t\t//Import metadata.\n\t\t\t\tthis.downloadThemeDialog.meta(new ObservableThemeMetadata(metadata));\n\n\t\t\t\t//Import settings.\n\t\t\t\tfor (const [settingId, value] of Object.entries(settings)) {\n\t\t\t\t\treport.totalSettings++;\n\n\t\t\t\t\tconst foundSetting = this.settings.get(settingId);\n\t\t\t\t\tfoundSetting.forEach((setting) => {\n\t\t\t\t\t\tconst oldValue = setting.value();\n\t\t\t\t\t\tconst errors = setting.tryUpdate(value);\n\t\t\t\t\t\tif (errors && errors.length) {\n\t\t\t\t\t\t\treport.invalidSettings++;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treport.importedSettings++;\n\t\t\t\t\t\t\tif (oldValue != value) {\n\t\t\t\t\t\t\t\treport.differentImportedSettings++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\tif (foundSetting.isEmpty()) {\n\t\t\t\t\t\treport.skippedSettings++;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tthis.lastImportReport(report);\n\t\t\t\tthis.isImportReportVisible(true);\n\n\t\t\t}).catch((error) => {\n\t\t\t\t//Error handling: Show the error message to the user.\n\t\t\t\tlet errorMessage: string;\n\t\t\t\tif (error instanceof Error) {\n\t\t\t\t\terrorMessage = error.message;\n\t\t\t\t} else {\n\t\t\t\t\terrorMessage = String(error);\n\t\t\t\t}\n\t\t\t\talert('Error: ' + errorMessage);\n\t\t\t}).finally(() => {\n\t\t\t\tthis.isImporting(false);\n\t\t\t\tthis.$importFileInput?.val('');\n\t\t\t});\n\t\t}\n\n\t\tprivate parseImportedAdminThemeFile(\n\t\t\tcontent: string,\n\t\t\tname: string,\n\t\t\tschema: T\n\t\t): ReturnType {\n\t\t\ttry {\n\t\t\t\tconst parsedJson = JSON.parse(content);\n\t\t\t\treturn schema.parse(parsedJson);\n\t\t\t} catch (error) {\n\t\t\t\tlet errorMessage: string;\n\t\t\t\tif (error instanceof ZodError) {\n\t\t\t\t\t//Convert issues to a newline-separated string.\n\t\t\t\t\terrorMessage = error.issues.map((issue) => {\n\t\t\t\t\t\treturn issue.path.join('.') + ': ' + issue.message;\n\t\t\t\t\t}).join('\\n');\n\t\t\t\t} else if (error instanceof Error) {\n\t\t\t\t\terrorMessage = error.message;\n\t\t\t\t} else {\n\t\t\t\t\terrorMessage = String(error);\n\t\t\t\t}\n\t\t\t\t//Add the file name to the error message.\n\t\t\t\tthrow new Error('Error parsing ' + name + ':\\n' + errorMessage);\n\t\t\t}\n\t\t}\n\n\t\tdismissImportReport(): void {\n\t\t\tthis.isImportReportVisible(false);\n\t\t}\n\t}\n}\n\ndeclare global {\n\tinterface Window {\n\t\twsAdminCustomizer: AmeAdminCustomizer.AdminCustomizer;\n\t}\n}\n\njQuery(function () {\n\t//Give other scripts a chance to load before we start.\n\t//Some of them also use jQuery to run when the DOM is ready.\n\tsetTimeout(() => {\n\t\twindow.wsAdminCustomizer = new AmeAdminCustomizer.AdminCustomizer(wsAmeAdminCustomizerData);\n\t\tconst rootElement = document.getElementById('ame-ac-admin-customizer');\n\t\tif (rootElement === null) {\n\t\t\tthrow new Error('The root element for the admin customizer was not found.');\n\t\t}\n\n\t\tko.applyBindings(window.wsAdminCustomizer, rootElement);\n\n\t\t//Notify the customizer that bindings have been applied. It needs to do some\n\t\t//additional setup that can't be done until the DOM structure is ready.\n\t\tsetTimeout(() => {\n\t\t\twindow.wsAdminCustomizer.onBindingsApplied(rootElement);\n\t\t}, 5); //Components are rendered asynchronously.\n\t}, 20);\n});","'use strict';\r\nexport var AmeAdminCustomizerBase;\r\n(function (AmeAdminCustomizerBase) {\r\n class AdminCustomizerBase {\r\n constructor(scriptData) {\r\n this.allowedCommOrigins = scriptData.allowedCommOrigins;\r\n if (this.allowedCommOrigins.length === 0) {\r\n this.allowedCommOrigins = [window.location.origin];\r\n }\r\n this.allowedPreviewUrls = scriptData.allowedPreviewUrls;\r\n this.parsedAllowedUrls = this.allowedPreviewUrls.map(url => new URL(url));\r\n }\r\n isPreviewableUrl(url) {\r\n if (typeof url === 'string') {\r\n url = new URL(url);\r\n }\r\n if (typeof url.protocol === 'undefined') {\r\n return false;\r\n }\r\n //Only HTTP(S) links are previewable.\r\n if ((url.protocol !== 'http:') && (url.protocol !== 'https:')) {\r\n return false;\r\n }\r\n //Check against the list of allowed URLs.\r\n for (const allowedUrl of this.parsedAllowedUrls) {\r\n //Protocol and host must match. The path must start with the path\r\n //of the allowed URL (possibly without a trailing slash).\r\n if ((url.protocol === allowedUrl.protocol) && (url.host === allowedUrl.host)) {\r\n const allowedPath = allowedUrl.pathname.replace(/\\/$/, '');\r\n if (url.pathname.indexOf(allowedPath) === 0) {\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n }\r\n }\r\n AmeAdminCustomizerBase.AdminCustomizerBase = AdminCustomizerBase;\r\n})(AmeAdminCustomizerBase || (AmeAdminCustomizerBase = {}));\r\n//# sourceMappingURL=admin-customizer-base.js.map","import { AmeAcSection } from './ame-ac-section.js';\r\nimport { createComponentConfig } from '../../../pro-customizables/ko-components/control-base.js';\r\nclass AmeAcContentSection extends AmeAcSection {\r\n constructor(params, $element) {\r\n super(params, $element);\r\n if ((typeof params.parentSectionLevel === 'function') && ko.isObservable(params.parentSectionLevel)) {\r\n this.parentSectionLevel = params.parentSectionLevel;\r\n }\r\n else {\r\n this.parentSectionLevel = null;\r\n }\r\n this.contentSectionLevel = ko.pureComputed(() => {\r\n let parentLevel = 0;\r\n if (this.parentSectionLevel !== null) {\r\n parentLevel = this.parentSectionLevel();\r\n }\r\n return parentLevel + 1;\r\n });\r\n //Tell child sections about our section level.\r\n this.childComponents().forEach((child) => {\r\n if (child.name === 'ame-ac-content-section') {\r\n child.params.parentSectionLevel = this.contentSectionLevel;\r\n }\r\n });\r\n this.sectionLevelClass = ko.pureComputed(() => {\r\n const level = this.contentSectionLevel();\r\n return 'ame-ac-content-section-' + level;\r\n });\r\n }\r\n}\r\nexport default createComponentConfig(AmeAcContentSection, `\n\t
  • \n\t\t

    \t\n\t
  • \t\n\t\n\t\t\n\t\t\n`);\r\n//# sourceMappingURL=ame-ac-content-section.js.map","import { ComponentBindingOptions, createComponentConfig, KoContainerViewModel } from '../../../pro-customizables/ko-components/control-base.js';\r\nimport { AmeCustomizable } from '../../../pro-customizables/assets/customizable.js';\r\nvar ControlGroup = AmeCustomizable.ControlGroup;\r\nclass AmeAcControlGroup extends KoContainerViewModel {\r\n constructor(params, $element) {\r\n var _a, _b;\r\n super(params, $element);\r\n this.labelFor = (_b = ((_a = this.uiElement) === null || _a === void 0 ? void 0 : _a.labelFor)) !== null && _b !== void 0 ? _b : null;\r\n this.titleDisabled = (typeof params.titleDisabled !== 'undefined') ? (!!params.titleDisabled) : false;\r\n }\r\n getExpectedUiElementType() {\r\n return ControlGroup;\r\n }\r\n mapChildToComponentBinding(child) {\r\n if (child.component) {\r\n return ComponentBindingOptions.fromElement(child);\r\n }\r\n return super.mapChildToComponentBinding(child);\r\n }\r\n}\r\nexport default createComponentConfig(AmeAcControlGroup, `\n\t
  • \n\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t
      \n\t\t\t
    • \n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t
    • \t\t\n\t\t
    \n\t
  • \n`);\r\n//# sourceMappingURL=ame-ac-control-group.js.map","import { createComponentConfig, KoControlViewModel } from '../../../pro-customizables/ko-components/control-base.js';\r\nimport { AmeCustomizable } from '../../../pro-customizables/assets/customizable.js';\r\nvar Control = AmeCustomizable.Control;\r\nclass MissingComponentError extends Error {\r\n constructor(uiElement) {\r\n super(`The UI element \"${uiElement.label}\" [${uiElement.id}] is missing a component name.`);\r\n this.uiElement = uiElement;\r\n }\r\n}\r\nclass AmeAcControl extends KoControlViewModel {\r\n constructor(params, $element) {\r\n super(params, $element);\r\n //uiElement is required for this component.\r\n if (!this.uiElement) {\r\n throw new Error('The uiElement parameter is required for AmeAcControl');\r\n }\r\n this.wrapperLabelEnabled = (this.uiElement.label !== '') && (!this.uiElement.includesOwnLabel);\r\n this.labelForId = this.uiElement.labelTargetId;\r\n if (!this.uiElement.component) {\r\n throw new MissingComponentError(this.uiElement);\r\n }\r\n }\r\n getExpectedUiElementType() {\r\n return Control;\r\n }\r\n}\r\nexport default createComponentConfig(AmeAcControl, `\n\t
  • \n\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t
  • \n`);\r\n//# sourceMappingURL=ame-ac-control.js.map","import { createComponentConfig, KoContainerViewModel } from '../../../pro-customizables/ko-components/control-base.js';\r\nimport { AmeCustomizable } from '../../../pro-customizables/assets/customizable.js';\r\nvar Section = AmeCustomizable.Section;\r\nimport { AmeAcSection } from './ame-ac-section.js';\r\nclass AmeAcSectionLink extends KoContainerViewModel {\r\n constructor(params, $element) {\r\n super(params, $element);\r\n //uiElement is required for this component.\r\n if (!this.uiElement) {\r\n throw new Error('The uiElement parameter is required for AmeAcSectionLink');\r\n }\r\n this.targetElementId = AmeAcSection.getSectionElementId(this.uiElement);\r\n }\r\n getExpectedUiElementType() {\r\n return Section;\r\n }\r\n}\r\nexport default createComponentConfig(AmeAcSectionLink, `\n\t
  • \n\t\t

    \n\t
  • \n`);\r\n//# sourceMappingURL=ame-ac-section-link.js.map","import { ComponentBindingOptions, createComponentConfig, KoContainerViewModel } from '../../../pro-customizables/ko-components/control-base.js';\r\nimport { AmeCustomizable } from '../../../pro-customizables/assets/customizable.js';\r\nvar Section = AmeCustomizable.Section;\r\nvar Control = AmeCustomizable.Control;\r\nvar ControlGroup = AmeCustomizable.ControlGroup;\r\nexport class AmeAcSection extends KoContainerViewModel {\r\n constructor(params, $element) {\r\n super(params, $element);\r\n //Must have an uiElement.\r\n if (this.uiElement === null) {\r\n throw new Error('AmeAcSection must have an uiElement.');\r\n }\r\n this.elementId = AmeAcSection.getSectionElementId(this.uiElement);\r\n if ((typeof params.breadcrumbs !== 'undefined') && ko.isObservable(params.breadcrumbs)) {\r\n this.breadcrumbs = params.breadcrumbs;\r\n }\r\n else {\r\n this.breadcrumbs = null;\r\n }\r\n //To keep the header text alignment consistent when navigating between sections,\r\n //let's show something even if there are no breadcrumbs.\r\n const emptyBreadcrumbText = 'Admin Menu Editor Pro';\r\n this.breadcrumbText = ko.pureComputed(() => {\r\n if (this.breadcrumbs === null) {\r\n return emptyBreadcrumbText;\r\n }\r\n const breadcrumbs = this.breadcrumbs();\r\n if (breadcrumbs.length < 1) {\r\n return emptyBreadcrumbText;\r\n }\r\n let titles = breadcrumbs.map(crumb => crumb.title);\r\n //Show the root section differently, \"Admin Customizer\" is too long.\r\n //Not sure about what text to use here, could matching the Theme Customizer be confusing?\r\n //Alternatives: 🛠️🎨, use \\uFE0E to render the emoji without colors (only works for some).\r\n //Alternatives: ⋯ and …\r\n titles[0] = 'Customizing';\r\n //Due to space constraints, show only the last 2 breadcrumbs.\r\n if (titles.length > 2) {\r\n titles = titles.slice(titles.length - 2);\r\n }\r\n return titles.join(' \\u25B8 ');\r\n });\r\n }\r\n getExpectedUiElementType() {\r\n return Section;\r\n }\r\n mapChildToComponentBinding(child) {\r\n if (child instanceof Section) {\r\n if (child.preferredRole === 'content') {\r\n return ComponentBindingOptions.fromElement(child, 'ame-ac-content-section');\r\n }\r\n else {\r\n return ComponentBindingOptions.fromElement(child, 'ame-ac-section-link');\r\n }\r\n }\r\n else if (child instanceof ControlGroup) {\r\n return ComponentBindingOptions.fromElement(child, 'ame-ac-control-group');\r\n }\r\n else if ((child instanceof Control)\r\n && (['ame-ac-separator', 'ame-horizontal-separator'].indexOf(child.component) < 0)) {\r\n //Wrap each control in a control group if it's not already in one.\r\n //Separators are an exception because they're cosmetic and need different styling.\r\n const controlGroup = child.createControlGroup();\r\n return this.mapChildToComponentBinding(controlGroup);\r\n }\r\n else {\r\n return ComponentBindingOptions.fromElement(child);\r\n }\r\n }\r\n static getSectionElementId(section) {\r\n const prefix = 'ame-ac-section-';\r\n if (section.id) {\r\n return prefix + section.id;\r\n }\r\n const slug = section.title.toLowerCase().replace(/[^a-z0-9]/g, '-');\r\n if (slug !== '') {\r\n return prefix + slug;\r\n }\r\n throw new Error('Cannot generate a section element ID because the section does not have an ID or a title.');\r\n }\r\n dispose() {\r\n super.dispose();\r\n this.childComponents.dispose();\r\n }\r\n}\r\nexport default createComponentConfig(AmeAcSection, `\n\t
      \n\t\t\n\t\t\n\t\t\t\n\t\t\n\t
    \n`);\r\n//# sourceMappingURL=ame-ac-section.js.map","import { createComponentConfig, KoStandaloneControl } from '../../../pro-customizables/ko-components/control-base.js';\r\nclass AmeAcSeparator extends KoStandaloneControl {\r\n constructor(params, $element) {\r\n super(params, $element);\r\n }\r\n}\r\nexport default createComponentConfig(AmeAcSeparator, `\n\t
  • \n`);\r\n//# sourceMappingURL=ame-ac-separator.js.map","import { createRendererComponentConfig, KoRendererViewModel } from '../../../pro-customizables/ko-components/control-base.js';\r\nimport { AmeCustomizable } from '../../../pro-customizables/assets/customizable.js';\r\nvar Section = AmeCustomizable.Section;\r\nclass AmeAcStructure extends KoRendererViewModel {\r\n constructor(params, $element) {\r\n var _a;\r\n super(params, $element);\r\n this.allSections = [];\r\n const rootSection = new Section({\r\n t: 'section',\r\n id: 'structure-root',\r\n title: (_a = this.structure.title) !== null && _a !== void 0 ? _a : 'Root',\r\n }, this.structure.children);\r\n //Recursively collect all sections.\r\n function collectChildSections(section, accumulator = []) {\r\n accumulator.push(section);\r\n for (const child of section.children) {\r\n if (child instanceof Section) {\r\n collectChildSections(child, accumulator);\r\n }\r\n }\r\n return accumulator;\r\n }\r\n this.allSections = collectChildSections(rootSection);\r\n //Give the breadcrumb list to each section, if available.\r\n if (typeof params.breadcrumbs !== 'undefined') {\r\n for (const section of this.allSections) {\r\n section.componentParams.breadcrumbs = params.breadcrumbs;\r\n }\r\n }\r\n }\r\n}\r\nexport default createRendererComponentConfig(AmeAcStructure, `\n\t\n\t\t\n\t\n`);\r\n//# sourceMappingURL=ame-ac-structure.js.map","import { createComponentConfig, KoStandaloneControl } from '../../../pro-customizables/ko-components/control-base.js';\r\nclass AmeAcValidationErrors extends KoStandaloneControl {\r\n constructor(params, $element) {\r\n super(params, $element);\r\n if (typeof params.errors !== 'undefined') {\r\n if (Array.isArray(params.errors)) {\r\n this.errors = params.errors;\r\n }\r\n else if (ko.isObservable(params.errors)) {\r\n this.errors = params.errors;\r\n }\r\n else {\r\n throw new Error('The \"errors\" parameter must be an array or an observable array.');\r\n }\r\n }\r\n else {\r\n console.log('Params:', params);\r\n throw new Error('The \"errors\" parameter is required for the AmeAcValidationErrors component.');\r\n }\r\n }\r\n}\r\nexport default createComponentConfig(AmeAcValidationErrors, `\n\t
      \n\t\t
    • \n\t\t\t\n\t\t
    • \n\t
    \n`);\r\n//# sourceMappingURL=ame-ac-validation-errors.js.map","'use strict';\r\nimport { createControlComponentConfig, KoStandaloneControl } from '../control-base.js';\r\nimport { LazyPopupSliderAdapter } from '../lazy-popup-slider-adapter.js';\r\nconst allDimensionKeys = [\r\n 'top', 'bottom', 'left', 'right',\r\n 'topLeft', 'topRight', 'bottomLeft', 'bottomRight'\r\n];\r\nfunction isDimensionKey(key) {\r\n return allDimensionKeys.includes(key);\r\n}\r\nconst DefaultDimensionsInOrder = [\r\n ['top', 'Top'],\r\n ['bottom', 'Bottom'],\r\n ['left', 'Left'],\r\n ['right', 'Right'],\r\n];\r\nconst SideDimensions = ['top', 'bottom', 'left', 'right'];\r\nconst SymmetricDimensionMap = {\r\n 'vertical': ['top', 'bottom'],\r\n 'horizontal': ['left', 'right'],\r\n};\r\nfunction isSymmetricDimensionKey(key) {\r\n return SymmetricDimensionMap.hasOwnProperty(key);\r\n}\r\nlet nextId = 0;\r\nclass AmeBoxDimensions extends KoStandaloneControl {\r\n constructor(params, $element) {\r\n super(params, $element);\r\n this.inputIdPrefix = '_ame-box-dimensions-c-input-' + (nextId++);\r\n this.unitElementId = '_ame-box-dimensions-c-unit-' + (nextId++);\r\n if ((typeof params['dimensionNames'] !== 'undefined') && Array.isArray(params['dimensionNames'])) {\r\n this.dimensionsInOrder = params['dimensionNames'];\r\n }\r\n else {\r\n this.dimensionsInOrder = DefaultDimensionsInOrder;\r\n }\r\n //Make observable proxies for the individual dimension settings.\r\n const temp = {};\r\n for (const [dimensionKey, dimensionName] of this.dimensionsInOrder) {\r\n const setting = this.settings['value.' + dimensionKey];\r\n if (!setting || (typeof setting !== 'object')) {\r\n throw new Error(`Missing setting for the \"${dimensionName}\" side.`);\r\n }\r\n temp[dimensionKey] = ko.computed({\r\n read: () => {\r\n return setting.value();\r\n },\r\n write: (newValue) => {\r\n if (newValue === '') {\r\n newValue = null;\r\n }\r\n setting.value(newValue);\r\n },\r\n deferEvaluation: true,\r\n }).extend({ 'ameNumericInput': true });\r\n }\r\n this.dimensions = temp;\r\n //Similarly, make an observable for the unit setting.\r\n const unitSetting = this.settings['value.unit'];\r\n if (!unitSetting || (typeof unitSetting !== 'object')) {\r\n throw new Error('Missing setting for the unit.');\r\n }\r\n this.unitSetting = unitSetting;\r\n const defaultDropdownOptions = {\r\n options: [],\r\n optionsText: 'text',\r\n optionsValue: 'value'\r\n };\r\n if (params.unitDropdownOptions && (typeof params.unitDropdownOptions === 'object')) {\r\n const unitDropdownOptions = params.unitDropdownOptions;\r\n this.unitDropdownOptions = {\r\n options: unitDropdownOptions['options'] || defaultDropdownOptions.options,\r\n optionsText: unitDropdownOptions['optionsText'] || defaultDropdownOptions.optionsText,\r\n optionsValue: unitDropdownOptions['optionsValue'] || defaultDropdownOptions.optionsValue,\r\n };\r\n }\r\n else {\r\n this.unitDropdownOptions = defaultDropdownOptions;\r\n }\r\n this.isLinkActive = ko.observable(false);\r\n //Enable the link button by default if all dimensions are equal. Exception: null values.\r\n //Dimensions can have different defaults, so null doesn't necessarily mean that they\r\n //are actually equal.\r\n const firstKey = Object.keys(this.dimensions)[0];\r\n const firstValue = this.dimensions[firstKey]();\r\n if ((firstValue !== null) && (firstValue !== '')) {\r\n let areAllDimensionsEqual = true;\r\n for (const [dimensionKey] of this.dimensionsInOrder) {\r\n if (this.dimensions[dimensionKey]() !== firstValue) {\r\n areAllDimensionsEqual = false;\r\n break;\r\n }\r\n }\r\n this.isLinkActive(areAllDimensionsEqual);\r\n }\r\n //When \"link\" mode is enabled, keep all dimensions in sync.\r\n let isUpdatingAllDimensions = false; //Prevent infinite loops.\r\n const updateAllDimensions = (newValue) => {\r\n if (!isUpdatingAllDimensions && this.isLinkActive()) {\r\n isUpdatingAllDimensions = true;\r\n newValue = this.normalizeValue(newValue);\r\n for (const observable of Object.values(this.dimensions)) {\r\n observable(newValue);\r\n }\r\n isUpdatingAllDimensions = false;\r\n }\r\n };\r\n for (const dimensionKey of Object.keys(this.dimensions)) {\r\n this.dimensions[dimensionKey].subscribe(updateAllDimensions);\r\n }\r\n //In \"symmetric\" mode, the top/bottom and left/right dimensions are always equal.\r\n //The control will only show \"vertical\" and \"horizontal\" inputs.\r\n this.symmetricModeEnabled = ko.observable(this.decideSymmetricMode(params));\r\n //Create computed observables for the \"vertical\" and \"horizontal\" dimensions.\r\n this.symmetricValues = {};\r\n for (const name in SymmetricDimensionMap) {\r\n if (!isSymmetricDimensionKey(name) || !SymmetricDimensionMap.hasOwnProperty(name)) {\r\n continue;\r\n }\r\n const sides = SymmetricDimensionMap[name];\r\n this.symmetricValues[name] = ko.computed({\r\n read: () => {\r\n if (this.symmetricModeEnabled()) {\r\n return this.dimensions[sides[0]]();\r\n }\r\n else {\r\n return null;\r\n }\r\n },\r\n write: (newValue) => {\r\n if (this.symmetricModeEnabled()) {\r\n newValue = this.normalizeValue(newValue);\r\n for (const side of sides) {\r\n this.dimensions[side](newValue);\r\n }\r\n }\r\n },\r\n deferEvaluation: true\r\n }).extend({ 'ameNumericInput': true });\r\n }\r\n //The control displays a different set of inputs depending on the current mode.\r\n this.inputsInOrder = ko.pureComputed(() => {\r\n let result;\r\n if (this.symmetricModeEnabled()) {\r\n result = [\r\n ['vertical', 'Vertical'],\r\n ['horizontal', 'Horizontal'],\r\n ];\r\n }\r\n else {\r\n result = this.dimensionsInOrder;\r\n }\r\n return result;\r\n });\r\n let sliderOptions = {\r\n 'positionParentSelector': '.ame-single-box-dimension',\r\n 'verticalOffset': -2,\r\n };\r\n if (typeof params.popupSliderWithin === 'string') {\r\n sliderOptions.positionWithinClosest = params.popupSliderWithin;\r\n }\r\n this.sliderAdapter = new LazyPopupSliderAdapter(params.sliderRanges ? params.sliderRanges : null, '.ame-box-dimensions-control', 'input.ame-box-dimensions-input', sliderOptions);\r\n }\r\n get classes() {\r\n return ['ame-box-dimensions-control', ...super.classes];\r\n }\r\n //noinspection JSUnusedGlobalSymbols -- Used in the template.\r\n /**\r\n * Get an observable for a specific dimension or a pair of dimensions.\r\n *\r\n * Unfortunately, Knockout doesn't seem to support nested indexed accessors\r\n * like \"dimensions[$data[0]]\", so we have to use a method instead.\r\n */\r\n getInputObservable(key) {\r\n if (this.symmetricModeEnabled() && isSymmetricDimensionKey(key)) {\r\n return this.symmetricValues[key];\r\n }\r\n if (isDimensionKey(key)) {\r\n return this.dimensions[key];\r\n }\r\n throw new Error('Invalid input key for the current mode: ' + key);\r\n }\r\n getInputIdFor(key) {\r\n return this.inputIdPrefix + '-' + key;\r\n }\r\n // noinspection JSUnusedGlobalSymbols -- Used in the template.\r\n getInputAttributes(key) {\r\n return {\r\n id: this.getInputIdFor(key),\r\n 'data-unit-element-id': this.unitElementId,\r\n 'data-ame-box-dimension': key,\r\n };\r\n }\r\n // noinspection JSUnusedGlobalSymbols -- Used in the template.\r\n getSettingFor(key) {\r\n const settingName = 'value.' + key;\r\n if (settingName in this.settings) {\r\n return this.settings[settingName];\r\n }\r\n if (this.symmetricModeEnabled() && isSymmetricDimensionKey(key)) {\r\n for (const dimension of SymmetricDimensionMap[key]) {\r\n //Since both symmetric dimensions are always equal, we can use\r\n //either of the two settings.\r\n const settingName = 'value.' + dimension;\r\n if (settingName in this.settings) {\r\n return this.settings[dimension];\r\n }\r\n }\r\n }\r\n return null;\r\n }\r\n // noinspection JSUnusedGlobalSymbols -- Actually used in the template.\r\n toggleLink() {\r\n this.isLinkActive(!this.isLinkActive());\r\n //When enabling \"link\" mode, fill all inputs with the same value.\r\n //Use the first non-empty value.\r\n if (this.isLinkActive()) {\r\n let firstValue = null;\r\n for (const dimensionObservable of Object.values(this.dimensions)) {\r\n const value = dimensionObservable();\r\n if ((value !== null) && (value !== '')) {\r\n firstValue = value;\r\n break;\r\n }\r\n }\r\n if (firstValue !== null) {\r\n firstValue = this.normalizeValue(firstValue);\r\n for (const dimensionObservable of Object.values(this.dimensions)) {\r\n dimensionObservable(firstValue);\r\n }\r\n }\r\n }\r\n }\r\n normalizeValue(value) {\r\n if (value === null) {\r\n return null;\r\n }\r\n //Convert strings to numbers, and invalid strings to null.\r\n if (typeof value === 'string') {\r\n value = parseFloat(value);\r\n if (isNaN(value)) {\r\n return null;\r\n }\r\n }\r\n return value;\r\n }\r\n /**\r\n * Determine whether the control should be in \"symmetric\" mode.\r\n */\r\n decideSymmetricMode(componentParams) {\r\n //This mode is off by default and can be enabled by setting the \"symmetricMode\" parameter.\r\n let enableMode = (typeof componentParams['symmetricMode'] !== 'undefined')\r\n ? (!!componentParams['symmetricMode'])\r\n : false;\r\n if (!enableMode) {\r\n return false;\r\n }\r\n //Symmetric mode can't be enabled if the control doesn't have all side dimensions.\r\n const hasAllSideDimensions = SideDimensions.every((key) => {\r\n return (key in this.dimensions);\r\n });\r\n if (!hasAllSideDimensions) {\r\n return false;\r\n }\r\n //It also can only be enabled if top/bottom and left/right dimensions are equal.\r\n return ((this.dimensions['top']() === this.dimensions['bottom']())\r\n && (this.dimensions['left']() === this.dimensions['right']()));\r\n }\r\n}\r\nexport default createControlComponentConfig(AmeBoxDimensions, `\n\t
    \n\t\t\n\t\t\t
    \n\t\t\t\t\t\t\t\t\n\t\t\t\t\n\t\t\t
    \n\t\t\n\t\t\n\t\t\n\t
    \n`);\r\n//# sourceMappingURL=ame-box-dimensions.js.map","import { KoStandaloneControl } from '../control-base.js';\r\nexport class ChoiceControlOption {\r\n constructor(data) {\r\n this.value = data.value;\r\n this.label = data.label;\r\n this.description = data.description || '';\r\n this.enabled = (typeof data.enabled === 'undefined') || data.enabled;\r\n this.icon = data.icon || '';\r\n }\r\n}\r\nexport class AmeChoiceControl extends KoStandaloneControl {\r\n constructor(params, $element) {\r\n super(params, $element);\r\n this.options = ko.observableArray([]);\r\n if ((typeof params['options'] !== 'undefined') && Array.isArray(params.options)) {\r\n this.options(params.options.map((optionData) => new ChoiceControlOption(optionData)));\r\n }\r\n }\r\n}\r\n//# sourceMappingURL=ame-choice-control.js.map","'use strict';\r\nimport { createControlComponentConfig, KoStandaloneControl } from '../control-base.js';\r\n/**\r\n * Code editor control with syntax highlighting.\r\n *\r\n * This control uses the custom Knockout binding \"ameCodeMirror\" to do the heavy\r\n * lifting. The binding is defined in ko-extensions.ts.\r\n *\r\n * Note: The user can disable syntax highlighting. In that case, this control\r\n * should behave like a normal textarea.\r\n */\r\nclass AmeCodeEditor extends KoStandaloneControl {\r\n constructor(params, $element) {\r\n super(params, $element);\r\n if ((typeof params.editorSettings === 'object') && (params.editorSettings !== null)) {\r\n this.editorSettings = params.editorSettings;\r\n }\r\n else {\r\n this.editorSettings = false;\r\n }\r\n }\r\n}\r\nexport default createControlComponentConfig(AmeCodeEditor, `\n\t
    \n\t\t\n\t
    \n\t\n\t\t\n\t\n`);\r\n//# sourceMappingURL=ame-code-editor.js.map","import { createControlComponentConfig, KoStandaloneControl } from '../control-base.js';\r\n/**\r\n * A wrapper for the WordPress color picker.\r\n *\r\n * Note that the custom 'ameColorPicker' binding must be available when this component\r\n * is used. You must enqueue the 'ame-ko-extensions' script for this to work.\r\n */\r\nclass AmeColorPicker extends KoStandaloneControl {\r\n constructor(params, $element) {\r\n super(params, $element);\r\n }\r\n koDescendantsComplete(node) {\r\n //Make the color picker input visible. Its visibility is set to hidden by default.\r\n if (node.nodeType === Node.COMMENT_NODE) {\r\n //The component was bound to a comment node. The real element\r\n //should be the next non-comment sibling.\r\n let nextElement;\r\n do {\r\n nextElement = node.nextElementSibling;\r\n } while (nextElement && (nextElement.nodeType === Node.COMMENT_NODE));\r\n if (!nextElement) {\r\n return; //This should never happen.\r\n }\r\n node = nextElement;\r\n }\r\n if (!node || (node.nodeType !== Node.ELEMENT_NODE)) {\r\n return; //This should never happen.\r\n }\r\n const $picker = jQuery(node);\r\n //This should be a .wp-picker-container element that contains an input.\r\n const $input = $picker.find('input.ame-color-picker');\r\n if ($input.length > 0) {\r\n $input.css('visibility', 'visible');\r\n }\r\n }\r\n get classes() {\r\n return ['ame-color-picker', 'ame-color-picker-component', ...super.classes];\r\n }\r\n}\r\nexport default createControlComponentConfig(AmeColorPicker, `\n\t\n`);\r\n//# sourceMappingURL=ame-color-picker.js.map","/*\r\n * This utility module imports all the base Knockout components and exports\r\n * a function that can be used to register the components with Knockout.\r\n */\r\nimport ameBoxDimensions from './ame-box-dimensions/ame-box-dimensions.js';\r\nimport ameColorPicker from './ame-color-picker/ame-color-picker.js';\r\nimport ameFontStylePicker from './ame-font-style-picker/ame-font-style-picker.js';\r\nimport ameImageSelector from './ame-image-selector/ame-image-selector.js';\r\nimport ameNumberInput from './ame-number-input/ame-number-input.js';\r\nimport ameNestedDescription from './ame-nested-description/ame-nested-description.js';\r\nimport ameRadioButtonBar from './ame-radio-button-bar/ame-radio-button-bar.js';\r\nimport ameRadioGroup from './ame-radio-group/ame-radio-group.js';\r\nimport ameSelectBox from './ame-select-box/ame-select-box.js';\r\nimport ameSiblingDescription from './ame-sibling-description/ame-sibling-description.js';\r\nimport ameStaticHtml from './ame-static-html/ame-static-html.js';\r\nimport ameTextInput from './ame-text-input/ame-text-input.js';\r\nimport ameToggleCheckbox from './ame-toggle-checkbox/ame-toggle-checkbox.js';\r\nimport ameUnitDropdown from './ame-unit-dropdown/ame-unit-dropdown.js';\r\nimport ameWpEditor from './ame-wp-editor/ame-wp-editor.js';\r\nimport ameHorizontalSeparator from './ame-horizontal-separator/ame-horizontal-separator.js';\r\nimport ameCodeEditor from './ame-code-editor/ame-code-editor.js';\r\nlet componentsRegistered = false;\r\n/**\r\n * Register the base Knockout components that are part of AME.\r\n *\r\n * It's safe to call this function multiple times. It will only register the components once.\r\n */\r\nexport function registerBaseComponents() {\r\n if (componentsRegistered) {\r\n return;\r\n }\r\n ko.components.register('ame-box-dimensions', ameBoxDimensions);\r\n ko.components.register('ame-color-picker', ameColorPicker);\r\n ko.components.register('ame-font-style-picker', ameFontStylePicker);\r\n ko.components.register('ame-image-selector', ameImageSelector);\r\n ko.components.register('ame-number-input', ameNumberInput);\r\n ko.components.register('ame-nested-description', ameNestedDescription);\r\n ko.components.register('ame-radio-button-bar', ameRadioButtonBar);\r\n ko.components.register('ame-radio-group', ameRadioGroup);\r\n ko.components.register('ame-select-box', ameSelectBox);\r\n ko.components.register('ame-sibling-description', ameSiblingDescription);\r\n ko.components.register('ame-static-html', ameStaticHtml);\r\n ko.components.register('ame-text-input', ameTextInput);\r\n ko.components.register('ame-toggle-checkbox', ameToggleCheckbox);\r\n ko.components.register('ame-unit-dropdown', ameUnitDropdown);\r\n ko.components.register('ame-wp-editor', ameWpEditor);\r\n ko.components.register('ame-horizontal-separator', ameHorizontalSeparator);\r\n ko.components.register('ame-code-editor', ameCodeEditor);\r\n componentsRegistered = true;\r\n}\r\n//# sourceMappingURL=ame-components.js.map","import { KoComponentViewModel } from '../control-base.js';\r\n/**\r\n * Base class for description components.\r\n */\r\nexport class AmeDescriptionComponent extends KoComponentViewModel {\r\n constructor(params, $element) {\r\n super(params, $element);\r\n this.description = params.description || '';\r\n }\r\n}\r\n//# sourceMappingURL=ame-description.js.map","import { createControlComponentConfig, KoStandaloneControl } from '../control-base.js';\r\n//Note: Font style picker CSS is already included in the main 'controls.scss' file\r\n//and won't be duplicated or included here. Instead, load that stylesheet when\r\n//using any control components.\r\n/**\r\n * Font style options that can be selected in the picker component.\r\n *\r\n * Regrettably, these are duplicated from the PHP version of the control.\r\n * Once browsers support importing JSON files, we can move this to a separate\r\n * file and use that file in both places.\r\n */\r\nconst fontStyleOptions = {\r\n \"font-style\": [\r\n {\r\n \"value\": null,\r\n \"text\": \"Default font style\",\r\n \"label\": \"—\"\r\n },\r\n {\r\n \"value\": \"italic\",\r\n \"text\": \"Italic\",\r\n \"label\": \"\"\r\n }\r\n ],\r\n \"text-transform\": [\r\n {\r\n \"value\": null,\r\n \"text\": \"Default letter case\",\r\n \"label\": \"—\"\r\n },\r\n {\r\n \"value\": \"uppercase\",\r\n \"text\": \"Uppercase\",\r\n \"label\": {\r\n 'text-transform': 'uppercase'\r\n }\r\n },\r\n {\r\n \"value\": \"lowercase\",\r\n \"text\": \"Lowercase\",\r\n \"label\": {\r\n 'text-transform': 'lowercase'\r\n }\r\n },\r\n {\r\n \"value\": \"capitalize\",\r\n \"text\": \"Capitalize each word\",\r\n \"label\": {\r\n 'text-transform': 'capitalize'\r\n }\r\n }\r\n ],\r\n \"font-variant\": [\r\n {\r\n \"value\": null,\r\n \"text\": \"Default font variant\",\r\n \"label\": \"—\"\r\n },\r\n {\r\n \"value\": \"small-caps\",\r\n \"text\": \"Small caps\",\r\n \"label\": {\r\n 'font-variant': 'small-caps'\r\n }\r\n }\r\n ],\r\n \"text-decoration\": [\r\n {\r\n \"value\": null,\r\n \"text\": \"Default text decoration\",\r\n \"label\": \"—\"\r\n },\r\n {\r\n \"value\": \"underline\",\r\n \"text\": \"Underline\",\r\n \"label\": \"\"\r\n },\r\n {\r\n \"value\": \"line-through\",\r\n \"text\": \"Strikethrough\",\r\n \"label\": \"\"\r\n }\r\n ]\r\n};\r\n//Generate label HTML for options that don't have it yet.\r\nfunction makeFontSample(styles) {\r\n let styleString = '';\r\n for (const [property, value] of Object.entries(styles)) {\r\n styleString += `${property}: ${value};`;\r\n }\r\n return `ab`;\r\n}\r\nlet flattenedOptions = [];\r\nfor (const [property, options] of Object.entries(fontStyleOptions)) {\r\n options.forEach((option) => {\r\n //Skip null values. They're used to indicate the default option,\r\n //and we don't need those in the Knockout version of this control.\r\n if (option.value === null) {\r\n return;\r\n }\r\n let labelString;\r\n if (typeof option.label === 'object') {\r\n labelString = makeFontSample(option.label);\r\n }\r\n else {\r\n labelString = option.label;\r\n }\r\n flattenedOptions.push({\r\n 'value': option.value,\r\n 'text': option.text || '',\r\n 'property': property,\r\n 'label': labelString\r\n });\r\n });\r\n}\r\nclass AmeFontStylePicker extends KoStandaloneControl {\r\n constructor(params, $element) {\r\n super(params, $element);\r\n this.options = flattenedOptions;\r\n }\r\n get classes() {\r\n return ['ame-font-style-control', ...super.classes];\r\n }\r\n // noinspection JSUnusedGlobalSymbols -- Used in the template, below.\r\n isOptionSelected(property, value) {\r\n if (this.settings.hasOwnProperty(property)) {\r\n return (this.settings[property].value() === value);\r\n }\r\n return false;\r\n }\r\n // noinspection JSUnusedGlobalSymbols -- Used in the template.\r\n toggleOption(property, value) {\r\n if (!this.settings.hasOwnProperty(property)) {\r\n return;\r\n }\r\n const targetSetting = this.settings[property];\r\n if (targetSetting.value() === value) {\r\n //When the user clicks on the currently selected option, reset it to the default.\r\n targetSetting.tryUpdate(null);\r\n }\r\n else {\r\n //Otherwise, set the new value.\r\n targetSetting.tryUpdate(value);\r\n }\r\n }\r\n}\r\n//Note: This weird spacing in the template string is intentional. It's used to\r\n//remove whitespace nodes from the DOM, which would otherwise slightly change\r\n//the layout of the control.\r\nexport default createControlComponentConfig(AmeFontStylePicker, `\n\t
    \n\t\t\n\t
    \n`);\r\n//# sourceMappingURL=ame-font-style-picker.js.map","import { createControlComponentConfig, KoStandaloneControl } from '../control-base.js';\r\nclass AmeHorizontalSeparator extends KoStandaloneControl {\r\n constructor(params, $element) {\r\n super(params, $element);\r\n }\r\n}\r\nexport default createControlComponentConfig(AmeHorizontalSeparator, `\n\t
    \n`);\r\n//# sourceMappingURL=ame-horizontal-separator.js.map","'use strict';\r\nimport { createControlComponentConfig, KoStandaloneControl } from '../control-base.js';\r\n/**\r\n * Image selector control.\r\n *\r\n * This implementation hands off the work to the existing AmeImageSelectorApi.ImageSelector\r\n * class to avoid duplicating the effort. That class is not a module because it is also\r\n * used for the more progressive-enhancement-y PHP-rendered controls, so we can't import it.\r\n */\r\nclass AmeImageSelector extends KoStandaloneControl {\r\n constructor(params, $element) {\r\n super(params, $element);\r\n this.selectorInstance = null;\r\n //Verify that our dependencies are available.\r\n if (typeof AmeImageSelectorApi === 'undefined') {\r\n throw new Error('AmeImageSelectorApi is not available. Remember to enqueue \"ame-image-selector-control-v2\".');\r\n }\r\n if (typeof AmeImageSelectorApi.ImageSelector === 'undefined') {\r\n throw new Error('AmeImageSelectorApi.ImageSelector is not available. This is probably a bug.');\r\n }\r\n this.externalUrlsAllowed = !!params.externalUrlsAllowed;\r\n this.canSelectMedia = !!params.canSelectMedia;\r\n this.imageProxy = this.settings.value.value;\r\n }\r\n get classes() {\r\n return [\r\n 'ame-image-selector-v2',\r\n ...super.classes,\r\n ];\r\n }\r\n koDescendantsComplete() {\r\n const $container = this.findChild('.ame-image-selector-v2');\r\n if ($container.length === 0) {\r\n return;\r\n }\r\n this.selectorInstance = new AmeImageSelectorApi.ImageSelector($container, {\r\n externalUrlsAllowed: this.externalUrlsAllowed,\r\n canSelectMedia: this.canSelectMedia,\r\n }, this.imageProxy());\r\n }\r\n}\r\nexport default createControlComponentConfig(AmeImageSelector, `\n\t
    \n\t\t\n\t
    \n`);\r\n//# sourceMappingURL=ame-image-selector.js.map","import { createComponentConfig } from '../control-base.js';\r\nimport { AmeDescriptionComponent } from '../ame-description/ame-description.js';\r\n/**\r\n * A simple component that displays the description of a UI element.\r\n *\r\n * Like AmeSiblingDescription, but intended to be rendered inside\r\n * the parent control or container, not as a sibling.\r\n */\r\nclass AmeNestedDescription extends AmeDescriptionComponent {\r\n}\r\nexport default createComponentConfig(AmeNestedDescription, `\n\t
    \t\n`);\r\n//# sourceMappingURL=ame-nested-description.js.map","/// \r\nimport { createControlComponentConfig, KoDependentControl } from '../control-base.js';\r\nimport { AmeCustomizable } from '../../assets/customizable.js';\r\nvar Control = AmeCustomizable.Control;\r\nexport class AmeNumberInput extends KoDependentControl {\r\n constructor(params, $element) {\r\n super(params, $element);\r\n this.sliderRanges = null;\r\n this.slider = null;\r\n this.numericValue = this.valueProxy.extend({ 'ameNumericInput': true });\r\n this.unitText = params.unitText || '';\r\n this.hasUnitDropdown = params.hasUnitDropdown || false;\r\n this.unitElementId = params.unitElementId || '';\r\n if (this.hasUnitDropdown && params.unitDropdownOptions) {\r\n this.unitDropdownOptions = {\r\n options: params.unitDropdownOptions.options || [],\r\n optionsText: params.unitDropdownOptions.optionsText || 'text',\r\n optionsValue: params.unitDropdownOptions.optionsValue || 'value'\r\n };\r\n }\r\n else {\r\n this.unitDropdownOptions = null;\r\n }\r\n this.min = params.min || null;\r\n this.max = params.max || null;\r\n this.step = params.step || null;\r\n if (params.sliderRanges) {\r\n this.sliderRanges = params.sliderRanges;\r\n }\r\n this.popupSliderWithin = (typeof params.popupSliderWithin === 'string') ? params.popupSliderWithin : null;\r\n this.inputClasses.unshift('ame-input-with-popup-slider', 'ame-number-input');\r\n }\r\n get classes() {\r\n const classes = ['ame-number-input-control'];\r\n if (this.sliderRanges !== null) {\r\n classes.push('ame-container-with-popup-slider');\r\n }\r\n classes.push(...super.classes);\r\n return classes;\r\n }\r\n get inputClasses() {\r\n const classes = ['ame-input-with-popup-slider', 'ame-number-input'];\r\n classes.push(...super.inputClasses);\r\n return classes;\r\n }\r\n getAdditionalInputAttributes() {\r\n let attributes = super.getAdditionalInputAttributes();\r\n if (this.min !== null) {\r\n attributes['min'] = this.min.toString();\r\n }\r\n if (this.max !== null) {\r\n attributes['max'] = this.max.toString();\r\n }\r\n if (this.step !== null) {\r\n attributes['step'] = this.step.toString();\r\n }\r\n if (this.unitElementId) {\r\n attributes['data-unit-element-id'] = this.unitElementId;\r\n }\r\n return attributes;\r\n }\r\n // noinspection JSUnusedGlobalSymbols -- Used in the Knockout template in this same file.\r\n showPopupSlider($data, event) {\r\n if ((this.sliderRanges === null) || (typeof AmePopupSlider === 'undefined')) {\r\n return;\r\n }\r\n //Some sanity checks.\r\n if (!event.target) {\r\n return;\r\n }\r\n const $input = jQuery(event.target);\r\n if ($input.is(':disabled') || !$input.is('input')) {\r\n return;\r\n }\r\n const $container = $input.closest('.ame-container-with-popup-slider');\r\n if ($container.length < 1) {\r\n return;\r\n }\r\n //Initialize the slider if it's not already initialized.\r\n if (!this.slider) {\r\n let sliderOptions = {};\r\n if (this.popupSliderWithin) {\r\n sliderOptions.positionWithinClosest = this.popupSliderWithin;\r\n }\r\n //In HTML, we would pass the range data as a \"data-slider-ranges\" attribute,\r\n //but here we can just set the data directly.\r\n $input.data('slider-ranges', this.sliderRanges);\r\n this.slider = AmePopupSlider.createSlider($container, sliderOptions);\r\n }\r\n this.slider.showForInput($input);\r\n }\r\n getExpectedUiElementType() {\r\n return Control;\r\n }\r\n}\r\nexport default createControlComponentConfig(AmeNumberInput, `\n\t
    \n\t\t
    \n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t
    \n\t
    \t\n`);\r\n//# sourceMappingURL=ame-number-input.js.map","'use strict';\r\nimport { createControlComponentConfig } from '../control-base.js';\r\nimport { AmeChoiceControl } from '../ame-choice-control/ame-choice-control.js';\r\nclass AmeRadioButtonBar extends AmeChoiceControl {\r\n constructor(params, $element) {\r\n super(params, $element);\r\n }\r\n get classes() {\r\n return ['ame-radio-button-bar-control', ...super.classes];\r\n }\r\n}\r\nexport default createControlComponentConfig(AmeRadioButtonBar, `\n\t
    \n\t\t\n\t\t\n\t\t\n\t
    \n`);\r\n//# sourceMappingURL=ame-radio-button-bar.js.map","'use strict';\r\nimport { createControlComponentConfig } from '../control-base.js';\r\nimport { AmeChoiceControl } from '../ame-choice-control/ame-choice-control.js';\r\n// noinspection JSUnusedGlobalSymbols -- Enum keys like \"Paragraph\" are used when serializing wrapStyle in PHP.\r\nvar WrapStyle;\r\n(function (WrapStyle) {\r\n WrapStyle[\"LineBreak\"] = \"br\";\r\n WrapStyle[\"Paragraph\"] = \"p\";\r\n WrapStyle[\"None\"] = \"\";\r\n})(WrapStyle || (WrapStyle = {}));\r\nfunction isWrapStyle(value) {\r\n if (typeof value !== 'string') {\r\n return false;\r\n }\r\n return (typeof WrapStyle[value] === 'string');\r\n}\r\nlet nextRadioGroupId = 1;\r\nclass AmeRadioGroup extends AmeChoiceControl {\r\n constructor(params, $element) {\r\n super(params, $element);\r\n this.wrapStyle = WrapStyle.None;\r\n this.childByValue = new Map();\r\n if ((typeof params['valueChildIndexes'] === 'object') && Array.isArray(params.valueChildIndexes)) {\r\n const children = ko.unwrap(this.inputChildren);\r\n for (const [value, index] of params.valueChildIndexes) {\r\n if (!children || !children[index]) {\r\n throw new Error('The \"' + this.label + '\" radio group has no children, but its valueChildIndexes'\r\n + ' requires child #' + index + ' to be associated with value \"' + value + '\".');\r\n }\r\n this.childByValue.set(value, children[index]);\r\n }\r\n }\r\n this.wrapStyle = isWrapStyle(params.wrapStyle) ? WrapStyle[params.wrapStyle] : WrapStyle.None;\r\n if (this.childByValue.size > 0) {\r\n this.wrapStyle = WrapStyle.None;\r\n }\r\n this.radioInputPrefix = (typeof params.radioInputPrefix === 'string')\r\n ? params.radioInputPrefix\r\n : ('ame-rg-input-' + nextRadioGroupId++ + '-');\r\n }\r\n get classes() {\r\n const result = ['ame-radio-group-component', ...super.classes];\r\n if (this.childByValue.size > 0) {\r\n result.push('ame-rg-has-nested-controls');\r\n }\r\n return result;\r\n }\r\n // noinspection JSUnusedGlobalSymbols -- Used in the template below.\r\n getChoiceChild(value) {\r\n return this.childByValue.get(value) || null;\r\n }\r\n // noinspection JSUnusedGlobalSymbols -- Used in the template.\r\n /**\r\n * Get the ID attribute for a radio input.\r\n *\r\n * Note: This must match the algorithm used by the PHP version of this control\r\n * to work correctly with the BorderStyleSelector control that adds style samples\r\n * to each choice and uses the ID to link them to the inputs (so that clicking\r\n * the sample selects the option).\r\n */\r\n getRadioInputId(choice) {\r\n let sanitizedValue = (choice.value !== null) ? choice.value.toString() : '';\r\n //Emulate the sanitize_key() function from WordPress core.\r\n sanitizedValue = sanitizedValue.toLowerCase().replace(/[^a-z0-9_\\-]/gi, '');\r\n return this.radioInputPrefix + sanitizedValue;\r\n }\r\n}\r\nconst choiceTemplate = `\n\t\n`;\r\nexport default createControlComponentConfig(AmeRadioGroup, `\n\t
    \n\t\t\n\t\t\t\n\t\t\t\t${choiceTemplate}
    \n\t\t\t\n\t\t\t\n\t\t\t\t

    ${choiceTemplate}

    \n\t\t\t\n\t\t\t\n\t\t\t\t${choiceTemplate}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t
    \n`);\r\n//# sourceMappingURL=ame-radio-group.js.map","import { AmeChoiceControl } from '../ame-choice-control/ame-choice-control.js';\r\nimport { createControlComponentConfig } from '../control-base.js';\r\nclass AmeSelectBox extends AmeChoiceControl {\r\n constructor(params, $element) {\r\n super(params, $element);\r\n }\r\n get classes() {\r\n return ['ame-select-box-control', ...super.classes];\r\n }\r\n}\r\nexport default createControlComponentConfig(AmeSelectBox, `\n\t\n\t\n\t\t\n\t\t\n`);\r\n//# sourceMappingURL=ame-select-box.js.map","import { createComponentConfig } from '../control-base.js';\r\nimport { AmeDescriptionComponent } from '../ame-description/ame-description.js';\r\n/**\r\n * A simple component that displays the description of a UI element.\r\n *\r\n * This should be rendered as a sibling of the UI element's component,\r\n * typically immediately after it.\r\n *\r\n * Caution: HTML is allowed in the description.\r\n */\r\nclass AmeSiblingDescription extends AmeDescriptionComponent {\r\n}\r\nexport default createComponentConfig(AmeSiblingDescription, `\n\t

    \t\n`);\r\n//# sourceMappingURL=ame-sibling-description.js.map","import { createControlComponentConfig, KoStandaloneControl } from '../control-base.js';\r\nclass AmeStaticHtml extends KoStandaloneControl {\r\n constructor(params, $element) {\r\n super(params, $element);\r\n this.containerType = 'span';\r\n this.htmlContent = (typeof params.html === 'string') ? params.html : '';\r\n if (typeof params.container === 'string') {\r\n this.containerType = params.container;\r\n }\r\n }\r\n}\r\n//Note: The HTML content has to be in a container element because Knockout doesn't allow\r\n//using the \"html\" binding with virtual elements.\r\nexport default createControlComponentConfig(AmeStaticHtml, `\n\t\n\t\t
    \n\t\n\t\n\t\t\n\t\n`);\r\n//# sourceMappingURL=ame-static-html.js.map","import { createControlComponentConfig, KoDependentControl } from '../control-base.js';\r\nexport class AmeTextInput extends KoDependentControl {\r\n constructor(params, $element) {\r\n super(params, $element);\r\n this.inputType = 'text';\r\n this.isCode = params.isCode || false;\r\n this.inputType = params.inputType || 'text';\r\n }\r\n get inputClasses() {\r\n const classes = ['regular-text'];\r\n if (this.isCode) {\r\n classes.push('code');\r\n }\r\n classes.push('ame-text-input-control', ...super.inputClasses);\r\n return classes;\r\n }\r\n getAdditionalInputAttributes() {\r\n return Object.assign({ 'type': this.inputType }, super.getAdditionalInputAttributes());\r\n }\r\n}\r\nexport default createControlComponentConfig(AmeTextInput, `\n\t\n\t\n\t\t\n\t\t\n`);\r\n//# sourceMappingURL=ame-text-input.js.map","import { createControlComponentConfig, KoStandaloneControl } from '../control-base.js';\r\nclass AmeToggleCheckbox extends KoStandaloneControl {\r\n constructor(params, $element) {\r\n super(params, $element);\r\n this.onValue = (typeof params.onValue !== 'undefined') ? params.onValue : true;\r\n this.offValue = (typeof params.offValue !== 'undefined') ? params.offValue : false;\r\n if (typeof this.settings['value'] === 'undefined') {\r\n this.isChecked = ko.pureComputed(() => false);\r\n }\r\n else {\r\n this.isChecked = ko.computed({\r\n read: () => {\r\n return this.settings.value.value() === ko.unwrap(this.onValue);\r\n },\r\n write: (newValue) => {\r\n this.settings.value.value(ko.unwrap(newValue ? this.onValue : this.offValue));\r\n },\r\n deferEvaluation: true\r\n });\r\n }\r\n }\r\n get classes() {\r\n return ['ame-toggle-checkbox-control', ...super.classes];\r\n }\r\n}\r\n//Unlike the HTML version of this control, the Knockout version doesn't have\r\n//a second, hidden checkbox. This is because the component is entirely JS-based\r\n//and doesn't need to be submitted as part of a form.\r\nexport default createControlComponentConfig(AmeToggleCheckbox, `\n\t\t\n`);\r\n//# sourceMappingURL=ame-toggle-checkbox.js.map","import { createControlComponentConfig, KoStandaloneControl } from '../control-base.js';\r\nexport class AmeUnitDropdown extends KoStandaloneControl {\r\n constructor(params, $element) {\r\n super(params, $element);\r\n this.dropdownData = params.optionData || {\r\n options: [],\r\n optionsText: 'text',\r\n optionsValue: 'value'\r\n };\r\n this.selectId = params.id || '';\r\n }\r\n}\r\nexport default createControlComponentConfig(AmeUnitDropdown, `\n\t\n`);\r\n//# sourceMappingURL=ame-unit-dropdown.js.map","'use strict';\r\nimport { createControlComponentConfig, KoStandaloneControl } from '../control-base.js';\r\n//Note: Requires Lodash, but does not explicitly import it because this plugin\r\n//already uses Lodash as a global variable (wsAmeLodash) in many places. Code\r\n//that uses this component should make sure that Lodash is loaded.\r\nlet autoAssignedIdCounter = 0;\r\n/**\r\n * List of visual editor buttons that are visible in the \"teeny\" mode.\r\n *\r\n * Found in /wp-includes/class-wp-editor.php, the editor_settings() method.\r\n * The relevant code is around line #601 (as of WP 6.1.1).\r\n */\r\nconst TeenyButtons = [\r\n 'bold',\r\n 'italic',\r\n 'underline',\r\n 'blockquote',\r\n 'strikethrough',\r\n 'bullist',\r\n 'numlist',\r\n 'alignleft',\r\n 'aligncenter',\r\n 'alignright',\r\n 'undo',\r\n 'redo',\r\n 'link',\r\n 'fullscreen'\r\n];\r\n/**\r\n * List of Quicktags editor buttons that are visible by default.\r\n *\r\n * The default list of text editor buttons used by wp.editor.initialize()\r\n * doesn't match the defaults used by wp_editor() in PHP. Let's copy the list\r\n * from /includes/class-wp-editor.php.\r\n */\r\nconst DefaultQuicktagsButtons = [\r\n 'strong', 'em', 'link', 'block', 'del', 'ins', 'img', 'ul', 'ol', 'li', 'code', 'more', 'close'\r\n];\r\nclass AmeWpEditor extends KoStandaloneControl {\r\n constructor(params, $element) {\r\n super(params, $element);\r\n this.editorId = null;\r\n this.isWpEditorInitialized = false;\r\n const textSetting = this.settings.value;\r\n if (typeof textSetting === 'undefined') {\r\n throw new Error('Visual Editor control is missing the required setting');\r\n }\r\n this.rows = params.rows || 6;\r\n this.isTeeny = !!params.teeny;\r\n }\r\n getAdditionalInputAttributes() {\r\n return Object.assign({ rows: this.rows.toString() }, super.getAdditionalInputAttributes());\r\n }\r\n koDescendantsComplete() {\r\n const $textArea = this.findChild('textarea.ame-wp-editor-textarea');\r\n if ($textArea.length === 0) {\r\n return;\r\n }\r\n const currentValue = this.valueProxy();\r\n $textArea.val((currentValue === null) ? '' : currentValue.toString());\r\n //The textarea must have an ID for wp.editor.initialize() to work.\r\n {\r\n let editorId = $textArea.attr('id');\r\n if (!editorId) {\r\n editorId = 'ws-ame-wp-editor-aid-' + (autoAssignedIdCounter++);\r\n $textArea.attr('id', editorId);\r\n }\r\n this.editorId = editorId;\r\n }\r\n //Update the setting when the contents of the underlying textarea change.\r\n //This happens when the user selects the \"Text\" tab in the editor, or when\r\n //TinyMCE is unavailable (e.g. if the \"Disable the visual editor when writing\"\r\n //option is checked in the user's profile).\r\n $textArea.on('change input', this.throttleUpdates(() => $textArea.val()));\r\n let editorSettings = {\r\n tinymce: {\r\n wpautop: true\r\n },\r\n quicktags: {\r\n //The default list of text editor buttons used by wp.editor.initialize()\r\n //doesn't match the defaults used by wp_editor() in PHP. Let's copy the list\r\n //from /includes/class-wp-editor.php.\r\n buttons: DefaultQuicktagsButtons.join(','),\r\n },\r\n //Include the \"Add Media\" button.\r\n mediaButtons: true,\r\n };\r\n if (typeof window['tinymce'] === 'undefined') {\r\n //TinyMCE is disabled or not available.\r\n editorSettings.tinymce = false;\r\n }\r\n if (this.isTeeny && (typeof editorSettings.tinymce === 'object')) {\r\n editorSettings.tinymce.toolbar1 = TeenyButtons.join(',');\r\n editorSettings.tinymce.toolbar2 = '';\r\n }\r\n const $document = jQuery(document);\r\n const self = this;\r\n //After the editor finishes initializing, add an event listener to update\r\n //the setting when the contents of the visual editor change.\r\n $document.on('tinymce-editor-init', function addMceChangeListener(event, editor) {\r\n if (editor.id !== self.editorId) {\r\n return; //Not our editor.\r\n }\r\n //According to the TinyMCE documentation, the \"Change\" event is fired\r\n //when \"changes [...] cause an undo level to be added\". This could be\r\n //too frequent for our purposes, so we'll throttle the callback.\r\n editor.on('Change', self.throttleUpdates(() => editor.getContent()));\r\n $document.off('tinymce-editor-init', addMceChangeListener);\r\n });\r\n //Unfortunately, as of WP 6.2-beta, wp.editor.initialize() doesn't add\r\n //the \"wp-editor-container\" wrapper when only the Quicktags editor is used.\r\n //This means the editor won't be styled correctly. Let's fix that.\r\n $document.on('quicktags-init', function maybeAddEditorWrapper(event, editor) {\r\n if (!editor || (editor.id !== self.editorId)) {\r\n return;\r\n }\r\n if (editor.canvas) {\r\n const $textarea = jQuery(editor.canvas);\r\n const $wrapper = $textarea.closest('.wp-editor-container');\r\n if ($wrapper.length === 0) {\r\n //Also include the toolbar in the wrapper.\r\n const $toolbar = $textarea.prevAll('.quicktags-toolbar').first();\r\n $textarea.add($toolbar).wrapAll('
    ');\r\n }\r\n }\r\n $document.off('quicktags-init', maybeAddEditorWrapper);\r\n });\r\n //Finally, initialize the editor.\r\n wp.editor.initialize($textArea.attr('id'), editorSettings);\r\n this.isWpEditorInitialized = true;\r\n }\r\n /**\r\n * Create a throttled function that updates the setting.\r\n *\r\n * There are multiple ways to get the contents of the editor (e.g. TinyMCE mode\r\n * vs a plain textarea), so using a utility function helps avoid code duplication.\r\n *\r\n * @param valueGetter\r\n * @protected\r\n */\r\n throttleUpdates(valueGetter) {\r\n const textSetting = this.settings.value;\r\n return wsAmeLodash.throttle(function () {\r\n textSetting.value(valueGetter());\r\n return void 0;\r\n }, 1000, { leading: true, trailing: true });\r\n }\r\n dispose() {\r\n //Destroy the editor. It's not clear whether this is necessary, but it's\r\n //probably a good idea to give WP a chance to clean up.\r\n if (this.isWpEditorInitialized && (this.editorId !== null)) {\r\n wp.editor.remove(this.editorId);\r\n this.isWpEditorInitialized = false;\r\n }\r\n super.dispose();\r\n }\r\n}\r\n//Note: The class of the textarea element is set directly instead of using a binding\r\n//because it must always have the \"wp-editor-area\" class for it to render correctly\r\n//(apparently, wp.editor.initialize() does not automatically add that class).\r\n//Knockout should not be able to remove the class.\r\nexport default createControlComponentConfig(AmeWpEditor, `\n\t\t\n`);\r\n//# sourceMappingURL=ame-wp-editor.js.map","import { AmeCustomizable } from '../assets/customizable.js';\r\nvar Setting = AmeCustomizable.Setting;\r\nvar InterfaceStructure = AmeCustomizable.InterfaceStructure;\r\nvar Control = AmeCustomizable.Control;\r\nexport class KoComponentViewModel {\r\n constructor(params, $element) {\r\n var _a;\r\n this.params = params;\r\n this.$element = $element;\r\n this.isBoundToComment = ($element[0]) && ($element[0].nodeType === Node.COMMENT_NODE);\r\n this.uiElement = null;\r\n const expectedType = this.getExpectedUiElementType();\r\n if (expectedType !== null) {\r\n if ((typeof params.uiElement !== 'undefined')\r\n && (params.uiElement instanceof expectedType)) {\r\n this.uiElement = params.uiElement;\r\n }\r\n else {\r\n throw new Error('uiElement is not a ' + expectedType.name + ' instance.');\r\n }\r\n }\r\n else if ((typeof params.uiElement !== 'undefined') && !(this instanceof KoStandaloneControl)) {\r\n console.warn('Unexpected \"uiElement\" parameter for ' + this.constructor.name\r\n + ' that did not expect an UI element. Did you forget to override getExpectedUiElementType() ?', params.uiElement);\r\n }\r\n if (typeof params.children !== 'undefined') {\r\n if (Array.isArray(params.children) || this.isObservableArray(params.children)) {\r\n this.inputChildren = params.children;\r\n }\r\n else {\r\n throw new Error('Invalid \"children\" parameter: expected an array or an observable array.');\r\n }\r\n }\r\n else {\r\n this.inputChildren = [];\r\n }\r\n this.customClasses = ((typeof params.classes === 'object') && Array.isArray(params.classes)) ? params.classes : [];\r\n this.customStyles = ((typeof params.styles === 'object') && (params.styles !== null)) ? params.styles : {};\r\n if (typeof params.enabled !== 'undefined') {\r\n if (ko.isObservable(params.enabled)) {\r\n this.isEnabled = params.enabled;\r\n }\r\n else {\r\n this.isEnabled = ko.pureComputed(() => !!params.enabled);\r\n }\r\n }\r\n else {\r\n this.isEnabled = ko.pureComputed(() => true);\r\n }\r\n //Get the description either from the \"description\" parameter or from the UI element.\r\n this.description = params.description\r\n ? ko.unwrap(params.description.toString())\r\n : (((_a = this.uiElement) === null || _a === void 0 ? void 0 : _a.description) || '');\r\n }\r\n dispose() {\r\n //Does nothing by default.\r\n }\r\n getExpectedUiElementType() {\r\n return null;\r\n }\r\n get classes() {\r\n return [].concat(this.customClasses);\r\n }\r\n // noinspection JSUnusedGlobalSymbols -- Used in Knockout templates.\r\n get classString() {\r\n return this.classes.join(' ');\r\n }\r\n get styles() {\r\n return Object.assign({}, this.customStyles);\r\n }\r\n findChild(selector, allowSiblingSearch = null) {\r\n if (allowSiblingSearch === null) {\r\n //Enable only if the component is bound to a comment (i.e. \"\").\r\n allowSiblingSearch = this.isBoundToComment;\r\n }\r\n if (this.isBoundToComment) {\r\n if (allowSiblingSearch) {\r\n return this.$element.nextAll(selector).first();\r\n }\r\n else {\r\n //We would never find anything because a comment node has no children.\r\n return jQuery();\r\n }\r\n }\r\n return this.$element.find(selector);\r\n }\r\n isObservableArray(value) {\r\n return (typeof value === 'object')\r\n && (value !== null)\r\n && (typeof value.slice === 'function')\r\n && (typeof value.indexOf === 'function')\r\n && (ko.isObservable(value));\r\n }\r\n}\r\nfunction makeCreateVmFunctionForComponent(ctor) {\r\n return function (params, componentInfo) {\r\n const $element = jQuery(componentInfo.element);\r\n return new ctor(params, $element);\r\n };\r\n}\r\nexport function createComponentConfig(ctor, templateString) {\r\n return {\r\n viewModel: {\r\n createViewModel: makeCreateVmFunctionForComponent(ctor),\r\n },\r\n template: templateString,\r\n };\r\n}\r\n//endregion\r\n//region Container\r\nexport class ComponentBindingOptions {\r\n // noinspection JSUnusedGlobalSymbols -- the uiElement property is used in the KO template of AC control groups.\r\n constructor(name, params, uiElement) {\r\n this.name = name;\r\n this.params = params;\r\n this.uiElement = uiElement;\r\n if (name === '') {\r\n throw new Error('Component name cannot be empty.');\r\n }\r\n }\r\n static fromElement(element, overrideComponentName = null) {\r\n if (!element.component && (overrideComponentName === null)) {\r\n throw new Error(`Cannot create component binding options for UI element \"${element.id}\" without a component name.`);\r\n }\r\n return new ComponentBindingOptions(overrideComponentName || element.component, element.getComponentParams(), element);\r\n }\r\n}\r\nexport class KoContainerViewModel extends KoComponentViewModel {\r\n constructor(params, $element) {\r\n if (typeof params.children === 'undefined') {\r\n throw new Error('Missing \"children\" parameter.');\r\n }\r\n super(params, $element);\r\n this.title = ko.pureComputed(() => {\r\n if (typeof params.title !== 'undefined') {\r\n let title = ko.unwrap(params.title);\r\n if ((title !== null) && (typeof title !== 'undefined')) {\r\n return title.toString();\r\n }\r\n }\r\n if (this.uiElement) {\r\n return this.uiElement.title;\r\n }\r\n return '';\r\n });\r\n this.childComponents = ko.pureComputed(() => {\r\n const result = ko.unwrap(this.inputChildren)\r\n .map(child => this.mapChildToComponentBinding(child))\r\n .filter(binding => binding !== null);\r\n //TypeScript does not recognize that the filter() call above removes\r\n //all null values, so we need an explicit cast.\r\n return result;\r\n });\r\n }\r\n mapChildToComponentBinding(child) {\r\n //Does not map any children by default.\r\n return null;\r\n }\r\n dispose() {\r\n super.dispose();\r\n this.childComponents.dispose();\r\n }\r\n}\r\n//endregion\r\n//region Control\r\nexport class KoControlViewModel extends KoComponentViewModel {\r\n constructor(params, $element) {\r\n var _a;\r\n super(params, $element);\r\n this.settings =\r\n ((typeof params.settings === 'object') && isSettingMap(params.settings))\r\n ? params.settings\r\n : {};\r\n if (typeof this.settings.value !== 'undefined') {\r\n this.valueProxy = this.settings.value.value;\r\n }\r\n else {\r\n this.valueProxy = ko.pureComputed(() => {\r\n console.error('Missing \"value\" setting for a control component.', this.settings, params);\r\n return '';\r\n });\r\n }\r\n //Input ID will be provided by the server if applicable.\r\n this.primaryInputId = (typeof params.primaryInputId === 'string') ? params.primaryInputId : null;\r\n this.inputAttributes = ko.pureComputed(() => {\r\n var _a;\r\n const attributes = ((_a = this.uiElement) === null || _a === void 0 ? void 0 : _a.inputAttributes) || {};\r\n const inputId = this.getPrimaryInputId();\r\n if (inputId !== null) {\r\n attributes.id = inputId;\r\n }\r\n //Note: The \"name\" field is not used because these controls are entirely JS-driven.\r\n const additionalAttributes = this.getAdditionalInputAttributes();\r\n for (const key in additionalAttributes) {\r\n if (!additionalAttributes.hasOwnProperty(key)) {\r\n continue;\r\n }\r\n attributes[key] = additionalAttributes[key];\r\n }\r\n return attributes;\r\n });\r\n if ((typeof params.label !== 'undefined') && (params.label !== null)) {\r\n const unwrappedLabel = ko.unwrap(params.label);\r\n this.label = (typeof unwrappedLabel === 'undefined') ? '' : unwrappedLabel.toString();\r\n }\r\n else {\r\n this.label = ((_a = this.uiElement) === null || _a === void 0 ? void 0 : _a.label) || '';\r\n }\r\n }\r\n get inputClasses() {\r\n var _a;\r\n return ((_a = this.uiElement) === null || _a === void 0 ? void 0 : _a.inputClasses) || [];\r\n }\r\n // noinspection JSUnusedGlobalSymbols -- Used in Knockout templates.\r\n get inputClassString() {\r\n return this.inputClasses.join(' ');\r\n }\r\n getAdditionalInputAttributes() {\r\n return {};\r\n }\r\n getPrimaryInputId() {\r\n return this.primaryInputId;\r\n }\r\n}\r\nfunction isSettingMap(value) {\r\n if (value === null) {\r\n return false;\r\n }\r\n if (typeof value !== 'object') {\r\n return false;\r\n }\r\n const valueAsRecord = value;\r\n for (const key in valueAsRecord) {\r\n if (!valueAsRecord.hasOwnProperty(key)) {\r\n continue;\r\n }\r\n if (!(valueAsRecord[key] instanceof Setting)) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n}\r\n/**\r\n * A control that doesn't use or need a UI element instance, but can still have\r\n * settings and other parameters typically associated with controls.\r\n */\r\nexport class KoStandaloneControl extends KoControlViewModel {\r\n}\r\n/**\r\n * A control that requires a UI element of the \"Control\" class.\r\n */\r\nexport class KoDependentControl extends KoControlViewModel {\r\n getExpectedUiElementType() {\r\n return Control;\r\n }\r\n}\r\nexport function createControlComponentConfig(ctor, templateString) {\r\n return {\r\n viewModel: {\r\n createViewModel: makeCreateVmFunctionForComponent(ctor),\r\n },\r\n template: templateString,\r\n };\r\n}\r\n//endregion\r\n//region Renderer\r\nexport class KoRendererViewModel extends KoComponentViewModel {\r\n constructor(params, $element) {\r\n super(params, $element);\r\n if ((typeof params.structure !== 'object') || !(params.structure instanceof InterfaceStructure)) {\r\n throw new Error('Invalid interface structure for a renderer component.');\r\n }\r\n this.structure = params.structure;\r\n }\r\n}\r\nexport function createRendererComponentConfig(ctor, templateString) {\r\n return {\r\n viewModel: {\r\n createViewModel: makeCreateVmFunctionForComponent(ctor),\r\n },\r\n template: templateString,\r\n };\r\n}\r\n//endregion\r\n//# sourceMappingURL=control-base.js.map","/// \r\n/**\r\n * This is a wrapper for the popup slider that initializes the slider on first use.\r\n * It's useful for Knockout components.\r\n */\r\nexport class LazyPopupSliderAdapter {\r\n constructor(sliderRanges, containerSelector = '.ame-container-with-popup-slider', inputSelector = 'input', sliderOptions = {}) {\r\n this.sliderRanges = sliderRanges;\r\n this.containerSelector = containerSelector;\r\n this.inputSelector = inputSelector;\r\n this.sliderOptions = sliderOptions;\r\n this.slider = null;\r\n if (!sliderOptions.hasOwnProperty('ranges')) {\r\n sliderOptions.ranges = sliderRanges;\r\n }\r\n this.handleKoClickEvent = ($data, event) => {\r\n //Verify that this is one of the inputs we're interested in.\r\n //Also, disabled inputs should not trigger the slider.\r\n if (event.target === null) {\r\n return;\r\n }\r\n const $input = jQuery(event.target);\r\n if ($input.is(':disabled') || !$input.is(this.inputSelector)) {\r\n return;\r\n }\r\n //Short-circuit if the slider is already initialized.\r\n if (this.slider) {\r\n this.slider.showForInput($input);\r\n return;\r\n }\r\n //Some sanity checks.\r\n if (typeof AmePopupSlider === 'undefined') {\r\n return;\r\n }\r\n const $container = $input.closest(this.containerSelector);\r\n if ($container.length < 1) {\r\n return;\r\n }\r\n this.initSlider($container);\r\n if (this.slider !== null) {\r\n //TS doesn't realize that this.initSlider() will initialize the slider.\r\n this.slider.showForInput($input);\r\n }\r\n };\r\n }\r\n /**\r\n * Initialize the slider if it's not already initialized.\r\n */\r\n initSlider($container) {\r\n if (this.slider) {\r\n return;\r\n }\r\n //In HTML, we would pass the range data as a \"data-slider-ranges\" attribute,\r\n //but here they are passed via the \"ranges\" option (see the constructor).\r\n this.slider = AmePopupSlider.createSlider($container, this.sliderOptions);\r\n }\r\n}\r\n//# sourceMappingURL=lazy-popup-slider-adapter.js.map"],"names":[],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"admin-customizer.bundle.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yDAAyD,IAAI;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,oBAAoB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,gCAAgC;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD;AACrD;AACA,0DAA0D;AAC1D,iCAAiC;AACjC;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,eAAe,aAAa,eAAe;AACjF;AACA;AACA;AACA,yDAAyD,2DAA2D;AACpH;AACA;AACA,wDAAwD,kCAAkC;AAC1F;AACA;AACA;AACA;AACA;AACA,+DAA+D,+BAA+B;AAC9F;AACA;AACA,sDAAsD,+BAA+B,cAAc,eAAe;AAClH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8DAA8D,0BAA0B;AACxF;AACA,qCAAqC,SAAS,oDAAoD,0BAA0B;AAC5H;AACA;AACA;AACA,iEAAiE,4BAA4B;AAC7F;AACA;AACA,+DAA+D,0BAA0B;AACzF;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,iBAAiB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,sEAAsE,EAAE,eAAe;AACvI;AACA,iDAAiD,iEAAiE,EAAE,eAAe;AACnI;AACA,4CAA4C;AAC5C;AACA;AACA;AACA,0CAA0C,EAAE,cAAc;AAC1D;AACA,0CAA0C;AAC1C;AACA;AACA;AACA,0CAA0C,EAAE,gCAAgC;AAC5E;AACA;AACA;AACA;AACA;AACA,gDAAgD,qEAAqE,EAAE,eAAe;AACtI;AACA,iDAAiD,iEAAiE,EAAE,eAAe;AACnI;AACA,4CAA4C;AAC5C;AACA;AACA;AACA,uCAAuC,EAAE,cAAc;AACvD;AACA,4CAA4C;AAC5C;AACA;AACA;AACA,uCAAuC,EAAE,cAAc;AACvD;AACA,0CAA0C;AAC1C;AACA;AACA;AACA,0CAA0C,EAAE,gCAAgC;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sDAAsD,iBAAiB;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,YAAY,mCAAmC;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,kCAAkC;AAC1E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,aAAa;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,CAAC;AACD,4BAA4B,wBAAwB;AACpD,yBAAyB,wBAAwB;AACjD;AACA;AACA;AACA;;AAEA;AACA;AACA,sEAAsE,UAAU;AAChF;AACA,CAAC,8BAA8B;;AAE/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,4DAA4D;AACxE;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,qBAAqB;AACrB;AACA,qBAAqB;AACrB;AACA,iBAAiB;AACjB;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,mCAAmC;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,mCAAmC;AAClF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,sBAAsB,gCAAgC;AACtD,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,8BAA8B;AACpD,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,GAAG;AAC/B;AACA,sCAAsC,GAAG;AACzC,8BAA8B,EAAE,UAAU,EAAE,eAAe,EAAE,UAAU,EAAE,UAAU,GAAG;AACtF;AACA;AACA,4DAA4D,GAAG,mFAAmF,GAAG;AACrJ;AACA,sCAAsC,sBAAsB,sCAAsC,uBAAuB,OAAO,GAAG,cAAc;AACjJ;AACA,qCAAqC,yBAAyB,4DAA4D,EAAE,SAAS,IAAI,MAAM,EAAE,iCAAiC,EAAE,SAAS,IAAI,yBAAyB,IAAI,GAAG,EAAE,aAAa,IAAI,GAAG,IAAI,WAAW,IAAI,GAAG,EAAE,WAAW,IAAI,GAAG,IAAI,WAAW,IAAI,GAAG,EAAE,WAAW,IAAI,GAAG,IAAI,WAAW,IAAI,GAAG,EAAE,WAAW,IAAI,GAAG,IAAI,WAAW,IAAI,GAAG,EAAE,WAAW,IAAI,GAAG,IAAI,WAAW,IAAI,GAAG,EAAE,WAAW,IAAI,GAAG,IAAI,WAAW,IAAI,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E,KAAK,EAAE,KAAK,EAAE;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,4CAA4C,cAAc;AAC1D,SAAS;AACT;AACA;AACA,4CAA4C,qBAAqB;AACjE,SAAS;AACT;AACA;AACA,4CAA4C,qBAAqB;AACjE,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,iDAAiD;AACvF;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,yBAAyB;AAC/D;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,uBAAuB;AAC7D;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,gCAAgC,+CAA+C;AAC/E;AACA;AACA,gCAAgC,6CAA6C;AAC7E;AACA;AACA,gCAAgC,+CAA+C;AAC/E;AACA;AACA,gCAAgC,8CAA8C;AAC9E;AACA;AACA,gCAAgC,8CAA8C;AAC9E;AACA;AACA,gCAAgC,+CAA+C;AAC/E;AACA;AACA,gCAAgC,8CAA8C;AAC9E;AACA;AACA,gCAAgC,4CAA4C;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,gBAAgB,cAAc;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,aAAa;AACb;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,wDAAwD;AACjF,SAAS;AACT;AACA;AACA;AACA;AACA,yBAAyB,wDAAwD;AACjF,SAAS;AACT;AACA;AACA;AACA;AACA,2BAA2B,kDAAkD;AAC7E,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,aAAa;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,gBAAgB,cAAc;AAC9B,gBAAgB,yBAAyB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,6BAA6B;AACpD;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,6BAA6B;AAC5D,iCAAiC,uCAAuC;AACxE,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,6BAA6B;AACxD;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA,oBAAoB;AACpB,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA,8BAA8B,eAAe;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,gBAAgB,MAAM;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,MAAM;AACtB;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mEAAmE,cAAc;AACjF;AACA;AACA;AACA,8DAA8D,uBAAuB,sBAAsB,cAAc;AACzH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA,4BAA4B,kBAAkB;AAC9C;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,gBAAgB,cAAc;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,gBAAgB,cAAc;AAC9B;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,iCAAiC;AACjC;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,cAAc;AAC9B;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,gBAAgB,cAAc;AAC9B;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,gBAAgB,cAAc;AAC9B;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,sDAAsD;AAC7E,SAAS;AACT;AACA;AACA;AACA;AACA,uBAAuB,sDAAsD;AAC7E,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,MAAM;AACtB;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,MAAM;AACtB;AACA,mCAAmC,6CAA6C;AAChF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,MAAM;AACtB;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,cAAc;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,mCAAmC,6CAA6C;AAChF;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC,qBAAqB;AACrB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,mCAAmC,6CAA6C;AAChF;AACA;AACA;AACA,uGAAuG,qCAAqC;AAC5I,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,kBAAkB,2CAA2C;AAC7D;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,gBAAgB,MAAM;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,gBAAgB,MAAM;AACtB;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA,yBAAyB;AACzB;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,gBAAgB,MAAM;AACtB;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,cAAc;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,kCAAkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,cAAc;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA,qDAAqD,aAAa;AAClE,+BAA+B,sCAAsC;AACrE;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,sDAAsD;AACvD;AACA;AACA;AACA,sCAAsC,SAAS;AAC/C,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,sBAAsB;AAC/D,yCAAyC,sBAAsB;AAC/D;AACA;AACA;AACA,KAAK;AACL,yCAAyC,sBAAsB;AAC/D,qCAAqC,sBAAsB;AAC3D;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,cAAc;AAChC,wBAAwB,oBAAoB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,+BAA+B;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAE+pD;;;;;;;;;;;;;;;;;;;;;;;;;;;ACh3HnpD;AAEb,gDAAgD;AAChD,qDAAqD;AACrD,+CAA+C;AAE0D;AACV;AAC9B;AACJ;AACS;AACT;AACW;AACI;AACV;AACD;AACe;AACpB;AAKrD,IAAU,kBAAkB,CA+tElC;AA/tED,WAAiB,kBAAkB;IAElC,IAAO,iBAAiB,GAAG,wGAAiC,CAAC;IAG7D,IAAO,oBAAoB,GAAG,2GAAoC,CAAC;IACnE,IAAO,kBAAkB,GAAG,yGAAkC,CAAC;IAI/D,MAAM,CAAC,GAAG,MAAM,CAAC;IACjB,MAAM,CAAC,GAAG,WAAW,CAAC;IAEtB,0GAAsB,EAAE,CAAC;IACzB,EAAE,CAAC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C,iBAAiB,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAC;QACzD,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,yCAAyC;IACjD,CAAC,EAAE,EAAE,CAAC,CAAC;AACR,CAAC,CAAC,CAAC;;;;;;;;;;;;;;;AC/wEU;AACN;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,wDAAwD;AACzD;;;;;;;;;;;;;;;;ACvCmD;AAC8C;AACjG,kCAAkC,4DAAY;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,iEAAe,uGAAqB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,EAAC;AACH;;;;;;;;;;;;;;;;ACtCgJ;AAC5D;AACpF,mBAAmB,mGAA4B;AAC/C,gCAAgC,kGAAoB;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,iHAAmC;AACtD;AACA;AACA;AACA;AACA,iEAAe,uGAAqB;AACpC;AACA;AACA;AACA;AACA,mCAAmC,cAAc;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,EAAC;AACH;;;;;;;;;;;;;;;;AC9CqH;AACjC;AACpF,cAAc,8FAAuB;AACrC;AACA;AACA,iCAAiC,gBAAgB,KAAK,aAAa;AACnE;AACA;AACA;AACA,2BAA2B,gGAAkB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iEAAe,uGAAqB;AACpC;AACA;AACA;AACA,sEAAsE,gBAAgB;AACtF;AACA;AACA;AACA;AACA;AACA,sBAAsB,mEAAmE;AACzF;AACA,EAAE,EAAC;AACH;;;;;;;;;;;;;;;;;ACvCuH;AACnC;AACpF,cAAc,8FAAuB;AACc;AACnD,+BAA+B,kGAAoB;AACnD;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,gFAAgC;AAC/D,yBAAyB,oFAAoC;AAC7D;AACA;AACA;AACA;AACA;AACA,iEAAe,uGAAqB;AACpC,mDAAmD,oDAAoD;AACvG;AACA;AACA,EAAE,EAAC;AACH;;;;;;;;;;;;;;;;;ACvBgJ;AAC5D;AACpF,cAAc,8FAAuB;AACrC,cAAc,8FAAuB;AACrC,mBAAmB,mGAA4B;AACxC,2BAA2B,kGAAoB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,iHAAmC;AAC1D;AACA;AACA,uBAAuB,iHAAmC;AAC1D;AACA;AACA;AACA,mBAAmB,iHAAmC;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,iHAAmC;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iEAAe,uGAAqB;AACpC,8CAA8C,cAAc;AAC5D;AACA;AACA;AACA;AACA;AACA,sDAAsD,oDAAoD;AAC1G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,EAAC;AACH;;;;;;;;;;;;;;;ACtHsH;AACtH,6BAA6B,iGAAmB;AAChD;AACA;AACA;AACA;AACA,iEAAe,uGAAqB;AACpC;AACA,EAAE,EAAC;AACH;;;;;;;;;;;;;;;;ACT8H;AAC1C;AACpF,cAAc,8FAAuB;AACrC,6BAA6B,iGAAmB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iEAAe,+GAA6B;AAC5C;AACA,sBAAsB,4DAA4D;AAClF;AACA,EAAE,EAAC;AACH;;;;;;;;;;;;;;;ACxCsH;AACtH,oCAAoC,iGAAmB;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iEAAe,uGAAqB;AACpC;AACA;AACA,6EAA6E,qBAAqB;AAClG;AACA;AACA,EAAE,EAAC;AACH;;;;;;;;;;;;;;;;AC5Ba;AAC0E;AACd;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,iEAAmB;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4DAA4D,cAAc;AAC1E;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,aAAa,WAAW,yBAAyB;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,aAAa,WAAW,yBAAyB;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,iFAAsB;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iEAAe,8EAA4B;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,0CAA0C;AACvE;AACA;AACA;AACA;AACA,yEAAyE,mBAAmB;AAC5F;AACA;AACA;AACA,2DAA2D,uBAAuB;AAClF;AACA;AACA,EAAE,EAAC;AACH;;;;;;;;;;;;;;;;AC1SyD;AAClD;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,+BAA+B,iEAAmB;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;ACnBa;AAC0E;AACvF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,iEAAmB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iEAAe,8EAA4B;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,0CAA0C,2BAA2B;AAC3F;AACA,EAAE,EAAC;AACH;;;;;;;;;;;;;;;AChCuF;AACvF;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,iEAAmB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iEAAe,8EAA4B;AAC3C;AACA;AACA,EAAE,EAAC;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC3CA;AACA;AACA;AACA;AAC0E;AACN;AACc;AACR;AACN;AACkB;AACP;AACd;AACH;AAC2B;AACxB;AACH;AACe;AACN;AACZ;AACiC;AAC3B;AACjE;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA,iDAAiD,iFAAgB;AACjE,+CAA+C,6EAAc;AAC7D,oDAAoD,uFAAkB;AACtE,iDAAiD,iFAAgB;AACjE,+CAA+C,6EAAc;AAC7D,qDAAqD,yFAAoB;AACzE,mDAAmD,qFAAiB;AACpE,8CAA8C,2EAAa;AAC3D,6CAA6C,yEAAY;AACzD,sDAAsD,2FAAqB;AAC3E,8CAA8C,4EAAa;AAC3D,6CAA6C,0EAAY;AACzD,kDAAkD,oFAAiB;AACnE,gDAAgD,gFAAe;AAC/D,4CAA4C,wEAAW;AACvD,uDAAuD,8FAAsB;AAC7E,8CAA8C,4EAAa;AAC3D;AACA;AACA;;;;;;;;;;;;;;;AClD0D;AAC1D;AACA;AACA;AACO,sCAAsC,kEAAoB;AACjE;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;ACVuF;AACvF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,SAAS,IAAI,OAAO;AAC9C;AACA,mDAAmD,YAAY;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA,iCAAiC,iEAAmB;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iEAAe,8EAA4B;AAC3C;AACA;AACA;AACA,oEAAoE,oBAAoB;AACxF;AACA;AACA;AACA;AACA,mCAAmC,wDAAwD;AAC3F;AACA;AACA;AACA,EAAE,EAAC;AACH;;;;;;;;;;;;;;;ACnKuF;AACvF,qCAAqC,iEAAmB;AACxD;AACA;AACA;AACA;AACA,iEAAe,8EAA4B;AAC3C;AACA,EAAE,EAAC;AACH;;;;;;;;;;;;;;;ACTa;AAC0E;AACvF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,iEAAmB;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,iEAAe,8EAA4B;AAC3C;AACA,8DAA8D,wBAAwB;AACtF;AACA;AACA,EAAE,EAAC;AACH;;;;;;;;;;;;;;;;AC/C2D;AACqB;AAChF;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,wFAAuB;AAC1D;AACA,iEAAe,uEAAqB;AACpC;AACA,EAAE,EAAC;AACH;;;;;;;;;;;;;;;;;ACbA;AACsF;AACvB;AAC/D,cAAc,4EAAuB;AAC9B,6BAA6B,gEAAkB;AACtD;AACA;AACA;AACA;AACA,qDAAqD,yBAAyB;AAC9E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iEAAe,8EAA4B;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2EAA2E,qBAAqB;AAChG;AACA;AACA;AACA;AACA;AACA,yCAAyC,gDAAgD;AACzF;AACA;AACA;AACA,EAAE,EAAC;AACH;;;;;;;;;;;;;;;;ACnHa;AACqD;AACa;AAC/E,gCAAgC,uFAAgB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iEAAe,8EAA4B;AAC3C;AACA;AACA,2BAA2B,mBAAmB;AAC9C;AACA;AACA;AACA,8DAA8D,2BAA2B;AACzF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,EAAC;AACH;;;;;;;;;;;;;;;;AC9Ba;AACqD;AACa;AAC/E;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,8BAA8B;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,uFAAgB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,wEAAwE;AAChF;AACA;AACA,UAAU,sCAAsC;AAChD;AACA;AACA,uBAAuB,yCAAyC,2BAA2B;AAC3F;AACA;AACA;AACA,iEAAe,8EAA4B;AAC3C;AACA;AACA;AACA,MAAM,gBAAgB;AACtB;AACA;AACA,SAAS,eAAe;AACxB;AACA;AACA,MAAM;AACN;AACA;AACA;AACA,2BAA2B,8CAA8C;AACzE;AACA;AACA;AACA,EAAE,EAAC;AACH;;;;;;;;;;;;;;;;AClG+E;AACb;AAClE,2BAA2B,uFAAgB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iEAAe,8EAA4B;AAC3C;AACA;AACA;AACA,sBAAsB,0CAA0C,2BAA2B;AAC3F;AACA,EAAE,EAAC;AACH;;;;;;;;;;;;;;;;ACjB2D;AACqB;AAChF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,wFAAuB;AAC3D;AACA,iEAAe,uEAAqB;AACpC;AACA,EAAE,EAAC;AACH;;;;;;;;;;;;;;;ACfuF;AACvF,4BAA4B,iEAAmB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iEAAe,8EAA4B;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,EAAC;AACH;;;;;;;;;;;;;;;;ACrBsF;AAC/E,2BAA2B,gEAAkB;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,wBAAwB;AACvD;AACA;AACA,iEAAe,8EAA4B;AAC3C;AACA;AACA,sBAAsB,0CAA0C,2BAA2B;AAC3F;AACA,EAAE,EAAC;AACH;;;;;;;;;;;;;;;AC1BuF;AACvF,gCAAgC,iEAAmB;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iEAAe,8EAA4B;AAC3C;AACA;AACA;AACA;AACA;AACA,uBAAuB,yCAAyC,2BAA2B;AAC3F;AACA;AACA,EAAE,EAAC;AACH;;;;;;;;;;;;;;;;ACtCuF;AAChF,8BAA8B,iEAAmB;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iEAAe,8EAA4B;AAC3C;AACA;AACA,SAAS,aAAa;AACtB,EAAE,EAAC;AACH;;;;;;;;;;;;;;;ACjBa;AAC0E;AACvF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,iEAAmB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,4BAA4B;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,UAAU,+BAA+B;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iEAAe,8EAA4B;AAC3C;AACA,EAAE,EAAC;AACH;;;;;;;;;;;;;;;;;;;;;;;;ACpK4D;AAC5D,cAAc,4EAAuB;AACrC,yBAAyB,uFAAkC;AAC3D,cAAc,4EAAuB;AAC9B;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uFAAuF,WAAW;AAClG;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;AC5RA;AACA;AACA;AACA;AACA;AACO;AACP,iIAAiI;AACjI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","sources":["webpack:///./extras/zod/lib/index.js","webpack:///./extras/modules/admin-customizer/admin-customizer.ts","webpack:///./extras/modules/admin-customizer/admin-customizer-base.js","webpack:///./extras/modules/admin-customizer/ko-components/ame-ac-content-section.js","webpack:///./extras/modules/admin-customizer/ko-components/ame-ac-control-group.js","webpack:///./extras/modules/admin-customizer/ko-components/ame-ac-control.js","webpack:///./extras/modules/admin-customizer/ko-components/ame-ac-section-link.js","webpack:///./extras/modules/admin-customizer/ko-components/ame-ac-section.js","webpack:///./extras/modules/admin-customizer/ko-components/ame-ac-separator.js","webpack:///./extras/modules/admin-customizer/ko-components/ame-ac-structure.js","webpack:///./extras/modules/admin-customizer/ko-components/ame-ac-validation-errors.js","webpack:///./extras/pro-customizables/ko-components/ame-box-dimensions/ame-box-dimensions.js","webpack:///./extras/pro-customizables/ko-components/ame-choice-control/ame-choice-control.js","webpack:///./extras/pro-customizables/ko-components/ame-code-editor/ame-code-editor.js","webpack:///./extras/pro-customizables/ko-components/ame-color-picker/ame-color-picker.js","webpack:///./extras/pro-customizables/ko-components/ame-components.js","webpack:///./extras/pro-customizables/ko-components/ame-description/ame-description.js","webpack:///./extras/pro-customizables/ko-components/ame-font-style-picker/ame-font-style-picker.js","webpack:///./extras/pro-customizables/ko-components/ame-horizontal-separator/ame-horizontal-separator.js","webpack:///./extras/pro-customizables/ko-components/ame-image-selector/ame-image-selector.js","webpack:///./extras/pro-customizables/ko-components/ame-nested-description/ame-nested-description.js","webpack:///./extras/pro-customizables/ko-components/ame-number-input/ame-number-input.js","webpack:///./extras/pro-customizables/ko-components/ame-radio-button-bar/ame-radio-button-bar.js","webpack:///./extras/pro-customizables/ko-components/ame-radio-group/ame-radio-group.js","webpack:///./extras/pro-customizables/ko-components/ame-select-box/ame-select-box.js","webpack:///./extras/pro-customizables/ko-components/ame-sibling-description/ame-sibling-description.js","webpack:///./extras/pro-customizables/ko-components/ame-static-html/ame-static-html.js","webpack:///./extras/pro-customizables/ko-components/ame-text-input/ame-text-input.js","webpack:///./extras/pro-customizables/ko-components/ame-toggle-checkbox/ame-toggle-checkbox.js","webpack:///./extras/pro-customizables/ko-components/ame-unit-dropdown/ame-unit-dropdown.js","webpack:///./extras/pro-customizables/ko-components/ame-wp-editor/ame-wp-editor.js","webpack:///./extras/pro-customizables/ko-components/control-base.js","webpack:///./extras/pro-customizables/ko-components/lazy-popup-slider-adapter.js"],"sourcesContent":["var util;\n(function (util) {\n util.assertEqual = (val) => val;\n function assertIs(_arg) { }\n util.assertIs = assertIs;\n function assertNever(_x) {\n throw new Error();\n }\n util.assertNever = assertNever;\n util.arrayToEnum = (items) => {\n const obj = {};\n for (const item of items) {\n obj[item] = item;\n }\n return obj;\n };\n util.getValidEnumValues = (obj) => {\n const validKeys = util.objectKeys(obj).filter((k) => typeof obj[obj[k]] !== \"number\");\n const filtered = {};\n for (const k of validKeys) {\n filtered[k] = obj[k];\n }\n return util.objectValues(filtered);\n };\n util.objectValues = (obj) => {\n return util.objectKeys(obj).map(function (e) {\n return obj[e];\n });\n };\n util.objectKeys = typeof Object.keys === \"function\" // eslint-disable-line ban/ban\n ? (obj) => Object.keys(obj) // eslint-disable-line ban/ban\n : (object) => {\n const keys = [];\n for (const key in object) {\n if (Object.prototype.hasOwnProperty.call(object, key)) {\n keys.push(key);\n }\n }\n return keys;\n };\n util.find = (arr, checker) => {\n for (const item of arr) {\n if (checker(item))\n return item;\n }\n return undefined;\n };\n util.isInteger = typeof Number.isInteger === \"function\"\n ? (val) => Number.isInteger(val) // eslint-disable-line ban/ban\n : (val) => typeof val === \"number\" && isFinite(val) && Math.floor(val) === val;\n function joinValues(array, separator = \" | \") {\n return array\n .map((val) => (typeof val === \"string\" ? `'${val}'` : val))\n .join(separator);\n }\n util.joinValues = joinValues;\n util.jsonStringifyReplacer = (_, value) => {\n if (typeof value === \"bigint\") {\n return value.toString();\n }\n return value;\n };\n})(util || (util = {}));\nvar objectUtil;\n(function (objectUtil) {\n objectUtil.mergeShapes = (first, second) => {\n return {\n ...first,\n ...second, // second overwrites first\n };\n };\n})(objectUtil || (objectUtil = {}));\nconst ZodParsedType = util.arrayToEnum([\n \"string\",\n \"nan\",\n \"number\",\n \"integer\",\n \"float\",\n \"boolean\",\n \"date\",\n \"bigint\",\n \"symbol\",\n \"function\",\n \"undefined\",\n \"null\",\n \"array\",\n \"object\",\n \"unknown\",\n \"promise\",\n \"void\",\n \"never\",\n \"map\",\n \"set\",\n]);\nconst getParsedType = (data) => {\n const t = typeof data;\n switch (t) {\n case \"undefined\":\n return ZodParsedType.undefined;\n case \"string\":\n return ZodParsedType.string;\n case \"number\":\n return isNaN(data) ? ZodParsedType.nan : ZodParsedType.number;\n case \"boolean\":\n return ZodParsedType.boolean;\n case \"function\":\n return ZodParsedType.function;\n case \"bigint\":\n return ZodParsedType.bigint;\n case \"symbol\":\n return ZodParsedType.symbol;\n case \"object\":\n if (Array.isArray(data)) {\n return ZodParsedType.array;\n }\n if (data === null) {\n return ZodParsedType.null;\n }\n if (data.then &&\n typeof data.then === \"function\" &&\n data.catch &&\n typeof data.catch === \"function\") {\n return ZodParsedType.promise;\n }\n if (typeof Map !== \"undefined\" && data instanceof Map) {\n return ZodParsedType.map;\n }\n if (typeof Set !== \"undefined\" && data instanceof Set) {\n return ZodParsedType.set;\n }\n if (typeof Date !== \"undefined\" && data instanceof Date) {\n return ZodParsedType.date;\n }\n return ZodParsedType.object;\n default:\n return ZodParsedType.unknown;\n }\n};\n\nconst ZodIssueCode = util.arrayToEnum([\n \"invalid_type\",\n \"invalid_literal\",\n \"custom\",\n \"invalid_union\",\n \"invalid_union_discriminator\",\n \"invalid_enum_value\",\n \"unrecognized_keys\",\n \"invalid_arguments\",\n \"invalid_return_type\",\n \"invalid_date\",\n \"invalid_string\",\n \"too_small\",\n \"too_big\",\n \"invalid_intersection_types\",\n \"not_multiple_of\",\n \"not_finite\",\n]);\nconst quotelessJson = (obj) => {\n const json = JSON.stringify(obj, null, 2);\n return json.replace(/\"([^\"]+)\":/g, \"$1:\");\n};\nclass ZodError extends Error {\n constructor(issues) {\n super();\n this.issues = [];\n this.addIssue = (sub) => {\n this.issues = [...this.issues, sub];\n };\n this.addIssues = (subs = []) => {\n this.issues = [...this.issues, ...subs];\n };\n const actualProto = new.target.prototype;\n if (Object.setPrototypeOf) {\n // eslint-disable-next-line ban/ban\n Object.setPrototypeOf(this, actualProto);\n }\n else {\n this.__proto__ = actualProto;\n }\n this.name = \"ZodError\";\n this.issues = issues;\n }\n get errors() {\n return this.issues;\n }\n format(_mapper) {\n const mapper = _mapper ||\n function (issue) {\n return issue.message;\n };\n const fieldErrors = { _errors: [] };\n const processError = (error) => {\n for (const issue of error.issues) {\n if (issue.code === \"invalid_union\") {\n issue.unionErrors.map(processError);\n }\n else if (issue.code === \"invalid_return_type\") {\n processError(issue.returnTypeError);\n }\n else if (issue.code === \"invalid_arguments\") {\n processError(issue.argumentsError);\n }\n else if (issue.path.length === 0) {\n fieldErrors._errors.push(mapper(issue));\n }\n else {\n let curr = fieldErrors;\n let i = 0;\n while (i < issue.path.length) {\n const el = issue.path[i];\n const terminal = i === issue.path.length - 1;\n if (!terminal) {\n curr[el] = curr[el] || { _errors: [] };\n // if (typeof el === \"string\") {\n // curr[el] = curr[el] || { _errors: [] };\n // } else if (typeof el === \"number\") {\n // const errorArray: any = [];\n // errorArray._errors = [];\n // curr[el] = curr[el] || errorArray;\n // }\n }\n else {\n curr[el] = curr[el] || { _errors: [] };\n curr[el]._errors.push(mapper(issue));\n }\n curr = curr[el];\n i++;\n }\n }\n }\n };\n processError(this);\n return fieldErrors;\n }\n toString() {\n return this.message;\n }\n get message() {\n return JSON.stringify(this.issues, util.jsonStringifyReplacer, 2);\n }\n get isEmpty() {\n return this.issues.length === 0;\n }\n flatten(mapper = (issue) => issue.message) {\n const fieldErrors = {};\n const formErrors = [];\n for (const sub of this.issues) {\n if (sub.path.length > 0) {\n fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || [];\n fieldErrors[sub.path[0]].push(mapper(sub));\n }\n else {\n formErrors.push(mapper(sub));\n }\n }\n return { formErrors, fieldErrors };\n }\n get formErrors() {\n return this.flatten();\n }\n}\nZodError.create = (issues) => {\n const error = new ZodError(issues);\n return error;\n};\n\nconst errorMap = (issue, _ctx) => {\n let message;\n switch (issue.code) {\n case ZodIssueCode.invalid_type:\n if (issue.received === ZodParsedType.undefined) {\n message = \"Required\";\n }\n else {\n message = `Expected ${issue.expected}, received ${issue.received}`;\n }\n break;\n case ZodIssueCode.invalid_literal:\n message = `Invalid literal value, expected ${JSON.stringify(issue.expected, util.jsonStringifyReplacer)}`;\n break;\n case ZodIssueCode.unrecognized_keys:\n message = `Unrecognized key(s) in object: ${util.joinValues(issue.keys, \", \")}`;\n break;\n case ZodIssueCode.invalid_union:\n message = `Invalid input`;\n break;\n case ZodIssueCode.invalid_union_discriminator:\n message = `Invalid discriminator value. Expected ${util.joinValues(issue.options)}`;\n break;\n case ZodIssueCode.invalid_enum_value:\n message = `Invalid enum value. Expected ${util.joinValues(issue.options)}, received '${issue.received}'`;\n break;\n case ZodIssueCode.invalid_arguments:\n message = `Invalid function arguments`;\n break;\n case ZodIssueCode.invalid_return_type:\n message = `Invalid function return type`;\n break;\n case ZodIssueCode.invalid_date:\n message = `Invalid date`;\n break;\n case ZodIssueCode.invalid_string:\n if (typeof issue.validation === \"object\") {\n if (\"includes\" in issue.validation) {\n message = `Invalid input: must include \"${issue.validation.includes}\"`;\n if (typeof issue.validation.position === \"number\") {\n message = `${message} at one or more positions greater than or equal to ${issue.validation.position}`;\n }\n }\n else if (\"startsWith\" in issue.validation) {\n message = `Invalid input: must start with \"${issue.validation.startsWith}\"`;\n }\n else if (\"endsWith\" in issue.validation) {\n message = `Invalid input: must end with \"${issue.validation.endsWith}\"`;\n }\n else {\n util.assertNever(issue.validation);\n }\n }\n else if (issue.validation !== \"regex\") {\n message = `Invalid ${issue.validation}`;\n }\n else {\n message = \"Invalid\";\n }\n break;\n case ZodIssueCode.too_small:\n if (issue.type === \"array\")\n message = `Array must contain ${issue.exact ? \"exactly\" : issue.inclusive ? `at least` : `more than`} ${issue.minimum} element(s)`;\n else if (issue.type === \"string\")\n message = `String must contain ${issue.exact ? \"exactly\" : issue.inclusive ? `at least` : `over`} ${issue.minimum} character(s)`;\n else if (issue.type === \"number\")\n message = `Number must be ${issue.exact\n ? `exactly equal to `\n : issue.inclusive\n ? `greater than or equal to `\n : `greater than `}${issue.minimum}`;\n else if (issue.type === \"date\")\n message = `Date must be ${issue.exact\n ? `exactly equal to `\n : issue.inclusive\n ? `greater than or equal to `\n : `greater than `}${new Date(Number(issue.minimum))}`;\n else\n message = \"Invalid input\";\n break;\n case ZodIssueCode.too_big:\n if (issue.type === \"array\")\n message = `Array must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `less than`} ${issue.maximum} element(s)`;\n else if (issue.type === \"string\")\n message = `String must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `under`} ${issue.maximum} character(s)`;\n else if (issue.type === \"number\")\n message = `Number must be ${issue.exact\n ? `exactly`\n : issue.inclusive\n ? `less than or equal to`\n : `less than`} ${issue.maximum}`;\n else if (issue.type === \"bigint\")\n message = `BigInt must be ${issue.exact\n ? `exactly`\n : issue.inclusive\n ? `less than or equal to`\n : `less than`} ${issue.maximum}`;\n else if (issue.type === \"date\")\n message = `Date must be ${issue.exact\n ? `exactly`\n : issue.inclusive\n ? `smaller than or equal to`\n : `smaller than`} ${new Date(Number(issue.maximum))}`;\n else\n message = \"Invalid input\";\n break;\n case ZodIssueCode.custom:\n message = `Invalid input`;\n break;\n case ZodIssueCode.invalid_intersection_types:\n message = `Intersection results could not be merged`;\n break;\n case ZodIssueCode.not_multiple_of:\n message = `Number must be a multiple of ${issue.multipleOf}`;\n break;\n case ZodIssueCode.not_finite:\n message = \"Number must be finite\";\n break;\n default:\n message = _ctx.defaultError;\n util.assertNever(issue);\n }\n return { message };\n};\n\nlet overrideErrorMap = errorMap;\nfunction setErrorMap(map) {\n overrideErrorMap = map;\n}\nfunction getErrorMap() {\n return overrideErrorMap;\n}\n\nconst makeIssue = (params) => {\n const { data, path, errorMaps, issueData } = params;\n const fullPath = [...path, ...(issueData.path || [])];\n const fullIssue = {\n ...issueData,\n path: fullPath,\n };\n let errorMessage = \"\";\n const maps = errorMaps\n .filter((m) => !!m)\n .slice()\n .reverse();\n for (const map of maps) {\n errorMessage = map(fullIssue, { data, defaultError: errorMessage }).message;\n }\n return {\n ...issueData,\n path: fullPath,\n message: issueData.message || errorMessage,\n };\n};\nconst EMPTY_PATH = [];\nfunction addIssueToContext(ctx, issueData) {\n const issue = makeIssue({\n issueData: issueData,\n data: ctx.data,\n path: ctx.path,\n errorMaps: [\n ctx.common.contextualErrorMap,\n ctx.schemaErrorMap,\n getErrorMap(),\n errorMap, // then global default map\n ].filter((x) => !!x),\n });\n ctx.common.issues.push(issue);\n}\nclass ParseStatus {\n constructor() {\n this.value = \"valid\";\n }\n dirty() {\n if (this.value === \"valid\")\n this.value = \"dirty\";\n }\n abort() {\n if (this.value !== \"aborted\")\n this.value = \"aborted\";\n }\n static mergeArray(status, results) {\n const arrayValue = [];\n for (const s of results) {\n if (s.status === \"aborted\")\n return INVALID;\n if (s.status === \"dirty\")\n status.dirty();\n arrayValue.push(s.value);\n }\n return { status: status.value, value: arrayValue };\n }\n static async mergeObjectAsync(status, pairs) {\n const syncPairs = [];\n for (const pair of pairs) {\n syncPairs.push({\n key: await pair.key,\n value: await pair.value,\n });\n }\n return ParseStatus.mergeObjectSync(status, syncPairs);\n }\n static mergeObjectSync(status, pairs) {\n const finalObject = {};\n for (const pair of pairs) {\n const { key, value } = pair;\n if (key.status === \"aborted\")\n return INVALID;\n if (value.status === \"aborted\")\n return INVALID;\n if (key.status === \"dirty\")\n status.dirty();\n if (value.status === \"dirty\")\n status.dirty();\n if (typeof value.value !== \"undefined\" || pair.alwaysSet) {\n finalObject[key.value] = value.value;\n }\n }\n return { status: status.value, value: finalObject };\n }\n}\nconst INVALID = Object.freeze({\n status: \"aborted\",\n});\nconst DIRTY = (value) => ({ status: \"dirty\", value });\nconst OK = (value) => ({ status: \"valid\", value });\nconst isAborted = (x) => x.status === \"aborted\";\nconst isDirty = (x) => x.status === \"dirty\";\nconst isValid = (x) => x.status === \"valid\";\nconst isAsync = (x) => typeof Promise !== \"undefined\" && x instanceof Promise;\n\nvar errorUtil;\n(function (errorUtil) {\n errorUtil.errToObj = (message) => typeof message === \"string\" ? { message } : message || {};\n errorUtil.toString = (message) => typeof message === \"string\" ? message : message === null || message === void 0 ? void 0 : message.message;\n})(errorUtil || (errorUtil = {}));\n\nclass ParseInputLazyPath {\n constructor(parent, value, path, key) {\n this._cachedPath = [];\n this.parent = parent;\n this.data = value;\n this._path = path;\n this._key = key;\n }\n get path() {\n if (!this._cachedPath.length) {\n if (this._key instanceof Array) {\n this._cachedPath.push(...this._path, ...this._key);\n }\n else {\n this._cachedPath.push(...this._path, this._key);\n }\n }\n return this._cachedPath;\n }\n}\nconst handleResult = (ctx, result) => {\n if (isValid(result)) {\n return { success: true, data: result.value };\n }\n else {\n if (!ctx.common.issues.length) {\n throw new Error(\"Validation failed but no issues detected.\");\n }\n return {\n success: false,\n get error() {\n if (this._error)\n return this._error;\n const error = new ZodError(ctx.common.issues);\n this._error = error;\n return this._error;\n },\n };\n }\n};\nfunction processCreateParams(params) {\n if (!params)\n return {};\n const { errorMap, invalid_type_error, required_error, description } = params;\n if (errorMap && (invalid_type_error || required_error)) {\n throw new Error(`Can't use \"invalid_type_error\" or \"required_error\" in conjunction with custom error map.`);\n }\n if (errorMap)\n return { errorMap: errorMap, description };\n const customMap = (iss, ctx) => {\n if (iss.code !== \"invalid_type\")\n return { message: ctx.defaultError };\n if (typeof ctx.data === \"undefined\") {\n return { message: required_error !== null && required_error !== void 0 ? required_error : ctx.defaultError };\n }\n return { message: invalid_type_error !== null && invalid_type_error !== void 0 ? invalid_type_error : ctx.defaultError };\n };\n return { errorMap: customMap, description };\n}\nclass ZodType {\n constructor(def) {\n /** Alias of safeParseAsync */\n this.spa = this.safeParseAsync;\n this._def = def;\n this.parse = this.parse.bind(this);\n this.safeParse = this.safeParse.bind(this);\n this.parseAsync = this.parseAsync.bind(this);\n this.safeParseAsync = this.safeParseAsync.bind(this);\n this.spa = this.spa.bind(this);\n this.refine = this.refine.bind(this);\n this.refinement = this.refinement.bind(this);\n this.superRefine = this.superRefine.bind(this);\n this.optional = this.optional.bind(this);\n this.nullable = this.nullable.bind(this);\n this.nullish = this.nullish.bind(this);\n this.array = this.array.bind(this);\n this.promise = this.promise.bind(this);\n this.or = this.or.bind(this);\n this.and = this.and.bind(this);\n this.transform = this.transform.bind(this);\n this.brand = this.brand.bind(this);\n this.default = this.default.bind(this);\n this.catch = this.catch.bind(this);\n this.describe = this.describe.bind(this);\n this.pipe = this.pipe.bind(this);\n this.isNullable = this.isNullable.bind(this);\n this.isOptional = this.isOptional.bind(this);\n }\n get description() {\n return this._def.description;\n }\n _getType(input) {\n return getParsedType(input.data);\n }\n _getOrReturnCtx(input, ctx) {\n return (ctx || {\n common: input.parent.common,\n data: input.data,\n parsedType: getParsedType(input.data),\n schemaErrorMap: this._def.errorMap,\n path: input.path,\n parent: input.parent,\n });\n }\n _processInputParams(input) {\n return {\n status: new ParseStatus(),\n ctx: {\n common: input.parent.common,\n data: input.data,\n parsedType: getParsedType(input.data),\n schemaErrorMap: this._def.errorMap,\n path: input.path,\n parent: input.parent,\n },\n };\n }\n _parseSync(input) {\n const result = this._parse(input);\n if (isAsync(result)) {\n throw new Error(\"Synchronous parse encountered promise.\");\n }\n return result;\n }\n _parseAsync(input) {\n const result = this._parse(input);\n return Promise.resolve(result);\n }\n parse(data, params) {\n const result = this.safeParse(data, params);\n if (result.success)\n return result.data;\n throw result.error;\n }\n safeParse(data, params) {\n var _a;\n const ctx = {\n common: {\n issues: [],\n async: (_a = params === null || params === void 0 ? void 0 : params.async) !== null && _a !== void 0 ? _a : false,\n contextualErrorMap: params === null || params === void 0 ? void 0 : params.errorMap,\n },\n path: (params === null || params === void 0 ? void 0 : params.path) || [],\n schemaErrorMap: this._def.errorMap,\n parent: null,\n data,\n parsedType: getParsedType(data),\n };\n const result = this._parseSync({ data, path: ctx.path, parent: ctx });\n return handleResult(ctx, result);\n }\n async parseAsync(data, params) {\n const result = await this.safeParseAsync(data, params);\n if (result.success)\n return result.data;\n throw result.error;\n }\n async safeParseAsync(data, params) {\n const ctx = {\n common: {\n issues: [],\n contextualErrorMap: params === null || params === void 0 ? void 0 : params.errorMap,\n async: true,\n },\n path: (params === null || params === void 0 ? void 0 : params.path) || [],\n schemaErrorMap: this._def.errorMap,\n parent: null,\n data,\n parsedType: getParsedType(data),\n };\n const maybeAsyncResult = this._parse({ data, path: ctx.path, parent: ctx });\n const result = await (isAsync(maybeAsyncResult)\n ? maybeAsyncResult\n : Promise.resolve(maybeAsyncResult));\n return handleResult(ctx, result);\n }\n refine(check, message) {\n const getIssueProperties = (val) => {\n if (typeof message === \"string\" || typeof message === \"undefined\") {\n return { message };\n }\n else if (typeof message === \"function\") {\n return message(val);\n }\n else {\n return message;\n }\n };\n return this._refinement((val, ctx) => {\n const result = check(val);\n const setError = () => ctx.addIssue({\n code: ZodIssueCode.custom,\n ...getIssueProperties(val),\n });\n if (typeof Promise !== \"undefined\" && result instanceof Promise) {\n return result.then((data) => {\n if (!data) {\n setError();\n return false;\n }\n else {\n return true;\n }\n });\n }\n if (!result) {\n setError();\n return false;\n }\n else {\n return true;\n }\n });\n }\n refinement(check, refinementData) {\n return this._refinement((val, ctx) => {\n if (!check(val)) {\n ctx.addIssue(typeof refinementData === \"function\"\n ? refinementData(val, ctx)\n : refinementData);\n return false;\n }\n else {\n return true;\n }\n });\n }\n _refinement(refinement) {\n return new ZodEffects({\n schema: this,\n typeName: ZodFirstPartyTypeKind.ZodEffects,\n effect: { type: \"refinement\", refinement },\n });\n }\n superRefine(refinement) {\n return this._refinement(refinement);\n }\n optional() {\n return ZodOptional.create(this, this._def);\n }\n nullable() {\n return ZodNullable.create(this, this._def);\n }\n nullish() {\n return this.nullable().optional();\n }\n array() {\n return ZodArray.create(this, this._def);\n }\n promise() {\n return ZodPromise.create(this, this._def);\n }\n or(option) {\n return ZodUnion.create([this, option], this._def);\n }\n and(incoming) {\n return ZodIntersection.create(this, incoming, this._def);\n }\n transform(transform) {\n return new ZodEffects({\n ...processCreateParams(this._def),\n schema: this,\n typeName: ZodFirstPartyTypeKind.ZodEffects,\n effect: { type: \"transform\", transform },\n });\n }\n default(def) {\n const defaultValueFunc = typeof def === \"function\" ? def : () => def;\n return new ZodDefault({\n ...processCreateParams(this._def),\n innerType: this,\n defaultValue: defaultValueFunc,\n typeName: ZodFirstPartyTypeKind.ZodDefault,\n });\n }\n brand() {\n return new ZodBranded({\n typeName: ZodFirstPartyTypeKind.ZodBranded,\n type: this,\n ...processCreateParams(this._def),\n });\n }\n catch(def) {\n const catchValueFunc = typeof def === \"function\" ? def : () => def;\n return new ZodCatch({\n ...processCreateParams(this._def),\n innerType: this,\n catchValue: catchValueFunc,\n typeName: ZodFirstPartyTypeKind.ZodCatch,\n });\n }\n describe(description) {\n const This = this.constructor;\n return new This({\n ...this._def,\n description,\n });\n }\n pipe(target) {\n return ZodPipeline.create(this, target);\n }\n isOptional() {\n return this.safeParse(undefined).success;\n }\n isNullable() {\n return this.safeParse(null).success;\n }\n}\nconst cuidRegex = /^c[^\\s-]{8,}$/i;\nconst cuid2Regex = /^[a-z][a-z0-9]*$/;\nconst ulidRegex = /[0-9A-HJKMNP-TV-Z]{26}/;\nconst uuidRegex = /^([a-f0-9]{8}-[a-f0-9]{4}-[1-5][a-f0-9]{3}-[a-f0-9]{4}-[a-f0-9]{12}|00000000-0000-0000-0000-000000000000)$/i;\n// from https://stackoverflow.com/a/46181/1550155\n// old version: too slow, didn't support unicode\n// const emailRegex = /^((([a-z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+(\\.([a-z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+)*)|((\\x22)((((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(([\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f]|\\x21|[\\x23-\\x5b]|[\\x5d-\\x7e]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(\\\\([\\x01-\\x09\\x0b\\x0c\\x0d-\\x7f]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]))))*(((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(\\x22)))@((([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\\.)+(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))$/i;\n//old email regex\n// const emailRegex = /^(([^<>()[\\].,;:\\s@\"]+(\\.[^<>()[\\].,;:\\s@\"]+)*)|(\".+\"))@((?!-)([^<>()[\\].,;:\\s@\"]+\\.)+[^<>()[\\].,;:\\s@\"]{1,})[^-<>()[\\].,;:\\s@\"]$/i;\n// eslint-disable-next-line\nconst emailRegex = /^(([^<>()[\\]\\\\.,;:\\s@\\\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\\\"]+)*)|(\\\".+\\\"))@((\\[(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\\])|(\\[IPv6:(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))\\])|([A-Za-z0-9]([A-Za-z0-9-]*[A-Za-z0-9])*(\\.[A-Za-z]{2,})+))$/;\n// from https://thekevinscott.com/emojis-in-javascript/#writing-a-regular-expression\nconst emojiRegex = /^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$/u;\nconst ipv4Regex = /^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/;\nconst ipv6Regex = /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/;\n// Adapted from https://stackoverflow.com/a/3143231\nconst datetimeRegex = (args) => {\n if (args.precision) {\n if (args.offset) {\n return new RegExp(`^\\\\d{4}-\\\\d{2}-\\\\d{2}T\\\\d{2}:\\\\d{2}:\\\\d{2}\\\\.\\\\d{${args.precision}}(([+-]\\\\d{2}(:?\\\\d{2})?)|Z)$`);\n }\n else {\n return new RegExp(`^\\\\d{4}-\\\\d{2}-\\\\d{2}T\\\\d{2}:\\\\d{2}:\\\\d{2}\\\\.\\\\d{${args.precision}}Z$`);\n }\n }\n else if (args.precision === 0) {\n if (args.offset) {\n return new RegExp(`^\\\\d{4}-\\\\d{2}-\\\\d{2}T\\\\d{2}:\\\\d{2}:\\\\d{2}(([+-]\\\\d{2}(:?\\\\d{2})?)|Z)$`);\n }\n else {\n return new RegExp(`^\\\\d{4}-\\\\d{2}-\\\\d{2}T\\\\d{2}:\\\\d{2}:\\\\d{2}Z$`);\n }\n }\n else {\n if (args.offset) {\n return new RegExp(`^\\\\d{4}-\\\\d{2}-\\\\d{2}T\\\\d{2}:\\\\d{2}:\\\\d{2}(\\\\.\\\\d+)?(([+-]\\\\d{2}(:?\\\\d{2})?)|Z)$`);\n }\n else {\n return new RegExp(`^\\\\d{4}-\\\\d{2}-\\\\d{2}T\\\\d{2}:\\\\d{2}:\\\\d{2}(\\\\.\\\\d+)?Z$`);\n }\n }\n};\nfunction isValidIP(ip, version) {\n if ((version === \"v4\" || !version) && ipv4Regex.test(ip)) {\n return true;\n }\n if ((version === \"v6\" || !version) && ipv6Regex.test(ip)) {\n return true;\n }\n return false;\n}\nclass ZodString extends ZodType {\n constructor() {\n super(...arguments);\n this._regex = (regex, validation, message) => this.refinement((data) => regex.test(data), {\n validation,\n code: ZodIssueCode.invalid_string,\n ...errorUtil.errToObj(message),\n });\n /**\n * @deprecated Use z.string().min(1) instead.\n * @see {@link ZodString.min}\n */\n this.nonempty = (message) => this.min(1, errorUtil.errToObj(message));\n this.trim = () => new ZodString({\n ...this._def,\n checks: [...this._def.checks, { kind: \"trim\" }],\n });\n this.toLowerCase = () => new ZodString({\n ...this._def,\n checks: [...this._def.checks, { kind: \"toLowerCase\" }],\n });\n this.toUpperCase = () => new ZodString({\n ...this._def,\n checks: [...this._def.checks, { kind: \"toUpperCase\" }],\n });\n }\n _parse(input) {\n if (this._def.coerce) {\n input.data = String(input.data);\n }\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.string) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.string,\n received: ctx.parsedType,\n }\n //\n );\n return INVALID;\n }\n const status = new ParseStatus();\n let ctx = undefined;\n for (const check of this._def.checks) {\n if (check.kind === \"min\") {\n if (input.data.length < check.value) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n minimum: check.value,\n type: \"string\",\n inclusive: true,\n exact: false,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"max\") {\n if (input.data.length > check.value) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n maximum: check.value,\n type: \"string\",\n inclusive: true,\n exact: false,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"length\") {\n const tooBig = input.data.length > check.value;\n const tooSmall = input.data.length < check.value;\n if (tooBig || tooSmall) {\n ctx = this._getOrReturnCtx(input, ctx);\n if (tooBig) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n maximum: check.value,\n type: \"string\",\n inclusive: true,\n exact: true,\n message: check.message,\n });\n }\n else if (tooSmall) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n minimum: check.value,\n type: \"string\",\n inclusive: true,\n exact: true,\n message: check.message,\n });\n }\n status.dirty();\n }\n }\n else if (check.kind === \"email\") {\n if (!emailRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"email\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"emoji\") {\n if (!emojiRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"emoji\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"uuid\") {\n if (!uuidRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"uuid\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"cuid\") {\n if (!cuidRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"cuid\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"cuid2\") {\n if (!cuid2Regex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"cuid2\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"ulid\") {\n if (!ulidRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"ulid\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"url\") {\n try {\n new URL(input.data);\n }\n catch (_a) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"url\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"regex\") {\n check.regex.lastIndex = 0;\n const testResult = check.regex.test(input.data);\n if (!testResult) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"regex\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"trim\") {\n input.data = input.data.trim();\n }\n else if (check.kind === \"includes\") {\n if (!input.data.includes(check.value, check.position)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_string,\n validation: { includes: check.value, position: check.position },\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"toLowerCase\") {\n input.data = input.data.toLowerCase();\n }\n else if (check.kind === \"toUpperCase\") {\n input.data = input.data.toUpperCase();\n }\n else if (check.kind === \"startsWith\") {\n if (!input.data.startsWith(check.value)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_string,\n validation: { startsWith: check.value },\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"endsWith\") {\n if (!input.data.endsWith(check.value)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_string,\n validation: { endsWith: check.value },\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"datetime\") {\n const regex = datetimeRegex(check);\n if (!regex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_string,\n validation: \"datetime\",\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"ip\") {\n if (!isValidIP(input.data, check.version)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"ip\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else {\n util.assertNever(check);\n }\n }\n return { status: status.value, value: input.data };\n }\n _addCheck(check) {\n return new ZodString({\n ...this._def,\n checks: [...this._def.checks, check],\n });\n }\n email(message) {\n return this._addCheck({ kind: \"email\", ...errorUtil.errToObj(message) });\n }\n url(message) {\n return this._addCheck({ kind: \"url\", ...errorUtil.errToObj(message) });\n }\n emoji(message) {\n return this._addCheck({ kind: \"emoji\", ...errorUtil.errToObj(message) });\n }\n uuid(message) {\n return this._addCheck({ kind: \"uuid\", ...errorUtil.errToObj(message) });\n }\n cuid(message) {\n return this._addCheck({ kind: \"cuid\", ...errorUtil.errToObj(message) });\n }\n cuid2(message) {\n return this._addCheck({ kind: \"cuid2\", ...errorUtil.errToObj(message) });\n }\n ulid(message) {\n return this._addCheck({ kind: \"ulid\", ...errorUtil.errToObj(message) });\n }\n ip(options) {\n return this._addCheck({ kind: \"ip\", ...errorUtil.errToObj(options) });\n }\n datetime(options) {\n var _a;\n if (typeof options === \"string\") {\n return this._addCheck({\n kind: \"datetime\",\n precision: null,\n offset: false,\n message: options,\n });\n }\n return this._addCheck({\n kind: \"datetime\",\n precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === \"undefined\" ? null : options === null || options === void 0 ? void 0 : options.precision,\n offset: (_a = options === null || options === void 0 ? void 0 : options.offset) !== null && _a !== void 0 ? _a : false,\n ...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message),\n });\n }\n regex(regex, message) {\n return this._addCheck({\n kind: \"regex\",\n regex: regex,\n ...errorUtil.errToObj(message),\n });\n }\n includes(value, options) {\n return this._addCheck({\n kind: \"includes\",\n value: value,\n position: options === null || options === void 0 ? void 0 : options.position,\n ...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message),\n });\n }\n startsWith(value, message) {\n return this._addCheck({\n kind: \"startsWith\",\n value: value,\n ...errorUtil.errToObj(message),\n });\n }\n endsWith(value, message) {\n return this._addCheck({\n kind: \"endsWith\",\n value: value,\n ...errorUtil.errToObj(message),\n });\n }\n min(minLength, message) {\n return this._addCheck({\n kind: \"min\",\n value: minLength,\n ...errorUtil.errToObj(message),\n });\n }\n max(maxLength, message) {\n return this._addCheck({\n kind: \"max\",\n value: maxLength,\n ...errorUtil.errToObj(message),\n });\n }\n length(len, message) {\n return this._addCheck({\n kind: \"length\",\n value: len,\n ...errorUtil.errToObj(message),\n });\n }\n get isDatetime() {\n return !!this._def.checks.find((ch) => ch.kind === \"datetime\");\n }\n get isEmail() {\n return !!this._def.checks.find((ch) => ch.kind === \"email\");\n }\n get isURL() {\n return !!this._def.checks.find((ch) => ch.kind === \"url\");\n }\n get isEmoji() {\n return !!this._def.checks.find((ch) => ch.kind === \"emoji\");\n }\n get isUUID() {\n return !!this._def.checks.find((ch) => ch.kind === \"uuid\");\n }\n get isCUID() {\n return !!this._def.checks.find((ch) => ch.kind === \"cuid\");\n }\n get isCUID2() {\n return !!this._def.checks.find((ch) => ch.kind === \"cuid2\");\n }\n get isULID() {\n return !!this._def.checks.find((ch) => ch.kind === \"ulid\");\n }\n get isIP() {\n return !!this._def.checks.find((ch) => ch.kind === \"ip\");\n }\n get minLength() {\n let min = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"min\") {\n if (min === null || ch.value > min)\n min = ch.value;\n }\n }\n return min;\n }\n get maxLength() {\n let max = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"max\") {\n if (max === null || ch.value < max)\n max = ch.value;\n }\n }\n return max;\n }\n}\nZodString.create = (params) => {\n var _a;\n return new ZodString({\n checks: [],\n typeName: ZodFirstPartyTypeKind.ZodString,\n coerce: (_a = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a !== void 0 ? _a : false,\n ...processCreateParams(params),\n });\n};\n// https://stackoverflow.com/questions/3966484/why-does-modulus-operator-return-fractional-number-in-javascript/31711034#31711034\nfunction floatSafeRemainder(val, step) {\n const valDecCount = (val.toString().split(\".\")[1] || \"\").length;\n const stepDecCount = (step.toString().split(\".\")[1] || \"\").length;\n const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;\n const valInt = parseInt(val.toFixed(decCount).replace(\".\", \"\"));\n const stepInt = parseInt(step.toFixed(decCount).replace(\".\", \"\"));\n return (valInt % stepInt) / Math.pow(10, decCount);\n}\nclass ZodNumber extends ZodType {\n constructor() {\n super(...arguments);\n this.min = this.gte;\n this.max = this.lte;\n this.step = this.multipleOf;\n }\n _parse(input) {\n if (this._def.coerce) {\n input.data = Number(input.data);\n }\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.number) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.number,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n let ctx = undefined;\n const status = new ParseStatus();\n for (const check of this._def.checks) {\n if (check.kind === \"int\") {\n if (!util.isInteger(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: \"integer\",\n received: \"float\",\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"min\") {\n const tooSmall = check.inclusive\n ? input.data < check.value\n : input.data <= check.value;\n if (tooSmall) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n minimum: check.value,\n type: \"number\",\n inclusive: check.inclusive,\n exact: false,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"max\") {\n const tooBig = check.inclusive\n ? input.data > check.value\n : input.data >= check.value;\n if (tooBig) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n maximum: check.value,\n type: \"number\",\n inclusive: check.inclusive,\n exact: false,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"multipleOf\") {\n if (floatSafeRemainder(input.data, check.value) !== 0) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.not_multiple_of,\n multipleOf: check.value,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"finite\") {\n if (!Number.isFinite(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.not_finite,\n message: check.message,\n });\n status.dirty();\n }\n }\n else {\n util.assertNever(check);\n }\n }\n return { status: status.value, value: input.data };\n }\n gte(value, message) {\n return this.setLimit(\"min\", value, true, errorUtil.toString(message));\n }\n gt(value, message) {\n return this.setLimit(\"min\", value, false, errorUtil.toString(message));\n }\n lte(value, message) {\n return this.setLimit(\"max\", value, true, errorUtil.toString(message));\n }\n lt(value, message) {\n return this.setLimit(\"max\", value, false, errorUtil.toString(message));\n }\n setLimit(kind, value, inclusive, message) {\n return new ZodNumber({\n ...this._def,\n checks: [\n ...this._def.checks,\n {\n kind,\n value,\n inclusive,\n message: errorUtil.toString(message),\n },\n ],\n });\n }\n _addCheck(check) {\n return new ZodNumber({\n ...this._def,\n checks: [...this._def.checks, check],\n });\n }\n int(message) {\n return this._addCheck({\n kind: \"int\",\n message: errorUtil.toString(message),\n });\n }\n positive(message) {\n return this._addCheck({\n kind: \"min\",\n value: 0,\n inclusive: false,\n message: errorUtil.toString(message),\n });\n }\n negative(message) {\n return this._addCheck({\n kind: \"max\",\n value: 0,\n inclusive: false,\n message: errorUtil.toString(message),\n });\n }\n nonpositive(message) {\n return this._addCheck({\n kind: \"max\",\n value: 0,\n inclusive: true,\n message: errorUtil.toString(message),\n });\n }\n nonnegative(message) {\n return this._addCheck({\n kind: \"min\",\n value: 0,\n inclusive: true,\n message: errorUtil.toString(message),\n });\n }\n multipleOf(value, message) {\n return this._addCheck({\n kind: \"multipleOf\",\n value: value,\n message: errorUtil.toString(message),\n });\n }\n finite(message) {\n return this._addCheck({\n kind: \"finite\",\n message: errorUtil.toString(message),\n });\n }\n safe(message) {\n return this._addCheck({\n kind: \"min\",\n inclusive: true,\n value: Number.MIN_SAFE_INTEGER,\n message: errorUtil.toString(message),\n })._addCheck({\n kind: \"max\",\n inclusive: true,\n value: Number.MAX_SAFE_INTEGER,\n message: errorUtil.toString(message),\n });\n }\n get minValue() {\n let min = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"min\") {\n if (min === null || ch.value > min)\n min = ch.value;\n }\n }\n return min;\n }\n get maxValue() {\n let max = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"max\") {\n if (max === null || ch.value < max)\n max = ch.value;\n }\n }\n return max;\n }\n get isInt() {\n return !!this._def.checks.find((ch) => ch.kind === \"int\" ||\n (ch.kind === \"multipleOf\" && util.isInteger(ch.value)));\n }\n get isFinite() {\n let max = null, min = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"finite\" ||\n ch.kind === \"int\" ||\n ch.kind === \"multipleOf\") {\n return true;\n }\n else if (ch.kind === \"min\") {\n if (min === null || ch.value > min)\n min = ch.value;\n }\n else if (ch.kind === \"max\") {\n if (max === null || ch.value < max)\n max = ch.value;\n }\n }\n return Number.isFinite(min) && Number.isFinite(max);\n }\n}\nZodNumber.create = (params) => {\n return new ZodNumber({\n checks: [],\n typeName: ZodFirstPartyTypeKind.ZodNumber,\n coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,\n ...processCreateParams(params),\n });\n};\nclass ZodBigInt extends ZodType {\n constructor() {\n super(...arguments);\n this.min = this.gte;\n this.max = this.lte;\n }\n _parse(input) {\n if (this._def.coerce) {\n input.data = BigInt(input.data);\n }\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.bigint) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.bigint,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n let ctx = undefined;\n const status = new ParseStatus();\n for (const check of this._def.checks) {\n if (check.kind === \"min\") {\n const tooSmall = check.inclusive\n ? input.data < check.value\n : input.data <= check.value;\n if (tooSmall) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n type: \"bigint\",\n minimum: check.value,\n inclusive: check.inclusive,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"max\") {\n const tooBig = check.inclusive\n ? input.data > check.value\n : input.data >= check.value;\n if (tooBig) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n type: \"bigint\",\n maximum: check.value,\n inclusive: check.inclusive,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"multipleOf\") {\n if (input.data % check.value !== BigInt(0)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.not_multiple_of,\n multipleOf: check.value,\n message: check.message,\n });\n status.dirty();\n }\n }\n else {\n util.assertNever(check);\n }\n }\n return { status: status.value, value: input.data };\n }\n gte(value, message) {\n return this.setLimit(\"min\", value, true, errorUtil.toString(message));\n }\n gt(value, message) {\n return this.setLimit(\"min\", value, false, errorUtil.toString(message));\n }\n lte(value, message) {\n return this.setLimit(\"max\", value, true, errorUtil.toString(message));\n }\n lt(value, message) {\n return this.setLimit(\"max\", value, false, errorUtil.toString(message));\n }\n setLimit(kind, value, inclusive, message) {\n return new ZodBigInt({\n ...this._def,\n checks: [\n ...this._def.checks,\n {\n kind,\n value,\n inclusive,\n message: errorUtil.toString(message),\n },\n ],\n });\n }\n _addCheck(check) {\n return new ZodBigInt({\n ...this._def,\n checks: [...this._def.checks, check],\n });\n }\n positive(message) {\n return this._addCheck({\n kind: \"min\",\n value: BigInt(0),\n inclusive: false,\n message: errorUtil.toString(message),\n });\n }\n negative(message) {\n return this._addCheck({\n kind: \"max\",\n value: BigInt(0),\n inclusive: false,\n message: errorUtil.toString(message),\n });\n }\n nonpositive(message) {\n return this._addCheck({\n kind: \"max\",\n value: BigInt(0),\n inclusive: true,\n message: errorUtil.toString(message),\n });\n }\n nonnegative(message) {\n return this._addCheck({\n kind: \"min\",\n value: BigInt(0),\n inclusive: true,\n message: errorUtil.toString(message),\n });\n }\n multipleOf(value, message) {\n return this._addCheck({\n kind: \"multipleOf\",\n value,\n message: errorUtil.toString(message),\n });\n }\n get minValue() {\n let min = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"min\") {\n if (min === null || ch.value > min)\n min = ch.value;\n }\n }\n return min;\n }\n get maxValue() {\n let max = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"max\") {\n if (max === null || ch.value < max)\n max = ch.value;\n }\n }\n return max;\n }\n}\nZodBigInt.create = (params) => {\n var _a;\n return new ZodBigInt({\n checks: [],\n typeName: ZodFirstPartyTypeKind.ZodBigInt,\n coerce: (_a = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a !== void 0 ? _a : false,\n ...processCreateParams(params),\n });\n};\nclass ZodBoolean extends ZodType {\n _parse(input) {\n if (this._def.coerce) {\n input.data = Boolean(input.data);\n }\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.boolean) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.boolean,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n return OK(input.data);\n }\n}\nZodBoolean.create = (params) => {\n return new ZodBoolean({\n typeName: ZodFirstPartyTypeKind.ZodBoolean,\n coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,\n ...processCreateParams(params),\n });\n};\nclass ZodDate extends ZodType {\n _parse(input) {\n if (this._def.coerce) {\n input.data = new Date(input.data);\n }\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.date) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.date,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n if (isNaN(input.data.getTime())) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_date,\n });\n return INVALID;\n }\n const status = new ParseStatus();\n let ctx = undefined;\n for (const check of this._def.checks) {\n if (check.kind === \"min\") {\n if (input.data.getTime() < check.value) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n message: check.message,\n inclusive: true,\n exact: false,\n minimum: check.value,\n type: \"date\",\n });\n status.dirty();\n }\n }\n else if (check.kind === \"max\") {\n if (input.data.getTime() > check.value) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n message: check.message,\n inclusive: true,\n exact: false,\n maximum: check.value,\n type: \"date\",\n });\n status.dirty();\n }\n }\n else {\n util.assertNever(check);\n }\n }\n return {\n status: status.value,\n value: new Date(input.data.getTime()),\n };\n }\n _addCheck(check) {\n return new ZodDate({\n ...this._def,\n checks: [...this._def.checks, check],\n });\n }\n min(minDate, message) {\n return this._addCheck({\n kind: \"min\",\n value: minDate.getTime(),\n message: errorUtil.toString(message),\n });\n }\n max(maxDate, message) {\n return this._addCheck({\n kind: \"max\",\n value: maxDate.getTime(),\n message: errorUtil.toString(message),\n });\n }\n get minDate() {\n let min = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"min\") {\n if (min === null || ch.value > min)\n min = ch.value;\n }\n }\n return min != null ? new Date(min) : null;\n }\n get maxDate() {\n let max = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"max\") {\n if (max === null || ch.value < max)\n max = ch.value;\n }\n }\n return max != null ? new Date(max) : null;\n }\n}\nZodDate.create = (params) => {\n return new ZodDate({\n checks: [],\n coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,\n typeName: ZodFirstPartyTypeKind.ZodDate,\n ...processCreateParams(params),\n });\n};\nclass ZodSymbol extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.symbol) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.symbol,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n return OK(input.data);\n }\n}\nZodSymbol.create = (params) => {\n return new ZodSymbol({\n typeName: ZodFirstPartyTypeKind.ZodSymbol,\n ...processCreateParams(params),\n });\n};\nclass ZodUndefined extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.undefined) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.undefined,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n return OK(input.data);\n }\n}\nZodUndefined.create = (params) => {\n return new ZodUndefined({\n typeName: ZodFirstPartyTypeKind.ZodUndefined,\n ...processCreateParams(params),\n });\n};\nclass ZodNull extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.null) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.null,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n return OK(input.data);\n }\n}\nZodNull.create = (params) => {\n return new ZodNull({\n typeName: ZodFirstPartyTypeKind.ZodNull,\n ...processCreateParams(params),\n });\n};\nclass ZodAny extends ZodType {\n constructor() {\n super(...arguments);\n // to prevent instances of other classes from extending ZodAny. this causes issues with catchall in ZodObject.\n this._any = true;\n }\n _parse(input) {\n return OK(input.data);\n }\n}\nZodAny.create = (params) => {\n return new ZodAny({\n typeName: ZodFirstPartyTypeKind.ZodAny,\n ...processCreateParams(params),\n });\n};\nclass ZodUnknown extends ZodType {\n constructor() {\n super(...arguments);\n // required\n this._unknown = true;\n }\n _parse(input) {\n return OK(input.data);\n }\n}\nZodUnknown.create = (params) => {\n return new ZodUnknown({\n typeName: ZodFirstPartyTypeKind.ZodUnknown,\n ...processCreateParams(params),\n });\n};\nclass ZodNever extends ZodType {\n _parse(input) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.never,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n}\nZodNever.create = (params) => {\n return new ZodNever({\n typeName: ZodFirstPartyTypeKind.ZodNever,\n ...processCreateParams(params),\n });\n};\nclass ZodVoid extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.undefined) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.void,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n return OK(input.data);\n }\n}\nZodVoid.create = (params) => {\n return new ZodVoid({\n typeName: ZodFirstPartyTypeKind.ZodVoid,\n ...processCreateParams(params),\n });\n};\nclass ZodArray extends ZodType {\n _parse(input) {\n const { ctx, status } = this._processInputParams(input);\n const def = this._def;\n if (ctx.parsedType !== ZodParsedType.array) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.array,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n if (def.exactLength !== null) {\n const tooBig = ctx.data.length > def.exactLength.value;\n const tooSmall = ctx.data.length < def.exactLength.value;\n if (tooBig || tooSmall) {\n addIssueToContext(ctx, {\n code: tooBig ? ZodIssueCode.too_big : ZodIssueCode.too_small,\n minimum: (tooSmall ? def.exactLength.value : undefined),\n maximum: (tooBig ? def.exactLength.value : undefined),\n type: \"array\",\n inclusive: true,\n exact: true,\n message: def.exactLength.message,\n });\n status.dirty();\n }\n }\n if (def.minLength !== null) {\n if (ctx.data.length < def.minLength.value) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n minimum: def.minLength.value,\n type: \"array\",\n inclusive: true,\n exact: false,\n message: def.minLength.message,\n });\n status.dirty();\n }\n }\n if (def.maxLength !== null) {\n if (ctx.data.length > def.maxLength.value) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n maximum: def.maxLength.value,\n type: \"array\",\n inclusive: true,\n exact: false,\n message: def.maxLength.message,\n });\n status.dirty();\n }\n }\n if (ctx.common.async) {\n return Promise.all([...ctx.data].map((item, i) => {\n return def.type._parseAsync(new ParseInputLazyPath(ctx, item, ctx.path, i));\n })).then((result) => {\n return ParseStatus.mergeArray(status, result);\n });\n }\n const result = [...ctx.data].map((item, i) => {\n return def.type._parseSync(new ParseInputLazyPath(ctx, item, ctx.path, i));\n });\n return ParseStatus.mergeArray(status, result);\n }\n get element() {\n return this._def.type;\n }\n min(minLength, message) {\n return new ZodArray({\n ...this._def,\n minLength: { value: minLength, message: errorUtil.toString(message) },\n });\n }\n max(maxLength, message) {\n return new ZodArray({\n ...this._def,\n maxLength: { value: maxLength, message: errorUtil.toString(message) },\n });\n }\n length(len, message) {\n return new ZodArray({\n ...this._def,\n exactLength: { value: len, message: errorUtil.toString(message) },\n });\n }\n nonempty(message) {\n return this.min(1, message);\n }\n}\nZodArray.create = (schema, params) => {\n return new ZodArray({\n type: schema,\n minLength: null,\n maxLength: null,\n exactLength: null,\n typeName: ZodFirstPartyTypeKind.ZodArray,\n ...processCreateParams(params),\n });\n};\nfunction deepPartialify(schema) {\n if (schema instanceof ZodObject) {\n const newShape = {};\n for (const key in schema.shape) {\n const fieldSchema = schema.shape[key];\n newShape[key] = ZodOptional.create(deepPartialify(fieldSchema));\n }\n return new ZodObject({\n ...schema._def,\n shape: () => newShape,\n });\n }\n else if (schema instanceof ZodArray) {\n return new ZodArray({\n ...schema._def,\n type: deepPartialify(schema.element),\n });\n }\n else if (schema instanceof ZodOptional) {\n return ZodOptional.create(deepPartialify(schema.unwrap()));\n }\n else if (schema instanceof ZodNullable) {\n return ZodNullable.create(deepPartialify(schema.unwrap()));\n }\n else if (schema instanceof ZodTuple) {\n return ZodTuple.create(schema.items.map((item) => deepPartialify(item)));\n }\n else {\n return schema;\n }\n}\nclass ZodObject extends ZodType {\n constructor() {\n super(...arguments);\n this._cached = null;\n /**\n * @deprecated In most cases, this is no longer needed - unknown properties are now silently stripped.\n * If you want to pass through unknown properties, use `.passthrough()` instead.\n */\n this.nonstrict = this.passthrough;\n // extend<\n // Augmentation extends ZodRawShape,\n // NewOutput extends util.flatten<{\n // [k in keyof Augmentation | keyof Output]: k extends keyof Augmentation\n // ? Augmentation[k][\"_output\"]\n // : k extends keyof Output\n // ? Output[k]\n // : never;\n // }>,\n // NewInput extends util.flatten<{\n // [k in keyof Augmentation | keyof Input]: k extends keyof Augmentation\n // ? Augmentation[k][\"_input\"]\n // : k extends keyof Input\n // ? Input[k]\n // : never;\n // }>\n // >(\n // augmentation: Augmentation\n // ): ZodObject<\n // extendShape,\n // UnknownKeys,\n // Catchall,\n // NewOutput,\n // NewInput\n // > {\n // return new ZodObject({\n // ...this._def,\n // shape: () => ({\n // ...this._def.shape(),\n // ...augmentation,\n // }),\n // }) as any;\n // }\n /**\n * @deprecated Use `.extend` instead\n * */\n this.augment = this.extend;\n }\n _getCached() {\n if (this._cached !== null)\n return this._cached;\n const shape = this._def.shape();\n const keys = util.objectKeys(shape);\n return (this._cached = { shape, keys });\n }\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.object) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.object,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n const { status, ctx } = this._processInputParams(input);\n const { shape, keys: shapeKeys } = this._getCached();\n const extraKeys = [];\n if (!(this._def.catchall instanceof ZodNever &&\n this._def.unknownKeys === \"strip\")) {\n for (const key in ctx.data) {\n if (!shapeKeys.includes(key)) {\n extraKeys.push(key);\n }\n }\n }\n const pairs = [];\n for (const key of shapeKeys) {\n const keyValidator = shape[key];\n const value = ctx.data[key];\n pairs.push({\n key: { status: \"valid\", value: key },\n value: keyValidator._parse(new ParseInputLazyPath(ctx, value, ctx.path, key)),\n alwaysSet: key in ctx.data,\n });\n }\n if (this._def.catchall instanceof ZodNever) {\n const unknownKeys = this._def.unknownKeys;\n if (unknownKeys === \"passthrough\") {\n for (const key of extraKeys) {\n pairs.push({\n key: { status: \"valid\", value: key },\n value: { status: \"valid\", value: ctx.data[key] },\n });\n }\n }\n else if (unknownKeys === \"strict\") {\n if (extraKeys.length > 0) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.unrecognized_keys,\n keys: extraKeys,\n });\n status.dirty();\n }\n }\n else if (unknownKeys === \"strip\") ;\n else {\n throw new Error(`Internal ZodObject error: invalid unknownKeys value.`);\n }\n }\n else {\n // run catchall validation\n const catchall = this._def.catchall;\n for (const key of extraKeys) {\n const value = ctx.data[key];\n pairs.push({\n key: { status: \"valid\", value: key },\n value: catchall._parse(new ParseInputLazyPath(ctx, value, ctx.path, key) //, ctx.child(key), value, getParsedType(value)\n ),\n alwaysSet: key in ctx.data,\n });\n }\n }\n if (ctx.common.async) {\n return Promise.resolve()\n .then(async () => {\n const syncPairs = [];\n for (const pair of pairs) {\n const key = await pair.key;\n syncPairs.push({\n key,\n value: await pair.value,\n alwaysSet: pair.alwaysSet,\n });\n }\n return syncPairs;\n })\n .then((syncPairs) => {\n return ParseStatus.mergeObjectSync(status, syncPairs);\n });\n }\n else {\n return ParseStatus.mergeObjectSync(status, pairs);\n }\n }\n get shape() {\n return this._def.shape();\n }\n strict(message) {\n errorUtil.errToObj;\n return new ZodObject({\n ...this._def,\n unknownKeys: \"strict\",\n ...(message !== undefined\n ? {\n errorMap: (issue, ctx) => {\n var _a, _b, _c, _d;\n const defaultError = (_c = (_b = (_a = this._def).errorMap) === null || _b === void 0 ? void 0 : _b.call(_a, issue, ctx).message) !== null && _c !== void 0 ? _c : ctx.defaultError;\n if (issue.code === \"unrecognized_keys\")\n return {\n message: (_d = errorUtil.errToObj(message).message) !== null && _d !== void 0 ? _d : defaultError,\n };\n return {\n message: defaultError,\n };\n },\n }\n : {}),\n });\n }\n strip() {\n return new ZodObject({\n ...this._def,\n unknownKeys: \"strip\",\n });\n }\n passthrough() {\n return new ZodObject({\n ...this._def,\n unknownKeys: \"passthrough\",\n });\n }\n // const AugmentFactory =\n // (def: Def) =>\n // (\n // augmentation: Augmentation\n // ): ZodObject<\n // extendShape, Augmentation>,\n // Def[\"unknownKeys\"],\n // Def[\"catchall\"]\n // > => {\n // return new ZodObject({\n // ...def,\n // shape: () => ({\n // ...def.shape(),\n // ...augmentation,\n // }),\n // }) as any;\n // };\n extend(augmentation) {\n return new ZodObject({\n ...this._def,\n shape: () => ({\n ...this._def.shape(),\n ...augmentation,\n }),\n });\n }\n /**\n * Prior to zod@1.0.12 there was a bug in the\n * inferred type of merged objects. Please\n * upgrade if you are experiencing issues.\n */\n merge(merging) {\n const merged = new ZodObject({\n unknownKeys: merging._def.unknownKeys,\n catchall: merging._def.catchall,\n shape: () => ({\n ...this._def.shape(),\n ...merging._def.shape(),\n }),\n typeName: ZodFirstPartyTypeKind.ZodObject,\n });\n return merged;\n }\n // merge<\n // Incoming extends AnyZodObject,\n // Augmentation extends Incoming[\"shape\"],\n // NewOutput extends {\n // [k in keyof Augmentation | keyof Output]: k extends keyof Augmentation\n // ? Augmentation[k][\"_output\"]\n // : k extends keyof Output\n // ? Output[k]\n // : never;\n // },\n // NewInput extends {\n // [k in keyof Augmentation | keyof Input]: k extends keyof Augmentation\n // ? Augmentation[k][\"_input\"]\n // : k extends keyof Input\n // ? Input[k]\n // : never;\n // }\n // >(\n // merging: Incoming\n // ): ZodObject<\n // extendShape>,\n // Incoming[\"_def\"][\"unknownKeys\"],\n // Incoming[\"_def\"][\"catchall\"],\n // NewOutput,\n // NewInput\n // > {\n // const merged: any = new ZodObject({\n // unknownKeys: merging._def.unknownKeys,\n // catchall: merging._def.catchall,\n // shape: () =>\n // objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),\n // typeName: ZodFirstPartyTypeKind.ZodObject,\n // }) as any;\n // return merged;\n // }\n setKey(key, schema) {\n return this.augment({ [key]: schema });\n }\n // merge(\n // merging: Incoming\n // ): //ZodObject = (merging) => {\n // ZodObject<\n // extendShape>,\n // Incoming[\"_def\"][\"unknownKeys\"],\n // Incoming[\"_def\"][\"catchall\"]\n // > {\n // // const mergedShape = objectUtil.mergeShapes(\n // // this._def.shape(),\n // // merging._def.shape()\n // // );\n // const merged: any = new ZodObject({\n // unknownKeys: merging._def.unknownKeys,\n // catchall: merging._def.catchall,\n // shape: () =>\n // objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),\n // typeName: ZodFirstPartyTypeKind.ZodObject,\n // }) as any;\n // return merged;\n // }\n catchall(index) {\n return new ZodObject({\n ...this._def,\n catchall: index,\n });\n }\n pick(mask) {\n const shape = {};\n util.objectKeys(mask).forEach((key) => {\n if (mask[key] && this.shape[key]) {\n shape[key] = this.shape[key];\n }\n });\n return new ZodObject({\n ...this._def,\n shape: () => shape,\n });\n }\n omit(mask) {\n const shape = {};\n util.objectKeys(this.shape).forEach((key) => {\n if (!mask[key]) {\n shape[key] = this.shape[key];\n }\n });\n return new ZodObject({\n ...this._def,\n shape: () => shape,\n });\n }\n /**\n * @deprecated\n */\n deepPartial() {\n return deepPartialify(this);\n }\n partial(mask) {\n const newShape = {};\n util.objectKeys(this.shape).forEach((key) => {\n const fieldSchema = this.shape[key];\n if (mask && !mask[key]) {\n newShape[key] = fieldSchema;\n }\n else {\n newShape[key] = fieldSchema.optional();\n }\n });\n return new ZodObject({\n ...this._def,\n shape: () => newShape,\n });\n }\n required(mask) {\n const newShape = {};\n util.objectKeys(this.shape).forEach((key) => {\n if (mask && !mask[key]) {\n newShape[key] = this.shape[key];\n }\n else {\n const fieldSchema = this.shape[key];\n let newField = fieldSchema;\n while (newField instanceof ZodOptional) {\n newField = newField._def.innerType;\n }\n newShape[key] = newField;\n }\n });\n return new ZodObject({\n ...this._def,\n shape: () => newShape,\n });\n }\n keyof() {\n return createZodEnum(util.objectKeys(this.shape));\n }\n}\nZodObject.create = (shape, params) => {\n return new ZodObject({\n shape: () => shape,\n unknownKeys: \"strip\",\n catchall: ZodNever.create(),\n typeName: ZodFirstPartyTypeKind.ZodObject,\n ...processCreateParams(params),\n });\n};\nZodObject.strictCreate = (shape, params) => {\n return new ZodObject({\n shape: () => shape,\n unknownKeys: \"strict\",\n catchall: ZodNever.create(),\n typeName: ZodFirstPartyTypeKind.ZodObject,\n ...processCreateParams(params),\n });\n};\nZodObject.lazycreate = (shape, params) => {\n return new ZodObject({\n shape,\n unknownKeys: \"strip\",\n catchall: ZodNever.create(),\n typeName: ZodFirstPartyTypeKind.ZodObject,\n ...processCreateParams(params),\n });\n};\nclass ZodUnion extends ZodType {\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n const options = this._def.options;\n function handleResults(results) {\n // return first issue-free validation if it exists\n for (const result of results) {\n if (result.result.status === \"valid\") {\n return result.result;\n }\n }\n for (const result of results) {\n if (result.result.status === \"dirty\") {\n // add issues from dirty option\n ctx.common.issues.push(...result.ctx.common.issues);\n return result.result;\n }\n }\n // return invalid\n const unionErrors = results.map((result) => new ZodError(result.ctx.common.issues));\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_union,\n unionErrors,\n });\n return INVALID;\n }\n if (ctx.common.async) {\n return Promise.all(options.map(async (option) => {\n const childCtx = {\n ...ctx,\n common: {\n ...ctx.common,\n issues: [],\n },\n parent: null,\n };\n return {\n result: await option._parseAsync({\n data: ctx.data,\n path: ctx.path,\n parent: childCtx,\n }),\n ctx: childCtx,\n };\n })).then(handleResults);\n }\n else {\n let dirty = undefined;\n const issues = [];\n for (const option of options) {\n const childCtx = {\n ...ctx,\n common: {\n ...ctx.common,\n issues: [],\n },\n parent: null,\n };\n const result = option._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: childCtx,\n });\n if (result.status === \"valid\") {\n return result;\n }\n else if (result.status === \"dirty\" && !dirty) {\n dirty = { result, ctx: childCtx };\n }\n if (childCtx.common.issues.length) {\n issues.push(childCtx.common.issues);\n }\n }\n if (dirty) {\n ctx.common.issues.push(...dirty.ctx.common.issues);\n return dirty.result;\n }\n const unionErrors = issues.map((issues) => new ZodError(issues));\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_union,\n unionErrors,\n });\n return INVALID;\n }\n }\n get options() {\n return this._def.options;\n }\n}\nZodUnion.create = (types, params) => {\n return new ZodUnion({\n options: types,\n typeName: ZodFirstPartyTypeKind.ZodUnion,\n ...processCreateParams(params),\n });\n};\n/////////////////////////////////////////////////////\n/////////////////////////////////////////////////////\n////////// //////////\n////////// ZodDiscriminatedUnion //////////\n////////// //////////\n/////////////////////////////////////////////////////\n/////////////////////////////////////////////////////\nconst getDiscriminator = (type) => {\n if (type instanceof ZodLazy) {\n return getDiscriminator(type.schema);\n }\n else if (type instanceof ZodEffects) {\n return getDiscriminator(type.innerType());\n }\n else if (type instanceof ZodLiteral) {\n return [type.value];\n }\n else if (type instanceof ZodEnum) {\n return type.options;\n }\n else if (type instanceof ZodNativeEnum) {\n // eslint-disable-next-line ban/ban\n return Object.keys(type.enum);\n }\n else if (type instanceof ZodDefault) {\n return getDiscriminator(type._def.innerType);\n }\n else if (type instanceof ZodUndefined) {\n return [undefined];\n }\n else if (type instanceof ZodNull) {\n return [null];\n }\n else {\n return null;\n }\n};\nclass ZodDiscriminatedUnion extends ZodType {\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n if (ctx.parsedType !== ZodParsedType.object) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.object,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n const discriminator = this.discriminator;\n const discriminatorValue = ctx.data[discriminator];\n const option = this.optionsMap.get(discriminatorValue);\n if (!option) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_union_discriminator,\n options: Array.from(this.optionsMap.keys()),\n path: [discriminator],\n });\n return INVALID;\n }\n if (ctx.common.async) {\n return option._parseAsync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n });\n }\n else {\n return option._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n });\n }\n }\n get discriminator() {\n return this._def.discriminator;\n }\n get options() {\n return this._def.options;\n }\n get optionsMap() {\n return this._def.optionsMap;\n }\n /**\n * The constructor of the discriminated union schema. Its behaviour is very similar to that of the normal z.union() constructor.\n * However, it only allows a union of objects, all of which need to share a discriminator property. This property must\n * have a different value for each object in the union.\n * @param discriminator the name of the discriminator property\n * @param types an array of object schemas\n * @param params\n */\n static create(discriminator, options, params) {\n // Get all the valid discriminator values\n const optionsMap = new Map();\n // try {\n for (const type of options) {\n const discriminatorValues = getDiscriminator(type.shape[discriminator]);\n if (!discriminatorValues) {\n throw new Error(`A discriminator value for key \\`${discriminator}\\` could not be extracted from all schema options`);\n }\n for (const value of discriminatorValues) {\n if (optionsMap.has(value)) {\n throw new Error(`Discriminator property ${String(discriminator)} has duplicate value ${String(value)}`);\n }\n optionsMap.set(value, type);\n }\n }\n return new ZodDiscriminatedUnion({\n typeName: ZodFirstPartyTypeKind.ZodDiscriminatedUnion,\n discriminator,\n options,\n optionsMap,\n ...processCreateParams(params),\n });\n }\n}\nfunction mergeValues(a, b) {\n const aType = getParsedType(a);\n const bType = getParsedType(b);\n if (a === b) {\n return { valid: true, data: a };\n }\n else if (aType === ZodParsedType.object && bType === ZodParsedType.object) {\n const bKeys = util.objectKeys(b);\n const sharedKeys = util\n .objectKeys(a)\n .filter((key) => bKeys.indexOf(key) !== -1);\n const newObj = { ...a, ...b };\n for (const key of sharedKeys) {\n const sharedValue = mergeValues(a[key], b[key]);\n if (!sharedValue.valid) {\n return { valid: false };\n }\n newObj[key] = sharedValue.data;\n }\n return { valid: true, data: newObj };\n }\n else if (aType === ZodParsedType.array && bType === ZodParsedType.array) {\n if (a.length !== b.length) {\n return { valid: false };\n }\n const newArray = [];\n for (let index = 0; index < a.length; index++) {\n const itemA = a[index];\n const itemB = b[index];\n const sharedValue = mergeValues(itemA, itemB);\n if (!sharedValue.valid) {\n return { valid: false };\n }\n newArray.push(sharedValue.data);\n }\n return { valid: true, data: newArray };\n }\n else if (aType === ZodParsedType.date &&\n bType === ZodParsedType.date &&\n +a === +b) {\n return { valid: true, data: a };\n }\n else {\n return { valid: false };\n }\n}\nclass ZodIntersection extends ZodType {\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n const handleParsed = (parsedLeft, parsedRight) => {\n if (isAborted(parsedLeft) || isAborted(parsedRight)) {\n return INVALID;\n }\n const merged = mergeValues(parsedLeft.value, parsedRight.value);\n if (!merged.valid) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_intersection_types,\n });\n return INVALID;\n }\n if (isDirty(parsedLeft) || isDirty(parsedRight)) {\n status.dirty();\n }\n return { status: status.value, value: merged.data };\n };\n if (ctx.common.async) {\n return Promise.all([\n this._def.left._parseAsync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n }),\n this._def.right._parseAsync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n }),\n ]).then(([left, right]) => handleParsed(left, right));\n }\n else {\n return handleParsed(this._def.left._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n }), this._def.right._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n }));\n }\n }\n}\nZodIntersection.create = (left, right, params) => {\n return new ZodIntersection({\n left: left,\n right: right,\n typeName: ZodFirstPartyTypeKind.ZodIntersection,\n ...processCreateParams(params),\n });\n};\nclass ZodTuple extends ZodType {\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n if (ctx.parsedType !== ZodParsedType.array) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.array,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n if (ctx.data.length < this._def.items.length) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n minimum: this._def.items.length,\n inclusive: true,\n exact: false,\n type: \"array\",\n });\n return INVALID;\n }\n const rest = this._def.rest;\n if (!rest && ctx.data.length > this._def.items.length) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n maximum: this._def.items.length,\n inclusive: true,\n exact: false,\n type: \"array\",\n });\n status.dirty();\n }\n const items = [...ctx.data]\n .map((item, itemIndex) => {\n const schema = this._def.items[itemIndex] || this._def.rest;\n if (!schema)\n return null;\n return schema._parse(new ParseInputLazyPath(ctx, item, ctx.path, itemIndex));\n })\n .filter((x) => !!x); // filter nulls\n if (ctx.common.async) {\n return Promise.all(items).then((results) => {\n return ParseStatus.mergeArray(status, results);\n });\n }\n else {\n return ParseStatus.mergeArray(status, items);\n }\n }\n get items() {\n return this._def.items;\n }\n rest(rest) {\n return new ZodTuple({\n ...this._def,\n rest,\n });\n }\n}\nZodTuple.create = (schemas, params) => {\n if (!Array.isArray(schemas)) {\n throw new Error(\"You must pass an array of schemas to z.tuple([ ... ])\");\n }\n return new ZodTuple({\n items: schemas,\n typeName: ZodFirstPartyTypeKind.ZodTuple,\n rest: null,\n ...processCreateParams(params),\n });\n};\nclass ZodRecord extends ZodType {\n get keySchema() {\n return this._def.keyType;\n }\n get valueSchema() {\n return this._def.valueType;\n }\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n if (ctx.parsedType !== ZodParsedType.object) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.object,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n const pairs = [];\n const keyType = this._def.keyType;\n const valueType = this._def.valueType;\n for (const key in ctx.data) {\n pairs.push({\n key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, key)),\n value: valueType._parse(new ParseInputLazyPath(ctx, ctx.data[key], ctx.path, key)),\n });\n }\n if (ctx.common.async) {\n return ParseStatus.mergeObjectAsync(status, pairs);\n }\n else {\n return ParseStatus.mergeObjectSync(status, pairs);\n }\n }\n get element() {\n return this._def.valueType;\n }\n static create(first, second, third) {\n if (second instanceof ZodType) {\n return new ZodRecord({\n keyType: first,\n valueType: second,\n typeName: ZodFirstPartyTypeKind.ZodRecord,\n ...processCreateParams(third),\n });\n }\n return new ZodRecord({\n keyType: ZodString.create(),\n valueType: first,\n typeName: ZodFirstPartyTypeKind.ZodRecord,\n ...processCreateParams(second),\n });\n }\n}\nclass ZodMap extends ZodType {\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n if (ctx.parsedType !== ZodParsedType.map) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.map,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n const keyType = this._def.keyType;\n const valueType = this._def.valueType;\n const pairs = [...ctx.data.entries()].map(([key, value], index) => {\n return {\n key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, [index, \"key\"])),\n value: valueType._parse(new ParseInputLazyPath(ctx, value, ctx.path, [index, \"value\"])),\n };\n });\n if (ctx.common.async) {\n const finalMap = new Map();\n return Promise.resolve().then(async () => {\n for (const pair of pairs) {\n const key = await pair.key;\n const value = await pair.value;\n if (key.status === \"aborted\" || value.status === \"aborted\") {\n return INVALID;\n }\n if (key.status === \"dirty\" || value.status === \"dirty\") {\n status.dirty();\n }\n finalMap.set(key.value, value.value);\n }\n return { status: status.value, value: finalMap };\n });\n }\n else {\n const finalMap = new Map();\n for (const pair of pairs) {\n const key = pair.key;\n const value = pair.value;\n if (key.status === \"aborted\" || value.status === \"aborted\") {\n return INVALID;\n }\n if (key.status === \"dirty\" || value.status === \"dirty\") {\n status.dirty();\n }\n finalMap.set(key.value, value.value);\n }\n return { status: status.value, value: finalMap };\n }\n }\n}\nZodMap.create = (keyType, valueType, params) => {\n return new ZodMap({\n valueType,\n keyType,\n typeName: ZodFirstPartyTypeKind.ZodMap,\n ...processCreateParams(params),\n });\n};\nclass ZodSet extends ZodType {\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n if (ctx.parsedType !== ZodParsedType.set) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.set,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n const def = this._def;\n if (def.minSize !== null) {\n if (ctx.data.size < def.minSize.value) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n minimum: def.minSize.value,\n type: \"set\",\n inclusive: true,\n exact: false,\n message: def.minSize.message,\n });\n status.dirty();\n }\n }\n if (def.maxSize !== null) {\n if (ctx.data.size > def.maxSize.value) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n maximum: def.maxSize.value,\n type: \"set\",\n inclusive: true,\n exact: false,\n message: def.maxSize.message,\n });\n status.dirty();\n }\n }\n const valueType = this._def.valueType;\n function finalizeSet(elements) {\n const parsedSet = new Set();\n for (const element of elements) {\n if (element.status === \"aborted\")\n return INVALID;\n if (element.status === \"dirty\")\n status.dirty();\n parsedSet.add(element.value);\n }\n return { status: status.value, value: parsedSet };\n }\n const elements = [...ctx.data.values()].map((item, i) => valueType._parse(new ParseInputLazyPath(ctx, item, ctx.path, i)));\n if (ctx.common.async) {\n return Promise.all(elements).then((elements) => finalizeSet(elements));\n }\n else {\n return finalizeSet(elements);\n }\n }\n min(minSize, message) {\n return new ZodSet({\n ...this._def,\n minSize: { value: minSize, message: errorUtil.toString(message) },\n });\n }\n max(maxSize, message) {\n return new ZodSet({\n ...this._def,\n maxSize: { value: maxSize, message: errorUtil.toString(message) },\n });\n }\n size(size, message) {\n return this.min(size, message).max(size, message);\n }\n nonempty(message) {\n return this.min(1, message);\n }\n}\nZodSet.create = (valueType, params) => {\n return new ZodSet({\n valueType,\n minSize: null,\n maxSize: null,\n typeName: ZodFirstPartyTypeKind.ZodSet,\n ...processCreateParams(params),\n });\n};\nclass ZodFunction extends ZodType {\n constructor() {\n super(...arguments);\n this.validate = this.implement;\n }\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n if (ctx.parsedType !== ZodParsedType.function) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.function,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n function makeArgsIssue(args, error) {\n return makeIssue({\n data: args,\n path: ctx.path,\n errorMaps: [\n ctx.common.contextualErrorMap,\n ctx.schemaErrorMap,\n getErrorMap(),\n errorMap,\n ].filter((x) => !!x),\n issueData: {\n code: ZodIssueCode.invalid_arguments,\n argumentsError: error,\n },\n });\n }\n function makeReturnsIssue(returns, error) {\n return makeIssue({\n data: returns,\n path: ctx.path,\n errorMaps: [\n ctx.common.contextualErrorMap,\n ctx.schemaErrorMap,\n getErrorMap(),\n errorMap,\n ].filter((x) => !!x),\n issueData: {\n code: ZodIssueCode.invalid_return_type,\n returnTypeError: error,\n },\n });\n }\n const params = { errorMap: ctx.common.contextualErrorMap };\n const fn = ctx.data;\n if (this._def.returns instanceof ZodPromise) {\n return OK(async (...args) => {\n const error = new ZodError([]);\n const parsedArgs = await this._def.args\n .parseAsync(args, params)\n .catch((e) => {\n error.addIssue(makeArgsIssue(args, e));\n throw error;\n });\n const result = await fn(...parsedArgs);\n const parsedReturns = await this._def.returns._def.type\n .parseAsync(result, params)\n .catch((e) => {\n error.addIssue(makeReturnsIssue(result, e));\n throw error;\n });\n return parsedReturns;\n });\n }\n else {\n return OK((...args) => {\n const parsedArgs = this._def.args.safeParse(args, params);\n if (!parsedArgs.success) {\n throw new ZodError([makeArgsIssue(args, parsedArgs.error)]);\n }\n const result = fn(...parsedArgs.data);\n const parsedReturns = this._def.returns.safeParse(result, params);\n if (!parsedReturns.success) {\n throw new ZodError([makeReturnsIssue(result, parsedReturns.error)]);\n }\n return parsedReturns.data;\n });\n }\n }\n parameters() {\n return this._def.args;\n }\n returnType() {\n return this._def.returns;\n }\n args(...items) {\n return new ZodFunction({\n ...this._def,\n args: ZodTuple.create(items).rest(ZodUnknown.create()),\n });\n }\n returns(returnType) {\n return new ZodFunction({\n ...this._def,\n returns: returnType,\n });\n }\n implement(func) {\n const validatedFunc = this.parse(func);\n return validatedFunc;\n }\n strictImplement(func) {\n const validatedFunc = this.parse(func);\n return validatedFunc;\n }\n static create(args, returns, params) {\n return new ZodFunction({\n args: (args\n ? args\n : ZodTuple.create([]).rest(ZodUnknown.create())),\n returns: returns || ZodUnknown.create(),\n typeName: ZodFirstPartyTypeKind.ZodFunction,\n ...processCreateParams(params),\n });\n }\n}\nclass ZodLazy extends ZodType {\n get schema() {\n return this._def.getter();\n }\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n const lazySchema = this._def.getter();\n return lazySchema._parse({ data: ctx.data, path: ctx.path, parent: ctx });\n }\n}\nZodLazy.create = (getter, params) => {\n return new ZodLazy({\n getter: getter,\n typeName: ZodFirstPartyTypeKind.ZodLazy,\n ...processCreateParams(params),\n });\n};\nclass ZodLiteral extends ZodType {\n _parse(input) {\n if (input.data !== this._def.value) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n received: ctx.data,\n code: ZodIssueCode.invalid_literal,\n expected: this._def.value,\n });\n return INVALID;\n }\n return { status: \"valid\", value: input.data };\n }\n get value() {\n return this._def.value;\n }\n}\nZodLiteral.create = (value, params) => {\n return new ZodLiteral({\n value: value,\n typeName: ZodFirstPartyTypeKind.ZodLiteral,\n ...processCreateParams(params),\n });\n};\nfunction createZodEnum(values, params) {\n return new ZodEnum({\n values: values,\n typeName: ZodFirstPartyTypeKind.ZodEnum,\n ...processCreateParams(params),\n });\n}\nclass ZodEnum extends ZodType {\n _parse(input) {\n if (typeof input.data !== \"string\") {\n const ctx = this._getOrReturnCtx(input);\n const expectedValues = this._def.values;\n addIssueToContext(ctx, {\n expected: util.joinValues(expectedValues),\n received: ctx.parsedType,\n code: ZodIssueCode.invalid_type,\n });\n return INVALID;\n }\n if (this._def.values.indexOf(input.data) === -1) {\n const ctx = this._getOrReturnCtx(input);\n const expectedValues = this._def.values;\n addIssueToContext(ctx, {\n received: ctx.data,\n code: ZodIssueCode.invalid_enum_value,\n options: expectedValues,\n });\n return INVALID;\n }\n return OK(input.data);\n }\n get options() {\n return this._def.values;\n }\n get enum() {\n const enumValues = {};\n for (const val of this._def.values) {\n enumValues[val] = val;\n }\n return enumValues;\n }\n get Values() {\n const enumValues = {};\n for (const val of this._def.values) {\n enumValues[val] = val;\n }\n return enumValues;\n }\n get Enum() {\n const enumValues = {};\n for (const val of this._def.values) {\n enumValues[val] = val;\n }\n return enumValues;\n }\n extract(values) {\n return ZodEnum.create(values);\n }\n exclude(values) {\n return ZodEnum.create(this.options.filter((opt) => !values.includes(opt)));\n }\n}\nZodEnum.create = createZodEnum;\nclass ZodNativeEnum extends ZodType {\n _parse(input) {\n const nativeEnumValues = util.getValidEnumValues(this._def.values);\n const ctx = this._getOrReturnCtx(input);\n if (ctx.parsedType !== ZodParsedType.string &&\n ctx.parsedType !== ZodParsedType.number) {\n const expectedValues = util.objectValues(nativeEnumValues);\n addIssueToContext(ctx, {\n expected: util.joinValues(expectedValues),\n received: ctx.parsedType,\n code: ZodIssueCode.invalid_type,\n });\n return INVALID;\n }\n if (nativeEnumValues.indexOf(input.data) === -1) {\n const expectedValues = util.objectValues(nativeEnumValues);\n addIssueToContext(ctx, {\n received: ctx.data,\n code: ZodIssueCode.invalid_enum_value,\n options: expectedValues,\n });\n return INVALID;\n }\n return OK(input.data);\n }\n get enum() {\n return this._def.values;\n }\n}\nZodNativeEnum.create = (values, params) => {\n return new ZodNativeEnum({\n values: values,\n typeName: ZodFirstPartyTypeKind.ZodNativeEnum,\n ...processCreateParams(params),\n });\n};\nclass ZodPromise extends ZodType {\n unwrap() {\n return this._def.type;\n }\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n if (ctx.parsedType !== ZodParsedType.promise &&\n ctx.common.async === false) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.promise,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n const promisified = ctx.parsedType === ZodParsedType.promise\n ? ctx.data\n : Promise.resolve(ctx.data);\n return OK(promisified.then((data) => {\n return this._def.type.parseAsync(data, {\n path: ctx.path,\n errorMap: ctx.common.contextualErrorMap,\n });\n }));\n }\n}\nZodPromise.create = (schema, params) => {\n return new ZodPromise({\n type: schema,\n typeName: ZodFirstPartyTypeKind.ZodPromise,\n ...processCreateParams(params),\n });\n};\nclass ZodEffects extends ZodType {\n innerType() {\n return this._def.schema;\n }\n sourceType() {\n return this._def.schema._def.typeName === ZodFirstPartyTypeKind.ZodEffects\n ? this._def.schema.sourceType()\n : this._def.schema;\n }\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n const effect = this._def.effect || null;\n if (effect.type === \"preprocess\") {\n const processed = effect.transform(ctx.data);\n if (ctx.common.async) {\n return Promise.resolve(processed).then((processed) => {\n return this._def.schema._parseAsync({\n data: processed,\n path: ctx.path,\n parent: ctx,\n });\n });\n }\n else {\n return this._def.schema._parseSync({\n data: processed,\n path: ctx.path,\n parent: ctx,\n });\n }\n }\n const checkCtx = {\n addIssue: (arg) => {\n addIssueToContext(ctx, arg);\n if (arg.fatal) {\n status.abort();\n }\n else {\n status.dirty();\n }\n },\n get path() {\n return ctx.path;\n },\n };\n checkCtx.addIssue = checkCtx.addIssue.bind(checkCtx);\n if (effect.type === \"refinement\") {\n const executeRefinement = (acc\n // effect: RefinementEffect\n ) => {\n const result = effect.refinement(acc, checkCtx);\n if (ctx.common.async) {\n return Promise.resolve(result);\n }\n if (result instanceof Promise) {\n throw new Error(\"Async refinement encountered during synchronous parse operation. Use .parseAsync instead.\");\n }\n return acc;\n };\n if (ctx.common.async === false) {\n const inner = this._def.schema._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n });\n if (inner.status === \"aborted\")\n return INVALID;\n if (inner.status === \"dirty\")\n status.dirty();\n // return value is ignored\n executeRefinement(inner.value);\n return { status: status.value, value: inner.value };\n }\n else {\n return this._def.schema\n ._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx })\n .then((inner) => {\n if (inner.status === \"aborted\")\n return INVALID;\n if (inner.status === \"dirty\")\n status.dirty();\n return executeRefinement(inner.value).then(() => {\n return { status: status.value, value: inner.value };\n });\n });\n }\n }\n if (effect.type === \"transform\") {\n if (ctx.common.async === false) {\n const base = this._def.schema._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n });\n if (!isValid(base))\n return base;\n const result = effect.transform(base.value, checkCtx);\n if (result instanceof Promise) {\n throw new Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);\n }\n return { status: status.value, value: result };\n }\n else {\n return this._def.schema\n ._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx })\n .then((base) => {\n if (!isValid(base))\n return base;\n return Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({ status: status.value, value: result }));\n });\n }\n }\n util.assertNever(effect);\n }\n}\nZodEffects.create = (schema, effect, params) => {\n return new ZodEffects({\n schema,\n typeName: ZodFirstPartyTypeKind.ZodEffects,\n effect,\n ...processCreateParams(params),\n });\n};\nZodEffects.createWithPreprocess = (preprocess, schema, params) => {\n return new ZodEffects({\n schema,\n effect: { type: \"preprocess\", transform: preprocess },\n typeName: ZodFirstPartyTypeKind.ZodEffects,\n ...processCreateParams(params),\n });\n};\nclass ZodOptional extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType === ZodParsedType.undefined) {\n return OK(undefined);\n }\n return this._def.innerType._parse(input);\n }\n unwrap() {\n return this._def.innerType;\n }\n}\nZodOptional.create = (type, params) => {\n return new ZodOptional({\n innerType: type,\n typeName: ZodFirstPartyTypeKind.ZodOptional,\n ...processCreateParams(params),\n });\n};\nclass ZodNullable extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType === ZodParsedType.null) {\n return OK(null);\n }\n return this._def.innerType._parse(input);\n }\n unwrap() {\n return this._def.innerType;\n }\n}\nZodNullable.create = (type, params) => {\n return new ZodNullable({\n innerType: type,\n typeName: ZodFirstPartyTypeKind.ZodNullable,\n ...processCreateParams(params),\n });\n};\nclass ZodDefault extends ZodType {\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n let data = ctx.data;\n if (ctx.parsedType === ZodParsedType.undefined) {\n data = this._def.defaultValue();\n }\n return this._def.innerType._parse({\n data,\n path: ctx.path,\n parent: ctx,\n });\n }\n removeDefault() {\n return this._def.innerType;\n }\n}\nZodDefault.create = (type, params) => {\n return new ZodDefault({\n innerType: type,\n typeName: ZodFirstPartyTypeKind.ZodDefault,\n defaultValue: typeof params.default === \"function\"\n ? params.default\n : () => params.default,\n ...processCreateParams(params),\n });\n};\nclass ZodCatch extends ZodType {\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n // newCtx is used to not collect issues from inner types in ctx\n const newCtx = {\n ...ctx,\n common: {\n ...ctx.common,\n issues: [],\n },\n };\n const result = this._def.innerType._parse({\n data: newCtx.data,\n path: newCtx.path,\n parent: {\n ...newCtx,\n },\n });\n if (isAsync(result)) {\n return result.then((result) => {\n return {\n status: \"valid\",\n value: result.status === \"valid\"\n ? result.value\n : this._def.catchValue({\n get error() {\n return new ZodError(newCtx.common.issues);\n },\n input: newCtx.data,\n }),\n };\n });\n }\n else {\n return {\n status: \"valid\",\n value: result.status === \"valid\"\n ? result.value\n : this._def.catchValue({\n get error() {\n return new ZodError(newCtx.common.issues);\n },\n input: newCtx.data,\n }),\n };\n }\n }\n removeCatch() {\n return this._def.innerType;\n }\n}\nZodCatch.create = (type, params) => {\n return new ZodCatch({\n innerType: type,\n typeName: ZodFirstPartyTypeKind.ZodCatch,\n catchValue: typeof params.catch === \"function\" ? params.catch : () => params.catch,\n ...processCreateParams(params),\n });\n};\nclass ZodNaN extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.nan) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.nan,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n return { status: \"valid\", value: input.data };\n }\n}\nZodNaN.create = (params) => {\n return new ZodNaN({\n typeName: ZodFirstPartyTypeKind.ZodNaN,\n ...processCreateParams(params),\n });\n};\nconst BRAND = Symbol(\"zod_brand\");\nclass ZodBranded extends ZodType {\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n const data = ctx.data;\n return this._def.type._parse({\n data,\n path: ctx.path,\n parent: ctx,\n });\n }\n unwrap() {\n return this._def.type;\n }\n}\nclass ZodPipeline extends ZodType {\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n if (ctx.common.async) {\n const handleAsync = async () => {\n const inResult = await this._def.in._parseAsync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n });\n if (inResult.status === \"aborted\")\n return INVALID;\n if (inResult.status === \"dirty\") {\n status.dirty();\n return DIRTY(inResult.value);\n }\n else {\n return this._def.out._parseAsync({\n data: inResult.value,\n path: ctx.path,\n parent: ctx,\n });\n }\n };\n return handleAsync();\n }\n else {\n const inResult = this._def.in._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n });\n if (inResult.status === \"aborted\")\n return INVALID;\n if (inResult.status === \"dirty\") {\n status.dirty();\n return {\n status: \"dirty\",\n value: inResult.value,\n };\n }\n else {\n return this._def.out._parseSync({\n data: inResult.value,\n path: ctx.path,\n parent: ctx,\n });\n }\n }\n }\n static create(a, b) {\n return new ZodPipeline({\n in: a,\n out: b,\n typeName: ZodFirstPartyTypeKind.ZodPipeline,\n });\n }\n}\nconst custom = (check, params = {}, \n/*\n * @deprecated\n *\n * Pass `fatal` into the params object instead:\n *\n * ```ts\n * z.string().custom((val) => val.length > 5, { fatal: false })\n * ```\n *\n */\nfatal) => {\n if (check)\n return ZodAny.create().superRefine((data, ctx) => {\n var _a, _b;\n if (!check(data)) {\n const p = typeof params === \"function\"\n ? params(data)\n : typeof params === \"string\"\n ? { message: params }\n : params;\n const _fatal = (_b = (_a = p.fatal) !== null && _a !== void 0 ? _a : fatal) !== null && _b !== void 0 ? _b : true;\n const p2 = typeof p === \"string\" ? { message: p } : p;\n ctx.addIssue({ code: \"custom\", ...p2, fatal: _fatal });\n }\n });\n return ZodAny.create();\n};\nconst late = {\n object: ZodObject.lazycreate,\n};\nvar ZodFirstPartyTypeKind;\n(function (ZodFirstPartyTypeKind) {\n ZodFirstPartyTypeKind[\"ZodString\"] = \"ZodString\";\n ZodFirstPartyTypeKind[\"ZodNumber\"] = \"ZodNumber\";\n ZodFirstPartyTypeKind[\"ZodNaN\"] = \"ZodNaN\";\n ZodFirstPartyTypeKind[\"ZodBigInt\"] = \"ZodBigInt\";\n ZodFirstPartyTypeKind[\"ZodBoolean\"] = \"ZodBoolean\";\n ZodFirstPartyTypeKind[\"ZodDate\"] = \"ZodDate\";\n ZodFirstPartyTypeKind[\"ZodSymbol\"] = \"ZodSymbol\";\n ZodFirstPartyTypeKind[\"ZodUndefined\"] = \"ZodUndefined\";\n ZodFirstPartyTypeKind[\"ZodNull\"] = \"ZodNull\";\n ZodFirstPartyTypeKind[\"ZodAny\"] = \"ZodAny\";\n ZodFirstPartyTypeKind[\"ZodUnknown\"] = \"ZodUnknown\";\n ZodFirstPartyTypeKind[\"ZodNever\"] = \"ZodNever\";\n ZodFirstPartyTypeKind[\"ZodVoid\"] = \"ZodVoid\";\n ZodFirstPartyTypeKind[\"ZodArray\"] = \"ZodArray\";\n ZodFirstPartyTypeKind[\"ZodObject\"] = \"ZodObject\";\n ZodFirstPartyTypeKind[\"ZodUnion\"] = \"ZodUnion\";\n ZodFirstPartyTypeKind[\"ZodDiscriminatedUnion\"] = \"ZodDiscriminatedUnion\";\n ZodFirstPartyTypeKind[\"ZodIntersection\"] = \"ZodIntersection\";\n ZodFirstPartyTypeKind[\"ZodTuple\"] = \"ZodTuple\";\n ZodFirstPartyTypeKind[\"ZodRecord\"] = \"ZodRecord\";\n ZodFirstPartyTypeKind[\"ZodMap\"] = \"ZodMap\";\n ZodFirstPartyTypeKind[\"ZodSet\"] = \"ZodSet\";\n ZodFirstPartyTypeKind[\"ZodFunction\"] = \"ZodFunction\";\n ZodFirstPartyTypeKind[\"ZodLazy\"] = \"ZodLazy\";\n ZodFirstPartyTypeKind[\"ZodLiteral\"] = \"ZodLiteral\";\n ZodFirstPartyTypeKind[\"ZodEnum\"] = \"ZodEnum\";\n ZodFirstPartyTypeKind[\"ZodEffects\"] = \"ZodEffects\";\n ZodFirstPartyTypeKind[\"ZodNativeEnum\"] = \"ZodNativeEnum\";\n ZodFirstPartyTypeKind[\"ZodOptional\"] = \"ZodOptional\";\n ZodFirstPartyTypeKind[\"ZodNullable\"] = \"ZodNullable\";\n ZodFirstPartyTypeKind[\"ZodDefault\"] = \"ZodDefault\";\n ZodFirstPartyTypeKind[\"ZodCatch\"] = \"ZodCatch\";\n ZodFirstPartyTypeKind[\"ZodPromise\"] = \"ZodPromise\";\n ZodFirstPartyTypeKind[\"ZodBranded\"] = \"ZodBranded\";\n ZodFirstPartyTypeKind[\"ZodPipeline\"] = \"ZodPipeline\";\n})(ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {}));\nconst instanceOfType = (\n// const instanceOfType = any>(\ncls, params = {\n message: `Input not instance of ${cls.name}`,\n}) => custom((data) => data instanceof cls, params);\nconst stringType = ZodString.create;\nconst numberType = ZodNumber.create;\nconst nanType = ZodNaN.create;\nconst bigIntType = ZodBigInt.create;\nconst booleanType = ZodBoolean.create;\nconst dateType = ZodDate.create;\nconst symbolType = ZodSymbol.create;\nconst undefinedType = ZodUndefined.create;\nconst nullType = ZodNull.create;\nconst anyType = ZodAny.create;\nconst unknownType = ZodUnknown.create;\nconst neverType = ZodNever.create;\nconst voidType = ZodVoid.create;\nconst arrayType = ZodArray.create;\nconst objectType = ZodObject.create;\nconst strictObjectType = ZodObject.strictCreate;\nconst unionType = ZodUnion.create;\nconst discriminatedUnionType = ZodDiscriminatedUnion.create;\nconst intersectionType = ZodIntersection.create;\nconst tupleType = ZodTuple.create;\nconst recordType = ZodRecord.create;\nconst mapType = ZodMap.create;\nconst setType = ZodSet.create;\nconst functionType = ZodFunction.create;\nconst lazyType = ZodLazy.create;\nconst literalType = ZodLiteral.create;\nconst enumType = ZodEnum.create;\nconst nativeEnumType = ZodNativeEnum.create;\nconst promiseType = ZodPromise.create;\nconst effectsType = ZodEffects.create;\nconst optionalType = ZodOptional.create;\nconst nullableType = ZodNullable.create;\nconst preprocessType = ZodEffects.createWithPreprocess;\nconst pipelineType = ZodPipeline.create;\nconst ostring = () => stringType().optional();\nconst onumber = () => numberType().optional();\nconst oboolean = () => booleanType().optional();\nconst coerce = {\n string: ((arg) => ZodString.create({ ...arg, coerce: true })),\n number: ((arg) => ZodNumber.create({ ...arg, coerce: true })),\n boolean: ((arg) => ZodBoolean.create({\n ...arg,\n coerce: true,\n })),\n bigint: ((arg) => ZodBigInt.create({ ...arg, coerce: true })),\n date: ((arg) => ZodDate.create({ ...arg, coerce: true })),\n};\nconst NEVER = INVALID;\n\nvar z = /*#__PURE__*/Object.freeze({\n __proto__: null,\n defaultErrorMap: errorMap,\n setErrorMap: setErrorMap,\n getErrorMap: getErrorMap,\n makeIssue: makeIssue,\n EMPTY_PATH: EMPTY_PATH,\n addIssueToContext: addIssueToContext,\n ParseStatus: ParseStatus,\n INVALID: INVALID,\n DIRTY: DIRTY,\n OK: OK,\n isAborted: isAborted,\n isDirty: isDirty,\n isValid: isValid,\n isAsync: isAsync,\n get util () { return util; },\n get objectUtil () { return objectUtil; },\n ZodParsedType: ZodParsedType,\n getParsedType: getParsedType,\n ZodType: ZodType,\n ZodString: ZodString,\n ZodNumber: ZodNumber,\n ZodBigInt: ZodBigInt,\n ZodBoolean: ZodBoolean,\n ZodDate: ZodDate,\n ZodSymbol: ZodSymbol,\n ZodUndefined: ZodUndefined,\n ZodNull: ZodNull,\n ZodAny: ZodAny,\n ZodUnknown: ZodUnknown,\n ZodNever: ZodNever,\n ZodVoid: ZodVoid,\n ZodArray: ZodArray,\n ZodObject: ZodObject,\n ZodUnion: ZodUnion,\n ZodDiscriminatedUnion: ZodDiscriminatedUnion,\n ZodIntersection: ZodIntersection,\n ZodTuple: ZodTuple,\n ZodRecord: ZodRecord,\n ZodMap: ZodMap,\n ZodSet: ZodSet,\n ZodFunction: ZodFunction,\n ZodLazy: ZodLazy,\n ZodLiteral: ZodLiteral,\n ZodEnum: ZodEnum,\n ZodNativeEnum: ZodNativeEnum,\n ZodPromise: ZodPromise,\n ZodEffects: ZodEffects,\n ZodTransformer: ZodEffects,\n ZodOptional: ZodOptional,\n ZodNullable: ZodNullable,\n ZodDefault: ZodDefault,\n ZodCatch: ZodCatch,\n ZodNaN: ZodNaN,\n BRAND: BRAND,\n ZodBranded: ZodBranded,\n ZodPipeline: ZodPipeline,\n custom: custom,\n Schema: ZodType,\n ZodSchema: ZodType,\n late: late,\n get ZodFirstPartyTypeKind () { return ZodFirstPartyTypeKind; },\n coerce: coerce,\n any: anyType,\n array: arrayType,\n bigint: bigIntType,\n boolean: booleanType,\n date: dateType,\n discriminatedUnion: discriminatedUnionType,\n effect: effectsType,\n 'enum': enumType,\n 'function': functionType,\n 'instanceof': instanceOfType,\n intersection: intersectionType,\n lazy: lazyType,\n literal: literalType,\n map: mapType,\n nan: nanType,\n nativeEnum: nativeEnumType,\n never: neverType,\n 'null': nullType,\n nullable: nullableType,\n number: numberType,\n object: objectType,\n oboolean: oboolean,\n onumber: onumber,\n optional: optionalType,\n ostring: ostring,\n pipeline: pipelineType,\n preprocess: preprocessType,\n promise: promiseType,\n record: recordType,\n set: setType,\n strictObject: strictObjectType,\n string: stringType,\n symbol: symbolType,\n transformer: effectsType,\n tuple: tupleType,\n 'undefined': undefinedType,\n union: unionType,\n unknown: unknownType,\n 'void': voidType,\n NEVER: NEVER,\n ZodIssueCode: ZodIssueCode,\n quotelessJson: quotelessJson,\n ZodError: ZodError\n});\n\nexport { BRAND, DIRTY, EMPTY_PATH, INVALID, NEVER, OK, ParseStatus, ZodType as Schema, ZodAny, ZodArray, ZodBigInt, ZodBoolean, ZodBranded, ZodCatch, ZodDate, ZodDefault, ZodDiscriminatedUnion, ZodEffects, ZodEnum, ZodError, ZodFirstPartyTypeKind, ZodFunction, ZodIntersection, ZodIssueCode, ZodLazy, ZodLiteral, ZodMap, ZodNaN, ZodNativeEnum, ZodNever, ZodNull, ZodNullable, ZodNumber, ZodObject, ZodOptional, ZodParsedType, ZodPipeline, ZodPromise, ZodRecord, ZodType as ZodSchema, ZodSet, ZodString, ZodSymbol, ZodEffects as ZodTransformer, ZodTuple, ZodType, ZodUndefined, ZodUnion, ZodUnknown, ZodVoid, addIssueToContext, anyType as any, arrayType as array, bigIntType as bigint, booleanType as boolean, coerce, custom, dateType as date, z as default, errorMap as defaultErrorMap, discriminatedUnionType as discriminatedUnion, effectsType as effect, enumType as enum, functionType as function, getErrorMap, getParsedType, instanceOfType as instanceof, intersectionType as intersection, isAborted, isAsync, isDirty, isValid, late, lazyType as lazy, literalType as literal, makeIssue, mapType as map, nanType as nan, nativeEnumType as nativeEnum, neverType as never, nullType as null, nullableType as nullable, numberType as number, objectType as object, objectUtil, oboolean, onumber, optionalType as optional, ostring, pipelineType as pipeline, preprocessType as preprocess, promiseType as promise, quotelessJson, recordType as record, setType as set, setErrorMap, strictObjectType as strictObject, stringType as string, symbolType as symbol, effectsType as transformer, tupleType as tuple, undefinedType as undefined, unionType as union, unknownType as unknown, util, voidType as void, z };\n","'use strict';\n\n/// \n/// \n/// \n\nimport {AmeCustomizable, AmeCustomizableViewModel} from '../../pro-customizables/assets/customizable.js';\nimport {registerBaseComponents} from '../../pro-customizables/ko-components/ame-components.js';\nimport AmeAcStructure from './ko-components/ame-ac-structure.js';\nimport AmeAcSection from './ko-components/ame-ac-section.js';\nimport AmeAcSectionLink from './ko-components/ame-ac-section-link.js';\nimport AmeAcControl from './ko-components/ame-ac-control.js';\nimport AmeAcControlGroup from './ko-components/ame-ac-control-group.js';\nimport AmeAcContentSection from './ko-components/ame-ac-content-section.js';\nimport {AmeAdminCustomizerBase} from './admin-customizer-base.js';\nimport AmeAcSeparator from './ko-components/ame-ac-separator.js';\nimport AmeAcValidationErrors from './ko-components/ame-ac-validation-errors.js';\nimport z, {ZodError, ZodType} from '../../zod/lib/index.js';\n\ndeclare var wsAmeLodash: _.LoDashStatic;\ndeclare const wsAmeAdminCustomizerData: AmeAdminCustomizer.ScriptData;\n\nexport namespace AmeAdminCustomizer {\n\timport Setting = AmeCustomizable.Setting;\n\timport SettingCollection = AmeCustomizable.SettingCollection;\n\timport InterfaceStructureData = AmeCustomizable.InterfaceStructureData;\n\timport InterfaceStructure = AmeCustomizable.InterfaceStructure;\n\timport unserializeUiElement = AmeCustomizable.unserializeUiElement;\n\timport unserializeSetting = AmeCustomizable.unserializeSetting;\n\timport AnySpecificElementData = AmeCustomizable.AnySpecificElementData;\n\timport CustomizableVmInterface = AmeCustomizableViewModel.CustomizableVmInterface;\n\n\tconst $ = jQuery;\n\tconst _ = wsAmeLodash;\n\n\tregisterBaseComponents();\n\tko.components.register('ame-ac-structure', AmeAcStructure);\n\tko.components.register('ame-ac-section', AmeAcSection);\n\tko.components.register('ame-ac-section-link', AmeAcSectionLink);\n\tko.components.register('ame-ac-content-section', AmeAcContentSection);\n\tko.components.register('ame-ac-control-group', AmeAcControlGroup);\n\tko.components.register('ame-ac-control', AmeAcControl);\n\tko.components.register('ame-ac-separator', AmeAcSeparator);\n\tko.components.register('ame-ac-validation-errors', AmeAcValidationErrors);\n\n\texport interface ScriptData extends AmeAdminCustomizerBase.ScriptData, AdminThemeTexts {\n\t\tajaxUrl: string;\n\t\tsaveChangesetNonce: string;\n\t\ttrashChangesetNonce: string;\n\t\tchangesetItemCount: number;\n\t\tchangesetStatus: string;\n\t\tchangesetThemeMetadata: AdminThemeMetadata | null;\n\n\t\trefreshPreviewNonce: string;\n\t\tinitialPreviewUrl: string;\n\t\tinterfaceStructure: InterfaceStructureData;\n\n\t\t/**\n\t\t * The template to use when generating the URL for a changeset.\n\t\t *\n\t\t * By default, the changeset name is added as a query parameter. Alternatively,\n\t\t * you can use a path template that includes a \"{changeset}\" placeholder, which\n\t\t * will be replaced with the changeset name.\n\t\t */\n\t\tchangesetPathTemplate: string | null;\n\n\t\t/**\n\t\t * Whether to use pushState() to update the URL when the changeset name changes.\n\t\t *\n\t\t * By default, we discourage navigating to the old URL (no pushState()) because\n\t\t * the name is only expected to change when the old changeset becomes invalid\n\t\t * (e.g. it's deleted or published).\n\t\t */\n\t\tchangesetPushStateEnabled: boolean;\n\n\t\t/**\n\t\t * Admin Customizer base path. Defaults to the current URL path.\n\t\t *\n\t\t * Note that setting this to a non-empty value will also stop AC from\n\t\t * adding the \"page\" query parameter to the URL.\n\t\t */\n\t\tcustomBasePath: string | null;\n\n\t\texitPromptMode?: number;\n\t}\n\n\tinterface AdminThemeTexts {\n\t\tgeneratorCreditPhrase?: string;\n\t\tstandalonePluginNote?: string;\n\t}\n\n\tconst reducedMotionQuery = window.matchMedia('(prefers-reduced-motion: reduce)');\n\tlet prefersReducedMotion = reducedMotionQuery && reducedMotionQuery.matches;\n\treducedMotionQuery.addEventListener('change', () => {\n\t\tprefersReducedMotion = reducedMotionQuery.matches;\n\t});\n\n\tclass CustomizerSettingsCollection extends SettingCollection {\n\t\t/**\n\t\t * Settings that have changed since the last save attempt.\n\t\t */\n\t\tprivate pendingSettings: Record = {};\n\t\t/**\n\t\t * Settings that in the process of being sent to the server to be saved.\n\t\t * They might not be saved yet.\n\t\t */\n\t\tprivate sentSettings: Record = {};\n\t\tprivate currentChangesetRequest: JQueryXHR | null = null;\n\t\tprivate saveTriggerTimeoutId: null | ReturnType = null;\n\n\t\tprivate readonly currentChangeset: KnockoutObservable;\n\t\tpublic readonly changesetName: KnockoutComputed;\n\n\t\tpublic readonly adminThemeMetadata: KnockoutObservable;\n\t\tprivate readonly underlyingMetadata: KnockoutObservable = ko.observable(null);\n\t\tprivate readonly metadataHasChanged: KnockoutObservable = ko.observable(false);\n\n\t\tpublic readonly isExclusiveOperationInProgress: KnockoutComputed;\n\t\tprivate readonly exclusiveOperation: KnockoutObservable = ko.observable(false);\n\n\t\tconstructor(\n\t\t\tpublic readonly ajaxUrl: string,\n\t\t\tpublic readonly saveChangesetNonce: string,\n\t\t\tpublic readonly trashChangesetNonce: string,\n\t\t\tchangesetName: string,\n\t\t\tchangesetItemCount: number = 0,\n\t\t\tchangesetStatus: string | null = null\n\t\t) {\n\t\t\tsuper();\n\t\t\tconst self = this;\n\n\t\t\tthis.currentChangeset = ko.observable(\n\t\t\t\tnew Changeset(changesetName, changesetItemCount, changesetStatus)\n\t\t\t);\n\t\t\tthis.changesetName = ko.pureComputed(() => {\n\t\t\t\treturn (self.currentChangeset()?.name()) || '';\n\t\t\t});\n\n\t\t\tthis.adminThemeMetadata = ko.computed({\n\t\t\t\tread: () => this.underlyingMetadata(),\n\t\t\t\twrite: (newValue) => {\n\t\t\t\t\tconst oldValue = this.underlyingMetadata.peek();\n\t\t\t\t\tif (!_.isEqual(newValue, oldValue)) {\n\t\t\t\t\t\tthis.underlyingMetadata(newValue);\n\t\t\t\t\t\tthis.metadataHasChanged(true);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t//Automatically save the changeset when any settings change.\n\t\t\tconst totalChangeCount = ko.pureComputed(() => {\n\t\t\t\tconst changeset = self.currentChangeset();\n\t\t\t\treturn (changeset ? changeset.currentSessionChanges() : 0);\n\t\t\t});\n\t\t\tconst debouncedSaveTrigger = _.debounce(\n\t\t\t\t() => {\n\t\t\t\t\t//Only save if there are changes. This may look like a duplicate check,\n\t\t\t\t\t//but it's not: the totalChangeCount() may change between the time\n\t\t\t\t\t//the debounced function is called and the time this code is executed.\n\t\t\t\t\t//\n\t\t\t\t\t//Also save if the metadata has changed, but only if the changeset\n\t\t\t\t\t//is not empty. Saving a changeset with only metadata is not useful.\n\t\t\t\t\tif (\n\t\t\t\t\t\t(totalChangeCount() > 0)\n\t\t\t\t\t\t|| (this.metadataHasChanged() && this.currentChangeset().isNonEmpty())\n\t\t\t\t\t) {\n\t\t\t\t\t\tself.queueChangesetUpdate()\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t3000,\n\t\t\t\t{leading: true, trailing: true}\n\t\t\t)\n\t\t\ttotalChangeCount.subscribe((counter) => {\n\t\t\t\tif (counter > 0) {\n\t\t\t\t\tdebouncedSaveTrigger();\n\t\t\t\t}\n\t\t\t});\n\t\t\t//Also save when theme metadata changes.\n\t\t\tthis.metadataHasChanged.subscribe((hasChanged) => {\n\t\t\t\tif (hasChanged) {\n\t\t\t\t\tdebouncedSaveTrigger();\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tthis.isExclusiveOperationInProgress = ko.pureComputed(() => {\n\t\t\t\treturn self.exclusiveOperation();\n\t\t\t});\n\n\t\t\t//Keep track of unsaved changes and changesets.\n\t\t\tthis.addChangeListener((setting: Setting) => {\n\t\t\t\tthis.pendingSettings[setting.id] = setting;\n\n\t\t\t\tlet changeset = this.currentChangeset();\n\t\t\t\t//If the current changeset cannot be modified, create a new one\n\t\t\t\t//for the changed setting(s).\n\t\t\t\tif (!changeset?.canBeModified()) {\n\t\t\t\t\tchangeset = new Changeset();\n\t\t\t\t\tthis.currentChangeset(changeset);\n\t\t\t\t}\n\t\t\t\t//Track the number of changes in the current session.\n\t\t\t\tchangeset.currentSessionChanges(changeset.currentSessionChanges() + 1);\n\t\t\t});\n\t\t}\n\n\t\tqueueChangesetUpdate(delay: number = 0) {\n\t\t\tif (delay > 0) {\n\t\t\t\tif (this.saveTriggerTimeoutId !== null) {\n\t\t\t\t\t//Replace the existing timeout with a new one.\n\t\t\t\t\tclearTimeout(this.saveTriggerTimeoutId);\n\t\t\t\t}\n\t\t\t\tthis.saveTriggerTimeoutId = setTimeout(() => {\n\t\t\t\t\tthis.saveTriggerTimeoutId = null;\n\t\t\t\t\tthis.queueChangesetUpdate(0);\n\t\t\t\t}, delay);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (this.saveTriggerTimeoutId !== null) {\n\t\t\t\treturn; //Another timeout is already waiting.\n\t\t\t}\n\n\t\t\tif (this.currentChangesetRequest !== null) {\n\t\t\t\t//There's an in-progress request, so wait until it's done.\n\t\t\t\tthis.currentChangesetRequest.always(() => {\n\t\t\t\t\t//Wait a bit to avoid hammering the server.\n\t\t\t\t\tthis.queueChangesetUpdate(1000);\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.saveChangeset();\n\t\t}\n\n\t\tprivate saveChangeset(status: string | null = null): JQueryPromise {\n\t\t\t//Do nothing if there are no changes.\n\t\t\tif (_.isEmpty(this.pendingSettings) && (status === null) && !this.metadataHasChanged()) {\n\t\t\t\treturn $.Deferred().reject(new Error('There are no changes to save.')).promise();\n\t\t\t}\n\n\t\t\tif (this.isExclusiveOperationInProgress()) {\n\t\t\t\treturn $.Deferred().reject(\n\t\t\t\t\tnew Error('Another exclusive changeset operation is in progress.')\n\t\t\t\t).promise();\n\t\t\t}\n\n\t\t\tlet isExclusiveRequest = (status === 'publish') || (status === 'trash');\n\t\t\tif (isExclusiveRequest) {\n\t\t\t\tthis.exclusiveOperation(true);\n\t\t\t}\n\n\t\t\tconst savedChangeset = this.currentChangeset();\n\n\t\t\t//Keep a local copy of the settings in case something changes instance\n\t\t\t//properties while the request is in progress (should never happen).\n\t\t\tconst settingsToSend = this.pendingSettings;\n\t\t\tthis.sentSettings = settingsToSend;\n\t\t\tthis.pendingSettings = {};\n\n\t\t\tconst modifiedSettings = _.mapValues(settingsToSend, setting => setting.value());\n\t\t\tconst requestData: Record = {\n\t\t\t\taction: 'ws_ame_ac_save_changeset',\n\t\t\t\t_ajax_nonce: this.saveChangesetNonce,\n\t\t\t\tchangeset: (savedChangeset?.name()) ?? '',\n\t\t\t\tmodified: JSON.stringify(modifiedSettings),\n\t\t\t};\n\t\t\tif (status !== null) {\n\t\t\t\trequestData['status'] = status;\n\t\t\t}\n\t\t\t//If the changeset doesn't have a name, it is new.\n\t\t\tif (!savedChangeset?.hasName()) {\n\t\t\t\trequestData['createNew'] = 1;\n\t\t\t}\n\n\t\t\t//Also send the metadata if it has changed.\n\t\t\tconst metadataWasChanged = this.metadataHasChanged();\n\t\t\tif (metadataWasChanged) {\n\t\t\t\tconst metadata = this.adminThemeMetadata();\n\t\t\t\trequestData['adminThemeMetadata'] = JSON.stringify(metadata);\n\t\t\t}\n\t\t\tthis.metadataHasChanged(false);\n\n\t\t\tconst request = $.ajax({\n\t\t\t\turl: this.ajaxUrl,\n\t\t\t\tmethod: 'POST',\n\t\t\t\tdata: requestData,\n\t\t\t\tdataType: 'json',\n\t\t\t\ttimeout: 20000,\n\t\t\t});\n\t\t\tthis.currentChangesetRequest = request;\n\n\t\t\tinterface ServerValidationResults {\n\t\t\t\t[settingId: string]: {\n\t\t\t\t\tisValid: boolean;\n\t\t\t\t\terrors: Array<{ code: string; message: string; }>;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst self = this;\n\n\t\t\tfunction storeValidationResultsFrom(serverResponse: any) {\n\t\t\t\tconst results: ServerValidationResults = _.get(\n\t\t\t\t\tserverResponse,\n\t\t\t\t\t['data', 'validationResults']\n\t\t\t\t);\n\t\t\t\tif (typeof results !== 'object') {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tfor (const settingId in results) {\n\t\t\t\t\tconst setting = self.get(settingId);\n\t\t\t\t\tif (!setting.isDefined()) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!modifiedSettings.hasOwnProperty(settingId)) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tconst sentValue = modifiedSettings[settingId];\n\n\t\t\t\t\tconst state = results[settingId];\n\t\t\t\t\tif (state.isValid) {\n\t\t\t\t\t\tsetting.get().clearValidationErrorsForValue(sentValue);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t//Since the server response is not fully validated, some typeof checks\n\t\t\t\t\t\t//are still useful.\n\t\t\t\t\t\t// noinspection SuspiciousTypeOfGuard\n\t\t\t\t\t\tsetting.get().addValidationErrorsForValue(\n\t\t\t\t\t\t\tsentValue,\n\t\t\t\t\t\t\t_.filter(state.errors, error => (typeof error.message === 'string'))\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunction storeChangesetDetailsFrom(serverResponse: any) {\n\t\t\t\tif (!savedChangeset) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t//Store the returned changeset name in case a new changeset was created\n\t\t\t\t//or an existing changeset was forked due to permissions.\n\t\t\t\tconst newName = _.get(serverResponse, ['data', 'changeset']);\n\t\t\t\tif (!savedChangeset.hasName() || (newName !== savedChangeset.name())) {\n\t\t\t\t\tif (typeof newName === 'string') {\n\t\t\t\t\t\tsavedChangeset.name(newName);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//Store the changeset status.\n\t\t\t\tconst newStatus = _.get(serverResponse, ['data', 'changesetStatus']);\n\t\t\t\tif (typeof newStatus === 'string') {\n\t\t\t\t\tsavedChangeset.status(newStatus);\n\t\t\t\t}\n\n\t\t\t\t//Store the number of changes in the changeset.\n\t\t\t\tconst newChangeCount = _.get(serverResponse, ['data', 'changesetItemCount']);\n\t\t\t\tif (typeof newChangeCount === 'number') {\n\t\t\t\t\tsavedChangeset.knownItemCount(newChangeCount);\n\t\t\t\t}\n\n\t\t\t\t//Was the changeset published? Because changesets are typically moved\n\t\t\t\t//to trash after publishing, \"status\" might be \"trash\" instead of \"publish\",\n\t\t\t\t//but we still want to know if it was successfully published.\n\t\t\t\tconst wasPublished = _.get(serverResponse, ['data', 'changesetWasPublished'], null);\n\t\t\t\tif (wasPublished) {\n\t\t\t\t\tsavedChangeset.wasPublished(wasPublished);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\trequest.done(function (response) {\n\t\t\t\tstoreChangesetDetailsFrom(response);\n\t\t\t\tstoreValidationResultsFrom(response);\n\n\t\t\t\t//After successfully publishing a changeset, it has no more\n\t\t\t\t//unsaved changes.\n\t\t\t\tconst isPublished =\n\t\t\t\t\t(savedChangeset.status() === 'publish')\n\t\t\t\t\t|| (savedChangeset.status() === 'future')\n\t\t\t\t\t|| (savedChangeset.wasPublished());\n\t\t\t\tif (isPublished) {\n\t\t\t\t\tsavedChangeset.currentSessionChanges(0);\n\t\t\t\t}\n\n\t\t\t\t//After a changeset is published or trashed, it can no longer\n\t\t\t\t//be edited. We may be able to replace it with a new changeset\n\t\t\t\t//that was created on the server.\n\t\t\t\tif (!self.currentChangeset().canBeModified()) {\n\t\t\t\t\tconst nextChangeset = _.get(response, ['data', 'nextChangeset']);\n\t\t\t\t\tif ((typeof nextChangeset === 'string') && (nextChangeset !== '')) {\n\t\t\t\t\t\tself.currentChangeset(new Changeset(nextChangeset));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\n\t\t\trequest.fail((requestObject: JQueryXHR) => {\n\t\t\t\tif (typeof requestObject.responseJSON === 'object') {\n\t\t\t\t\tstoreValidationResultsFrom(requestObject.responseJSON);\n\t\t\t\t\tstoreChangesetDetailsFrom(requestObject.responseJSON);\n\t\t\t\t}\n\n\t\t\t\t//Add the unsaved settings back to the pending list.\n\t\t\t\tfor (const id in settingsToSend) {\n\t\t\t\t\t//Keep only settings that still exist.\n\t\t\t\t\tif (this.get(id).isDefined()) {\n\t\t\t\t\t\tthis.pendingSettings[id] = settingsToSend[id];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t//We don't automatically retry because the problem might be something\n\t\t\t\t//that doesn't get better on its own, like missing permissions.\n\t\t\t});\n\n\t\t\trequest.always(() => {\n\t\t\t\tthis.currentChangesetRequest = null;\n\t\t\t\tthis.sentSettings = {};\n\t\t\t\tif (isExclusiveRequest) {\n\t\t\t\t\tthis.exclusiveOperation(false);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\treturn request;\n\t\t}\n\n\t\tpublic savePendingSettings(timeout: number = 20): JQueryPromise {\n\t\t\tif (this.isExclusiveOperationInProgress()) {\n\t\t\t\t//Wait for the exclusive operation to finish.\n\t\t\t\tconst deferred = $.Deferred();\n\t\t\t\tconst result = deferred.then(() => this.doSavePendingSettings());\n\n\t\t\t\tconst startTime = Date.now();\n\t\t\t\tconst timer = setInterval(() => {\n\t\t\t\t\tif (!this.isExclusiveOperationInProgress()) {\n\t\t\t\t\t\tclearInterval(timer);\n\t\t\t\t\t\tdeferred.resolve();\n\t\t\t\t\t} else if ((Date.now() - startTime) > timeout) {\n\t\t\t\t\t\tclearInterval(timer);\n\t\t\t\t\t\tdeferred.reject(new Error('Exclusive operation timed out.'));\n\t\t\t\t\t}\n\t\t\t\t}, 200);\n\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\treturn this.doSavePendingSettings();\n\t\t}\n\n\t\tprivate doSavePendingSettings(): JQueryPromise {\n\t\t\t//If there are no changes, we don't need to do anything.\n\t\t\tif (_.isEmpty(this.pendingSettings)) {\n\t\t\t\treturn $.Deferred().resolve().promise();\n\t\t\t}\n\t\t\treturn this.saveChangeset();\n\t\t}\n\n\t\tpublic getCurrentChangeset(): Changeset {\n\t\t\treturn this.currentChangeset();\n\t\t}\n\n\t\t/**\n\t\t * Get any unsaved setting changes.\n\t\t *\n\t\t * @returns Object An object mapping setting IDs to their modified values.\n\t\t */\n\t\tpublic get unsavedChanges(): Record {\n\t\t\t//Include both pending settings and sent settings. Sent settings\n\t\t\t//might not be saved yet.\n\t\t\tlet unsavedSettings: Record = {};\n\t\t\t_.defaults(unsavedSettings, this.pendingSettings, this.sentSettings);\n\n\t\t\treturn _.mapValues(unsavedSettings, setting => setting.value());\n\t\t}\n\n\t\tpublic publishChangeset(): JQueryPromise {\n\t\t\tif (this.isExclusiveOperationInProgress()) {\n\t\t\t\treturn $.Deferred()\n\t\t\t\t\t.reject(new Error('Another exclusive changeset operation is already in progress.'))\n\t\t\t\t\t.promise();\n\t\t\t}\n\t\t\treturn this.saveChangeset('publish');\n\t\t}\n\n\t\tpublic trashChangeset(): JQueryPromise {\n\t\t\tif (this.isExclusiveOperationInProgress()) {\n\t\t\t\treturn $.Deferred()\n\t\t\t\t\t.reject(new Error('Another exclusive changeset operation is already in progress.'))\n\t\t\t\t\t.promise();\n\t\t\t}\n\n\t\t\tconst changeset = this.currentChangeset();\n\t\t\tif (!changeset.hasName()) {\n\t\t\t\t//The changeset hasn't been saved yet, so we can just mark it as trashed.\n\t\t\t\tchangeset.status('trash');\n\t\t\t\tchangeset.currentSessionChanges(0);\n\n\t\t\t\t//It's a success of sorts.\n\t\t\t\treturn $.Deferred().resolve(true).promise();\n\t\t\t}\n\n\t\t\tthis.exclusiveOperation(true);\n\n\t\t\tconst requestData: Record = {\n\t\t\t\taction: 'ws_ame_ac_trash_changeset',\n\t\t\t\t_ajax_nonce: this.trashChangesetNonce,\n\t\t\t\tchangeset: changeset.name\n\t\t\t};\n\n\t\t\tconst request = $.ajax({\n\t\t\t\turl: this.ajaxUrl,\n\t\t\t\tmethod: 'POST',\n\t\t\t\tdata: requestData,\n\t\t\t\tdataType: 'json',\n\t\t\t\ttimeout: 20000,\n\t\t\t});\n\t\t\tthis.currentChangesetRequest = request;\n\n\t\t\trequest.done(function () {\n\t\t\t\tchangeset.status('trash');\n\t\t\t\tchangeset.currentSessionChanges(0);\n\t\t\t});\n\n\t\t\t//Unfortunately, jQuery doesn't seem to allow us to create a custom\n\t\t\t//error object and pass it to other handlers, so code that uses this\n\t\t\t//method will have to parse the error response itself.\n\n\t\t\trequest.always(() => {\n\t\t\t\tthis.currentChangesetRequest = null;\n\t\t\t\tthis.exclusiveOperation(false);\n\t\t\t});\n\n\t\t\treturn request;\n\t\t}\n\n\t\tpublic addInitialThemeMetadata(metadata: AdminThemeMetadata | null) {\n\t\t\tthis.underlyingMetadata(metadata);\n\t\t\tthis.metadataHasChanged(false);\n\t\t}\n\t}\n\n\tclass Changeset {\n\t\tpublic readonly name: KnockoutObservable;\n\t\tpublic readonly knownItemCount: KnockoutObservable;\n\t\tpublic readonly status: KnockoutObservable;\n\n\t\t/**\n\t\t * The number of times settings have been changed in this changeset\n\t\t * during the current customizer session.\n\t\t *\n\t\t * Note that this is not the same as the number settings in the changeset:\n\t\t * if the same setting is changed X times, this counter will increase by X,\n\t\t * but the changeset will still only have one entry for that setting.\n\t\t */\n\t\tpublic readonly currentSessionChanges: KnockoutObservable = ko.observable(0);\n\n\t\t/**\n\t\t * Once a changeset has been published or deleted, its contents can't be modified any more.\n\t\t * @private\n\t\t */\n\t\tprivate readonly fixedContentStatuses: Record =\n\t\t\t{'publish': true, 'trash': true, 'future': true};\n\n\t\tpublic readonly wasPublished: KnockoutObservable = ko.observable(false);\n\n\t\tconstructor(name: string = '', knownItemCount: number = 0, initialStatus: string | null = '') {\n\t\t\tthis.name = ko.observable(name);\n\n\t\t\tthis.name.subscribe((newName) => {\n\t\t\t\t//In theory, the type system should ensure that the name is always a string,\n\t\t\t\t//but that only works on the TS side. I've previously run into a bug where\n\t\t\t\t//a null value was sent from the server. Let's add a check here to make it\n\t\t\t\t//easier to spot bugs like that in the future.\n\t\t\t\tif ((typeof (newName as unknown) !== 'string')) {\n\t\t\t\t\tthrow new Error('Changeset name must always be a string, found ' + (typeof newName));\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tthis.knownItemCount = ko.observable(knownItemCount);\n\t\t\tthis.status = ko.observable(initialStatus ?? '');\n\t\t}\n\n\t\tpublic hasName(): boolean {\n\t\t\tconst name = this.name();\n\t\t\treturn (name !== '');\n\t\t}\n\n\t\tpublic canBeModified(): boolean {\n\t\t\treturn !this.fixedContentStatuses.hasOwnProperty(this.status());\n\t\t}\n\n\t\tpublic isNonEmpty(): boolean {\n\t\t\treturn (this.currentSessionChanges() > 0) || (this.knownItemCount() > 0)\n\t\t}\n\t}\n\n\tconst TemporaryChangesetName = 'temporary000'; //Note: Must match the value used in PHP.\n\n\t//region Admin theme\n\tconst UrlOrEmpty = z.union([\n\t\tz.string().url().max(1000),\n\t\tz.literal('')\n\t]);\n\n\tconst AdminThemeMetadata = z.object({\n\t\tpluginName: z.string().max(100),\n\t\tshortDescription: z.string().max(500),\n\n\t\tpluginSlug: z.string().max(64).toLowerCase().default('')\n\t\t\t.refine(\n\t\t\t\tfunction (input: string) {\n\t\t\t\t\t//Only allow alphanumeric characters, underscores, and dashes.\n\t\t\t\t\t//Empty string is allowed.\n\t\t\t\t\treturn /^[a-z0-9_-]*$/.test(input);\n\t\t\t\t},\n\t\t\t\t{message: 'The slug can only contain letters (a-z), numbers, underscores, and dashes.'}\n\t\t\t),\n\t\tidentifierPrefix: z.string().max(20).optional(),\n\n\t\tpluginVersion: z.string().default('1.0').optional(),\n\t\tpluginUrl: UrlOrEmpty.optional(),\n\t\tauthorName: z.string().max(100).optional(),\n\t\tauthorUrl: UrlOrEmpty.optional(),\n\t\trequiredWpVersion: z.string().max(30).default('4.7').optional(),\n\t\ttestedWpVersion: z.string().max(30).optional(),\n\t\twasEverConfirmed: z.boolean().default(false).optional(),\n\t});\n\n\ttype AdminThemeMetadata = z.infer;\n\n\tconst AdminThemeSettings = z.record(\n\t\t//Key type\n\t\tz.string().min(1),\n\t\t//Value type\n\t\tz.any()\n\t);\n\n\tclass AdminThemeImportReport {\n\t\tpublic totalSettings: number = 0;\n\t\tpublic importedSettings: number = 0;\n\t\tpublic invalidSettings: number = 0;\n\t\tpublic skippedSettings: number = 0;\n\t\tpublic differentImportedSettings: number = 0;\n\n\t\tpublic readonly pluginName: string;\n\n\t\tconstructor(\n\t\t\tpublic readonly fileName: string,\n\t\t\tpublic readonly metadata: AdminThemeMetadata\n\t\t) {\n\t\t\tthis.pluginName = metadata.pluginName || '(Unnamed)';\n\t\t}\n\t}\n\n\tinterface WithZodValidationResults extends ObservableValidationFields {\n\t\tameZodValidationError: KnockoutObservable;\n\t}\n\n\ttype ZodValidatedObservable = KnockoutComputed & WithZodValidationResults;\n\n\tfunction observableWithZodValidation>(\n\t\tvalue: z.output,\n\t\tschema: S\n\t): ZodValidatedObservable> {\n\t\tconst underlyingObservable = ko.observable(value);\n\n\t\tconst observable: ZodValidatedObservable = ko.pureComputed({\n\t\t\tread: underlyingObservable,\n\t\t\twrite: (newValue: T) => {\n\t\t\t\tconst validationResult = schema.safeParse(newValue);\n\t\t\t\tif (validationResult.success) {\n\t\t\t\t\tunderlyingObservable(validationResult.data);\n\t\t\t\t\tobservable.ameZodValidationError(null);\n\t\t\t\t\tobservable.ameValidationErrors([]);\n\t\t\t\t} else {\n\t\t\t\t\tobservable.ameZodValidationError(validationResult.error);\n\t\t\t\t\t//Convert Zod issues to ObservableValidationErrors.\n\t\t\t\t\tobservable.ameValidationErrors(validationResult.error.issues.map(issue => {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tcode: issue.code,\n\t\t\t\t\t\t\tmessage: issue.message\n\t\t\t\t\t\t} satisfies ObservableValidationError;\n\t\t\t\t\t}));\n\t\t\t\t}\n\t\t\t}\n\t\t}) as ZodValidatedObservable;\n\n\t\tobservable.ameZodValidationError = ko.observable(null);\n\t\tobservable.ameValidationErrors = ko.observable([] as ObservableValidationError[]);\n\t\tobservable.ameIsValid = ko.pureComputed(() => {\n\t\t\tconst errors = observable.ameValidationErrors();\n\t\t\treturn !errors || errors.length === 0;\n\t\t});\n\n\t\treturn observable;\n\t}\n\n\tclass ObservableThemeMetadata {\n\t\tpublic readonly pluginName: ZodValidatedObservable;\n\t\tpublic readonly shortDescription: ZodValidatedObservable;\n\t\tpublic readonly pluginSlug: ZodValidatedObservable;\n\t\tpublic readonly identifierPrefix: ZodValidatedObservable;\n\t\tpublic readonly pluginVersion: ZodValidatedObservable;\n\t\tpublic readonly pluginUrl: ZodValidatedObservable;\n\t\tpublic readonly authorName: ZodValidatedObservable;\n\t\tpublic readonly authorUrl: ZodValidatedObservable;\n\t\tpublic readonly requiredWpVersion: ZodValidatedObservable;\n\t\tpublic readonly testedWpVersion: ZodValidatedObservable;\n\t\tpublic readonly wasEverConfirmed: ZodValidatedObservable;\n\n\t\tconstructor(metadata: AdminThemeMetadata) {\n\t\t\tthis.pluginName = observableWithZodValidation(\n\t\t\t\tmetadata.pluginName,\n\t\t\t\tAdminThemeMetadata.shape.pluginName\n\t\t\t);\n\t\t\tthis.shortDescription = observableWithZodValidation(\n\t\t\t\tmetadata.shortDescription,\n\t\t\t\tAdminThemeMetadata.shape.shortDescription\n\t\t\t);\n\n\t\t\tthis.pluginSlug = observableWithZodValidation(\n\t\t\t\tmetadata.pluginSlug ?? '',\n\t\t\t\tAdminThemeMetadata.shape.pluginSlug\n\t\t\t);\n\t\t\tthis.identifierPrefix = observableWithZodValidation(\n\t\t\t\tmetadata.identifierPrefix ?? '',\n\t\t\t\tAdminThemeMetadata.shape.identifierPrefix\n\t\t\t);\n\n\t\t\tthis.pluginVersion = observableWithZodValidation(\n\t\t\t\tmetadata.pluginVersion ?? '',\n\t\t\t\tAdminThemeMetadata.shape.pluginVersion\n\t\t\t);\n\t\t\tthis.pluginUrl = observableWithZodValidation(\n\t\t\t\tmetadata.pluginUrl ?? '',\n\t\t\t\tAdminThemeMetadata.shape.pluginUrl\n\t\t\t);\n\t\t\tthis.authorName = observableWithZodValidation(\n\t\t\t\tmetadata.authorName ?? '',\n\t\t\t\tAdminThemeMetadata.shape.authorName\n\t\t\t);\n\t\t\tthis.authorUrl = observableWithZodValidation(\n\t\t\t\tmetadata.authorUrl ?? '',\n\t\t\t\tAdminThemeMetadata.shape.authorUrl\n\t\t\t);\n\t\t\tthis.requiredWpVersion = observableWithZodValidation(\n\t\t\t\tmetadata.requiredWpVersion ?? '',\n\t\t\t\tAdminThemeMetadata.shape.requiredWpVersion\n\t\t\t);\n\t\t\tthis.testedWpVersion = observableWithZodValidation(\n\t\t\t\tmetadata.testedWpVersion ?? '',\n\t\t\t\tAdminThemeMetadata.shape.testedWpVersion\n\t\t\t);\n\n\t\t\tthis.wasEverConfirmed = observableWithZodValidation(\n\t\t\t\tmetadata.wasEverConfirmed ?? false,\n\t\t\t\tAdminThemeMetadata.shape.wasEverConfirmed\n\t\t\t);\n\t\t}\n\n\t\tpublic toObject(): AdminThemeMetadata {\n\t\t\treturn {\n\t\t\t\tpluginName: this.pluginName(),\n\t\t\t\tshortDescription: this.shortDescription(),\n\t\t\t\tpluginSlug: this.pluginSlug(),\n\t\t\t\tidentifierPrefix: this.identifierPrefix(),\n\t\t\t\tpluginVersion: this.pluginVersion(),\n\t\t\t\tpluginUrl: this.pluginUrl(),\n\t\t\t\tauthorName: this.authorName(),\n\t\t\t\tauthorUrl: this.authorUrl(),\n\t\t\t\trequiredWpVersion: this.requiredWpVersion(),\n\t\t\t\ttestedWpVersion: this.testedWpVersion(),\n\t\t\t\twasEverConfirmed: this.wasEverConfirmed()\n\t\t\t};\n\t\t}\n\n\t\tisValid(): boolean {\n\t\t\t//This seems really inelegant, but I can't think of a better way to do it.\n\t\t\treturn this.pluginName.ameIsValid()\n\t\t\t\t&& this.shortDescription.ameIsValid()\n\t\t\t\t&& this.pluginSlug.ameIsValid()\n\t\t\t\t&& this.identifierPrefix.ameIsValid()\n\t\t\t\t&& this.pluginVersion.ameIsValid()\n\t\t\t\t&& this.pluginUrl.ameIsValid()\n\t\t\t\t&& this.authorName.ameIsValid()\n\t\t\t\t&& this.authorUrl.ameIsValid()\n\t\t\t\t&& this.requiredWpVersion.ameIsValid()\n\t\t\t\t&& this.testedWpVersion.ameIsValid()\n\t\t\t\t&& this.wasEverConfirmed.ameIsValid();\n\t\t}\n\t}\n\n\tenum MetadataDialogMode {\n\t\tDownload,\n\t\tEdit\n\t}\n\n\tclass DownloadThemeDialog extends AmeBaseKnockoutDialog {\n\t\tpublic readonly meta: KnockoutObservable;\n\t\tpublic readonly areFieldsEditable: KnockoutComputed;\n\t\tpublic readonly isOperationInProgress: KnockoutObservable = ko.observable(false);\n\n\t\tpublic readonly mode: KnockoutObservable = ko.observable(MetadataDialogMode.Download);\n\n\t\tautoCancelButton: boolean = true;\n\t\tisConfirmButtonEnabled: KnockoutObservable;\n\t\treadonly confirmButtonLabel: KnockoutObservable;\n\n\t\tadvancedOptionsVisible: KnockoutObservable = ko.observable(false);\n\t\tadvancedOptionsToggleLabel: KnockoutComputed;\n\n\t\thelpVisible: KnockoutObservable = ko.observable(false);\n\t\thelpToggleLabel: KnockoutComputed;\n\t\thelpContainerVisible: KnockoutComputed;\n\n\t\tchangesetName: KnockoutObservable = ko.observable('');\n\t\tmetadataJson: KnockoutObservable = ko.observable('');\n\t\tdownloadCookieName: KnockoutObservable = ko.observable('');\n\n\t\tpublic readonly adminThemeTexts: Required;\n\n\t\tprivate cleanupCurrentDownload: () => void = () => {\n\t\t};\n\n\t\tconstructor(\n\t\t\tprivate readonly getChangesetName: () => string,\n\t\t\tprivate readonly savePendingChangesetData: () => JQueryPromise,\n\t\t\tprivate readonly metadataObservable: KnockoutObservable,\n\t\t\tcustomAdminThemeTexts: AdminThemeTexts\n\t\t) {\n\t\t\tsuper();\n\t\t\tthis.options.minWidth = 400;\n\n\t\t\tthis.adminThemeTexts = {\n\t\t\t\t...{\n\t\t\t\t\tgeneratorCreditPhrase: 'generated using the Admin Menu Editor Pro plugin.',\n\t\t\t\t\tstandalonePluginNote: 'The result is a standalone plugin that you can use without Admin Menu Editor Pro.',\n\t\t\t\t},\n\t\t\t\t...customAdminThemeTexts\n\t\t\t}\n\n\t\t\tlet initialMetadata = metadataObservable();\n\t\t\tif (initialMetadata === null) {\n\t\t\t\tinitialMetadata = this.getSampleMetadata();\n\t\t\t}\n\n\t\t\tthis.meta = ko.observable(new ObservableThemeMetadata(initialMetadata));\n\n\t\t\tthis.confirmButtonLabel = ko.computed(() => {\n\t\t\t\tif (this.mode() === MetadataDialogMode.Download) {\n\t\t\t\t\treturn 'Download Admin Theme';\n\t\t\t\t}\n\t\t\t\treturn 'OK';\n\t\t\t});\n\n\t\t\tthis.isConfirmButtonEnabled = ko.computed(() => {\n\t\t\t\tif (this.isOperationInProgress()) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tif (getChangesetName() === '') {\n\t\t\t\t\t//To generate an admin theme, the changeset must have already been saved.\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\treturn this.meta().isValid();\n\t\t\t});\n\n\t\t\tthis.areFieldsEditable = ko.computed(() => {\n\t\t\t\treturn !this.isOperationInProgress();\n\t\t\t});\n\n\t\t\tthis.advancedOptionsToggleLabel = ko.pureComputed((): string => {\n\t\t\t\treturn this.advancedOptionsVisible() ? 'Fewer options' : 'More options';\n\t\t\t});\n\t\t\tthis.helpToggleLabel = ko.pureComputed((): string => {\n\t\t\t\treturn this.helpVisible() ? 'Hide info' : 'How it works';\n\t\t\t});\n\n\t\t\t//Hide the help container in download mode.\n\t\t\tthis.helpContainerVisible = ko.pureComputed((): boolean => {\n\t\t\t\treturn this.mode() === MetadataDialogMode.Download;\n\t\t\t});\n\n\t\t\tthis.mode.subscribe((newMode: MetadataDialogMode) => {\n\t\t\t\tif (newMode === MetadataDialogMode.Download) {\n\t\t\t\t\tthis.title('Generate admin theme');\n\t\t\t\t} else if (newMode === MetadataDialogMode.Edit) {\n\t\t\t\t\tthis.title('Edit admin theme properties');\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tprivate getSampleMetadata() {\n\t\t\treturn AdminThemeMetadata.parse({\n\t\t\t\tpluginName: 'Custom Admin Theme',\n\t\t\t\tshortDescription: 'A custom admin theme ' + this.adminThemeTexts.generatorCreditPhrase,\n\t\t\t\tpluginVersion: '1.0',\n\t\t\t});\n\t\t}\n\n\t\tonOpen(event: JQueryEventObject, ui: any): void {\n\t\t\tlet latestMetadata = this.metadataObservable();\n\t\t\tif (latestMetadata === null) {\n\t\t\t\tlatestMetadata = this.getSampleMetadata();\n\t\t\t}\n\t\t\tthis.meta(new ObservableThemeMetadata(latestMetadata));\n\t\t}\n\n\t\ttoggleAdvancedOptions(): void {\n\t\t\tthis.advancedOptionsVisible(!this.advancedOptionsVisible());\n\t\t}\n\n\t\ttoggleHelp(): void {\n\t\t\tthis.helpVisible(!this.helpVisible());\n\t\t}\n\n\t\tonConfirm(event: JQueryEventObject) {\n\t\t\tif (!this.meta().isValid()) {\n\t\t\t\t//This should never happen because the confirm button is disabled\n\t\t\t\t//when the metadata is invalid.\n\t\t\t\talert('Error: The admin theme details are not valid.');\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst metadata = this.meta().toObject();\n\t\t\tmetadata.wasEverConfirmed = true;\n\t\t\tthis.metadataObservable(metadata);\n\n\t\t\tif (this.mode() === MetadataDialogMode.Edit) {\n\t\t\t\t//That's all we need to do in edit mode.\n\t\t\t\tthis.isOpen(false);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.triggerDownloadWithErrorReporting(metadata);\n\t\t}\n\n\t\tpublic triggerDownloadWithErrorReporting(metadata: AdminThemeMetadata) {\n\t\t\tif (this.isOperationInProgress()) {\n\t\t\t\talert('Error: Another operation is already in progress.');\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.triggerDownload(metadata)\n\t\t\t\t.fail((error: string) => {\n\t\t\t\t\tif (error !== '') {\n\t\t\t\t\t\talert('Error: ' + error);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t}\n\n\t\tprivate triggerDownload(metadata: AdminThemeMetadata): JQueryPromise {\n\t\t\tconst deferred = $.Deferred();\n\n\t\t\t//Sanity checks.\n\t\t\t//Download mode still requires a saved changeset.\n\t\t\tconst changesetName = this.getChangesetName();\n\t\t\tif (changesetName === '') {\n\t\t\t\treturn deferred.reject('The changeset has not been saved yet (name is empty).').promise();\n\t\t\t}\n\n\t\t\tthis.isOperationInProgress(true);\n\n\t\t\tconst $form = $('#ame-ac-theme-download-request-form');\n\t\t\tconst $frame = $('#ame-ac-theme-download-frame');\n\n\t\t\t//Cancel the operation and re-enable buttons if the request takes too long.\n\t\t\tlet isCancelledOrDone: boolean = false;\n\t\t\tconst requestTimeoutMs = 30000;\n\t\t\tconst requestStartTime = (new Date()).getTime();\n\t\t\tlet statusCheckInterval: ReturnType | null = null;\n\n\t\t\tconst cleanup = this.cleanupCurrentDownload = () => {\n\t\t\t\tisCancelledOrDone = true;\n\n\t\t\t\t$frame.off('load.ameAcDownloadAdminTheme');\n\t\t\t\tif (timeoutTimer) {\n\t\t\t\t\tclearTimeout(timeoutTimer);\n\t\t\t\t}\n\t\t\t\tif (statusCheckInterval) {\n\t\t\t\t\tclearInterval(statusCheckInterval);\n\t\t\t\t}\n\t\t\t\t$frame.attr('src', 'about:blank');\n\n\t\t\t\tthis.isOperationInProgress(false);\n\n\t\t\t\tif (this.cleanupCurrentDownload === cleanup) {\n\t\t\t\t\tthis.cleanupCurrentDownload = () => {\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst timeoutTimer = setTimeout(() => {\n\t\t\t\tdeferred.reject('The download operation timed out.');\n\t\t\t\tcleanup();\n\t\t\t}, requestTimeoutMs);\n\n\t\t\tthis.savePendingChangesetData().then(\n\t\t\t\t() => {\n\t\t\t\t\tif (isCancelledOrDone) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.changesetName(changesetName);\n\t\t\t\t\tthis.metadataJson(JSON.stringify(metadata));\n\n\t\t\t\t\t//The server will set a cookie with a unique name that can be used\n\t\t\t\t\t//to check if the download has been initiated. Note that the user\n\t\t\t\t\t//can still cancel the download.\n\t\t\t\t\tconst cookieName = ('ameAcFileDownload_'\n\t\t\t\t\t\t+ new Date().getTime()\n\t\t\t\t\t\t+ '_'\n\t\t\t\t\t\t+ Math.round(Math.random() * 10000) //No dots allowed in these cookie names.\n\t\t\t\t\t);\n\t\t\t\t\tthis.downloadCookieName(cookieName);\n\n\t\t\t\t\t//Clear the frame to prevent the old response from being read.\n\t\t\t\t\t$frame.attr('src', 'about:blank');\n\t\t\t\t\ttry {\n\t\t\t\t\t\t$frame.contents().find('body').html('');\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t//Ignore but log cross-origin errors. These should not happen in practice.\n\t\t\t\t\t\tif (console && console.error) {\n\t\t\t\t\t\t\tconsole.error(e);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tstatusCheckInterval = setInterval(() => {\n\t\t\t\t\t\tconst cookieValue = $.cookie(cookieName);\n\t\t\t\t\t\tif (cookieValue) {\n\t\t\t\t\t\t\tcleanup();\n\t\t\t\t\t\t\t$.removeCookie(cookieName);\n\n\t\t\t\t\t\t\t//Close the dialog when the download starts.\n\t\t\t\t\t\t\tthis.isOpen(false);\n\t\t\t\t\t\t\tdeferred.resolve();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ((new Date()).getTime() - requestStartTime > requestTimeoutMs) {\n\t\t\t\t\t\t\tcleanup();\n\t\t\t\t\t\t\tdeferred.reject('The download operation timed out.');\n\t\t\t\t\t\t}\n\t\t\t\t\t}, 1000);\n\n\t\t\t\t\t$frame.on('load.ameAcDownloadAdminTheme', () => {\n\t\t\t\t\t\t//Get the response from the frame. It should be JSON displayed as text.\n\t\t\t\t\t\tconst responseText = String($frame.contents().text()).trim();\n\t\t\t\t\t\tconst response = JSON.parse(responseText);\n\n\t\t\t\t\t\tcleanup();\n\n\t\t\t\t\t\tif ((response === null) || (typeof response !== 'object')) {\n\t\t\t\t\t\t\tdeferred.reject('Received an invalid response from the server.');\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif (!response.success) {\n\t\t\t\t\t\t\t\tlet errorMessage;\n\t\t\t\t\t\t\t\tif (response.data.message) {\n\t\t\t\t\t\t\t\t\terrorMessage = response.data.message;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\terrorMessage = 'An unknown error occurred on the server.';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdeferred.reject(errorMessage);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t//This should never happen in practice.\n\t\t\t\t\t\t\t\tdeferred.reject('The server did not start the download correctly.');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\t$form.trigger('submit');\n\t\t\t\t},\n\t\t\t\t() => {\n\t\t\t\t\tif (isCancelledOrDone) {\n\t\t\t\t\t\tif (deferred.state() === 'pending') {\n\t\t\t\t\t\t\tdeferred.reject(''); //No error message; the user probably cancelled the operation.\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tcleanup();\n\t\t\t\t\tdeferred.reject('Could not save the changeset data before generating an admin theme.');\n\t\t\t\t}\n\t\t\t);\n\n\t\t\treturn deferred.promise();\n\t\t}\n\n\t\tonClose(event: JQueryEventObject, ui: any) {\n\t\t\tthis.cleanupCurrentDownload();\n\t\t}\n\t}\n\n\t//endregion\n\n\tclass SectionNavigation {\n\t\tprivate sectionNavStack: KnockoutObservableArray = ko.observableArray([] as string[]);\n\t\tprivate $sectionList: JQuery;\n\n\t\tpublic readonly breadcrumbs: KnockoutObservable;\n\n\t\tconstructor() {\n\t\t\tthis.$sectionList = $('#ame-ac-container-collection');\n\n\t\t\tthis.$sectionList.on('click', '.ame-ac-section-link', (event) => {\n\t\t\t\tevent.preventDefault()\n\n\t\t\t\tif (event.currentTarget === null) {\n\t\t\t\t\treturn; //Shouldn't happen in practice, but let's satisfy the type checker.\n\t\t\t\t}\n\n\t\t\t\tconst targetId = $(event.currentTarget).data('target-id');\n\t\t\t\tif (targetId) {\n\t\t\t\t\tthis.navigateToSection(targetId);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tthis.$sectionList.on('click', '.ame-ac-section-back-button', (event) => {\n\t\t\t\tevent.preventDefault()\n\t\t\t\tthis.navigateBack();\n\t\t\t});\n\n\t\t\tthis.breadcrumbs = ko.pureComputed(() => {\n\t\t\t\treturn this.sectionNavStack()\n\t\t\t\t\t.map((sectionId) => $('#' + sectionId))\n\t\t\t\t\t.filter(($section) => $section.length > 0)\n\t\t\t\t\t.map(($section) => {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\ttitle: $section.find('.ame-ac-section-title .ame-ac-section-own-title')\n\t\t\t\t\t\t\t\t.first().text()\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t});\n\t\t}\n\n\t\tnavigateToSection(sectionElementId: string) {\n\t\t\tconst $section = $('#' + sectionElementId);\n\t\t\tif ($section.length === 0) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ($section.hasClass('ame-ac-current-section')) {\n\t\t\t\treturn; //Already on this section.\n\t\t\t}\n\n\t\t\t//If the requested section is in the navigation stack, navigate back\n\t\t\t//to it instead of putting more sections on the stack.\n\t\t\tconst stackIndex = this.sectionNavStack.indexOf(sectionElementId);\n\t\t\tif (stackIndex !== -1) {\n\t\t\t\twhile (this.sectionNavStack().length > stackIndex) {\n\t\t\t\t\tthis.navigateBack();\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst $previousSection = this.$sectionList.find('.ame-ac-current-section');\n\t\t\tif ($previousSection.length > 0) {\n\t\t\t\tthis.expectTransition($previousSection, '.ame-ac-section');\n\t\t\t\t$previousSection\n\t\t\t\t\t.removeClass('ame-ac-current-section')\n\t\t\t\t\t.addClass('ame-ac-previous-section');\n\t\t\t\tthis.sectionNavStack.push($previousSection.attr('id'));\n\n\t\t\t\t$previousSection.trigger('adminMenuEditor:leaveSection');\n\t\t\t}\n\n\t\t\tthis.expectTransition($section, '.ame-ac-section');\n\t\t\t$section.addClass('ame-ac-current-section');\n\n\t\t\t$section.trigger('adminMenuEditor:enterSection');\n\t\t}\n\n\t\tnavigateBack() {\n\t\t\tif (this.sectionNavStack().length < 1) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst $newCurrentSection = $('#' + this.sectionNavStack.pop());\n\t\t\tif ($newCurrentSection.length === 0) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst $oldCurrentSection = this.$sectionList.find('.ame-ac-current-section');\n\t\t\tthis.expectTransition($oldCurrentSection, '.ame-ac-section');\n\t\t\t$oldCurrentSection.removeClass('ame-ac-current-section ame-ac-previous-section');\n\t\t\t$oldCurrentSection.trigger('adminMenuEditor:leaveSection');\n\n\t\t\tconst $oldPreviousSection = this.$sectionList.find('.ame-ac-previous-section');\n\t\t\t$oldPreviousSection.removeClass('ame-ac-previous-section');\n\n\t\t\t//Show the new current section.\n\t\t\tthis.expectTransition($newCurrentSection, '.ame-ac-section');\n\t\t\t$newCurrentSection.addClass('ame-ac-current-section');\n\t\t\t$newCurrentSection.trigger('adminMenuEditor:enterSection');\n\n\t\t\t//The next section in the stack becomes the previous section.\n\t\t\tif (this.sectionNavStack().length > 0) {\n\t\t\t\tthis.$sectionList.find('#' + this.sectionNavStack()[this.sectionNavStack().length - 1])\n\t\t\t\t\t.addClass('ame-ac-previous-section');\n\t\t\t}\n\t\t}\n\n\t\t//Add a special class to sections when they have an active CSS transition.\n\t\t//This is used to keep both sections visible while the previous section\n\t\t//slides out and the next section slides in.\n\t\texpectTransition($element: JQuery, requiredSelector: string) {\n\t\t\tif (prefersReducedMotion) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ($element.data('ameHasTransitionEvents')) {\n\t\t\t\treturn; //Event handler(s) already added.\n\t\t\t}\n\n\t\t\tconst transitionEvents = 'transitionend transitioncancel';\n\n\t\t\t$element.addClass('ame-ac-transitioning');\n\n\t\t\tfunction transitionEndCallback(event: JQueryEventObject) {\n\t\t\t\t//Ignore events that bubble from child elements.\n\t\t\t\tif (!$(event.target).is(requiredSelector)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t$element\n\t\t\t\t\t.off(transitionEvents, transitionEndCallback)\n\t\t\t\t\t.data('ameHasTransitionEvents', null)\n\t\t\t\t\t.removeClass('ame-ac-transitioning');\n\t\t\t}\n\n\t\t\t$element.data('ameHasTransitionEvents', true);\n\t\t\t$element.on(transitionEvents, transitionEndCallback);\n\t\t}\n\t}\n\n\texport interface NavigationBreadcrumb {\n\t\ttitle: string;\n\t}\n\n\t/**\n\t * Whether to ask for confirmation when the user tries to exit the customizer.\n\t */\n\tenum ExitPromptMode {\n\t\t/**\n\t\t * Ask if there are unsaved changes.\n\t\t */\n\t\tUnsavedChanges = 1,\n\n\t\t/**\n\t\t * Ask if the current changeset hasn't been published yet.\n\t\t */\n\t\tUnpublishedChanges = 2\n\t}\n\n\texport class AdminCustomizer extends AmeAdminCustomizerBase.AdminCustomizerBase implements CustomizableVmInterface {\n\t\tprivate readonly exitPromptMessage = 'Unsaved changes will be lost if you navigate away from this page.';\n\t\t//Admin themes generated by this plugin should be fairly small.\n\t\tprivate readonly maxImportFileSize = 500 * 1024;\n\n\t\tsectionNavigation: SectionNavigation;\n\t\tsettings: CustomizerSettingsCollection;\n\t\tpublic readonly interfaceStructure: InterfaceStructure;\n\n\t\tprivate readonly $previewFrame: JQuery;\n\n\t\t/**\n\t\t * Preview frame URL.\n\t\t */\n\t\tprivate currentPreviewUrl: string | null = null;\n\t\t/**\n\t\t * The default preview URL that can be used when the current frame URL cannot be detected.\n\t\t */\n\t\tprivate readonly initialPreviewUrl: string;\n\t\tprivate previewConnection: ReturnType | null = null;\n\t\tprivate readonly refreshPreviewNonce: string;\n\n\t\tprivate readonly $saveButton: JQuery;\n\n\t\tpublic readonly downloadThemeDialog: DownloadThemeDialog;\n\t\tprivate $extraActionMenu: JQuery | null = null;\n\t\tprivate $extraActionButton: JQuery | null = null;\n\n\t\tprivate $importFileInput: JQuery | null = null;\n\t\tprivate isImporting: KnockoutObservable = ko.observable(false);\n\t\tprivate lastImportReport: KnockoutObservable = ko.observable(null);\n\t\tprivate isImportReportVisible: KnockoutObservable = ko.observable(true);\n\n\t\tprivate isDiscardingChanges: KnockoutObservable = ko.observable(false);\n\n\t\tpublic readonly isGeneralOverlayVisible: KnockoutObservable;\n\n\t\tprivate readonly importActionEnabled: KnockoutComputed;\n\t\tprivate readonly discardChangesActionEnabled: KnockoutComputed;\n\t\tprivate readonly downloadThemeActionEnabled: KnockoutComputed;\n\n\t\tprivate readonly customBasePath: string | null;\n\t\tprivate readonly consoleLoggingEnabled: boolean;\n\t\tprivate readonly exitPromptMode: ExitPromptMode;\n\n\t\tconstructor(scriptData: ScriptData) {\n\t\t\tsuper(scriptData);\n\n\t\t\tthis.settings = new CustomizerSettingsCollection(\n\t\t\t\tscriptData.ajaxUrl,\n\t\t\t\tscriptData.saveChangesetNonce,\n\t\t\t\tscriptData.trashChangesetNonce,\n\t\t\t\tscriptData.changesetName,\n\t\t\t\tscriptData.changesetItemCount,\n\t\t\t\tscriptData.changesetStatus\n\t\t\t);\n\t\t\t_.forOwn(scriptData.settings, (data, id) => {\n\t\t\t\tif (typeof id === 'string') {\n\t\t\t\t\tthis.settings.add(unserializeSetting(id, data));\n\t\t\t\t}\n\t\t\t});\n\t\t\tif (scriptData.changesetThemeMetadata) {\n\t\t\t\tthis.settings.addInitialThemeMetadata(scriptData.changesetThemeMetadata);\n\t\t\t}\n\n\t\t\tthis.customBasePath = scriptData.customBasePath || null;\n\t\t\tthis.consoleLoggingEnabled = scriptData.isWpDebugEnabled || false;\n\n\t\t\tif ((typeof scriptData.exitPromptMode === 'number') && (scriptData.exitPromptMode in ExitPromptMode)) {\n\t\t\t\tthis.exitPromptMode = scriptData.exitPromptMode;\n\t\t\t} else {\n\t\t\t\tthis.exitPromptMode = ExitPromptMode.UnpublishedChanges;\n\t\t\t}\n\n\t\t\tlet sectionIdCounter = 0;\n\n\t\t\tthis.interfaceStructure = unserializeUiElement(\n\t\t\t\tscriptData.interfaceStructure,\n\t\t\t\tthis.settings.get.bind(this.settings),\n\t\t\t\t(data: AnySpecificElementData) => {\n\t\t\t\t\tswitch (data.t) {\n\t\t\t\t\t\tcase 'section':\n\t\t\t\t\t\t\tdata.component = 'ame-ac-section';\n\t\t\t\t\t\t\t//All sections must have unique IDs for navigation to work.\n\t\t\t\t\t\t\tif (!data.id) {\n\t\t\t\t\t\t\t\tdata.id = 'autoID-' + (++sectionIdCounter);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'control-group':\n\t\t\t\t\t\t\tdata.component = 'ame-ac-control-group';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'control':\n\t\t\t\t\t\t\t//Tell controls that use number inputs to position the popup\n\t\t\t\t\t\t\t//slider within the customizer sidebar.\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t(data.component === 'ame-number-input')\n\t\t\t\t\t\t\t\t|| (data.component === 'ame-box-dimensions')\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tdata.params = data.params || {};\n\t\t\t\t\t\t\t\tdata.params.popupSliderWithin = '#ame-ac-sidebar-content';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t//Replace regular separators with AC-specific ones.\n\t\t\t\t\t\t\tif (data.component === 'ame-horizontal-separator') {\n\t\t\t\t\t\t\t\tdata.component = 'ame-ac-separator';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t//Remove the reload parameter from the URL. It is only used to avoid\n\t\t\t//caching issues, and is not needed otherwise.\n\t\t\tconst currentUrl = new URL(window.location.href);\n\t\t\tif (currentUrl.searchParams.get('_ame-ac-reload') !== null) {\n\t\t\t\tcurrentUrl.searchParams.delete('_ame-ac-reload');\n\t\t\t\twindow.history.replaceState({}, '', currentUrl.href);\n\t\t\t}\n\n\t\t\t//Also remove the \"request new changeset\" parameter.\n\t\t\tif (currentUrl.searchParams.get('_ame-ac-new-changeset') !== null) {\n\t\t\t\tcurrentUrl.searchParams.delete('_ame-ac-new-changeset');\n\t\t\t\twindow.history.replaceState({}, '', currentUrl.href);\n\t\t\t}\n\n\t\t\tconst changesetPathTemplate: string | null = scriptData.changesetPathTemplate;\n\t\t\tconst changesetPlaceholder = '{changeset}';\n\n\t\t\tfunction addChangesetToUrl(currentUrl: string, changesetName: string): URL {\n\t\t\t\tconst url = new URL(currentUrl);\n\t\t\t\tif (changesetPathTemplate) {\n\t\t\t\t\turl.pathname = changesetPathTemplate.replace(changesetPlaceholder, changesetName);\n\t\t\t\t\t//With a custom path, the \"page\" parameter that points to the AC\n\t\t\t\t\t//admin page is not necessary and would be confusing.\n\t\t\t\t\turl.searchParams.delete('page');\n\t\t\t\t\t//When the changeset name is stored in the path, the \"ame-ac-changeset\"\n\t\t\t\t\t//parameter is no longer needed, and could be out of sync with the path.\n\t\t\t\t\turl.searchParams.delete('ame-ac-changeset');\n\t\t\t\t} else {\n\t\t\t\t\turl.searchParams.set('ame-ac-changeset', changesetName);\n\t\t\t\t}\n\t\t\t\treturn url;\n\t\t\t}\n\n\t\t\tfunction getChangesetFromUrl(url: string): string {\n\t\t\t\tconst parsedUrl = new URL(url);\n\t\t\t\tif (changesetPathTemplate) {\n\t\t\t\t\tfunction escapeRegExp(input: string): string {\n\t\t\t\t\t\treturn input.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n\t\t\t\t\t}\n\n\t\t\t\t\tconst placeholderStart = changesetPathTemplate.indexOf(changesetPlaceholder);\n\t\t\t\t\tconst placeholderEnd = placeholderStart + changesetPlaceholder.length;\n\n\t\t\t\t\tconst changesetPathTemplateRegex = new RegExp(\n\t\t\t\t\t\t'^' + escapeRegExp(changesetPathTemplate.slice(0, placeholderStart))\n\t\t\t\t\t\t+ '([^a-zA-Z0-9]+)'\n\t\t\t\t\t\t+ escapeRegExp(changesetPathTemplate.slice(placeholderEnd))\n\t\t\t\t\t);\n\n\t\t\t\t\tconst match = parsedUrl.pathname.match(changesetPathTemplateRegex);\n\t\t\t\t\treturn match ? match[1] : '';\n\t\t\t\t} else {\n\t\t\t\t\treturn parsedUrl.searchParams.get('ame-ac-changeset') ?? '';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//Add the changeset name to the URL (if not already present).\n\t\t\tif (getChangesetFromUrl(window.location.href) !== this.settings.changesetName()) {\n\t\t\t\tconst newUrl = addChangesetToUrl(window.location.href, this.settings.changesetName());\n\t\t\t\twindow.history.replaceState({}, '', newUrl.href);\n\t\t\t}\n\n\t\t\t//When the changeset name changes, also change the URL.\n\t\t\tthis.settings.changesetName.subscribe((changesetName) => {\n\t\t\t\tconst url = addChangesetToUrl(window.location.href, changesetName);\n\t\t\t\tif (scriptData.changesetPushStateEnabled) {\n\t\t\t\t\twindow.history.pushState({}, '', url.href);\n\t\t\t\t} else {\n\t\t\t\t\twindow.history.replaceState({}, '', url.href);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tthis.$saveButton = $('#ame-ac-apply-changes');\n\n\t\t\t//The save button should be enabled when:\n\t\t\t// - There are non-zero changes in the current changeset.\n\t\t\t// - All settings are valid.\n\t\t\t// - The changeset is not in the process of being published, deleted, etc.\n\t\t\t// - The contents of the changeset can be modified (e.g. not already published).\n\t\t\tconst isSaveButtonEnabled = ko.pureComputed(() => {\n\t\t\t\tconst changeset = this.settings.getCurrentChangeset();\n\t\t\t\treturn (\n\t\t\t\t\tchangeset.isNonEmpty()\n\t\t\t\t\t&& changeset.canBeModified()\n\t\t\t\t\t&& !this.settings.isExclusiveOperationInProgress()\n\t\t\t\t\t&& !this.settings.hasValidationErrors()\n\t\t\t\t);\n\t\t\t});\n\t\t\t//Update button state when the customizer loads.\n\t\t\tthis.$saveButton.prop('disabled', !isSaveButtonEnabled());\n\t\t\t//And also on changes.\n\t\t\tisSaveButtonEnabled.subscribe((isEnabled) => {\n\t\t\t\tthis.$saveButton.prop('disabled', !isEnabled);\n\t\t\t\t//Change the text back to the default when the button is enabled.\n\t\t\t\tif (isEnabled) {\n\t\t\t\t\tthis.$saveButton.val(this.$saveButton.data('default-text') ?? 'Save Changes');\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t//Handle the \"Save Changes\" button.\n\t\t\tthis.$saveButton.on('click', () => {\n\t\t\t\t//Show the spinner.\n\t\t\t\tconst $spinner = $('#ame-ac-primary-actions .spinner');\n\t\t\t\t$spinner.css('visibility', 'visible').show();\n\n\t\t\t\tconst publishFailNoticeId = 'ame-ac-publish-failed-notice';\n\t\t\t\t//Remove the previous error notification, if any.\n\t\t\t\t$('#' + publishFailNoticeId).remove();\n\n\t\t\t\tconst promise = this.settings.publishChangeset();\n\n\t\t\t\tpromise.fail((error) => {\n\t\t\t\t\t//Show a dismissible error notification.\n\t\t\t\t\tlet message = 'An unexpected error occurred while saving changes.';\n\t\t\t\t\tif (typeof error === 'string') {\n\t\t\t\t\t\tmessage = error;\n\t\t\t\t\t} else if (error instanceof Error) {\n\t\t\t\t\t\tmessage = error.message;\n\t\t\t\t\t} else if (typeof error.responseJSON === 'object') {\n\t\t\t\t\t\tmessage = _.get(error.responseJSON, ['data', 'message'], message);\n\t\t\t\t\t}\n\n\t\t\t\t\tconst $notice = $('
    ')\n\t\t\t\t\t\t.attr('id', publishFailNoticeId)\n\t\t\t\t\t\t.addClass('notice notice-error is-dismissible')\n\t\t\t\t\t\t.text(message);\n\n\t\t\t\t\t//WordPress won't automatically add the dismiss button to a dynamically\n\t\t\t\t\t//generated notice like this, so we have to do it.\n\t\t\t\t\t$notice.append(\n\t\t\t\t\t\t$('')\n\t\t\t\t\t\t\t.append('Dismiss this notice')\n\t\t\t\t\t\t\t.on('click', (event) => {\n\t\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\t\t$notice.remove(); //Not as fancy as WP does it.\n\t\t\t\t\t\t\t})\n\t\t\t\t\t);\n\n\t\t\t\t\tconst $container = $('#ame-ac-global-notification-area');\n\t\t\t\t\t$container.append($notice);\n\t\t\t\t})\n\n\t\t\t\tpromise.done(() => {\n\t\t\t\t\tthis.$saveButton.val(this.$saveButton.data('published-text') ?? 'Saved');\n\n\t\t\t\t\t//The preview could be stale. For example, the color scheme module\n\t\t\t\t\t//switches between \"actual\" and \"preview\" color schemes dynamically,\n\t\t\t\t\t//but the \"actual\" scheme could change after applying new settings.\n\t\t\t\t\t//Let's reload the preview frame to make sure it's up-to-date.\n\t\t\t\t\tthis.queuePreviewFrameReload();\n\t\t\t\t});\n\n\t\t\t\tpromise.always(() => {\n\t\t\t\t\t$spinner.css('visibility', 'hidden');\n\t\t\t\t});\n\t\t\t});\n\n\t\t\t//Prevent the user from interacting with settings while the changeset is being modified.\n\t\t\tthis.settings.isExclusiveOperationInProgress.subscribe((isInProgress) => {\n\t\t\t\t$('#ame-ac-sidebar-blocker-overlay').toggle(isInProgress);\n\t\t\t});\n\n\t\t\t//Show a general overlay with a progress spinner while something is happening.\n\t\t\tthis.isGeneralOverlayVisible = ko.pureComputed(() => {\n\t\t\t\treturn this.isImporting() || this.isDiscardingChanges();\n\t\t\t});\n\n\t\t\t//Initialize the \"download admin theme\" dialog.\n\t\t\tthis.downloadThemeDialog = new DownloadThemeDialog(\n\t\t\t\t() => this.settings.getCurrentChangeset().name(),\n\t\t\t\t() => this.settings.savePendingSettings(),\n\t\t\t\tthis.settings.adminThemeMetadata,\n\t\t\t\tscriptData\n\t\t\t);\n\n\t\t\t//Toggle available extra actions based on changeset status.\n\t\t\tthis.importActionEnabled = ko.pureComputed(() => {\n\t\t\t\tconst changeset = this.settings.getCurrentChangeset();\n\t\t\t\treturn changeset && changeset.canBeModified()\n\t\t\t\t\t&& !this.settings.isExclusiveOperationInProgress();\n\t\t\t});\n\t\t\tthis.importActionEnabled.subscribe((isEnabled) => {\n\t\t\t\tif (this.$extraActionMenu) {\n\t\t\t\t\tthis.$extraActionMenu.find('.ame-ac-import-theme-action')\n\t\t\t\t\t\t.toggleClass('ui-state-disabled', !isEnabled);\n\t\t\t\t}\n\t\t\t});\n\t\t\tthis.discardChangesActionEnabled = ko.pureComputed(() => {\n\t\t\t\tconst changeset = this.settings.getCurrentChangeset();\n\t\t\t\treturn changeset && changeset.isNonEmpty() && changeset.canBeModified()\n\t\t\t\t\t&& !this.settings.isExclusiveOperationInProgress()\n\t\t\t});\n\t\t\tthis.discardChangesActionEnabled.subscribe((isEnabled) => {\n\t\t\t\tif (this.$extraActionMenu) {\n\t\t\t\t\tthis.$extraActionMenu.find('.ame-ac-discard-changes-action')\n\t\t\t\t\t\t.toggleClass('ui-state-disabled', !isEnabled);\n\t\t\t\t}\n\t\t\t});\n\t\t\tthis.downloadThemeActionEnabled = ko.pureComputed(() => {\n\t\t\t\treturn (\n\t\t\t\t\t!this.settings.isExclusiveOperationInProgress()\n\t\t\t\t\t&& !this.downloadThemeDialog.isOperationInProgress()\n\t\t\t\t\t//The changeset must already be saved for the download to work,\n\t\t\t\t\t//which means it should have a name.\n\t\t\t\t\t&& (this.settings.getCurrentChangeset().name() !== '')\n\t\t\t\t\t//The changeset should probably be non-empty.\n\t\t\t\t\t&& this.settings.getCurrentChangeset().isNonEmpty()\n\t\t\t\t);\n\t\t\t});\n\t\t\tthis.downloadThemeActionEnabled.subscribe((isEnabled) => {\n\t\t\t\tif (this.$extraActionMenu) {\n\t\t\t\t\tthis.$extraActionMenu.find('.ame-ac-download-theme-action')\n\t\t\t\t\t\t.toggleClass('ui-state-disabled', !isEnabled);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tthis.sectionNavigation = new SectionNavigation();\n\n\t\t\t//Set up the preview frame.\n\t\t\tthis.$previewFrame = $('iframe#ame-ac-preview');\n\n\t\t\tthis.initialPreviewUrl = scriptData.initialPreviewUrl;\n\t\t\tthis.refreshPreviewNonce = scriptData.refreshPreviewNonce;\n\n\t\t\tthis.$previewFrame.on('load', () => {\n\t\t\t\tthis.isFrameLoading = false;\n\n\t\t\t\t//The URL that was actually loaded might not match the one that\n\t\t\t\t//was requested (e.g. because there was a redirect).\n\t\t\t\tthis.currentPreviewUrl = null;\n\n\t\t\t\t//Close the previous postMessage connection.\n\t\t\t\tif (this.previewConnection) {\n\t\t\t\t\tthis.previewConnection.disconnect();\n\t\t\t\t\tthis.previewConnection = null;\n\t\t\t\t}\n\n\t\t\t\tconst frame = this.$previewFrame.get(0) as HTMLIFrameElement;\n\t\t\t\tif (!frame || !(frame instanceof HTMLIFrameElement)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t//Try to get the preview URL from the iframe.\n\t\t\t\ttry {\n\t\t\t\t\tconst url = frame.contentWindow?.location.href;\n\t\t\t\t\tif (url) {\n\t\t\t\t\t\tthis.currentPreviewUrl = url;\n\t\t\t\t\t}\n\t\t\t\t} catch (e) {\n\t\t\t\t\t//We can't get the URL directly, probably because it's a cross-origin iframe.\n\t\t\t\t}\n\n\t\t\t\tthis.previewConnection = AmeAcCommunicator.connectToChild(\n\t\t\t\t\tframe,\n\t\t\t\t\t{\n\t\t\t\t\t\t'setPreviewUrl': (url: string) => {\n\t\t\t\t\t\t\tif (this.isPreviewableUrl(url)) {\n\t\t\t\t\t\t\t\tthis.previewUrl = url;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\t'notifyPreviewUrlChanged': (url: string) => {\n\t\t\t\t\t\t\tthis.currentPreviewUrl = url;\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tthis.allowedCommOrigins,\n\t\t\t\t\tscriptData.isWpDebugEnabled\n\t\t\t\t);\n\n\t\t\t\tthis.previewConnection.promise.then((connection) => {\n\t\t\t\t\tif (typeof connection === 'undefined') {\n\t\t\t\t\t\t//This should never happen, but the type checker doesn't know that.\n\t\t\t\t\t\tthrow new Error('Unexpected error: Connection apparently succeeded, but the connection object is undefined');\n\t\t\t\t\t}\n\n\t\t\t\t\tconnection.execute('getCurrentUrl').then((url) => {\n\t\t\t\t\t\tif (url && (typeof url === 'string')) {\n\t\t\t\t\t\t\tthis.currentPreviewUrl = url;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\t//Notify other scripts that the preview frame is loaded and\n\t\t\t\t\t//the postMessage connection is ready for use.\n\t\t\t\t\t$('body').trigger('adminMenuEditor:acPreviewConnectionReady');\n\t\t\t\t});\n\t\t\t});\n\n\t\t\tthis.previewUrl = this.initialPreviewUrl;\n\n\t\t\t//Notify other scripts. This lets them register custom controls and so on.\n\t\t\t$('#ame-ac-admin-customizer').trigger('adminMenuEditor:acRegister', [this]);\n\n\t\t\tconst throttledReloadPreview = _.throttle(\n\t\t\t\t() => {\n\t\t\t\t\tthis.queuePreviewFrameReload();\n\t\t\t\t},\n\t\t\t\t1000, //The reload method does its own throttling, so we use a low wait time here.\n\t\t\t\t{leading: true, trailing: true}\n\t\t\t);\n\n\t\t\t//Refresh the preview when any setting changes.\n\t\t\tthis.settings.addChangeListener((setting, newValue) => {\n\t\t\t\tif (\n\t\t\t\t\tsetting.supportsPostMessage\n\t\t\t\t\t&& this.previewConnection\n\t\t\t\t\t&& this.previewConnection.isConnected\n\t\t\t\t) {\n\t\t\t\t\tthis.previewConnection.execute('previewSetting', setting.id, newValue);\n\t\t\t\t} else {\n\t\t\t\t\tlet reason: string = 'Unknown';\n\t\t\t\t\tif (!setting.supportsPostMessage) {\n\t\t\t\t\t\treason = 'Setting \"' + setting.id + '\" does not support postMessage';\n\t\t\t\t\t} else if (!this.previewConnection) {\n\t\t\t\t\t\treason = 'No preview connection';\n\t\t\t\t\t} else if (!this.previewConnection.isConnected) {\n\t\t\t\t\t\treason = 'Preview connection is not connected';\n\t\t\t\t\t}\n\t\t\t\t\tthis.log('Reloading the preview frame because: ' + reason);\n\n\t\t\t\t\tthrottledReloadPreview();\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tconst registerUnloadPrompt = () => {\n\t\t\t\t//Ask for confirmation when the user tries to leave the page and the changeset\n\t\t\t\t//has unpublished/unsaved changes.\n\t\t\t\t$(window).on('beforeunload.ame-ac-exit-confirm', (event) => {\n\t\t\t\t\tif (this.isExitPromptNeeded()) {\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t//Note: The confirmation prompt will only be displayed if the user\n\t\t\t\t\t\t//has interacted with the page (e.g. clicked something).\n\n\t\t\t\t\t\t//As of this writing, MDN says that some browsers still don't support triggering\n\t\t\t\t\t\t//an \"unsaved changes\" prompt with event.preventDefault(). You need to set\n\t\t\t\t\t\t//event.returnValue to a string or return a string from the event handler.\n\t\t\t\t\t\t//Modern browsers will ignore the content and display their own generic message.\n\t\t\t\t\t\treturn this.exitPromptMessage;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t/*\n\t\t\t Allegedly, registering a beforeunload handler can cause the browser to\n\t\t\t disable some optimizations, so let's only do it when the user changes\n\t\t\t something or the changeset already contains some changes.\n\t\t\t */\n\t\t\tif (this.settings.getCurrentChangeset().isNonEmpty()) {\n\t\t\t\tregisterUnloadPrompt();\n\t\t\t} else {\n\t\t\t\tconst listenerId = this.settings.addChangeListener(() => {\n\t\t\t\t\t//Remove the listener after it has been triggered once.\n\t\t\t\t\tthis.settings.removeChangeListener(listenerId);\n\t\t\t\t\tregisterUnloadPrompt();\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\tgetSettingObservable(settingId: string, defaultValue: any): KnockoutObservable {\n\t\t\t//Let's just implement this temporarily while working on refactoring this\n\t\t\t//stuff to use KO components.\n\t\t\treturn this.settings\n\t\t\t\t.get(settingId)\n\t\t\t\t.map(setting => setting.value)\n\t\t\t\t.getOrElse(ko.observable(defaultValue));\n\t\t}\n\n\t\tgetAllSettingValues(): Record {\n\t\t\tthrow new Error('Method not implemented.');\n\t\t}\n\n\t\tget previewUrl(): string | null {\n\t\t\treturn this.currentPreviewUrl;\n\t\t}\n\n\t\tset previewUrl(url: string | null) {\n\t\t\tif (url === this.currentPreviewUrl) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t//The URL starts out as null, but it cannot be set to NULL again after\n\t\t\t//the preview frame has been loaded.\n\t\t\tif (url === null) {\n\t\t\t\tthrow new Error('Cannot directly set preview URL to null');\n\t\t\t}\n\n\t\t\tif (this.isPreviewableUrl(url)) {\n\t\t\t\tthis.navigatePreviewFrame(url);\n\t\t\t}\n\t\t}\n\n\t\tprivate navigatePreviewFrame(url: string | null = null, forceReload: boolean = false) {\n\t\t\tconst oldUrl = this.previewUrl;\n\t\t\tif (url === null) {\n\t\t\t\turl = oldUrl ?? this.initialPreviewUrl;\n\t\t\t}\n\n\t\t\tconst isSameUrl = (oldUrl === url);\n\t\t\tif (isSameUrl && !forceReload) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t//If there are any unsaved changes, let's include them in the preview by simulating\n\t\t\t//a form submission and sending the changes as form data. The server-side component\n\t\t\t//will merge these changes with existing changeset data.\n\t\t\tconst unsavedChanges = this.settings.unsavedChanges;\n\t\t\tconst simulateFormSubmission = !_.isEmpty(unsavedChanges);\n\n\t\t\tconst parsedUrl = new URL(url);\n\n\t\t\t//If we're not using form submission, add a special parameter\n\t\t\t//to the URL to force a refresh.\n\t\t\tconst refreshParam = '_ame-ac-refresh-trigger';\n\t\t\tif (isSameUrl && !simulateFormSubmission) {\n\t\t\t\tparsedUrl.searchParams.set(refreshParam, Date.now() + '_' + Math.random());\n\t\t\t} else {\n\t\t\t\t//Otherwise, remove the parameter just to be safe.\n\t\t\t\tparsedUrl.searchParams.delete(refreshParam);\n\t\t\t}\n\n\t\t\t//Ensure that the changeset used in the preview matches the current\n\t\t\t//changeset and preview is enabled. This is just a precaution. Normally,\n\t\t\t//the preview script automatically changes link URLs.\n\t\t\tlet changesetName = this.settings.changesetName();\n\t\t\tif (changesetName === '') {\n\t\t\t\t//Use a special value if the changeset hasn't been saved yet.\n\t\t\t\tchangesetName = TemporaryChangesetName;\n\t\t\t}\n\t\t\tparsedUrl.searchParams.set('ame-ac-changeset', changesetName);\n\t\t\tparsedUrl.searchParams.set('ame-ac-preview', '1');\n\n\t\t\tthis.hasPendingPreviewReload = false; //Reloading now, so no longer pending.\n\t\t\tthis.isFrameLoading = true;\n\n\t\t\t//console.info('navigatePreviewFrame: Navigating to ' + parsedUrl.href);\n\t\t\tif (simulateFormSubmission) {\n\t\t\t\tconst formData = {\n\t\t\t\t\taction: 'ws_ame_ac_refresh_preview_frame',\n\t\t\t\t\t\"ame-ac-changeset\": changesetName,\n\t\t\t\t\tmodified: JSON.stringify(unsavedChanges),\n\t\t\t\t\tnonce: this.refreshPreviewNonce\n\t\t\t\t}\n\n\t\t\t\tconst $form = $('')\n\t\t\t\t\t.attr('method', 'post')\n\t\t\t\t\t.attr('action', parsedUrl.href)\n\t\t\t\t\t.attr('target', 'ame-ac-preview-frame')\n\t\t\t\t\t.appendTo('body');\n\n\t\t\t\tlet key: keyof typeof formData;\n\t\t\t\tfor (key in formData) {\n\t\t\t\t\tconst value = formData[key];\n\t\t\t\t\t$('')\n\t\t\t\t\t\t.attr('type', 'hidden')\n\t\t\t\t\t\t.attr('name', key)\n\t\t\t\t\t\t.val(value)\n\t\t\t\t\t\t.appendTo($form);\n\t\t\t\t}\n\n\t\t\t\tthis.currentPreviewUrl = parsedUrl.href;\n\t\t\t\t$form.trigger('submit');\n\t\t\t\t$form.remove();\n\t\t\t} else {\n\t\t\t\tthis.currentPreviewUrl = parsedUrl.href;\n\t\t\t\tthis.$previewFrame.attr('src', this.currentPreviewUrl);\n\t\t\t}\n\t\t}\n\n\t\tprivate _isFrameLoading: boolean = false;\n\t\tprivate frameLoadingTimeoutId: number | null = null;\n\t\tprivate lastPreviewLoadTimestamp: Date = new Date(0);\n\n\t\tprivate reloadWaitTimeoutId: number | null = null;\n\t\tprivate hasPendingPreviewReload: boolean = false;\n\n\t\tprivate set isFrameLoading(isLoading: boolean) {\n\t\t\tconst wasLoadingBefore = this._isFrameLoading;\n\t\t\tif (!isLoading && (isLoading === wasLoadingBefore)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t//In some circumstances, we may start to load a new URL before\n\t\t\t//the previous one has finished loading. This is valid and should\n\t\t\t//reset the load timeout.\n\n\t\t\t$('#ame-ac-preview-refresh-indicator').toggleClass('ame-ac-show-indicator', isLoading);\n\t\t\tif (this.frameLoadingTimeoutId) {\n\t\t\t\tclearTimeout(this.frameLoadingTimeoutId);\n\t\t\t\tthis.frameLoadingTimeoutId = null;\n\t\t\t}\n\n\t\t\tif (isLoading) {\n\t\t\t\t//As a precaution, we'll assume that if the frame doesn't load in a reasonable\n\t\t\t\t//time, it will never finish loading.\n\t\t\t\tthis.frameLoadingTimeoutId = window.setTimeout(() => {\n\t\t\t\t\tif (this.isFrameLoading) {\n\t\t\t\t\t\tthis.isFrameLoading = false;\n\t\t\t\t\t}\n\t\t\t\t}, 20000);\n\t\t\t}\n\t\t\tthis._isFrameLoading = isLoading;\n\n\t\t\tif (wasLoadingBefore && !isLoading) {\n\t\t\t\tthis.lastPreviewLoadTimestamp = new Date();\n\t\t\t}\n\n\t\t\t//Once the frame is loaded, trigger any pending reload.\n\t\t\tif (!isLoading && this.hasPendingPreviewReload) {\n\t\t\t\tthis.hasPendingPreviewReload = false;\n\t\t\t\tthis.queuePreviewFrameReload();\n\t\t\t}\n\t\t}\n\n\t\tpublic get isFrameLoading(): boolean {\n\t\t\treturn this._isFrameLoading;\n\t\t}\n\n\t\tprivate queuePreviewFrameReload() {\n\t\t\tif (this.reloadWaitTimeoutId) {\n\t\t\t\treturn; //The frame will reload soon.\n\t\t\t}\n\n\t\t\tif (this.isFrameLoading) {\n\t\t\t\tthis.hasPendingPreviewReload = true;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t//To avoid stressing the server, wait at least X ms after the last\n\t\t\t//load completes before reloading the frame.\n\t\t\tconst reloadWaitTime = 2000;\n\t\t\tconst now = new Date();\n\t\t\tconst timeSinceLastLoad = now.getTime() - this.lastPreviewLoadTimestamp.getTime();\n\t\t\tif (timeSinceLastLoad < reloadWaitTime) {\n\t\t\t\tthis.reloadWaitTimeoutId = window.setTimeout(() => {\n\t\t\t\t\tthis.reloadWaitTimeoutId = null;\n\t\t\t\t\tthis.queuePreviewFrameReload();\n\t\t\t\t}, reloadWaitTime - timeSinceLastLoad);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t//Actually reload the frame.\n\t\t\tthis.navigatePreviewFrame(null, true);\n\t\t}\n\n\t\tonBindingsApplied(rootElement: HTMLElement) {\n\t\t\t//Navigate to the root section. In the current implementation this can't happen\n\t\t\t//until bindings have been applied, so it's not part of the constructor.\n\t\t\tthis.navigateToRootSection();\n\n\t\t\t//Initialize the action menu.\n\t\t\tthis.$extraActionButton = jQuery('#ame-ac-extra-actions-trigger', rootElement);\n\t\t\tthis.$extraActionMenu = jQuery('#ame-ac-extra-actions-menu', rootElement).menu();\n\n\t\t\t//Update menu states.\n\t\t\tthis.importActionEnabled.notifySubscribers(this.importActionEnabled());\n\t\t\tthis.discardChangesActionEnabled.notifySubscribers(this.discardChangesActionEnabled());\n\n\t\t\t//Get the file picker.\n\t\t\tthis.$importFileInput = jQuery('#ame-ac-import-admin-theme-file', rootElement);\n\t\t}\n\n\t\tnavigateToRootSection() {\n\t\t\tthis.sectionNavigation.navigateToSection('ame-ac-section-structure-root');\n\t\t}\n\n\t\t// noinspection JSUnusedGlobalSymbols -- Used in at least one add-on.\n\t\t/**\n\t\t * Execute an RPC method in the preview frame.\n\t\t *\n\t\t * @param {string} methodName\n\t\t * @param {*} args\n\t\t */\n\t\texecuteRpcMethod(methodName: string, ...args: any): JQueryPromise {\n\t\t\tif (!this.previewConnection || !this.previewConnection.isConnected) {\n\t\t\t\treturn $.Deferred().reject('The preview frame is not connected.').promise();\n\t\t\t}\n\t\t\treturn this.previewConnection.execute(methodName, ...args);\n\t\t}\n\n\t\tconfirmExit() {\n\t\t\tif (this.isExitPromptNeeded()) {\n\t\t\t\tif (window.confirm(this.exitPromptMessage)) {\n\t\t\t\t\t//Remove the confirmation prompt that appears when leaving the page.\n\t\t\t\t\t//We don't want to show two prompts.\n\t\t\t\t\t$(window).off('beforeunload.ame-ac-exit-confirm');\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\n\t\tprivate isExitPromptNeeded(): boolean {\n\t\t\tconst changeset = this.settings.getCurrentChangeset();\n\n\t\t\t//No need to save anything if the changeset is empty.\n\t\t\tif (!changeset.isNonEmpty()) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tswitch (this.exitPromptMode) {\n\t\t\t\tcase ExitPromptMode.UnpublishedChanges:\n\t\t\t\t\treturn (\n\t\t\t\t\t\t!changeset.wasPublished()\n\t\t\t\t\t\t&& (changeset.status() !== 'trash') //Can't publish a trashed changeset.\n\t\t\t\t\t);\n\t\t\t\tcase ExitPromptMode.UnsavedChanges:\n\t\t\t\t\tconst unsavedChanges = this.settings.unsavedChanges;\n\t\t\t\t\treturn !_.isEmpty(unsavedChanges);\n\t\t\t\tdefault:\n\t\t\t\t\treturn false;\n\t\t\t}\n\n\t\t}\n\n\t\t// noinspection JSUnusedGlobalSymbols -- Used in the Knockout template.\n\t\ttoggleExtraActionMenu() {\n\t\t\tif (!this.$extraActionMenu) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.$extraActionMenu.toggle();\n\n\t\t\tif (this.$extraActionMenu.is(':visible')) {\n\t\t\t\t//Position the menu below the button.\n\t\t\t\tconst $button = $('#ame-ac-extra-actions-trigger');\n\t\t\t\tthis.$extraActionMenu.position({\n\t\t\t\t\tmy: 'right top',\n\t\t\t\t\tat: 'right bottom',\n\t\t\t\t\tof: $button,\n\t\t\t\t\tcollision: 'flipfit'\n\t\t\t\t});\n\n\t\t\t\t//Hide the menu when the user clicks outside the menu or the button.\n\t\t\t\t$(document).on('mousedown.ameAcExtraMenuHide', this.handleClickOutsideActionMenu.bind(this));\n\t\t\t} else {\n\t\t\t\t//Remove the click listener if it's still active.\n\t\t\t\t$(document).off('mousedown.ameAcExtraMenuHide');\n\t\t\t}\n\t\t}\n\n\t\thandleClickOutsideActionMenu(event: JQueryEventObject) {\n\t\t\tif (\n\t\t\t\t!this.$extraActionMenu\n\t\t\t\t|| !this.$extraActionMenu.is(':visible')\n\t\t\t\t|| !this.$extraActionButton\n\t\t\t) {\n\t\t\t\t//The event listener should not be active if the menu is not visible.\n\t\t\t\t$(document).off('mousedown.ameAcExtraMenuHide');\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst menuElement = this.$extraActionMenu.get(0);\n\t\t\tconst buttonElement = this.$extraActionButton.get(0);\n\t\t\tconst isClickOutsideMenu = !menuElement.contains(event.target);\n\t\t\tconst isClickOutsideButton = !buttonElement.contains(event.target);\n\n\t\t\tif (isClickOutsideMenu && isClickOutsideButton) {\n\t\t\t\tthis.hideExtraActionMenu();\n\t\t\t}\n\t\t}\n\n\t\tprivate hideExtraActionMenu() {\n\t\t\tif (!this.$extraActionMenu) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.$extraActionMenu.hide();\n\t\t\t//Stop listening for clicks outside the menu.\n\t\t\t$(document).off('mousedown.ameAcExtraMenuHide');\n\t\t}\n\n\t\tprivate openMetadataDialog(mode: MetadataDialogMode) {\n\t\t\tthis.downloadThemeDialog.mode(mode);\n\t\t\tthis.downloadThemeDialog.isOpen(true);\n\t\t\tthis.isImportReportVisible(false);\n\t\t\tthis.hideExtraActionMenu();\n\t\t}\n\n\t\tactionOpenDownloadDialog() {\n\t\t\tif (!this.downloadThemeActionEnabled()) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.openMetadataDialog(MetadataDialogMode.Download);\n\t\t}\n\n\t\t// noinspection JSUnusedGlobalSymbols -- Used in another plugin.\n\t\tactionEditOrDownloadTheme() {\n\t\t\tif (!this.downloadThemeActionEnabled()) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t//If the user hasn't confirmed the theme metadata yet, show the dialog.\n\t\t\tconst metadata = this.settings.adminThemeMetadata();\n\t\t\tif ((metadata === null) || !metadata.wasEverConfirmed) {\n\t\t\t\tthis.openMetadataDialog(MetadataDialogMode.Download);\n\t\t\t} else {\n\t\t\t\tthis.downloadThemeDialog.triggerDownloadWithErrorReporting(metadata);\n\t\t\t}\n\t\t}\n\n\t\t// noinspection JSUnusedGlobalSymbols -- Used in another plugin.\n\t\tactionOpenMetadataDialog() {\n\t\t\tthis.openMetadataDialog(MetadataDialogMode.Edit);\n\t\t}\n\n\t\tactionOpenImportDialog() {\n\t\t\tif (!this.importActionEnabled()) {\n\t\t\t\t//Can't import if there is no changeset or the changeset can't be edited.\n\t\t\t\t//The menu item should be disabled in this case, but we'll check anyway.\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tthis.hideExtraActionMenu();\n\n\t\t\t//Allow the default action to proceed, which will open the file picker.\n\t\t\treturn true;\n\t\t}\n\n\t\tactionDiscardChanges() {\n\t\t\tif (!this.discardChangesActionEnabled()) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.hideExtraActionMenu();\n\n\t\t\tif (this.settings.isExclusiveOperationInProgress()) {\n\t\t\t\talert('Another operation is in progress. Please wait for it to complete before discarding changes.');\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (!confirm('Are you sure you want to discard your unsaved changes?')) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.isImportReportVisible(false);\n\t\t\tthis.isDiscardingChanges(true);\n\n\t\t\tthis.settings.trashChangeset()\n\t\t\t\t.then(() => {\n\t\t\t\t\t//Reload the customizer with a new changeset.\n\t\t\t\t\tconst url = new URL(window.location.href);\n\t\t\t\t\tif (this.customBasePath) {\n\t\t\t\t\t\turl.pathname = this.customBasePath;\n\t\t\t\t\t\turl.search = '';\n\t\t\t\t\t} else {\n\t\t\t\t\t\t//To get the customizer's base URL, get the current URL\n\t\t\t\t\t\t//and remove all query parameters except \"page\".\n\t\t\t\t\t\tconst page = url.searchParams.get('page');\n\t\t\t\t\t\turl.search = '';\n\t\t\t\t\t\turl.searchParams.set('page', page || 'ame-admin-customizer');\n\t\t\t\t\t}\n\t\t\t\t\t//Notify the customizer that we definitely want a new changeset;\n\t\t\t\t\t//don't try to load a draft.\n\t\t\t\t\turl.searchParams.set('_ame-ac-new-changeset', '1');\n\n\t\t\t\t\t//Don't need the hash.\n\t\t\t\t\turl.hash = '';\n\n\t\t\t\t\t//Add a random parameter to force a reload.\n\t\t\t\t\turl.searchParams.set('_ame-ac-reload', Math.random().toString(36).substring(7));\n\n\t\t\t\t\t//Navigate to the new URL.\n\t\t\t\t\twindow.location.href = url.toString();\n\n\t\t\t\t\t//Note that the isDiscardingChanges flag is not reset here,\n\t\t\t\t\t//so the progress overlay will stay visible until the page reloads.\n\t\t\t\t})\n\t\t\t\t.fail((requestObject) => {\n\t\t\t\t\tlet message: string = requestObject.statusText || 'Unknown error.';\n\n\t\t\t\t\tif (typeof requestObject.responseJSON === 'object') {\n\t\t\t\t\t\tconst customMessage = _.get(requestObject.responseJSON, ['data', 'message']);\n\t\t\t\t\t\tif (typeof customMessage === 'string') {\n\t\t\t\t\t\t\tmessage = customMessage;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\talert('Error: ' + message);\n\t\t\t\t\tthis.isDiscardingChanges(false);\n\t\t\t\t});\n\t\t}\n\n\t\thandleImportFileSelection() {\n\t\t\tif (!this.$importFileInput) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst fileInput = this.$importFileInput.get(0) as HTMLInputElement;\n\t\t\tif (!fileInput || !fileInput.files || (fileInput.files.length < 1)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t//Get the first file. Normally, there should only be one.\n\t\t\tconst selectedFile = fileInput.files.item(0);\n\t\t\tif (!selectedFile) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t//Limit the file size.\n\t\t\tif (selectedFile.size > this.maxImportFileSize) {\n\t\t\t\talert(\n\t\t\t\t\t'Error: The selected file is too large. The maximum file size is '\n\t\t\t\t\t+ Math.round(this.maxImportFileSize / 1024) + ' KiB'\n\t\t\t\t);\n\t\t\t\t//Clear the file input.\n\t\t\t\tthis.$importFileInput.val('');\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.isImporting(true);\n\t\t\tthis.lastImportReport(null);\n\n\t\t\tJSZip.loadAsync(selectedFile).then(\n\t\t\t\t(zip) => {\n\t\t\t\t\tconst metadataFileRegex = /^([\\\\/]?[a-zA-Z0-9_-]+[\\\\/])metadata\\.json$/;\n\t\t\t\t\tconst foundMetadataFiles = zip.file(metadataFileRegex);\n\t\t\t\t\tif (!foundMetadataFiles || (foundMetadataFiles.length < 1)) {\n\t\t\t\t\t\tthrow new Error('The selected file is not an admin theme generated by this tool.');\n\t\t\t\t\t}\n\t\t\t\t\tconst metadataFile = foundMetadataFiles[0];\n\n\t\t\t\t\t//Get the directory name and separator from the metadata file path.\n\t\t\t\t\t//The prefix will usually be something like \"admin-theme-slug/\".\n\t\t\t\t\tconst matches = metadataFileRegex.exec(metadataFile.name);\n\t\t\t\t\tlet directoryPrefix: string;\n\t\t\t\t\tif (!matches || (matches.length < 2)) {\n\t\t\t\t\t\tthrow new Error('The directory structure of this ZIP file is not recognized.');\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdirectoryPrefix = matches[1];\n\t\t\t\t\t}\n\n\t\t\t\t\tconst settingsFile = zip.file(directoryPrefix + 'settings.json');\n\t\t\t\t\tif (!settingsFile) {\n\t\t\t\t\t\tthrow new Error('The selected ZIP file is missing a settings.json file.');\n\t\t\t\t\t}\n\n\t\t\t\t\t//Read both files.\n\t\t\t\t\treturn Promise.all([\n\t\t\t\t\t\tmetadataFile.async('string'),\n\t\t\t\t\t\tsettingsFile.async('string')\n\t\t\t\t\t]);\n\t\t\t\t},\n\t\t\t\t(error) => {\n\t\t\t\t\tconst errorMessage = error.message || error;\n\t\t\t\t\tthrow new Error('Error reading \"' + selectedFile.name + '\": ' + errorMessage);\n\t\t\t\t}\n\t\t\t).then((fileContents) => {\n\t\t\t\tif (!fileContents) {\n\t\t\t\t\tthrow new Error('Failed to read settings and metadata from the ZIP file.');\n\t\t\t\t}\n\n\t\t\t\tconst metadata = this.parseImportedAdminThemeFile(\n\t\t\t\t\tfileContents[0],\n\t\t\t\t\t'metadata.json',\n\t\t\t\t\tAdminThemeMetadata\n\t\t\t\t);\n\t\t\t\tconst settings = this.parseImportedAdminThemeFile(\n\t\t\t\t\tfileContents[1],\n\t\t\t\t\t'settings.json',\n\t\t\t\t\tAdminThemeSettings\n\t\t\t\t);\n\t\t\t\tconst report = new AdminThemeImportReport(selectedFile.name, metadata);\n\n\t\t\t\t//Import metadata.\n\t\t\t\tthis.downloadThemeDialog.meta(new ObservableThemeMetadata(metadata));\n\n\t\t\t\t//Import settings.\n\t\t\t\tfor (const [settingId, value] of Object.entries(settings)) {\n\t\t\t\t\treport.totalSettings++;\n\n\t\t\t\t\tconst foundSetting = this.settings.get(settingId);\n\t\t\t\t\tfoundSetting.forEach((setting) => {\n\t\t\t\t\t\tconst oldValue = setting.value();\n\t\t\t\t\t\tconst errors = setting.tryUpdate(value);\n\t\t\t\t\t\tif (errors && errors.length) {\n\t\t\t\t\t\t\treport.invalidSettings++;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treport.importedSettings++;\n\t\t\t\t\t\t\tif (oldValue != value) {\n\t\t\t\t\t\t\t\treport.differentImportedSettings++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\tif (foundSetting.isEmpty()) {\n\t\t\t\t\t\treport.skippedSettings++;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tthis.lastImportReport(report);\n\t\t\t\tthis.isImportReportVisible(true);\n\n\t\t\t}).catch((error) => {\n\t\t\t\t//Error handling: Show the error message to the user.\n\t\t\t\tlet errorMessage: string;\n\t\t\t\tif (error instanceof Error) {\n\t\t\t\t\terrorMessage = error.message;\n\t\t\t\t} else {\n\t\t\t\t\terrorMessage = String(error);\n\t\t\t\t}\n\t\t\t\talert('Error: ' + errorMessage);\n\t\t\t}).finally(() => {\n\t\t\t\tthis.isImporting(false);\n\t\t\t\tthis.$importFileInput?.val('');\n\t\t\t});\n\t\t}\n\n\t\tprivate parseImportedAdminThemeFile(\n\t\t\tcontent: string,\n\t\t\tname: string,\n\t\t\tschema: T\n\t\t): ReturnType {\n\t\t\ttry {\n\t\t\t\tconst parsedJson = JSON.parse(content);\n\t\t\t\treturn schema.parse(parsedJson);\n\t\t\t} catch (error) {\n\t\t\t\tlet errorMessage: string;\n\t\t\t\tif (error instanceof ZodError) {\n\t\t\t\t\t//Convert issues to a newline-separated string.\n\t\t\t\t\terrorMessage = error.issues.map((issue) => {\n\t\t\t\t\t\treturn issue.path.join('.') + ': ' + issue.message;\n\t\t\t\t\t}).join('\\n');\n\t\t\t\t} else if (error instanceof Error) {\n\t\t\t\t\terrorMessage = error.message;\n\t\t\t\t} else {\n\t\t\t\t\terrorMessage = String(error);\n\t\t\t\t}\n\t\t\t\t//Add the file name to the error message.\n\t\t\t\tthrow new Error('Error parsing ' + name + ':\\n' + errorMessage);\n\t\t\t}\n\t\t}\n\n\t\tdismissImportReport(): void {\n\t\t\tthis.isImportReportVisible(false);\n\t\t}\n\n\t\tlog(message: any): void {\n\t\t\tif (this.consoleLoggingEnabled && console && console.log) {\n\t\t\t\tconsole.log(message);\n\t\t\t}\n\t\t}\n\t}\n}\n\ndeclare global {\n\tinterface Window {\n\t\twsAdminCustomizer: AmeAdminCustomizer.AdminCustomizer;\n\t}\n}\n\njQuery(function () {\n\t//Give other scripts a chance to load before we start.\n\t//Some of them also use jQuery to run when the DOM is ready.\n\tsetTimeout(() => {\n\t\twindow.wsAdminCustomizer = new AmeAdminCustomizer.AdminCustomizer(wsAmeAdminCustomizerData);\n\t\tconst rootElement = document.getElementById('ame-ac-admin-customizer');\n\t\tif (rootElement === null) {\n\t\t\tthrow new Error('The root element for the admin customizer was not found.');\n\t\t}\n\n\t\tko.applyBindings(window.wsAdminCustomizer, rootElement);\n\n\t\t//Notify the customizer that bindings have been applied. It needs to do some\n\t\t//additional setup that can't be done until the DOM structure is ready.\n\t\tsetTimeout(() => {\n\t\t\twindow.wsAdminCustomizer.onBindingsApplied(rootElement);\n\t\t}, 5); //Components are rendered asynchronously.\n\t}, 20);\n});","'use strict';\r\nexport var AmeAdminCustomizerBase;\r\n(function (AmeAdminCustomizerBase) {\r\n class AdminCustomizerBase {\r\n constructor(scriptData) {\r\n this.allowedCommOrigins = scriptData.allowedCommOrigins;\r\n if (this.allowedCommOrigins.length === 0) {\r\n this.allowedCommOrigins = [window.location.origin];\r\n }\r\n this.allowedPreviewUrls = scriptData.allowedPreviewUrls;\r\n this.parsedAllowedUrls = this.allowedPreviewUrls.map(url => new URL(url));\r\n }\r\n isPreviewableUrl(url) {\r\n if (typeof url === 'string') {\r\n url = new URL(url);\r\n }\r\n if (typeof url.protocol === 'undefined') {\r\n return false;\r\n }\r\n //Only HTTP(S) links are previewable.\r\n if ((url.protocol !== 'http:') && (url.protocol !== 'https:')) {\r\n return false;\r\n }\r\n //Check against the list of allowed URLs.\r\n for (const allowedUrl of this.parsedAllowedUrls) {\r\n //Protocol and host must match. The path must start with the path\r\n //of the allowed URL (possibly without a trailing slash).\r\n if ((url.protocol === allowedUrl.protocol) && (url.host === allowedUrl.host)) {\r\n const allowedPath = allowedUrl.pathname.replace(/\\/$/, '');\r\n if (url.pathname.indexOf(allowedPath) === 0) {\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n }\r\n }\r\n AmeAdminCustomizerBase.AdminCustomizerBase = AdminCustomizerBase;\r\n})(AmeAdminCustomizerBase || (AmeAdminCustomizerBase = {}));\r\n//# sourceMappingURL=admin-customizer-base.js.map","import { AmeAcSection } from './ame-ac-section.js';\r\nimport { createComponentConfig } from '../../../pro-customizables/ko-components/control-base.js';\r\nclass AmeAcContentSection extends AmeAcSection {\r\n constructor(params, $element) {\r\n super(params, $element);\r\n if ((typeof params.parentSectionLevel === 'function') && ko.isObservable(params.parentSectionLevel)) {\r\n this.parentSectionLevel = params.parentSectionLevel;\r\n }\r\n else {\r\n this.parentSectionLevel = null;\r\n }\r\n this.contentSectionLevel = ko.pureComputed(() => {\r\n let parentLevel = 0;\r\n if (this.parentSectionLevel !== null) {\r\n parentLevel = this.parentSectionLevel();\r\n }\r\n return parentLevel + 1;\r\n });\r\n //Tell child sections about our section level.\r\n this.childComponents().forEach((child) => {\r\n if (child.name === 'ame-ac-content-section') {\r\n child.params.parentSectionLevel = this.contentSectionLevel;\r\n }\r\n });\r\n this.sectionLevelClass = ko.pureComputed(() => {\r\n const level = this.contentSectionLevel();\r\n return 'ame-ac-content-section-' + level;\r\n });\r\n }\r\n}\r\nexport default createComponentConfig(AmeAcContentSection, `\n\t
  • \n\t\t

    \t\n\t
  • \t\n\t\n\t\t\n\t\t\n`);\r\n//# sourceMappingURL=ame-ac-content-section.js.map","import { ComponentBindingOptions, createComponentConfig, KoContainerViewModel } from '../../../pro-customizables/ko-components/control-base.js';\r\nimport { AmeCustomizable } from '../../../pro-customizables/assets/customizable.js';\r\nvar ControlGroup = AmeCustomizable.ControlGroup;\r\nclass AmeAcControlGroup extends KoContainerViewModel {\r\n constructor(params, $element) {\r\n var _a, _b;\r\n super(params, $element);\r\n this.labelFor = (_b = ((_a = this.uiElement) === null || _a === void 0 ? void 0 : _a.labelFor)) !== null && _b !== void 0 ? _b : null;\r\n this.titleDisabled = (typeof params.titleDisabled !== 'undefined') ? (!!params.titleDisabled) : false;\r\n }\r\n getExpectedUiElementType() {\r\n return ControlGroup;\r\n }\r\n mapChildToComponentBinding(child) {\r\n if (child.component) {\r\n return ComponentBindingOptions.fromElement(child);\r\n }\r\n return super.mapChildToComponentBinding(child);\r\n }\r\n}\r\nexport default createComponentConfig(AmeAcControlGroup, `\n\t
  • \n\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t
      \n\t\t\t
    • \n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t
    • \t\t\n\t\t
    \n\t
  • \n`);\r\n//# sourceMappingURL=ame-ac-control-group.js.map","import { createComponentConfig, KoControlViewModel } from '../../../pro-customizables/ko-components/control-base.js';\r\nimport { AmeCustomizable } from '../../../pro-customizables/assets/customizable.js';\r\nvar Control = AmeCustomizable.Control;\r\nclass MissingComponentError extends Error {\r\n constructor(uiElement) {\r\n super(`The UI element \"${uiElement.label}\" [${uiElement.id}] is missing a component name.`);\r\n this.uiElement = uiElement;\r\n }\r\n}\r\nclass AmeAcControl extends KoControlViewModel {\r\n constructor(params, $element) {\r\n super(params, $element);\r\n //uiElement is required for this component.\r\n if (!this.uiElement) {\r\n throw new Error('The uiElement parameter is required for AmeAcControl');\r\n }\r\n this.wrapperLabelEnabled = (this.uiElement.label !== '') && (!this.uiElement.includesOwnLabel);\r\n this.labelForId = this.uiElement.labelTargetId;\r\n if (!this.uiElement.component) {\r\n throw new MissingComponentError(this.uiElement);\r\n }\r\n }\r\n getExpectedUiElementType() {\r\n return Control;\r\n }\r\n}\r\nexport default createComponentConfig(AmeAcControl, `\n\t
  • \n\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t
  • \n`);\r\n//# sourceMappingURL=ame-ac-control.js.map","import { createComponentConfig, KoContainerViewModel } from '../../../pro-customizables/ko-components/control-base.js';\r\nimport { AmeCustomizable } from '../../../pro-customizables/assets/customizable.js';\r\nvar Section = AmeCustomizable.Section;\r\nimport { AmeAcSection } from './ame-ac-section.js';\r\nclass AmeAcSectionLink extends KoContainerViewModel {\r\n constructor(params, $element) {\r\n super(params, $element);\r\n //uiElement is required for this component.\r\n if (!this.uiElement) {\r\n throw new Error('The uiElement parameter is required for AmeAcSectionLink');\r\n }\r\n this.targetElementId = AmeAcSection.getSectionElementId(this.uiElement);\r\n this.elementId = AmeAcSection.getSectionLinkElementId(this.uiElement);\r\n }\r\n getExpectedUiElementType() {\r\n return Section;\r\n }\r\n}\r\nexport default createComponentConfig(AmeAcSectionLink, `\n\t
  • \n\t\t

    \n\t
  • \n`);\r\n//# sourceMappingURL=ame-ac-section-link.js.map","import { ComponentBindingOptions, createComponentConfig, KoContainerViewModel } from '../../../pro-customizables/ko-components/control-base.js';\r\nimport { AmeCustomizable } from '../../../pro-customizables/assets/customizable.js';\r\nvar Section = AmeCustomizable.Section;\r\nvar Control = AmeCustomizable.Control;\r\nvar ControlGroup = AmeCustomizable.ControlGroup;\r\nexport class AmeAcSection extends KoContainerViewModel {\r\n constructor(params, $element) {\r\n super(params, $element);\r\n //Must have an uiElement.\r\n if (this.uiElement === null) {\r\n throw new Error('AmeAcSection must have an uiElement.');\r\n }\r\n this.elementId = AmeAcSection.getSectionElementId(this.uiElement);\r\n if ((typeof params.breadcrumbs !== 'undefined') && ko.isObservable(params.breadcrumbs)) {\r\n this.breadcrumbs = params.breadcrumbs;\r\n }\r\n else {\r\n this.breadcrumbs = null;\r\n }\r\n //To keep the header text alignment consistent when navigating between sections,\r\n //let's show something even if there are no breadcrumbs.\r\n const defaultEmptyBreadcrumbText = 'Admin Menu Editor Pro';\r\n //Let other modules change the default text.\r\n let filteredEmptyBreadcrumbText = null;\r\n if (wp && wp.hooks && wp.hooks.applyFilters) {\r\n filteredEmptyBreadcrumbText = wp.hooks.applyFilters('adminMenuEditor.ac.emptyBreadcrumbText', defaultEmptyBreadcrumbText);\r\n }\r\n const emptyBreadcrumbText = ((typeof filteredEmptyBreadcrumbText === 'string')\r\n ? filteredEmptyBreadcrumbText\r\n : defaultEmptyBreadcrumbText);\r\n this.breadcrumbText = ko.pureComputed(() => {\r\n if (this.breadcrumbs === null) {\r\n return emptyBreadcrumbText;\r\n }\r\n const breadcrumbs = this.breadcrumbs();\r\n if (breadcrumbs.length < 1) {\r\n return emptyBreadcrumbText;\r\n }\r\n let titles = breadcrumbs.map(crumb => crumb.title);\r\n //Show the root section differently, \"Admin Customizer\" is too long.\r\n //Not sure about what text to use here, could matching the Theme Customizer be confusing?\r\n //Alternatives: 🛠️🎨, use \\uFE0E to render the emoji without colors (only works for some).\r\n //Alternatives: ⋯ and …\r\n titles[0] = 'Customizing';\r\n //Due to space constraints, show only the last 2 breadcrumbs.\r\n if (titles.length > 2) {\r\n titles = titles.slice(titles.length - 2);\r\n }\r\n return titles.join(' \\u25B8 ');\r\n });\r\n }\r\n getExpectedUiElementType() {\r\n return Section;\r\n }\r\n mapChildToComponentBinding(child) {\r\n if (child instanceof Section) {\r\n if (child.preferredRole === 'content') {\r\n return ComponentBindingOptions.fromElement(child, 'ame-ac-content-section');\r\n }\r\n else {\r\n return ComponentBindingOptions.fromElement(child, 'ame-ac-section-link');\r\n }\r\n }\r\n else if (child instanceof ControlGroup) {\r\n return ComponentBindingOptions.fromElement(child, 'ame-ac-control-group');\r\n }\r\n else if ((child instanceof Control)\r\n && (['ame-ac-separator', 'ame-horizontal-separator'].indexOf(child.component) < 0)) {\r\n //Wrap each control in a control group if it's not already in one.\r\n //Separators are an exception because they're cosmetic and need different styling.\r\n const controlGroup = child.createControlGroup();\r\n return this.mapChildToComponentBinding(controlGroup);\r\n }\r\n else {\r\n return ComponentBindingOptions.fromElement(child);\r\n }\r\n }\r\n static getSectionElementId(section) {\r\n return AmeAcSection.generateSectionElementId(section, 'ame-ac-section-');\r\n }\r\n static getSectionLinkElementId(section) {\r\n return AmeAcSection.generateSectionElementId(section, 'ame-ac-slink-');\r\n }\r\n static generateSectionElementId(section, prefix) {\r\n if (section.id) {\r\n return prefix + section.id;\r\n }\r\n const slug = section.title.toLowerCase().replace(/[^a-z0-9]/g, '-');\r\n if (slug !== '') {\r\n return prefix + slug;\r\n }\r\n throw new Error('Cannot generate a section element ID because the section does not have an ID or a title.');\r\n }\r\n dispose() {\r\n super.dispose();\r\n this.childComponents.dispose();\r\n }\r\n}\r\nexport default createComponentConfig(AmeAcSection, `\n\t
      \n\t\t\n\t\t\n\t\t\t\n\t\t\n\t
    \n`);\r\n//# sourceMappingURL=ame-ac-section.js.map","import { createComponentConfig, KoStandaloneControl } from '../../../pro-customizables/ko-components/control-base.js';\r\nclass AmeAcSeparator extends KoStandaloneControl {\r\n constructor(params, $element) {\r\n super(params, $element);\r\n }\r\n}\r\nexport default createComponentConfig(AmeAcSeparator, `\n\t
  • \n`);\r\n//# sourceMappingURL=ame-ac-separator.js.map","import { createRendererComponentConfig, KoRendererViewModel } from '../../../pro-customizables/ko-components/control-base.js';\r\nimport { AmeCustomizable } from '../../../pro-customizables/assets/customizable.js';\r\nvar Section = AmeCustomizable.Section;\r\nclass AmeAcStructure extends KoRendererViewModel {\r\n constructor(params, $element) {\r\n var _a;\r\n super(params, $element);\r\n this.allNavigationSections = [];\r\n const rootSection = new Section({\r\n t: 'section',\r\n id: 'structure-root',\r\n title: (_a = this.structure.title) !== null && _a !== void 0 ? _a : 'Root',\r\n }, this.structure.children);\r\n //Recursively collect all navigable sections. Don't include content\r\n //sections: their parents will output them, not this component.\r\n function collectChildSections(section, accumulator = []) {\r\n if (section.preferredRole === 'navigation') {\r\n accumulator.push(section);\r\n }\r\n for (const child of section.children) {\r\n if (child instanceof Section) {\r\n collectChildSections(child, accumulator);\r\n }\r\n }\r\n return accumulator;\r\n }\r\n this.allNavigationSections = collectChildSections(rootSection);\r\n //Give the breadcrumb list to each section, if available.\r\n if (typeof params.breadcrumbs !== 'undefined') {\r\n for (const section of this.allNavigationSections) {\r\n section.componentParams.breadcrumbs = params.breadcrumbs;\r\n }\r\n }\r\n }\r\n}\r\nexport default createRendererComponentConfig(AmeAcStructure, `\n\t\n\t\t\n\t\n`);\r\n//# sourceMappingURL=ame-ac-structure.js.map","import { createComponentConfig, KoStandaloneControl } from '../../../pro-customizables/ko-components/control-base.js';\r\nclass AmeAcValidationErrors extends KoStandaloneControl {\r\n constructor(params, $element) {\r\n super(params, $element);\r\n if (typeof params.errors !== 'undefined') {\r\n if (Array.isArray(params.errors)) {\r\n this.errors = params.errors;\r\n }\r\n else if (ko.isObservable(params.errors)) {\r\n this.errors = params.errors;\r\n }\r\n else {\r\n throw new Error('The \"errors\" parameter must be an array or an observable array.');\r\n }\r\n }\r\n else {\r\n console.log('Params:', params);\r\n throw new Error('The \"errors\" parameter is required for the AmeAcValidationErrors component.');\r\n }\r\n }\r\n}\r\nexport default createComponentConfig(AmeAcValidationErrors, `\n\t
      \n\t\t
    • \n\t\t\t\n\t\t
    • \n\t
    \n`);\r\n//# sourceMappingURL=ame-ac-validation-errors.js.map","'use strict';\r\nimport { createControlComponentConfig, KoStandaloneControl } from '../control-base.js';\r\nimport { LazyPopupSliderAdapter } from '../lazy-popup-slider-adapter.js';\r\nconst allDimensionKeys = [\r\n 'top', 'bottom', 'left', 'right',\r\n 'topLeft', 'topRight', 'bottomLeft', 'bottomRight'\r\n];\r\nfunction isDimensionKey(key) {\r\n return allDimensionKeys.includes(key);\r\n}\r\nconst DefaultDimensionsInOrder = [\r\n ['top', 'Top'],\r\n ['bottom', 'Bottom'],\r\n ['left', 'Left'],\r\n ['right', 'Right'],\r\n];\r\nconst SideDimensions = ['top', 'bottom', 'left', 'right'];\r\nconst SymmetricDimensionMap = {\r\n 'vertical': ['top', 'bottom'],\r\n 'horizontal': ['left', 'right'],\r\n};\r\nfunction isSymmetricDimensionKey(key) {\r\n return SymmetricDimensionMap.hasOwnProperty(key);\r\n}\r\nlet nextId = 0;\r\nclass AmeBoxDimensions extends KoStandaloneControl {\r\n constructor(params, $element) {\r\n super(params, $element);\r\n this.inputIdPrefix = '_ame-box-dimensions-c-input-' + (nextId++);\r\n this.unitElementId = '_ame-box-dimensions-c-unit-' + (nextId++);\r\n this.wrapperAttributes = {};\r\n if ((typeof params.id === 'string') && (params.id !== '')) {\r\n this.wrapperAttributes['id'] = '_ame-box-dimensions-w-' + params.id;\r\n }\r\n if ((typeof params['dimensionNames'] !== 'undefined') && Array.isArray(params['dimensionNames'])) {\r\n this.dimensionsInOrder = params['dimensionNames'];\r\n }\r\n else {\r\n this.dimensionsInOrder = DefaultDimensionsInOrder;\r\n }\r\n //Make observable proxies for the individual dimension settings.\r\n const temp = {};\r\n for (const [dimensionKey, dimensionName] of this.dimensionsInOrder) {\r\n const setting = this.settings['value.' + dimensionKey];\r\n if (!setting || (typeof setting !== 'object')) {\r\n throw new Error(`Missing setting for the \"${dimensionName}\" side.`);\r\n }\r\n temp[dimensionKey] = ko.computed({\r\n read: () => {\r\n return setting.value();\r\n },\r\n write: (newValue) => {\r\n if (newValue === '') {\r\n newValue = null;\r\n }\r\n setting.value(newValue);\r\n },\r\n deferEvaluation: true,\r\n }).extend({ 'ameNumericInput': true });\r\n }\r\n this.dimensions = temp;\r\n //Similarly, make an observable for the unit setting.\r\n const unitSetting = this.settings['value.unit'];\r\n if (!unitSetting || (typeof unitSetting !== 'object')) {\r\n throw new Error('Missing setting for the unit.');\r\n }\r\n this.unitSetting = unitSetting;\r\n const defaultDropdownOptions = {\r\n options: [],\r\n optionsText: 'text',\r\n optionsValue: 'value'\r\n };\r\n if (params.unitDropdownOptions && (typeof params.unitDropdownOptions === 'object')) {\r\n const unitDropdownOptions = params.unitDropdownOptions;\r\n this.unitDropdownOptions = {\r\n options: unitDropdownOptions['options'] || defaultDropdownOptions.options,\r\n optionsText: unitDropdownOptions['optionsText'] || defaultDropdownOptions.optionsText,\r\n optionsValue: unitDropdownOptions['optionsValue'] || defaultDropdownOptions.optionsValue,\r\n };\r\n }\r\n else {\r\n this.unitDropdownOptions = defaultDropdownOptions;\r\n }\r\n this.isLinkActive = ko.observable(false);\r\n //Enable the link button by default if all dimensions are equal. Exception: null values.\r\n //Dimensions can have different defaults, so null doesn't necessarily mean that they\r\n //are actually equal.\r\n const firstKey = Object.keys(this.dimensions)[0];\r\n const firstValue = this.dimensions[firstKey]();\r\n if ((firstValue !== null) && (firstValue !== '')) {\r\n let areAllDimensionsEqual = true;\r\n for (const [dimensionKey] of this.dimensionsInOrder) {\r\n if (this.dimensions[dimensionKey]() !== firstValue) {\r\n areAllDimensionsEqual = false;\r\n break;\r\n }\r\n }\r\n this.isLinkActive(areAllDimensionsEqual);\r\n }\r\n //When \"link\" mode is enabled, keep all dimensions in sync.\r\n let isUpdatingAllDimensions = false; //Prevent infinite loops.\r\n const updateAllDimensions = (newValue) => {\r\n if (!isUpdatingAllDimensions && this.isLinkActive()) {\r\n isUpdatingAllDimensions = true;\r\n newValue = this.normalizeValue(newValue);\r\n for (const observable of Object.values(this.dimensions)) {\r\n observable(newValue);\r\n }\r\n isUpdatingAllDimensions = false;\r\n }\r\n };\r\n for (const dimensionKey of Object.keys(this.dimensions)) {\r\n this.dimensions[dimensionKey].subscribe(updateAllDimensions);\r\n }\r\n //In \"symmetric\" mode, the top/bottom and left/right dimensions are always equal.\r\n //The control will only show \"vertical\" and \"horizontal\" inputs.\r\n this.symmetricModeEnabled = ko.observable(this.decideSymmetricMode(params));\r\n //Create computed observables for the \"vertical\" and \"horizontal\" dimensions.\r\n this.symmetricValues = {};\r\n for (const name in SymmetricDimensionMap) {\r\n if (!isSymmetricDimensionKey(name) || !SymmetricDimensionMap.hasOwnProperty(name)) {\r\n continue;\r\n }\r\n const sides = SymmetricDimensionMap[name];\r\n this.symmetricValues[name] = ko.computed({\r\n read: () => {\r\n if (this.symmetricModeEnabled()) {\r\n return this.dimensions[sides[0]]();\r\n }\r\n else {\r\n return null;\r\n }\r\n },\r\n write: (newValue) => {\r\n if (this.symmetricModeEnabled()) {\r\n newValue = this.normalizeValue(newValue);\r\n for (const side of sides) {\r\n this.dimensions[side](newValue);\r\n }\r\n }\r\n },\r\n deferEvaluation: true\r\n }).extend({ 'ameNumericInput': true });\r\n }\r\n //The control displays a different set of inputs depending on the current mode.\r\n this.inputsInOrder = ko.pureComputed(() => {\r\n let result;\r\n if (this.symmetricModeEnabled()) {\r\n result = [\r\n ['vertical', 'Vertical'],\r\n ['horizontal', 'Horizontal'],\r\n ];\r\n }\r\n else {\r\n result = this.dimensionsInOrder;\r\n }\r\n return result;\r\n });\r\n let sliderOptions = {\r\n 'positionParentSelector': '.ame-single-box-dimension',\r\n 'verticalOffset': -2,\r\n };\r\n if (typeof params.popupSliderWithin === 'string') {\r\n sliderOptions.positionWithinClosest = params.popupSliderWithin;\r\n }\r\n this.sliderAdapter = new LazyPopupSliderAdapter(params.sliderRanges ? params.sliderRanges : null, '.ame-box-dimensions-control', 'input.ame-box-dimensions-input', sliderOptions);\r\n }\r\n get classes() {\r\n return ['ame-box-dimensions-control', ...super.classes];\r\n }\r\n //noinspection JSUnusedGlobalSymbols -- Used in the template.\r\n /**\r\n * Get an observable for a specific dimension or a pair of dimensions.\r\n *\r\n * Unfortunately, Knockout doesn't seem to support nested indexed accessors\r\n * like \"dimensions[$data[0]]\", so we have to use a method instead.\r\n */\r\n getInputObservable(key) {\r\n if (this.symmetricModeEnabled() && isSymmetricDimensionKey(key)) {\r\n return this.symmetricValues[key];\r\n }\r\n if (isDimensionKey(key)) {\r\n return this.dimensions[key];\r\n }\r\n throw new Error('Invalid input key for the current mode: ' + key);\r\n }\r\n getInputIdFor(key) {\r\n return this.inputIdPrefix + '-' + key;\r\n }\r\n // noinspection JSUnusedGlobalSymbols -- Used in the template.\r\n getInputAttributes(key) {\r\n return {\r\n id: this.getInputIdFor(key),\r\n 'data-unit-element-id': this.unitElementId,\r\n 'data-ame-box-dimension': key,\r\n };\r\n }\r\n // noinspection JSUnusedGlobalSymbols -- Used in the template.\r\n getSettingFor(key) {\r\n const settingName = 'value.' + key;\r\n if (settingName in this.settings) {\r\n return this.settings[settingName];\r\n }\r\n if (this.symmetricModeEnabled() && isSymmetricDimensionKey(key)) {\r\n for (const dimension of SymmetricDimensionMap[key]) {\r\n //Since both symmetric dimensions are always equal, we can use\r\n //either of the two settings.\r\n const settingName = 'value.' + dimension;\r\n if (settingName in this.settings) {\r\n return this.settings[dimension];\r\n }\r\n }\r\n }\r\n return null;\r\n }\r\n // noinspection JSUnusedGlobalSymbols -- Actually used in the template.\r\n toggleLink() {\r\n this.isLinkActive(!this.isLinkActive());\r\n //When enabling \"link\" mode, fill all inputs with the same value.\r\n //Use the first non-empty value.\r\n if (this.isLinkActive()) {\r\n let firstValue = null;\r\n for (const dimensionObservable of Object.values(this.dimensions)) {\r\n const value = dimensionObservable();\r\n if ((value !== null) && (value !== '')) {\r\n firstValue = value;\r\n break;\r\n }\r\n }\r\n if (firstValue !== null) {\r\n firstValue = this.normalizeValue(firstValue);\r\n for (const dimensionObservable of Object.values(this.dimensions)) {\r\n dimensionObservable(firstValue);\r\n }\r\n }\r\n }\r\n }\r\n normalizeValue(value) {\r\n if (value === null) {\r\n return null;\r\n }\r\n //Convert strings to numbers, and invalid strings to null.\r\n if (typeof value === 'string') {\r\n value = parseFloat(value);\r\n if (isNaN(value)) {\r\n return null;\r\n }\r\n }\r\n return value;\r\n }\r\n /**\r\n * Determine whether the control should be in \"symmetric\" mode.\r\n */\r\n decideSymmetricMode(componentParams) {\r\n //This mode is off by default and can be enabled by setting the \"symmetricMode\" parameter.\r\n let enableMode = (typeof componentParams['symmetricMode'] !== 'undefined')\r\n ? (!!componentParams['symmetricMode'])\r\n : false;\r\n if (!enableMode) {\r\n return false;\r\n }\r\n //Symmetric mode can't be enabled if the control doesn't have all side dimensions.\r\n const hasAllSideDimensions = SideDimensions.every((key) => {\r\n return (key in this.dimensions);\r\n });\r\n if (!hasAllSideDimensions) {\r\n return false;\r\n }\r\n //It also can only be enabled if top/bottom and left/right dimensions are equal.\r\n return ((this.dimensions['top']() === this.dimensions['bottom']())\r\n && (this.dimensions['left']() === this.dimensions['right']()));\r\n }\r\n}\r\nexport default createControlComponentConfig(AmeBoxDimensions, `\n\t
    \n\t\t\n\t\t\t
    \n\t\t\t\t\t\t\t\t\n\t\t\t\t\n\t\t\t
    \n\t\t\n\t\t\n\t\t\n\t
    \n`);\r\n//# sourceMappingURL=ame-box-dimensions.js.map","import { KoStandaloneControl } from '../control-base.js';\r\nexport class ChoiceControlOption {\r\n constructor(data) {\r\n this.value = data.value;\r\n this.label = data.label;\r\n this.description = data.description || '';\r\n this.enabled = (typeof data.enabled === 'undefined') || data.enabled;\r\n this.icon = data.icon || '';\r\n }\r\n}\r\nexport class AmeChoiceControl extends KoStandaloneControl {\r\n constructor(params, $element) {\r\n super(params, $element);\r\n this.options = ko.observableArray([]);\r\n if ((typeof params['options'] !== 'undefined') && Array.isArray(params.options)) {\r\n this.options(params.options.map((optionData) => new ChoiceControlOption(optionData)));\r\n }\r\n }\r\n}\r\n//# sourceMappingURL=ame-choice-control.js.map","'use strict';\r\nimport { createControlComponentConfig, KoStandaloneControl } from '../control-base.js';\r\n/**\r\n * Code editor control with syntax highlighting.\r\n *\r\n * This control uses the custom Knockout binding \"ameCodeMirror\" to do the heavy\r\n * lifting. The binding is defined in ko-extensions.ts.\r\n *\r\n * Note: The user can disable syntax highlighting. In that case, this control\r\n * should behave like a normal textarea.\r\n */\r\nclass AmeCodeEditor extends KoStandaloneControl {\r\n constructor(params, $element) {\r\n super(params, $element);\r\n if ((typeof params.editorSettings === 'object') && (params.editorSettings !== null)) {\r\n this.editorSettings = params.editorSettings;\r\n }\r\n else {\r\n this.editorSettings = false;\r\n }\r\n }\r\n}\r\nexport default createControlComponentConfig(AmeCodeEditor, `\n\t
    \n\t\t\n\t
    \n\t\n\t\t\n\t\n`);\r\n//# sourceMappingURL=ame-code-editor.js.map","import { createControlComponentConfig, KoStandaloneControl } from '../control-base.js';\r\n/**\r\n * A wrapper for the WordPress color picker.\r\n *\r\n * Note that the custom 'ameColorPicker' binding must be available when this component\r\n * is used. You must enqueue the 'ame-ko-extensions' script for this to work.\r\n */\r\nclass AmeColorPicker extends KoStandaloneControl {\r\n constructor(params, $element) {\r\n super(params, $element);\r\n }\r\n koDescendantsComplete(node) {\r\n //Make the color picker input visible. Its visibility is set to hidden by default.\r\n if (node.nodeType === Node.COMMENT_NODE) {\r\n //The component was bound to a comment node. The real element\r\n //should be the next non-comment sibling.\r\n let nextElement;\r\n do {\r\n nextElement = node.nextElementSibling;\r\n } while (nextElement && (nextElement.nodeType === Node.COMMENT_NODE));\r\n if (!nextElement) {\r\n return; //This should never happen.\r\n }\r\n node = nextElement;\r\n }\r\n if (!node || (node.nodeType !== Node.ELEMENT_NODE)) {\r\n return; //This should never happen.\r\n }\r\n const $picker = jQuery(node);\r\n //This should be a .wp-picker-container element that contains an input.\r\n const $input = $picker.find('input.ame-color-picker');\r\n if ($input.length > 0) {\r\n $input.css('visibility', 'visible');\r\n }\r\n }\r\n get classes() {\r\n return ['ame-color-picker', 'ame-color-picker-component', ...super.classes];\r\n }\r\n}\r\nexport default createControlComponentConfig(AmeColorPicker, `\n\t\n`);\r\n//# sourceMappingURL=ame-color-picker.js.map","/*\r\n * This utility module imports all the base Knockout components and exports\r\n * a function that can be used to register the components with Knockout.\r\n */\r\nimport ameBoxDimensions from './ame-box-dimensions/ame-box-dimensions.js';\r\nimport ameColorPicker from './ame-color-picker/ame-color-picker.js';\r\nimport ameFontStylePicker from './ame-font-style-picker/ame-font-style-picker.js';\r\nimport ameImageSelector from './ame-image-selector/ame-image-selector.js';\r\nimport ameNumberInput from './ame-number-input/ame-number-input.js';\r\nimport ameNestedDescription from './ame-nested-description/ame-nested-description.js';\r\nimport ameRadioButtonBar from './ame-radio-button-bar/ame-radio-button-bar.js';\r\nimport ameRadioGroup from './ame-radio-group/ame-radio-group.js';\r\nimport ameSelectBox from './ame-select-box/ame-select-box.js';\r\nimport ameSiblingDescription from './ame-sibling-description/ame-sibling-description.js';\r\nimport ameStaticHtml from './ame-static-html/ame-static-html.js';\r\nimport ameTextInput from './ame-text-input/ame-text-input.js';\r\nimport ameToggleCheckbox from './ame-toggle-checkbox/ame-toggle-checkbox.js';\r\nimport ameUnitDropdown from './ame-unit-dropdown/ame-unit-dropdown.js';\r\nimport ameWpEditor from './ame-wp-editor/ame-wp-editor.js';\r\nimport ameHorizontalSeparator from './ame-horizontal-separator/ame-horizontal-separator.js';\r\nimport ameCodeEditor from './ame-code-editor/ame-code-editor.js';\r\nlet componentsRegistered = false;\r\n/**\r\n * Register the base Knockout components that are part of AME.\r\n *\r\n * It's safe to call this function multiple times. It will only register the components once.\r\n */\r\nexport function registerBaseComponents() {\r\n if (componentsRegistered) {\r\n return;\r\n }\r\n ko.components.register('ame-box-dimensions', ameBoxDimensions);\r\n ko.components.register('ame-color-picker', ameColorPicker);\r\n ko.components.register('ame-font-style-picker', ameFontStylePicker);\r\n ko.components.register('ame-image-selector', ameImageSelector);\r\n ko.components.register('ame-number-input', ameNumberInput);\r\n ko.components.register('ame-nested-description', ameNestedDescription);\r\n ko.components.register('ame-radio-button-bar', ameRadioButtonBar);\r\n ko.components.register('ame-radio-group', ameRadioGroup);\r\n ko.components.register('ame-select-box', ameSelectBox);\r\n ko.components.register('ame-sibling-description', ameSiblingDescription);\r\n ko.components.register('ame-static-html', ameStaticHtml);\r\n ko.components.register('ame-text-input', ameTextInput);\r\n ko.components.register('ame-toggle-checkbox', ameToggleCheckbox);\r\n ko.components.register('ame-unit-dropdown', ameUnitDropdown);\r\n ko.components.register('ame-wp-editor', ameWpEditor);\r\n ko.components.register('ame-horizontal-separator', ameHorizontalSeparator);\r\n ko.components.register('ame-code-editor', ameCodeEditor);\r\n componentsRegistered = true;\r\n}\r\n//# sourceMappingURL=ame-components.js.map","import { KoComponentViewModel } from '../control-base.js';\r\n/**\r\n * Base class for description components.\r\n */\r\nexport class AmeDescriptionComponent extends KoComponentViewModel {\r\n constructor(params, $element) {\r\n super(params, $element);\r\n this.description = params.description || '';\r\n }\r\n}\r\n//# sourceMappingURL=ame-description.js.map","import { createControlComponentConfig, KoStandaloneControl } from '../control-base.js';\r\n//Note: Font style picker CSS is already included in the main 'controls.scss' file\r\n//and won't be duplicated or included here. Instead, load that stylesheet when\r\n//using any control components.\r\n/**\r\n * Font style options that can be selected in the picker component.\r\n *\r\n * Regrettably, these are duplicated from the PHP version of the control.\r\n * Once browsers support importing JSON files, we can move this to a separate\r\n * file and use that file in both places.\r\n */\r\nconst fontStyleOptions = {\r\n \"font-style\": [\r\n {\r\n \"value\": null,\r\n \"text\": \"Default font style\",\r\n \"label\": \"—\"\r\n },\r\n {\r\n \"value\": \"italic\",\r\n \"text\": \"Italic\",\r\n \"label\": \"\"\r\n }\r\n ],\r\n \"text-transform\": [\r\n {\r\n \"value\": null,\r\n \"text\": \"Default letter case\",\r\n \"label\": \"—\"\r\n },\r\n {\r\n \"value\": \"uppercase\",\r\n \"text\": \"Uppercase\",\r\n \"label\": {\r\n 'text-transform': 'uppercase'\r\n }\r\n },\r\n {\r\n \"value\": \"lowercase\",\r\n \"text\": \"Lowercase\",\r\n \"label\": {\r\n 'text-transform': 'lowercase'\r\n }\r\n },\r\n {\r\n \"value\": \"capitalize\",\r\n \"text\": \"Capitalize each word\",\r\n \"label\": {\r\n 'text-transform': 'capitalize'\r\n }\r\n }\r\n ],\r\n \"font-variant\": [\r\n {\r\n \"value\": null,\r\n \"text\": \"Default font variant\",\r\n \"label\": \"—\"\r\n },\r\n {\r\n \"value\": \"small-caps\",\r\n \"text\": \"Small caps\",\r\n \"label\": {\r\n 'font-variant': 'small-caps'\r\n }\r\n }\r\n ],\r\n \"text-decoration\": [\r\n {\r\n \"value\": null,\r\n \"text\": \"Default text decoration\",\r\n \"label\": \"—\"\r\n },\r\n {\r\n \"value\": \"underline\",\r\n \"text\": \"Underline\",\r\n \"label\": \"\"\r\n },\r\n {\r\n \"value\": \"line-through\",\r\n \"text\": \"Strikethrough\",\r\n \"label\": \"\"\r\n }\r\n ]\r\n};\r\n//Generate label HTML for options that don't have it yet.\r\nfunction makeFontSample(styles) {\r\n let styleString = '';\r\n for (const [property, value] of Object.entries(styles)) {\r\n styleString += `${property}: ${value};`;\r\n }\r\n return `ab`;\r\n}\r\nlet flattenedOptions = [];\r\nfor (const [property, options] of Object.entries(fontStyleOptions)) {\r\n options.forEach((option) => {\r\n //Skip null values. They're used to indicate the default option,\r\n //and we don't need those in the Knockout version of this control.\r\n if (option.value === null) {\r\n return;\r\n }\r\n let labelString;\r\n if (typeof option.label === 'object') {\r\n labelString = makeFontSample(option.label);\r\n }\r\n else {\r\n labelString = option.label;\r\n }\r\n flattenedOptions.push({\r\n 'value': option.value,\r\n 'text': option.text || '',\r\n 'property': property,\r\n 'label': labelString\r\n });\r\n });\r\n}\r\nclass AmeFontStylePicker extends KoStandaloneControl {\r\n constructor(params, $element) {\r\n super(params, $element);\r\n this.options = flattenedOptions;\r\n }\r\n get classes() {\r\n return ['ame-font-style-control', ...super.classes];\r\n }\r\n // noinspection JSUnusedGlobalSymbols -- Used in the template, below.\r\n isOptionSelected(property, value) {\r\n if (this.settings.hasOwnProperty(property)) {\r\n return (this.settings[property].value() === value);\r\n }\r\n return false;\r\n }\r\n // noinspection JSUnusedGlobalSymbols -- Used in the template.\r\n toggleOption(property, value) {\r\n if (!this.settings.hasOwnProperty(property)) {\r\n return;\r\n }\r\n const targetSetting = this.settings[property];\r\n if (targetSetting.value() === value) {\r\n //When the user clicks on the currently selected option, reset it to the default.\r\n targetSetting.tryUpdate(null);\r\n }\r\n else {\r\n //Otherwise, set the new value.\r\n targetSetting.tryUpdate(value);\r\n }\r\n }\r\n}\r\n//Note: This weird spacing in the template string is intentional. It's used to\r\n//remove whitespace nodes from the DOM, which would otherwise slightly change\r\n//the layout of the control.\r\nexport default createControlComponentConfig(AmeFontStylePicker, `\n\t
    \n\t\t\n\t
    \n`);\r\n//# sourceMappingURL=ame-font-style-picker.js.map","import { createControlComponentConfig, KoStandaloneControl } from '../control-base.js';\r\nclass AmeHorizontalSeparator extends KoStandaloneControl {\r\n constructor(params, $element) {\r\n super(params, $element);\r\n }\r\n}\r\nexport default createControlComponentConfig(AmeHorizontalSeparator, `\n\t
    \n`);\r\n//# sourceMappingURL=ame-horizontal-separator.js.map","'use strict';\r\nimport { createControlComponentConfig, KoStandaloneControl } from '../control-base.js';\r\n/**\r\n * Image selector control.\r\n *\r\n * This implementation hands off the work to the existing AmeImageSelectorApi.ImageSelector\r\n * class to avoid duplicating the effort. That class is not a module because it is also\r\n * used for the more progressive-enhancement-y PHP-rendered controls, so we can't import it.\r\n */\r\nclass AmeImageSelector extends KoStandaloneControl {\r\n constructor(params, $element) {\r\n super(params, $element);\r\n this.selectorInstance = null;\r\n //Verify that our dependencies are available.\r\n if (typeof AmeImageSelectorApi === 'undefined') {\r\n throw new Error('AmeImageSelectorApi is not available. Remember to enqueue \"ame-image-selector-control-v2\".');\r\n }\r\n if (typeof AmeImageSelectorApi.ImageSelector === 'undefined') {\r\n throw new Error('AmeImageSelectorApi.ImageSelector is not available. This is probably a bug.');\r\n }\r\n this.externalUrlsAllowed = !!params.externalUrlsAllowed;\r\n this.canSelectMedia = !!params.canSelectMedia;\r\n this.imageProxy = this.settings.value.value;\r\n }\r\n get classes() {\r\n return [\r\n 'ame-image-selector-v2',\r\n ...super.classes,\r\n ];\r\n }\r\n koDescendantsComplete() {\r\n const $container = this.findChild('.ame-image-selector-v2');\r\n if ($container.length === 0) {\r\n return;\r\n }\r\n this.selectorInstance = new AmeImageSelectorApi.ImageSelector($container, {\r\n externalUrlsAllowed: this.externalUrlsAllowed,\r\n canSelectMedia: this.canSelectMedia,\r\n }, this.imageProxy());\r\n }\r\n}\r\nexport default createControlComponentConfig(AmeImageSelector, `\n\t
    \n\t\t\n\t
    \n`);\r\n//# sourceMappingURL=ame-image-selector.js.map","import { createComponentConfig } from '../control-base.js';\r\nimport { AmeDescriptionComponent } from '../ame-description/ame-description.js';\r\n/**\r\n * A simple component that displays the description of a UI element.\r\n *\r\n * Like AmeSiblingDescription, but intended to be rendered inside\r\n * the parent control or container, not as a sibling.\r\n */\r\nclass AmeNestedDescription extends AmeDescriptionComponent {\r\n}\r\nexport default createComponentConfig(AmeNestedDescription, `\n\t
    \t\n`);\r\n//# sourceMappingURL=ame-nested-description.js.map","/// \r\nimport { createControlComponentConfig, KoDependentControl } from '../control-base.js';\r\nimport { AmeCustomizable } from '../../assets/customizable.js';\r\nvar Control = AmeCustomizable.Control;\r\nexport class AmeNumberInput extends KoDependentControl {\r\n constructor(params, $element) {\r\n super(params, $element);\r\n this.sliderRanges = null;\r\n this.slider = null;\r\n this.numericValue = this.valueProxy.extend({ 'ameNumericInput': true });\r\n this.unitText = params.unitText || '';\r\n this.hasUnitDropdown = params.hasUnitDropdown || false;\r\n this.unitElementId = params.unitElementId || '';\r\n if (this.hasUnitDropdown && params.unitDropdownOptions) {\r\n this.unitDropdownOptions = {\r\n options: params.unitDropdownOptions.options || [],\r\n optionsText: params.unitDropdownOptions.optionsText || 'text',\r\n optionsValue: params.unitDropdownOptions.optionsValue || 'value'\r\n };\r\n }\r\n else {\r\n this.unitDropdownOptions = null;\r\n }\r\n this.min = params.min || null;\r\n this.max = params.max || null;\r\n this.step = params.step || null;\r\n if (params.sliderRanges) {\r\n this.sliderRanges = params.sliderRanges;\r\n }\r\n this.popupSliderWithin = (typeof params.popupSliderWithin === 'string') ? params.popupSliderWithin : null;\r\n this.inputClasses.unshift('ame-input-with-popup-slider', 'ame-number-input');\r\n }\r\n get classes() {\r\n const classes = ['ame-number-input-control'];\r\n if (this.sliderRanges !== null) {\r\n classes.push('ame-container-with-popup-slider');\r\n }\r\n classes.push(...super.classes);\r\n return classes;\r\n }\r\n get inputClasses() {\r\n const classes = ['ame-input-with-popup-slider', 'ame-number-input'];\r\n classes.push(...super.inputClasses);\r\n return classes;\r\n }\r\n getAdditionalInputAttributes() {\r\n let attributes = super.getAdditionalInputAttributes();\r\n if (this.min !== null) {\r\n attributes['min'] = this.min.toString();\r\n }\r\n if (this.max !== null) {\r\n attributes['max'] = this.max.toString();\r\n }\r\n if (this.step !== null) {\r\n attributes['step'] = this.step.toString();\r\n }\r\n if (this.unitElementId) {\r\n attributes['data-unit-element-id'] = this.unitElementId;\r\n }\r\n return attributes;\r\n }\r\n // noinspection JSUnusedGlobalSymbols -- Used in the Knockout template in this same file.\r\n showPopupSlider($data, event) {\r\n if ((this.sliderRanges === null) || (typeof AmePopupSlider === 'undefined')) {\r\n return;\r\n }\r\n //Some sanity checks.\r\n if (!event.target) {\r\n return;\r\n }\r\n const $input = jQuery(event.target);\r\n if ($input.is(':disabled') || !$input.is('input')) {\r\n return;\r\n }\r\n const $container = $input.closest('.ame-container-with-popup-slider');\r\n if ($container.length < 1) {\r\n return;\r\n }\r\n //Initialize the slider if it's not already initialized.\r\n if (!this.slider) {\r\n let sliderOptions = {};\r\n if (this.popupSliderWithin) {\r\n sliderOptions.positionWithinClosest = this.popupSliderWithin;\r\n }\r\n //In HTML, we would pass the range data as a \"data-slider-ranges\" attribute,\r\n //but here we can just set the data directly.\r\n $input.data('slider-ranges', this.sliderRanges);\r\n this.slider = AmePopupSlider.createSlider($container, sliderOptions);\r\n }\r\n this.slider.showForInput($input);\r\n }\r\n getExpectedUiElementType() {\r\n return Control;\r\n }\r\n}\r\nexport default createControlComponentConfig(AmeNumberInput, `\n\t
    \n\t\t
    \n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t
    \n\t
    \t\n`);\r\n//# sourceMappingURL=ame-number-input.js.map","'use strict';\r\nimport { createControlComponentConfig } from '../control-base.js';\r\nimport { AmeChoiceControl } from '../ame-choice-control/ame-choice-control.js';\r\nclass AmeRadioButtonBar extends AmeChoiceControl {\r\n constructor(params, $element) {\r\n super(params, $element);\r\n }\r\n get classes() {\r\n return ['ame-radio-button-bar-control', ...super.classes];\r\n }\r\n}\r\nexport default createControlComponentConfig(AmeRadioButtonBar, `\n\t
    \n\t\t\n\t\t\n\t\t\n\t
    \n`);\r\n//# sourceMappingURL=ame-radio-button-bar.js.map","'use strict';\r\nimport { createControlComponentConfig } from '../control-base.js';\r\nimport { AmeChoiceControl } from '../ame-choice-control/ame-choice-control.js';\r\n// noinspection JSUnusedGlobalSymbols -- Enum keys like \"Paragraph\" are used when serializing wrapStyle in PHP.\r\nvar WrapStyle;\r\n(function (WrapStyle) {\r\n WrapStyle[\"LineBreak\"] = \"br\";\r\n WrapStyle[\"Paragraph\"] = \"p\";\r\n WrapStyle[\"None\"] = \"\";\r\n})(WrapStyle || (WrapStyle = {}));\r\nfunction isWrapStyle(value) {\r\n if (typeof value !== 'string') {\r\n return false;\r\n }\r\n return (typeof WrapStyle[value] === 'string');\r\n}\r\nlet nextRadioGroupId = 1;\r\nclass AmeRadioGroup extends AmeChoiceControl {\r\n constructor(params, $element) {\r\n super(params, $element);\r\n this.wrapStyle = WrapStyle.None;\r\n this.childByValue = new Map();\r\n if ((typeof params['valueChildIndexes'] === 'object') && Array.isArray(params.valueChildIndexes)) {\r\n const children = ko.unwrap(this.inputChildren);\r\n for (const [value, index] of params.valueChildIndexes) {\r\n if (!children || !children[index]) {\r\n throw new Error('The \"' + this.label + '\" radio group has no children, but its valueChildIndexes'\r\n + ' requires child #' + index + ' to be associated with value \"' + value + '\".');\r\n }\r\n this.childByValue.set(value, children[index]);\r\n }\r\n }\r\n this.wrapStyle = isWrapStyle(params.wrapStyle) ? WrapStyle[params.wrapStyle] : WrapStyle.None;\r\n if (this.childByValue.size > 0) {\r\n this.wrapStyle = WrapStyle.None;\r\n }\r\n this.radioInputPrefix = (typeof params.radioInputPrefix === 'string')\r\n ? params.radioInputPrefix\r\n : ('ame-rg-input-' + nextRadioGroupId++ + '-');\r\n }\r\n get classes() {\r\n const result = ['ame-radio-group-component', ...super.classes];\r\n if (this.childByValue.size > 0) {\r\n result.push('ame-rg-has-nested-controls');\r\n }\r\n return result;\r\n }\r\n // noinspection JSUnusedGlobalSymbols -- Used in the template below.\r\n getChoiceChild(value) {\r\n return this.childByValue.get(value) || null;\r\n }\r\n // noinspection JSUnusedGlobalSymbols -- Used in the template.\r\n /**\r\n * Get the ID attribute for a radio input.\r\n *\r\n * Note: This must match the algorithm used by the PHP version of this control\r\n * to work correctly with the BorderStyleSelector control that adds style samples\r\n * to each choice and uses the ID to link them to the inputs (so that clicking\r\n * the sample selects the option).\r\n */\r\n getRadioInputId(choice) {\r\n let sanitizedValue = (choice.value !== null) ? choice.value.toString() : '';\r\n //Emulate the sanitize_key() function from WordPress core.\r\n sanitizedValue = sanitizedValue.toLowerCase().replace(/[^a-z0-9_\\-]/gi, '');\r\n return this.radioInputPrefix + sanitizedValue;\r\n }\r\n}\r\nconst choiceTemplate = `\n\t\n`;\r\nexport default createControlComponentConfig(AmeRadioGroup, `\n\t
    \n\t\t\n\t\t\t\n\t\t\t\t${choiceTemplate}
    \n\t\t\t\n\t\t\t\n\t\t\t\t

    ${choiceTemplate}

    \n\t\t\t\n\t\t\t\n\t\t\t\t${choiceTemplate}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t
    \n`);\r\n//# sourceMappingURL=ame-radio-group.js.map","import { AmeChoiceControl } from '../ame-choice-control/ame-choice-control.js';\r\nimport { createControlComponentConfig } from '../control-base.js';\r\nclass AmeSelectBox extends AmeChoiceControl {\r\n constructor(params, $element) {\r\n super(params, $element);\r\n }\r\n get classes() {\r\n return ['ame-select-box-control', ...super.classes];\r\n }\r\n}\r\nexport default createControlComponentConfig(AmeSelectBox, `\n\t\n\t\n\t\t\n\t\t\n`);\r\n//# sourceMappingURL=ame-select-box.js.map","import { createComponentConfig } from '../control-base.js';\r\nimport { AmeDescriptionComponent } from '../ame-description/ame-description.js';\r\n/**\r\n * A simple component that displays the description of a UI element.\r\n *\r\n * This should be rendered as a sibling of the UI element's component,\r\n * typically immediately after it.\r\n *\r\n * Caution: HTML is allowed in the description.\r\n */\r\nclass AmeSiblingDescription extends AmeDescriptionComponent {\r\n}\r\nexport default createComponentConfig(AmeSiblingDescription, `\n\t

    \t\n`);\r\n//# sourceMappingURL=ame-sibling-description.js.map","import { createControlComponentConfig, KoStandaloneControl } from '../control-base.js';\r\nclass AmeStaticHtml extends KoStandaloneControl {\r\n constructor(params, $element) {\r\n super(params, $element);\r\n this.containerType = 'span';\r\n this.htmlContent = (typeof params.html === 'string') ? params.html : '';\r\n if (typeof params.container === 'string') {\r\n this.containerType = params.container;\r\n }\r\n }\r\n}\r\n//Note: The HTML content has to be in a container element because Knockout doesn't allow\r\n//using the \"html\" binding with virtual elements.\r\nexport default createControlComponentConfig(AmeStaticHtml, `\n\t\n\t\t
    \n\t\n\t\n\t\t\n\t\n`);\r\n//# sourceMappingURL=ame-static-html.js.map","import { createControlComponentConfig, KoDependentControl } from '../control-base.js';\r\nexport class AmeTextInput extends KoDependentControl {\r\n constructor(params, $element) {\r\n super(params, $element);\r\n this.inputType = 'text';\r\n this.isCode = params.isCode || false;\r\n this.inputType = params.inputType || 'text';\r\n }\r\n get inputClasses() {\r\n const classes = ['regular-text'];\r\n if (this.isCode) {\r\n classes.push('code');\r\n }\r\n classes.push('ame-text-input-control', ...super.inputClasses);\r\n return classes;\r\n }\r\n getAdditionalInputAttributes() {\r\n return Object.assign({ 'type': this.inputType }, super.getAdditionalInputAttributes());\r\n }\r\n}\r\nexport default createControlComponentConfig(AmeTextInput, `\n\t\n\t\n\t\t\n\t\t\n`);\r\n//# sourceMappingURL=ame-text-input.js.map","import { createControlComponentConfig, KoStandaloneControl } from '../control-base.js';\r\nclass AmeToggleCheckbox extends KoStandaloneControl {\r\n constructor(params, $element) {\r\n super(params, $element);\r\n this.onValue = (typeof params.onValue !== 'undefined') ? params.onValue : true;\r\n this.offValue = (typeof params.offValue !== 'undefined') ? params.offValue : false;\r\n if (typeof this.settings['value'] === 'undefined') {\r\n this.isChecked = ko.pureComputed(() => false);\r\n }\r\n else {\r\n this.isChecked = ko.computed({\r\n read: () => {\r\n return this.settings.value.value() === ko.unwrap(this.onValue);\r\n },\r\n write: (newValue) => {\r\n this.settings.value.value(ko.unwrap(newValue ? this.onValue : this.offValue));\r\n },\r\n deferEvaluation: true\r\n });\r\n }\r\n }\r\n get classes() {\r\n return ['ame-toggle-checkbox-control', ...super.classes];\r\n }\r\n}\r\n//Unlike the HTML version of this control, the Knockout version doesn't have\r\n//a second, hidden checkbox. This is because the component is entirely JS-based\r\n//and doesn't need to be submitted as part of a form.\r\nexport default createControlComponentConfig(AmeToggleCheckbox, `\n\t\t\n`);\r\n//# sourceMappingURL=ame-toggle-checkbox.js.map","import { createControlComponentConfig, KoStandaloneControl } from '../control-base.js';\r\nexport class AmeUnitDropdown extends KoStandaloneControl {\r\n constructor(params, $element) {\r\n super(params, $element);\r\n this.dropdownData = params.optionData || {\r\n options: [],\r\n optionsText: 'text',\r\n optionsValue: 'value'\r\n };\r\n this.selectId = params.id || '';\r\n }\r\n}\r\nexport default createControlComponentConfig(AmeUnitDropdown, `\n\t\n`);\r\n//# sourceMappingURL=ame-unit-dropdown.js.map","'use strict';\r\nimport { createControlComponentConfig, KoStandaloneControl } from '../control-base.js';\r\n//Note: Requires Lodash, but does not explicitly import it because this plugin\r\n//already uses Lodash as a global variable (wsAmeLodash) in many places. Code\r\n//that uses this component should make sure that Lodash is loaded.\r\nlet autoAssignedIdCounter = 0;\r\n/**\r\n * List of visual editor buttons that are visible in the \"teeny\" mode.\r\n *\r\n * Found in /wp-includes/class-wp-editor.php, the editor_settings() method.\r\n * The relevant code is around line #601 (as of WP 6.1.1).\r\n */\r\nconst TeenyButtons = [\r\n 'bold',\r\n 'italic',\r\n 'underline',\r\n 'blockquote',\r\n 'strikethrough',\r\n 'bullist',\r\n 'numlist',\r\n 'alignleft',\r\n 'aligncenter',\r\n 'alignright',\r\n 'undo',\r\n 'redo',\r\n 'link',\r\n 'fullscreen'\r\n];\r\n/**\r\n * List of Quicktags editor buttons that are visible by default.\r\n *\r\n * The default list of text editor buttons used by wp.editor.initialize()\r\n * doesn't match the defaults used by wp_editor() in PHP. Let's copy the list\r\n * from /includes/class-wp-editor.php.\r\n */\r\nconst DefaultQuicktagsButtons = [\r\n 'strong', 'em', 'link', 'block', 'del', 'ins', 'img', 'ul', 'ol', 'li', 'code', 'more', 'close'\r\n];\r\nclass AmeWpEditor extends KoStandaloneControl {\r\n constructor(params, $element) {\r\n super(params, $element);\r\n this.editorId = null;\r\n this.isWpEditorInitialized = false;\r\n const textSetting = this.settings.value;\r\n if (typeof textSetting === 'undefined') {\r\n throw new Error('Visual Editor control is missing the required setting');\r\n }\r\n this.rows = params.rows || 6;\r\n this.isTeeny = !!params.teeny;\r\n }\r\n getAdditionalInputAttributes() {\r\n return Object.assign({ rows: this.rows.toString() }, super.getAdditionalInputAttributes());\r\n }\r\n koDescendantsComplete() {\r\n const $textArea = this.findChild('textarea.ame-wp-editor-textarea');\r\n if ($textArea.length === 0) {\r\n return;\r\n }\r\n const currentValue = this.valueProxy();\r\n $textArea.val((currentValue === null) ? '' : currentValue.toString());\r\n //The textarea must have an ID for wp.editor.initialize() to work.\r\n {\r\n let editorId = $textArea.attr('id');\r\n if (!editorId) {\r\n editorId = 'ws-ame-wp-editor-aid-' + (autoAssignedIdCounter++);\r\n $textArea.attr('id', editorId);\r\n }\r\n this.editorId = editorId;\r\n }\r\n //Update the setting when the contents of the underlying textarea change.\r\n //This happens when the user selects the \"Text\" tab in the editor, or when\r\n //TinyMCE is unavailable (e.g. if the \"Disable the visual editor when writing\"\r\n //option is checked in the user's profile).\r\n $textArea.on('change input', this.throttleUpdates(() => $textArea.val()));\r\n let editorSettings = {\r\n tinymce: {\r\n wpautop: true\r\n },\r\n quicktags: {\r\n //The default list of text editor buttons used by wp.editor.initialize()\r\n //doesn't match the defaults used by wp_editor() in PHP. Let's copy the list\r\n //from /includes/class-wp-editor.php.\r\n buttons: DefaultQuicktagsButtons.join(','),\r\n },\r\n //Include the \"Add Media\" button.\r\n mediaButtons: true,\r\n };\r\n if (typeof window['tinymce'] === 'undefined') {\r\n //TinyMCE is disabled or not available.\r\n editorSettings.tinymce = false;\r\n }\r\n if (this.isTeeny && (typeof editorSettings.tinymce === 'object')) {\r\n editorSettings.tinymce.toolbar1 = TeenyButtons.join(',');\r\n editorSettings.tinymce.toolbar2 = '';\r\n }\r\n const $document = jQuery(document);\r\n const self = this;\r\n //After the editor finishes initializing, add an event listener to update\r\n //the setting when the contents of the visual editor change.\r\n $document.on('tinymce-editor-init', function addMceChangeListener(event, editor) {\r\n if (editor.id !== self.editorId) {\r\n return; //Not our editor.\r\n }\r\n //According to the TinyMCE documentation, the \"Change\" event is fired\r\n //when \"changes [...] cause an undo level to be added\". This could be\r\n //too frequent for our purposes, so we'll throttle the callback.\r\n editor.on('Change', self.throttleUpdates(() => editor.getContent()));\r\n $document.off('tinymce-editor-init', addMceChangeListener);\r\n });\r\n //Unfortunately, as of WP 6.2-beta, wp.editor.initialize() doesn't add\r\n //the \"wp-editor-container\" wrapper when only the Quicktags editor is used.\r\n //This means the editor won't be styled correctly. Let's fix that.\r\n $document.on('quicktags-init', function maybeAddEditorWrapper(event, editor) {\r\n if (!editor || (editor.id !== self.editorId)) {\r\n return;\r\n }\r\n if (editor.canvas) {\r\n const $textarea = jQuery(editor.canvas);\r\n const $wrapper = $textarea.closest('.wp-editor-container');\r\n if ($wrapper.length === 0) {\r\n //Also include the toolbar in the wrapper.\r\n const $toolbar = $textarea.prevAll('.quicktags-toolbar').first();\r\n $textarea.add($toolbar).wrapAll('
    ');\r\n }\r\n }\r\n $document.off('quicktags-init', maybeAddEditorWrapper);\r\n });\r\n //Finally, initialize the editor.\r\n wp.editor.initialize($textArea.attr('id'), editorSettings);\r\n this.isWpEditorInitialized = true;\r\n }\r\n /**\r\n * Create a throttled function that updates the setting.\r\n *\r\n * There are multiple ways to get the contents of the editor (e.g. TinyMCE mode\r\n * vs a plain textarea), so using a utility function helps avoid code duplication.\r\n *\r\n * @param valueGetter\r\n * @protected\r\n */\r\n throttleUpdates(valueGetter) {\r\n const textSetting = this.settings.value;\r\n return wsAmeLodash.throttle(function () {\r\n textSetting.value(valueGetter());\r\n return void 0;\r\n }, 1000, { leading: true, trailing: true });\r\n }\r\n dispose() {\r\n //Destroy the editor. It's not clear whether this is necessary, but it's\r\n //probably a good idea to give WP a chance to clean up.\r\n if (this.isWpEditorInitialized && (this.editorId !== null)) {\r\n wp.editor.remove(this.editorId);\r\n this.isWpEditorInitialized = false;\r\n }\r\n super.dispose();\r\n }\r\n}\r\n//Note: The class of the textarea element is set directly instead of using a binding\r\n//because it must always have the \"wp-editor-area\" class for it to render correctly\r\n//(apparently, wp.editor.initialize() does not automatically add that class).\r\n//Knockout should not be able to remove the class.\r\nexport default createControlComponentConfig(AmeWpEditor, `\n\t\t\n`);\r\n//# sourceMappingURL=ame-wp-editor.js.map","import { AmeCustomizable } from '../assets/customizable.js';\r\nvar Setting = AmeCustomizable.Setting;\r\nvar InterfaceStructure = AmeCustomizable.InterfaceStructure;\r\nvar Control = AmeCustomizable.Control;\r\nexport class KoComponentViewModel {\r\n constructor(params, $element) {\r\n var _a;\r\n this.params = params;\r\n this.$element = $element;\r\n this.isBoundToComment = ($element[0]) && ($element[0].nodeType === Node.COMMENT_NODE);\r\n this.uiElement = null;\r\n const expectedType = this.getExpectedUiElementType();\r\n if (expectedType !== null) {\r\n if ((typeof params.uiElement !== 'undefined')\r\n && (params.uiElement instanceof expectedType)) {\r\n this.uiElement = params.uiElement;\r\n }\r\n else {\r\n throw new Error('uiElement is not a ' + expectedType.name + ' instance.');\r\n }\r\n }\r\n else if ((typeof params.uiElement !== 'undefined') && !(this instanceof KoStandaloneControl)) {\r\n console.warn('Unexpected \"uiElement\" parameter for ' + this.constructor.name\r\n + ' that did not expect an UI element. Did you forget to override getExpectedUiElementType() ?', params.uiElement);\r\n }\r\n if (typeof params.children !== 'undefined') {\r\n if (Array.isArray(params.children) || this.isObservableArray(params.children)) {\r\n this.inputChildren = params.children;\r\n }\r\n else {\r\n throw new Error('Invalid \"children\" parameter: expected an array or an observable array.');\r\n }\r\n }\r\n else {\r\n this.inputChildren = [];\r\n }\r\n this.customClasses = ((typeof params.classes === 'object') && Array.isArray(params.classes)) ? params.classes : [];\r\n this.customStyles = ((typeof params.styles === 'object') && (params.styles !== null)) ? params.styles : {};\r\n if (typeof params.enabled !== 'undefined') {\r\n if (ko.isObservable(params.enabled)) {\r\n this.isEnabled = params.enabled;\r\n }\r\n else {\r\n this.isEnabled = ko.pureComputed(() => !!params.enabled);\r\n }\r\n }\r\n else {\r\n this.isEnabled = ko.pureComputed(() => true);\r\n }\r\n //Get the description either from the \"description\" parameter or from the UI element.\r\n this.description = params.description\r\n ? ko.unwrap(params.description.toString())\r\n : (((_a = this.uiElement) === null || _a === void 0 ? void 0 : _a.description) || '');\r\n }\r\n dispose() {\r\n //Does nothing by default.\r\n }\r\n getExpectedUiElementType() {\r\n return null;\r\n }\r\n get classes() {\r\n return [].concat(this.customClasses);\r\n }\r\n // noinspection JSUnusedGlobalSymbols -- Used in Knockout templates.\r\n get classString() {\r\n return this.classes.join(' ');\r\n }\r\n get styles() {\r\n return Object.assign({}, this.customStyles);\r\n }\r\n findChild(selector, allowSiblingSearch = null) {\r\n if (allowSiblingSearch === null) {\r\n //Enable only if the component is bound to a comment (i.e. \"\").\r\n allowSiblingSearch = this.isBoundToComment;\r\n }\r\n if (this.isBoundToComment) {\r\n if (allowSiblingSearch) {\r\n return this.$element.nextAll(selector).first();\r\n }\r\n else {\r\n //We would never find anything because a comment node has no children.\r\n return jQuery();\r\n }\r\n }\r\n return this.$element.find(selector);\r\n }\r\n isObservableArray(value) {\r\n return (typeof value === 'object')\r\n && (value !== null)\r\n && (typeof value.slice === 'function')\r\n && (typeof value.indexOf === 'function')\r\n && (ko.isObservable(value));\r\n }\r\n}\r\nfunction makeCreateVmFunctionForComponent(ctor) {\r\n return function (params, componentInfo) {\r\n const $element = jQuery(componentInfo.element);\r\n return new ctor(params, $element);\r\n };\r\n}\r\nexport function createComponentConfig(ctor, templateString) {\r\n return {\r\n viewModel: {\r\n createViewModel: makeCreateVmFunctionForComponent(ctor),\r\n },\r\n template: templateString,\r\n };\r\n}\r\n//endregion\r\n//region Container\r\nexport class ComponentBindingOptions {\r\n // noinspection JSUnusedGlobalSymbols -- the uiElement property is used in the KO template of AC control groups.\r\n constructor(name, params, uiElement) {\r\n this.name = name;\r\n this.params = params;\r\n this.uiElement = uiElement;\r\n if (name === '') {\r\n throw new Error('Component name cannot be empty.');\r\n }\r\n }\r\n static fromElement(element, overrideComponentName = null) {\r\n if (!element.component && (overrideComponentName === null)) {\r\n throw new Error(`Cannot create component binding options for UI element \"${element.id}\" without a component name.`);\r\n }\r\n return new ComponentBindingOptions(overrideComponentName || element.component, element.getComponentParams(), element);\r\n }\r\n}\r\nexport class KoContainerViewModel extends KoComponentViewModel {\r\n constructor(params, $element) {\r\n if (typeof params.children === 'undefined') {\r\n throw new Error('Missing \"children\" parameter.');\r\n }\r\n super(params, $element);\r\n this.title = ko.pureComputed(() => {\r\n if (typeof params.title !== 'undefined') {\r\n let title = ko.unwrap(params.title);\r\n if ((title !== null) && (typeof title !== 'undefined')) {\r\n return title.toString();\r\n }\r\n }\r\n if (this.uiElement) {\r\n return this.uiElement.title;\r\n }\r\n return '';\r\n });\r\n this.childComponents = ko.pureComputed(() => {\r\n const result = ko.unwrap(this.inputChildren)\r\n .map(child => this.mapChildToComponentBinding(child))\r\n .filter(binding => binding !== null);\r\n //TypeScript does not recognize that the filter() call above removes\r\n //all null values, so we need an explicit cast.\r\n return result;\r\n });\r\n }\r\n mapChildToComponentBinding(child) {\r\n //Does not map any children by default.\r\n return null;\r\n }\r\n dispose() {\r\n super.dispose();\r\n this.childComponents.dispose();\r\n }\r\n}\r\n//endregion\r\n//region Control\r\nexport class KoControlViewModel extends KoComponentViewModel {\r\n constructor(params, $element) {\r\n var _a;\r\n super(params, $element);\r\n this.settings =\r\n ((typeof params.settings === 'object') && isSettingMap(params.settings))\r\n ? params.settings\r\n : {};\r\n if (typeof this.settings.value !== 'undefined') {\r\n this.valueProxy = this.settings.value.value;\r\n }\r\n else {\r\n this.valueProxy = ko.pureComputed(() => {\r\n console.error('Missing \"value\" setting for a control component.', this.settings, params);\r\n return '';\r\n });\r\n }\r\n //Input ID will be provided by the server if applicable.\r\n this.primaryInputId = (typeof params.primaryInputId === 'string') ? params.primaryInputId : null;\r\n this.inputAttributes = ko.pureComputed(() => {\r\n var _a;\r\n const attributes = ((_a = this.uiElement) === null || _a === void 0 ? void 0 : _a.inputAttributes) || {};\r\n const inputId = this.getPrimaryInputId();\r\n if ((inputId !== null) && (inputId !== '')) {\r\n attributes.id = inputId;\r\n }\r\n //Note: The \"name\" field is not used because these controls are entirely JS-driven.\r\n const additionalAttributes = this.getAdditionalInputAttributes();\r\n for (const key in additionalAttributes) {\r\n if (!additionalAttributes.hasOwnProperty(key)) {\r\n continue;\r\n }\r\n attributes[key] = additionalAttributes[key];\r\n }\r\n return attributes;\r\n });\r\n if ((typeof params.label !== 'undefined') && (params.label !== null)) {\r\n const unwrappedLabel = ko.unwrap(params.label);\r\n this.label = (typeof unwrappedLabel === 'undefined') ? '' : unwrappedLabel.toString();\r\n }\r\n else {\r\n this.label = ((_a = this.uiElement) === null || _a === void 0 ? void 0 : _a.label) || '';\r\n }\r\n }\r\n get inputClasses() {\r\n var _a;\r\n return ((_a = this.uiElement) === null || _a === void 0 ? void 0 : _a.inputClasses) || [];\r\n }\r\n // noinspection JSUnusedGlobalSymbols -- Used in Knockout templates.\r\n get inputClassString() {\r\n return this.inputClasses.join(' ');\r\n }\r\n getAdditionalInputAttributes() {\r\n return {};\r\n }\r\n getPrimaryInputId() {\r\n return this.primaryInputId;\r\n }\r\n}\r\nfunction isSettingMap(value) {\r\n if (value === null) {\r\n return false;\r\n }\r\n if (typeof value !== 'object') {\r\n return false;\r\n }\r\n const valueAsRecord = value;\r\n for (const key in valueAsRecord) {\r\n if (!valueAsRecord.hasOwnProperty(key)) {\r\n continue;\r\n }\r\n if (!(valueAsRecord[key] instanceof Setting)) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n}\r\n/**\r\n * A control that doesn't use or need a UI element instance, but can still have\r\n * settings and other parameters typically associated with controls.\r\n */\r\nexport class KoStandaloneControl extends KoControlViewModel {\r\n}\r\n/**\r\n * A control that requires a UI element of the \"Control\" class.\r\n */\r\nexport class KoDependentControl extends KoControlViewModel {\r\n getExpectedUiElementType() {\r\n return Control;\r\n }\r\n}\r\nexport function createControlComponentConfig(ctor, templateString) {\r\n return {\r\n viewModel: {\r\n createViewModel: makeCreateVmFunctionForComponent(ctor),\r\n },\r\n template: templateString,\r\n };\r\n}\r\n//endregion\r\n//region Renderer\r\nexport class KoRendererViewModel extends KoComponentViewModel {\r\n constructor(params, $element) {\r\n super(params, $element);\r\n if ((typeof params.structure !== 'object') || !(params.structure instanceof InterfaceStructure)) {\r\n throw new Error('Invalid interface structure for a renderer component.');\r\n }\r\n this.structure = params.structure;\r\n }\r\n}\r\nexport function createRendererComponentConfig(ctor, templateString) {\r\n return {\r\n viewModel: {\r\n createViewModel: makeCreateVmFunctionForComponent(ctor),\r\n },\r\n template: templateString,\r\n };\r\n}\r\n//endregion\r\n//# sourceMappingURL=control-base.js.map","/// \r\n/**\r\n * This is a wrapper for the popup slider that initializes the slider on first use.\r\n * It's useful for Knockout components.\r\n */\r\nexport class LazyPopupSliderAdapter {\r\n constructor(sliderRanges, containerSelector = '.ame-container-with-popup-slider', inputSelector = 'input', sliderOptions = {}) {\r\n this.sliderRanges = sliderRanges;\r\n this.containerSelector = containerSelector;\r\n this.inputSelector = inputSelector;\r\n this.sliderOptions = sliderOptions;\r\n this.slider = null;\r\n if (!sliderOptions.hasOwnProperty('ranges')) {\r\n sliderOptions.ranges = sliderRanges;\r\n }\r\n this.handleKoClickEvent = ($data, event) => {\r\n //Verify that this is one of the inputs we're interested in.\r\n //Also, disabled inputs should not trigger the slider.\r\n if (event.target === null) {\r\n return;\r\n }\r\n const $input = jQuery(event.target);\r\n if ($input.is(':disabled') || !$input.is(this.inputSelector)) {\r\n return;\r\n }\r\n //Short-circuit if the slider is already initialized.\r\n if (this.slider) {\r\n this.slider.showForInput($input);\r\n return;\r\n }\r\n //Some sanity checks.\r\n if (typeof AmePopupSlider === 'undefined') {\r\n return;\r\n }\r\n const $container = $input.closest(this.containerSelector);\r\n if ($container.length < 1) {\r\n return;\r\n }\r\n this.initSlider($container);\r\n if (this.slider !== null) {\r\n //TS doesn't realize that this.initSlider() will initialize the slider.\r\n this.slider.showForInput($input);\r\n }\r\n };\r\n }\r\n /**\r\n * Initialize the slider if it's not already initialized.\r\n */\r\n initSlider($container) {\r\n if (this.slider) {\r\n return;\r\n }\r\n //In HTML, we would pass the range data as a \"data-slider-ranges\" attribute,\r\n //but here they are passed via the \"ranges\" option (see the constructor).\r\n this.slider = AmePopupSlider.createSlider($container, this.sliderOptions);\r\n }\r\n}\r\n//# sourceMappingURL=lazy-popup-slider-adapter.js.map"],"names":[],"sourceRoot":""} \ No newline at end of file diff --git a/dist/build.manifest.json b/dist/build.manifest.json index b0bbd70..2a3a66b 100644 --- a/dist/build.manifest.json +++ b/dist/build.manifest.json @@ -3,5 +3,19 @@ "runtime.bundle.js", "customizable.bundle.js", "admin-customizer.bundle.js" + ], + "menu-styler-ui": [ + "runtime.bundle.js", + "customizable.bundle.js", + "menu-styler-ui.bundle.js" + ], + "menu-styler-features": [ + "runtime.bundle.js", + "menu-styler-features.bundle.js" + ], + "admin-customizer-preview": [ + "runtime.bundle.js", + "customizable.bundle.js", + "admin-customizer-preview.bundle.js" ] } \ No newline at end of file diff --git a/dist/customizable.bundle.js b/dist/customizable.bundle.js index 6a5f370..4387a33 100644 --- a/dist/customizable.bundle.js +++ b/dist/customizable.bundle.js @@ -352,7 +352,7 @@ var AmeCustomizable; this.children = children; } getComponentParams() { - return Object.assign(Object.assign({}, this.componentParams), { uiElement: this, description: this.description, classes: this.classes, styles: this.styles, children: this.children }); + return Object.assign(Object.assign({}, this.componentParams), { uiElement: this, id: this.id, description: this.description, classes: this.classes, styles: this.styles, children: this.children }); } } AmeCustomizable.UiElement = UiElement; diff --git a/dist/customizable.bundle.js.map b/dist/customizable.bundle.js.map index a1c7302..82d4992 100644 --- a/dist/customizable.bundle.js.map +++ b/dist/customizable.bundle.js.map @@ -1 +1 @@ -{"version":3,"file":"customizable.bundle.js","mappings":";;;;;;;;;;;;;;AAAa;AACN;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,aAAa;AACb;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA,kDAAkD,YAAY;AAC9D;AACA,qBAAqB;AACrB;AACA;AACA;AACA,kDAAkD,YAAY;AAC9D;AACA,qBAAqB;AACrB;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2DAA2D,SAAS;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,eAAe;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,2BAA2B,qHAAqH;AACjM;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,iCAAiC,uBAAuB;AACzG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,iDAAiD,iCAAiC,wGAAwG;AAC1L;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,kBAAkB;AACvD;AACA;AACA;AACA;AACA;AACA,yBAAyB,mBAAmB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,0CAA0C;AACpC;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,4DAA4D;AAC7D","sources":["webpack:///./extras/pro-customizables/assets/customizable.js"],"sourcesContent":["'use strict';\r\nexport var AmeCustomizable;\r\n(function (AmeCustomizable) {\r\n var some = AmeMiniFunc.some;\r\n var none = AmeMiniFunc.none;\r\n var Either = AmeMiniFunc.Either;\r\n const _ = wsAmeLodash;\r\n class Setting {\r\n constructor(id, value = null, defaultValue = null, supportsPostMessage = false, groupTitle = null, validator = null) {\r\n this.validator = validator;\r\n this.groupTitle = null;\r\n /**\r\n * The last value that was tried to be set. This is used to ignore server-side\r\n * validation errors when the input value has changed since the request was sent.\r\n *\r\n * Displayed validation errors should be relevant to what the user tried\r\n * to enter, not the currently stored setting value.\r\n */\r\n this.lastTriedNewValue = null;\r\n this.id = id;\r\n this.underlyingValue = ko.observable(value);\r\n this.defaultValue = defaultValue;\r\n this.supportsPostMessage = supportsPostMessage;\r\n this.groupTitle = groupTitle;\r\n this.lastTriedNewValue = value;\r\n this.value = ko.computed({\r\n read: () => this.underlyingValue(),\r\n write: (newValue) => {\r\n const errors = this.tryUpdate(newValue);\r\n if (errors && (errors.length > 0)) {\r\n /*\r\n We could revert to the previous value here, but there are some cases where\r\n that would interfere with the user's input. For example, if the user is\r\n manually typing in a URL, the value will be temporarily invalid until they\r\n finish entering the protocol and domain name. If we revert to the previous\r\n value, the user will have to start over.\r\n\r\n Instead, let's leave the invalid value in place and let the user fix it.\r\n */\r\n }\r\n },\r\n owner: this\r\n });\r\n this.validationErrors = ko.observableArray();\r\n this.isValid = ko.computed(() => {\r\n return (this.validationErrors().length === 0);\r\n });\r\n }\r\n tryUpdate(newValue) {\r\n this.lastTriedNewValue = newValue;\r\n const oldValue = this.underlyingValue();\r\n //Clear validation errors.\r\n this.validationErrors.removeAll();\r\n //Validate and sanitize the new value.\r\n const [sanitizedValue, errors] = this.validate(newValue);\r\n this.validationErrors.push(...errors);\r\n if (errors.length > 0) {\r\n return errors;\r\n }\r\n //Remember the last validation subject so that server-side validation results\r\n //can be ignored if the value has changed since the request was sent.\r\n this.lastTriedNewValue = sanitizedValue;\r\n //Only update the underlying value if it has changed.\r\n if (sanitizedValue !== oldValue) {\r\n this.underlyingValue(sanitizedValue);\r\n }\r\n return [];\r\n }\r\n validate(newValue) {\r\n if (this.validator !== null) {\r\n const result = this.validator.check(newValue);\r\n if (result.isLeft()) {\r\n return [newValue, [result.value]];\r\n }\r\n else if (result.isRight()) {\r\n newValue = result.value;\r\n }\r\n }\r\n return [newValue, []];\r\n }\r\n /**\r\n * Add validation errors to the setting if the current value still\r\n * matches the given value.\r\n *\r\n * This is intended as a way to add validation errors that were produced\r\n * asynchronously, such as by sending the value to the server for validation.\r\n * The setting's value can change while the validation is in progress,\r\n * so we need to check that the validated value matches the current one.\r\n *\r\n * @param subjectValue\r\n * @param errors\r\n */\r\n addValidationErrorsForValue(subjectValue, errors) {\r\n if (this.lastTriedNewValue !== subjectValue) {\r\n return;\r\n }\r\n //Add the error(s) only if there is no existing error with the same code.\r\n const existingCodes = _.indexBy(this.validationErrors(), 'code');\r\n for (const error of errors) {\r\n if ((typeof error.code === 'undefined') || !existingCodes.hasOwnProperty(error.code)) {\r\n this.validationErrors.push(error);\r\n }\r\n }\r\n }\r\n clearValidationErrorsForValue(subjectValue) {\r\n if (this.lastTriedNewValue !== subjectValue) {\r\n return;\r\n }\r\n this.validationErrors.removeAll();\r\n }\r\n }\r\n AmeCustomizable.Setting = Setting;\r\n function unserializeSettingMap(settings) {\r\n const collection = new SettingCollection();\r\n for (const settingId in settings) {\r\n if (!settings.hasOwnProperty(settingId)) {\r\n continue;\r\n }\r\n const definition = settings[settingId];\r\n collection.add(unserializeSetting(settingId, definition));\r\n }\r\n return collection;\r\n }\r\n AmeCustomizable.unserializeSettingMap = unserializeSettingMap;\r\n function unserializeSetting(settingId, definition) {\r\n return new Setting(settingId, (typeof definition.value !== 'undefined') ? definition.value : null, (typeof definition.defaultValue !== 'undefined') ? definition.defaultValue : null, (typeof definition.supportsPostMessage !== 'undefined') ? definition.supportsPostMessage : false, (typeof definition.groupTitle !== 'undefined') ? definition.groupTitle : null, (typeof definition.validation !== 'undefined') ? (new Validator(definition.validation)) : null);\r\n }\r\n AmeCustomizable.unserializeSetting = unserializeSetting;\r\n const BuiltinParsers = {\r\n 'numeric': (value, config) => {\r\n //In some UI controls the observable value is updated as the user types,\r\n //so this parser/validator should be tolerant and accept partial values.\r\n let parsed;\r\n let sanitized;\r\n if (typeof value === 'number') {\r\n parsed = sanitized = value;\r\n }\r\n else {\r\n sanitized = (typeof value === 'string') ? value : String(value);\r\n sanitized = AmeMiniFunc.sanitizeNumericString(sanitized);\r\n parsed = parseFloat(sanitized);\r\n if (isNaN(parsed)) {\r\n return Either.left({\r\n message: 'Value must be a number.',\r\n code: 'invalid_number'\r\n });\r\n }\r\n }\r\n if (config) {\r\n if ((typeof config.min !== 'undefined') && parsed < config.min) {\r\n return Either.left({\r\n message: `Value must be ${config.min} or greater`,\r\n code: 'min_value'\r\n });\r\n }\r\n if (typeof config.max !== 'undefined' && parsed > config.max) {\r\n return Either.left({\r\n message: `Value must be ${config.max} or lower`,\r\n code: 'max_value'\r\n });\r\n }\r\n }\r\n return Either.right(sanitized);\r\n },\r\n 'int': (value) => {\r\n let parsed = (typeof value === 'number') ? value : parseInt(String(value), 10);\r\n if (isNaN(parsed)) {\r\n return Either.left({\r\n message: 'Value must be a number.',\r\n code: 'invalid_type'\r\n });\r\n }\r\n parsed = Math.floor(parsed);\r\n return Either.right(parsed);\r\n }\r\n };\r\n class Validator {\r\n constructor(config) {\r\n this.config = config;\r\n this.parsers = [];\r\n //Converting to null is only allowed if the setting is nullable.\r\n if (config.convertEsToNull && !config.isNullable) {\r\n throw new Error('convertEsToNull is only allowed if the setting is nullable.');\r\n }\r\n if (config.parsers) {\r\n for (const [parserId, parserConfig] of config.parsers) {\r\n if (!BuiltinParsers.hasOwnProperty(parserId)) {\r\n throw new Error(`Unknown parser: ${parserId}`);\r\n }\r\n this.parsers.push([BuiltinParsers[parserId], parserConfig]);\r\n }\r\n }\r\n }\r\n check(value) {\r\n if (value === null) {\r\n if (this.config.isNullable) {\r\n return Either.right(value);\r\n }\r\n else {\r\n return Either.left({\r\n message: 'This setting cannot be null.'\r\n });\r\n }\r\n }\r\n if (typeof value === 'string') {\r\n if (this.config.convertEsToNull && (value === '')) {\r\n return Either.right(null);\r\n }\r\n }\r\n for (const [parser, parserConfig] of this.parsers) {\r\n const result = parser(value, (parserConfig === null) ? undefined : parserConfig);\r\n if (result.isLeft()) {\r\n return result;\r\n }\r\n else if (result.isRight()) {\r\n value = result.value;\r\n }\r\n }\r\n return Either.right(value);\r\n }\r\n }\r\n class SettingCollection {\r\n constructor() {\r\n this.settings = {};\r\n /**\r\n * Adding settings to an observable array makes it easier to automatically\r\n * update computed values like \"are any settings invalid?\".\r\n */\r\n this.observableSettings = ko.observableArray();\r\n const self = this;\r\n this.hasValidationErrors = ko.pureComputed(() => {\r\n return _.some(self.observableSettings(), (setting) => {\r\n return !setting.isValid();\r\n });\r\n });\r\n this.changeListeners = new Map();\r\n }\r\n get(id) {\r\n if (this.settings.hasOwnProperty(id)) {\r\n return some(this.settings[id]);\r\n }\r\n return none;\r\n }\r\n add(setting) {\r\n this.settings[setting.id] = setting;\r\n this.observableSettings.push(setting);\r\n setting.value.subscribe((newValue) => this.onSettingChanged(setting, newValue));\r\n }\r\n onSettingChanged(setting, newValue) {\r\n this.notifyChangeListeners(setting, newValue);\r\n }\r\n /**\r\n * Add a callback that will be called whenever the value of a setting changes.\r\n *\r\n * @param callback\r\n */\r\n addChangeListener(callback) {\r\n const id = Symbol();\r\n this.changeListeners.set(id, callback);\r\n return id;\r\n }\r\n removeChangeListener(id) {\r\n this.changeListeners.delete(id);\r\n }\r\n notifyChangeListeners(setting, newValue) {\r\n for (const listener of this.changeListeners.values()) {\r\n listener(setting, newValue);\r\n }\r\n }\r\n getAllSettingIds() {\r\n return Object.keys(this.settings);\r\n }\r\n getAllSettingValues() {\r\n const values = {};\r\n for (const id in this.settings) {\r\n if (this.settings.hasOwnProperty(id)) {\r\n values[id] = this.settings[id].value();\r\n }\r\n }\r\n return values;\r\n }\r\n }\r\n AmeCustomizable.SettingCollection = SettingCollection;\r\n function isSettingConditionData(data) {\r\n if ((typeof data !== 'object') || (data === null)) {\r\n return false;\r\n }\r\n const dataAsRecord = data;\r\n return (typeof dataAsRecord.settingId === 'string'\r\n && typeof dataAsRecord.op === 'string'\r\n && typeof dataAsRecord.value !== 'undefined');\r\n }\r\n class SettingCondition {\r\n constructor(setting, op, value) {\r\n this.setting = setting;\r\n this.op = op;\r\n this.value = value;\r\n }\r\n evaluate() {\r\n const settingValue = this.setting.value();\r\n switch (this.op) {\r\n case '==':\r\n //Note the intentional use of == instead of ===.\r\n return settingValue == this.value;\r\n case '!=':\r\n return settingValue != this.value;\r\n case '>':\r\n return settingValue > this.value;\r\n case '<':\r\n return settingValue < this.value;\r\n case '>=':\r\n return settingValue >= this.value;\r\n case '<=':\r\n return settingValue <= this.value;\r\n case 'falsy':\r\n return !settingValue;\r\n case 'truthy':\r\n return !!settingValue;\r\n }\r\n }\r\n static fromData(data, findSetting) {\r\n const setting = findSetting(data.settingId);\r\n if (!setting || setting.isEmpty()) {\r\n throw new Error(`Setting with ID \"${data.settingId}\" not found for SettingCondition`);\r\n }\r\n return new SettingCondition(setting.get(), data.op, data.value);\r\n }\r\n }\r\n AmeCustomizable.SettingCondition = SettingCondition;\r\n class UiElement {\r\n constructor(data, children = []) {\r\n this.component = data.component || '';\r\n this.id = data.id || '';\r\n this.description = data.description || '';\r\n this.classes = data.classes || [];\r\n this.styles = data.styles || {};\r\n this.componentParams = data.params || {};\r\n this.children = children;\r\n }\r\n getComponentParams() {\r\n return Object.assign(Object.assign({}, this.componentParams), { uiElement: this, description: this.description, classes: this.classes, styles: this.styles, children: this.children });\r\n }\r\n }\r\n AmeCustomizable.UiElement = UiElement;\r\n class Container extends UiElement {\r\n constructor(data, children = []) {\r\n super(data, children);\r\n this.title = data.title;\r\n }\r\n replaceChild(oldChild, newChild) {\r\n const index = this.children.indexOf(oldChild);\r\n if (index === -1) {\r\n throw new Error('Child not found');\r\n }\r\n this.children[index] = newChild;\r\n }\r\n replaceChildByIndex(index, newChild) {\r\n this.children[index] = newChild;\r\n }\r\n }\r\n AmeCustomizable.Container = Container;\r\n class Section extends Container {\r\n constructor(data, children = []) {\r\n super(data, children);\r\n this.preferredRole = data.preferredRole || 'navigation';\r\n }\r\n }\r\n AmeCustomizable.Section = Section;\r\n class ControlGroup extends Container {\r\n constructor(data, children = [], enabled = null) {\r\n super(data, children);\r\n this.enabled = enabled || ko.observable(true);\r\n this.labelFor = data.labelFor || null;\r\n }\r\n getComponentParams() {\r\n return Object.assign(Object.assign({}, super.getComponentParams()), { enabled: this.enabled });\r\n }\r\n }\r\n AmeCustomizable.ControlGroup = ControlGroup;\r\n class InterfaceStructure extends Container {\r\n constructor(data, children = []) {\r\n super(data, children);\r\n }\r\n getAsSections() {\r\n let currentAnonymousSection = null;\r\n let sections = [];\r\n for (const child of this.children) {\r\n if (child instanceof Section) {\r\n sections.push(child);\r\n currentAnonymousSection = null;\r\n }\r\n else {\r\n if (!currentAnonymousSection) {\r\n currentAnonymousSection = new Section({\r\n t: 'section',\r\n title: '',\r\n children: []\r\n });\r\n sections.push(currentAnonymousSection);\r\n }\r\n currentAnonymousSection.children.push(child);\r\n }\r\n }\r\n return sections;\r\n }\r\n }\r\n AmeCustomizable.InterfaceStructure = InterfaceStructure;\r\n class Control extends UiElement {\r\n constructor(data, settings = {}, enabled = null, children = []) {\r\n super(data, children);\r\n this.label = data.label;\r\n this.settings = settings;\r\n this.inputClasses = data.inputClasses || [];\r\n this.inputAttributes = data.inputAttributes || {};\r\n this.enabled = enabled || ko.observable(true);\r\n // noinspection PointlessBooleanExpressionJS -- Might not actually be a boolean if sent from the server.\r\n this.includesOwnLabel = (typeof data.includesOwnLabel !== 'undefined') ? (!!data.includesOwnLabel) : false;\r\n this.labelTargetId = data.labelTargetId || '';\r\n this.primaryInputId = data.primaryInputId || '';\r\n this.settingValidationErrors = ko.pureComputed(() => {\r\n const errors = [];\r\n for (const [settingId, setting] of Object.entries(this.settings)) {\r\n const settingErrors = setting.validationErrors();\r\n if (settingErrors.length > 0) {\r\n for (const error of settingErrors) {\r\n errors.push([settingId, error]);\r\n }\r\n }\r\n }\r\n return errors;\r\n });\r\n }\r\n getComponentParams() {\r\n return Object.assign(Object.assign({}, super.getComponentParams()), { settings: this.settings, enabled: this.enabled, label: this.label, primaryInputId: this.primaryInputId });\r\n }\r\n getAutoGroupTitle() {\r\n if (this.settings['value']) {\r\n const customGroupTitle = this.settings['value'].groupTitle;\r\n if (customGroupTitle) {\r\n return customGroupTitle;\r\n }\r\n }\r\n return this.label;\r\n }\r\n /**\r\n * Create a control group wrapper with this control as its only child.\r\n */\r\n createControlGroup() {\r\n let title = this.getAutoGroupTitle();\r\n //Some controls like the checkbox already show their own label.\r\n //Don't add a group title in that case.\r\n if (this.includesOwnLabel) {\r\n title = '';\r\n }\r\n const data = {\r\n t: 'control-group',\r\n title: title\r\n };\r\n if (this.labelTargetId) {\r\n data.labelFor = this.labelTargetId;\r\n }\r\n return new ControlGroup(data, [this], this.enabled);\r\n }\r\n }\r\n AmeCustomizable.Control = Control;\r\n function unserializeUiElement(data, findSetting, dataCustomizer) {\r\n if (typeof dataCustomizer === 'function') {\r\n dataCustomizer(data);\r\n }\r\n const dataAsRecord = data;\r\n //Unserialize children recursively.\r\n let children = [];\r\n if ((typeof dataAsRecord['children'] !== 'undefined') && Array.isArray(dataAsRecord['children'])) {\r\n for (const childData of dataAsRecord['children']) {\r\n children.push(unserializeUiElement(childData, findSetting, dataCustomizer));\r\n }\r\n }\r\n //Unserialize the \"enabled\" condition.\r\n let enabled = null;\r\n if ((data.t === 'control') || (data.t === 'control-group')) {\r\n if (typeof data.enabled !== 'undefined') {\r\n if (isSettingConditionData(data.enabled)) {\r\n const condition = SettingCondition.fromData(data.enabled, findSetting);\r\n enabled = ko.pureComputed(() => condition.evaluate());\r\n }\r\n else {\r\n enabled = ko.pureComputed(() => !!data.enabled);\r\n }\r\n }\r\n else {\r\n enabled = ko.observable(true);\r\n }\r\n }\r\n switch (data.t) {\r\n case 'section':\r\n return new Section(data, children);\r\n case 'control-group':\r\n return new ControlGroup(data, children, enabled);\r\n case 'structure':\r\n return new InterfaceStructure(data, children);\r\n case 'control':\r\n let settings = {};\r\n if (data.settings) {\r\n for (const childName in data.settings) {\r\n if (data.settings.hasOwnProperty(childName)) {\r\n const settingId = data.settings[childName];\r\n const setting = findSetting(settingId);\r\n if (setting.isDefined()) {\r\n settings[childName] = setting.get();\r\n }\r\n else {\r\n throw new Error('Unknown setting \"' + settingId + '\" referenced by control \"' + data.label + '\".');\r\n }\r\n }\r\n }\r\n }\r\n return new Control(data, settings, enabled, children);\r\n }\r\n }\r\n AmeCustomizable.unserializeUiElement = unserializeUiElement;\r\n class SettingReaderRegistry {\r\n constructor() {\r\n this.notFound = {};\r\n this.valueReaders = [];\r\n }\r\n registerValueReader(getter, idPrefix = null) {\r\n this.valueReaders.push({ getter, idPrefix });\r\n }\r\n /**\r\n * Try to find a setting in a registered setting reader.\r\n */\r\n getValue(settingId) {\r\n for (const { getter, idPrefix } of this.valueReaders) {\r\n if ((idPrefix !== null) && !(settingId.startsWith(idPrefix))) {\r\n continue;\r\n }\r\n const result = getter(settingId, this.notFound);\r\n if (result !== this.notFound) {\r\n return some(result);\r\n }\r\n }\r\n return none;\r\n }\r\n }\r\n AmeCustomizable.SettingReaderRegistry = SettingReaderRegistry;\r\n class PreviewRegistry {\r\n constructor(previewValueGetter) {\r\n this.previewValueGetter = previewValueGetter;\r\n this.settingPreviewUpdaters = {};\r\n this.notFound = {};\r\n this.allPreviewUpdaters = ko.observableArray([]);\r\n }\r\n preview(settingId, value) {\r\n if (!this.settingPreviewUpdaters.hasOwnProperty(settingId)) {\r\n return;\r\n }\r\n const updaters = this.settingPreviewUpdaters[settingId];\r\n for (const updater of updaters) {\r\n updater.preview(settingId, value, this.previewValueGetter);\r\n }\r\n }\r\n clearPreview() {\r\n for (const updater of this.allPreviewUpdaters()) {\r\n updater.clearPreview();\r\n }\r\n }\r\n registerPreviewUpdater(settingIds, updater) {\r\n for (const settingId of settingIds) {\r\n if (!this.settingPreviewUpdaters.hasOwnProperty(settingId)) {\r\n this.settingPreviewUpdaters[settingId] = [];\r\n }\r\n this.settingPreviewUpdaters[settingId].push(updater);\r\n }\r\n if (this.allPreviewUpdaters.indexOf(updater) < 0) {\r\n this.allPreviewUpdaters.push(updater);\r\n }\r\n }\r\n registerPreviewCallback(settingId, callback) {\r\n this.registerPreviewUpdater([settingId], new PreviewCallbackWrapper(callback));\r\n }\r\n canPreview(settingId) {\r\n return (this.settingPreviewUpdaters.hasOwnProperty(settingId)\r\n && (this.settingPreviewUpdaters[settingId].length > 0));\r\n }\r\n }\r\n AmeCustomizable.PreviewRegistry = PreviewRegistry;\r\n class PreviewCallbackWrapper {\r\n constructor(callback) {\r\n this.callback = callback;\r\n }\r\n preview(settingId, value, getSettingValue) {\r\n this.callback(value);\r\n }\r\n clearPreview() {\r\n //Nothing to do in this case.\r\n }\r\n }\r\n class ThrottledPreviewRegistry extends PreviewRegistry {\r\n constructor(previewValueGetter, minPreviewRefreshInterval = 40) {\r\n super(previewValueGetter);\r\n this.minPreviewRefreshInterval = minPreviewRefreshInterval;\r\n this.pendingSettings = {};\r\n this.throttledUpdate = throttleAnimationFrame(this.applyPendingUpdates.bind(this), this.minPreviewRefreshInterval);\r\n }\r\n queuePreview(settingId) {\r\n this.pendingSettings[settingId] = true;\r\n this.throttledUpdate();\r\n }\r\n applyPendingUpdates() {\r\n //Cancel any pending updates in case this method was called directly.\r\n this.throttledUpdate.cancel();\r\n const pendingSettingIds = Object.keys(this.pendingSettings);\r\n if (pendingSettingIds.length === 0) {\r\n return;\r\n }\r\n this.updatePreview(pendingSettingIds);\r\n this.pendingSettings = {};\r\n }\r\n /**\r\n * Update the preview for the specified settings.\r\n *\r\n * This method is called by the throttled update function, but it can also be called\r\n * directly if necessary, e.g. to update the preview for all settings when the user\r\n * opens a settings screen for the first time. Note that calling it will *not* cancel\r\n * pending updates.\r\n *\r\n * @param settingIds\r\n */\r\n updatePreview(settingIds) {\r\n if (settingIds.length < 1) {\r\n return;\r\n }\r\n for (const settingId of settingIds) {\r\n const value = this.previewValueGetter(settingId, this.notFound);\r\n if (value !== this.notFound) {\r\n this.preview(settingId, value);\r\n }\r\n }\r\n }\r\n clearPreview() {\r\n this.throttledUpdate.cancel();\r\n this.pendingSettings = {};\r\n super.clearPreview();\r\n }\r\n }\r\n AmeCustomizable.ThrottledPreviewRegistry = ThrottledPreviewRegistry;\r\n /**\r\n * Creates a throttled function that runs the specified callback at most once\r\n * every `minInterval` milliseconds.\r\n *\r\n * The callback is always invoked using `requestAnimationFrame()`, so it will be delayed\r\n * until the next frame even if the required interval has already passed.\r\n */\r\n function throttleAnimationFrame(callback, minInterval = 0) {\r\n /**\r\n * Expected time between animation frames. Intervals shorter than this will be ineffective.\r\n */\r\n const expectedFrameTime = 1000 / 60;\r\n /**\r\n * The threshold at which we will use `setTimeout()` instead of `requestAnimationFrame()`.\r\n */\r\n const timeoutThreshold = Math.max(1000 / 20, expectedFrameTime * 2 + 1);\r\n const epsilon = 0.001;\r\n let requestAnimationFrameId = null;\r\n let timerId = null;\r\n let lastCallTimestamp = 0;\r\n let nextCallTimestamp = 0;\r\n function animationCallback() {\r\n requestAnimationFrameId = null;\r\n const now = Date.now();\r\n if (nextCallTimestamp <= now) {\r\n lastCallTimestamp = now;\r\n callback();\r\n return;\r\n }\r\n else {\r\n requestAnimationFrameId = window.requestAnimationFrame(animationCallback);\r\n }\r\n }\r\n const invoke = () => {\r\n if ((requestAnimationFrameId !== null) || (timerId !== null)) {\r\n return; //Already scheduled.\r\n }\r\n nextCallTimestamp = lastCallTimestamp + minInterval;\r\n const now = Date.now();\r\n if (nextCallTimestamp <= now) {\r\n nextCallTimestamp = now + expectedFrameTime - epsilon;\r\n }\r\n //Two-stage throttling: If the remaining time is large, use setTimeout().\r\n //If it's small, use requestAnimationFrame() and go frame by frame.\r\n const remainingTime = nextCallTimestamp - now;\r\n if (remainingTime > timeoutThreshold) {\r\n timerId = window.setTimeout(() => {\r\n timerId = null;\r\n requestAnimationFrameId = window.requestAnimationFrame(animationCallback);\r\n }, remainingTime - (expectedFrameTime / 2));\r\n }\r\n else {\r\n //Use requestAnimationFrame.\r\n requestAnimationFrameId = window.requestAnimationFrame(animationCallback);\r\n }\r\n };\r\n invoke.cancel = () => {\r\n if (requestAnimationFrameId !== null) {\r\n window.cancelAnimationFrame(requestAnimationFrameId);\r\n requestAnimationFrameId = null;\r\n }\r\n if (timerId !== null) {\r\n window.clearTimeout(timerId);\r\n timerId = null;\r\n }\r\n };\r\n return invoke;\r\n }\r\n //endregion\r\n})(AmeCustomizable || (AmeCustomizable = {}));\r\nexport var AmeCustomizableViewModel;\r\n(function (AmeCustomizableViewModel) {\r\n var SettingCollection = AmeCustomizable.SettingCollection;\r\n var Setting = AmeCustomizable.Setting;\r\n var ThrottledPreviewRegistry = AmeCustomizable.ThrottledPreviewRegistry;\r\n var SettingReaderRegistry = AmeCustomizable.SettingReaderRegistry;\r\n var lift = AmeMiniFunc.lift;\r\n class SimpleVm extends ThrottledPreviewRegistry {\r\n constructor(extraPreviewCondition = null) {\r\n const getSettingValue = (settingId, defaultResult) => {\r\n const setting = this.getOrCreateKnownSetting(settingId);\r\n if (setting !== null) {\r\n return setting.value();\r\n }\r\n return defaultResult;\r\n };\r\n super(getSettingValue, 40);\r\n this.previewDesired = ko.observable(false);\r\n this.settings = new SettingCollection();\r\n this.settingReaders = new SettingReaderRegistry();\r\n this.isPreviewPossible = ko.pureComputed(() => {\r\n return this.allPreviewUpdaters().length > 0;\r\n });\r\n this.isPreviewEnabled = ko.computed({\r\n read: () => {\r\n if (extraPreviewCondition !== null) {\r\n if (!extraPreviewCondition()) {\r\n return false;\r\n }\r\n }\r\n return this.getPreviewActiveState();\r\n },\r\n write: (newValue) => {\r\n this.previewDesired(newValue);\r\n if (newValue && !this.getPreviewActiveState()) {\r\n //Can't actually enable preview. Reset the checkbox/other input.\r\n this.isPreviewEnabled.notifySubscribers();\r\n }\r\n }\r\n });\r\n this.isPreviewEnabled.subscribe((newValue) => {\r\n if (newValue) {\r\n this.updatePreview(this.settings.getAllSettingIds());\r\n }\r\n else {\r\n this.clearPreview();\r\n }\r\n });\r\n this.settings.addChangeListener((setting) => {\r\n if (!this.isPreviewEnabled()) {\r\n return;\r\n }\r\n this.queuePreview(setting.id);\r\n });\r\n }\r\n getSettingObservable(settingId, unusedDefaultValue = null) {\r\n const result = this.getOrCreateKnownSetting(settingId);\r\n if (result !== null) {\r\n return result.value;\r\n }\r\n throw new Error('Unknown setting ID: ' + settingId);\r\n }\r\n getOrCreateKnownSetting(settingId) {\r\n const result = this.settings.get(settingId);\r\n if (result.isDefined()) {\r\n return result.get();\r\n }\r\n const foundValue = this.settingReaders.getValue(settingId);\r\n if (foundValue.isDefined()) {\r\n const setting = new Setting(settingId, foundValue.get());\r\n this.settings.add(setting);\r\n return setting;\r\n }\r\n return null;\r\n }\r\n registerSettingReader(reader, idPrefix = null) {\r\n this.settingReaders.registerValueReader(reader, idPrefix);\r\n }\r\n getPreviewActiveState() {\r\n return this.previewDesired() && this.isPreviewPossible();\r\n }\r\n getAllSettingValues() {\r\n return this.settings.getAllSettingValues();\r\n }\r\n /**\r\n * Reread all settings from the value readers. This will be used to reload settings\r\n * in case the underlying configuration is reset or a new configuration is loaded.\r\n */\r\n reloadAllSettings() {\r\n for (const settingId of this.settings.getAllSettingIds()) {\r\n lift([this.settings.get(settingId), this.settingReaders.getValue(settingId)], (setting, newValue) => setting.value(newValue));\r\n }\r\n }\r\n }\r\n AmeCustomizableViewModel.SimpleVm = SimpleVm;\r\n // noinspection JSUnusedGlobalSymbols -- Not used right now, but kept for testing and prototyping purposes.\r\n class NullVm {\r\n constructor() {\r\n this.settings = new SettingCollection();\r\n }\r\n getSettingObservable(settingId, defaultValue = null) {\r\n const existingSetting = this.settings.get(settingId);\r\n if (existingSetting.isDefined()) {\r\n return existingSetting.get().value;\r\n }\r\n const setting = new Setting(settingId, defaultValue);\r\n this.settings.add(setting);\r\n return setting.value;\r\n }\r\n getAllSettingValues() {\r\n return this.settings.getAllSettingValues();\r\n }\r\n }\r\n AmeCustomizableViewModel.NullVm = NullVm;\r\n})(AmeCustomizableViewModel || (AmeCustomizableViewModel = {}));\r\n//# sourceMappingURL=customizable.js.map"],"names":[],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"customizable.bundle.js","mappings":";;;;;;;;;;;;;;AAAa;AACN;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,aAAa;AACb;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA,kDAAkD,YAAY;AAC9D;AACA,qBAAqB;AACrB;AACA;AACA;AACA,kDAAkD,YAAY;AAC9D;AACA,qBAAqB;AACrB;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2DAA2D,SAAS;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,eAAe;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,2BAA2B,kIAAkI;AAC9M;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,iCAAiC,uBAAuB;AACzG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,iDAAiD,iCAAiC,wGAAwG;AAC1L;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,kBAAkB;AACvD;AACA;AACA;AACA;AACA;AACA,yBAAyB,mBAAmB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,0CAA0C;AACpC;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,4DAA4D;AAC7D","sources":["webpack:///./extras/pro-customizables/assets/customizable.js"],"sourcesContent":["'use strict';\r\nexport var AmeCustomizable;\r\n(function (AmeCustomizable) {\r\n var some = AmeMiniFunc.some;\r\n var none = AmeMiniFunc.none;\r\n var Either = AmeMiniFunc.Either;\r\n const _ = wsAmeLodash;\r\n class Setting {\r\n constructor(id, value = null, defaultValue = null, supportsPostMessage = false, groupTitle = null, validator = null) {\r\n this.validator = validator;\r\n this.groupTitle = null;\r\n /**\r\n * The last value that was tried to be set. This is used to ignore server-side\r\n * validation errors when the input value has changed since the request was sent.\r\n *\r\n * Displayed validation errors should be relevant to what the user tried\r\n * to enter, not the currently stored setting value.\r\n */\r\n this.lastTriedNewValue = null;\r\n this.id = id;\r\n this.underlyingValue = ko.observable(value);\r\n this.defaultValue = defaultValue;\r\n this.supportsPostMessage = supportsPostMessage;\r\n this.groupTitle = groupTitle;\r\n this.lastTriedNewValue = value;\r\n this.value = ko.computed({\r\n read: () => this.underlyingValue(),\r\n write: (newValue) => {\r\n const errors = this.tryUpdate(newValue);\r\n if (errors && (errors.length > 0)) {\r\n /*\r\n We could revert to the previous value here, but there are some cases where\r\n that would interfere with the user's input. For example, if the user is\r\n manually typing in a URL, the value will be temporarily invalid until they\r\n finish entering the protocol and domain name. If we revert to the previous\r\n value, the user will have to start over.\r\n\r\n Instead, let's leave the invalid value in place and let the user fix it.\r\n */\r\n }\r\n },\r\n owner: this\r\n });\r\n this.validationErrors = ko.observableArray();\r\n this.isValid = ko.computed(() => {\r\n return (this.validationErrors().length === 0);\r\n });\r\n }\r\n tryUpdate(newValue) {\r\n this.lastTriedNewValue = newValue;\r\n const oldValue = this.underlyingValue();\r\n //Clear validation errors.\r\n this.validationErrors.removeAll();\r\n //Validate and sanitize the new value.\r\n const [sanitizedValue, errors] = this.validate(newValue);\r\n this.validationErrors.push(...errors);\r\n if (errors.length > 0) {\r\n return errors;\r\n }\r\n //Remember the last validation subject so that server-side validation results\r\n //can be ignored if the value has changed since the request was sent.\r\n this.lastTriedNewValue = sanitizedValue;\r\n //Only update the underlying value if it has changed.\r\n if (sanitizedValue !== oldValue) {\r\n this.underlyingValue(sanitizedValue);\r\n }\r\n return [];\r\n }\r\n validate(newValue) {\r\n if (this.validator !== null) {\r\n const result = this.validator.check(newValue);\r\n if (result.isLeft()) {\r\n return [newValue, [result.value]];\r\n }\r\n else if (result.isRight()) {\r\n newValue = result.value;\r\n }\r\n }\r\n return [newValue, []];\r\n }\r\n /**\r\n * Add validation errors to the setting if the current value still\r\n * matches the given value.\r\n *\r\n * This is intended as a way to add validation errors that were produced\r\n * asynchronously, such as by sending the value to the server for validation.\r\n * The setting's value can change while the validation is in progress,\r\n * so we need to check that the validated value matches the current one.\r\n *\r\n * @param subjectValue\r\n * @param errors\r\n */\r\n addValidationErrorsForValue(subjectValue, errors) {\r\n if (this.lastTriedNewValue !== subjectValue) {\r\n return;\r\n }\r\n //Add the error(s) only if there is no existing error with the same code.\r\n const existingCodes = _.indexBy(this.validationErrors(), 'code');\r\n for (const error of errors) {\r\n if ((typeof error.code === 'undefined') || !existingCodes.hasOwnProperty(error.code)) {\r\n this.validationErrors.push(error);\r\n }\r\n }\r\n }\r\n clearValidationErrorsForValue(subjectValue) {\r\n if (this.lastTriedNewValue !== subjectValue) {\r\n return;\r\n }\r\n this.validationErrors.removeAll();\r\n }\r\n }\r\n AmeCustomizable.Setting = Setting;\r\n function unserializeSettingMap(settings) {\r\n const collection = new SettingCollection();\r\n for (const settingId in settings) {\r\n if (!settings.hasOwnProperty(settingId)) {\r\n continue;\r\n }\r\n const definition = settings[settingId];\r\n collection.add(unserializeSetting(settingId, definition));\r\n }\r\n return collection;\r\n }\r\n AmeCustomizable.unserializeSettingMap = unserializeSettingMap;\r\n function unserializeSetting(settingId, definition) {\r\n return new Setting(settingId, (typeof definition.value !== 'undefined') ? definition.value : null, (typeof definition.defaultValue !== 'undefined') ? definition.defaultValue : null, (typeof definition.supportsPostMessage !== 'undefined') ? definition.supportsPostMessage : false, (typeof definition.groupTitle !== 'undefined') ? definition.groupTitle : null, (typeof definition.validation !== 'undefined') ? (new Validator(definition.validation)) : null);\r\n }\r\n AmeCustomizable.unserializeSetting = unserializeSetting;\r\n const BuiltinParsers = {\r\n 'numeric': (value, config) => {\r\n //In some UI controls the observable value is updated as the user types,\r\n //so this parser/validator should be tolerant and accept partial values.\r\n let parsed;\r\n let sanitized;\r\n if (typeof value === 'number') {\r\n parsed = sanitized = value;\r\n }\r\n else {\r\n sanitized = (typeof value === 'string') ? value : String(value);\r\n sanitized = AmeMiniFunc.sanitizeNumericString(sanitized);\r\n parsed = parseFloat(sanitized);\r\n if (isNaN(parsed)) {\r\n return Either.left({\r\n message: 'Value must be a number.',\r\n code: 'invalid_number'\r\n });\r\n }\r\n }\r\n if (config) {\r\n if ((typeof config.min !== 'undefined') && parsed < config.min) {\r\n return Either.left({\r\n message: `Value must be ${config.min} or greater`,\r\n code: 'min_value'\r\n });\r\n }\r\n if (typeof config.max !== 'undefined' && parsed > config.max) {\r\n return Either.left({\r\n message: `Value must be ${config.max} or lower`,\r\n code: 'max_value'\r\n });\r\n }\r\n }\r\n return Either.right(sanitized);\r\n },\r\n 'int': (value) => {\r\n let parsed = (typeof value === 'number') ? value : parseInt(String(value), 10);\r\n if (isNaN(parsed)) {\r\n return Either.left({\r\n message: 'Value must be a number.',\r\n code: 'invalid_type'\r\n });\r\n }\r\n parsed = Math.floor(parsed);\r\n return Either.right(parsed);\r\n }\r\n };\r\n class Validator {\r\n constructor(config) {\r\n this.config = config;\r\n this.parsers = [];\r\n //Converting to null is only allowed if the setting is nullable.\r\n if (config.convertEsToNull && !config.isNullable) {\r\n throw new Error('convertEsToNull is only allowed if the setting is nullable.');\r\n }\r\n if (config.parsers) {\r\n for (const [parserId, parserConfig] of config.parsers) {\r\n if (!BuiltinParsers.hasOwnProperty(parserId)) {\r\n throw new Error(`Unknown parser: ${parserId}`);\r\n }\r\n this.parsers.push([BuiltinParsers[parserId], parserConfig]);\r\n }\r\n }\r\n }\r\n check(value) {\r\n if (value === null) {\r\n if (this.config.isNullable) {\r\n return Either.right(value);\r\n }\r\n else {\r\n return Either.left({\r\n message: 'This setting cannot be null.'\r\n });\r\n }\r\n }\r\n if (typeof value === 'string') {\r\n if (this.config.convertEsToNull && (value === '')) {\r\n return Either.right(null);\r\n }\r\n }\r\n for (const [parser, parserConfig] of this.parsers) {\r\n const result = parser(value, (parserConfig === null) ? undefined : parserConfig);\r\n if (result.isLeft()) {\r\n return result;\r\n }\r\n else if (result.isRight()) {\r\n value = result.value;\r\n }\r\n }\r\n return Either.right(value);\r\n }\r\n }\r\n class SettingCollection {\r\n constructor() {\r\n this.settings = {};\r\n /**\r\n * Adding settings to an observable array makes it easier to automatically\r\n * update computed values like \"are any settings invalid?\".\r\n */\r\n this.observableSettings = ko.observableArray();\r\n const self = this;\r\n this.hasValidationErrors = ko.pureComputed(() => {\r\n return _.some(self.observableSettings(), (setting) => {\r\n return !setting.isValid();\r\n });\r\n });\r\n this.changeListeners = new Map();\r\n }\r\n get(id) {\r\n if (this.settings.hasOwnProperty(id)) {\r\n return some(this.settings[id]);\r\n }\r\n return none;\r\n }\r\n add(setting) {\r\n this.settings[setting.id] = setting;\r\n this.observableSettings.push(setting);\r\n setting.value.subscribe((newValue) => this.onSettingChanged(setting, newValue));\r\n }\r\n onSettingChanged(setting, newValue) {\r\n this.notifyChangeListeners(setting, newValue);\r\n }\r\n /**\r\n * Add a callback that will be called whenever the value of a setting changes.\r\n *\r\n * @param callback\r\n */\r\n addChangeListener(callback) {\r\n const id = Symbol();\r\n this.changeListeners.set(id, callback);\r\n return id;\r\n }\r\n removeChangeListener(id) {\r\n this.changeListeners.delete(id);\r\n }\r\n notifyChangeListeners(setting, newValue) {\r\n for (const listener of this.changeListeners.values()) {\r\n listener(setting, newValue);\r\n }\r\n }\r\n getAllSettingIds() {\r\n return Object.keys(this.settings);\r\n }\r\n getAllSettingValues() {\r\n const values = {};\r\n for (const id in this.settings) {\r\n if (this.settings.hasOwnProperty(id)) {\r\n values[id] = this.settings[id].value();\r\n }\r\n }\r\n return values;\r\n }\r\n }\r\n AmeCustomizable.SettingCollection = SettingCollection;\r\n function isSettingConditionData(data) {\r\n if ((typeof data !== 'object') || (data === null)) {\r\n return false;\r\n }\r\n const dataAsRecord = data;\r\n return (typeof dataAsRecord.settingId === 'string'\r\n && typeof dataAsRecord.op === 'string'\r\n && typeof dataAsRecord.value !== 'undefined');\r\n }\r\n class SettingCondition {\r\n constructor(setting, op, value) {\r\n this.setting = setting;\r\n this.op = op;\r\n this.value = value;\r\n }\r\n evaluate() {\r\n const settingValue = this.setting.value();\r\n switch (this.op) {\r\n case '==':\r\n //Note the intentional use of == instead of ===.\r\n return settingValue == this.value;\r\n case '!=':\r\n return settingValue != this.value;\r\n case '>':\r\n return settingValue > this.value;\r\n case '<':\r\n return settingValue < this.value;\r\n case '>=':\r\n return settingValue >= this.value;\r\n case '<=':\r\n return settingValue <= this.value;\r\n case 'falsy':\r\n return !settingValue;\r\n case 'truthy':\r\n return !!settingValue;\r\n }\r\n }\r\n static fromData(data, findSetting) {\r\n const setting = findSetting(data.settingId);\r\n if (!setting || setting.isEmpty()) {\r\n throw new Error(`Setting with ID \"${data.settingId}\" not found for SettingCondition`);\r\n }\r\n return new SettingCondition(setting.get(), data.op, data.value);\r\n }\r\n }\r\n AmeCustomizable.SettingCondition = SettingCondition;\r\n class UiElement {\r\n constructor(data, children = []) {\r\n this.component = data.component || '';\r\n this.id = data.id || '';\r\n this.description = data.description || '';\r\n this.classes = data.classes || [];\r\n this.styles = data.styles || {};\r\n this.componentParams = data.params || {};\r\n this.children = children;\r\n }\r\n getComponentParams() {\r\n return Object.assign(Object.assign({}, this.componentParams), { uiElement: this, id: this.id, description: this.description, classes: this.classes, styles: this.styles, children: this.children });\r\n }\r\n }\r\n AmeCustomizable.UiElement = UiElement;\r\n class Container extends UiElement {\r\n constructor(data, children = []) {\r\n super(data, children);\r\n this.title = data.title;\r\n }\r\n replaceChild(oldChild, newChild) {\r\n const index = this.children.indexOf(oldChild);\r\n if (index === -1) {\r\n throw new Error('Child not found');\r\n }\r\n this.children[index] = newChild;\r\n }\r\n replaceChildByIndex(index, newChild) {\r\n this.children[index] = newChild;\r\n }\r\n }\r\n AmeCustomizable.Container = Container;\r\n class Section extends Container {\r\n constructor(data, children = []) {\r\n super(data, children);\r\n this.preferredRole = data.preferredRole || 'navigation';\r\n }\r\n }\r\n AmeCustomizable.Section = Section;\r\n class ControlGroup extends Container {\r\n constructor(data, children = [], enabled = null) {\r\n super(data, children);\r\n this.enabled = enabled || ko.observable(true);\r\n this.labelFor = data.labelFor || null;\r\n }\r\n getComponentParams() {\r\n return Object.assign(Object.assign({}, super.getComponentParams()), { enabled: this.enabled });\r\n }\r\n }\r\n AmeCustomizable.ControlGroup = ControlGroup;\r\n class InterfaceStructure extends Container {\r\n constructor(data, children = []) {\r\n super(data, children);\r\n }\r\n getAsSections() {\r\n let currentAnonymousSection = null;\r\n let sections = [];\r\n for (const child of this.children) {\r\n if (child instanceof Section) {\r\n sections.push(child);\r\n currentAnonymousSection = null;\r\n }\r\n else {\r\n if (!currentAnonymousSection) {\r\n currentAnonymousSection = new Section({\r\n t: 'section',\r\n title: '',\r\n children: []\r\n });\r\n sections.push(currentAnonymousSection);\r\n }\r\n currentAnonymousSection.children.push(child);\r\n }\r\n }\r\n return sections;\r\n }\r\n }\r\n AmeCustomizable.InterfaceStructure = InterfaceStructure;\r\n class Control extends UiElement {\r\n constructor(data, settings = {}, enabled = null, children = []) {\r\n super(data, children);\r\n this.label = data.label;\r\n this.settings = settings;\r\n this.inputClasses = data.inputClasses || [];\r\n this.inputAttributes = data.inputAttributes || {};\r\n this.enabled = enabled || ko.observable(true);\r\n // noinspection PointlessBooleanExpressionJS -- Might not actually be a boolean if sent from the server.\r\n this.includesOwnLabel = (typeof data.includesOwnLabel !== 'undefined') ? (!!data.includesOwnLabel) : false;\r\n this.labelTargetId = data.labelTargetId || '';\r\n this.primaryInputId = data.primaryInputId || '';\r\n this.settingValidationErrors = ko.pureComputed(() => {\r\n const errors = [];\r\n for (const [settingId, setting] of Object.entries(this.settings)) {\r\n const settingErrors = setting.validationErrors();\r\n if (settingErrors.length > 0) {\r\n for (const error of settingErrors) {\r\n errors.push([settingId, error]);\r\n }\r\n }\r\n }\r\n return errors;\r\n });\r\n }\r\n getComponentParams() {\r\n return Object.assign(Object.assign({}, super.getComponentParams()), { settings: this.settings, enabled: this.enabled, label: this.label, primaryInputId: this.primaryInputId });\r\n }\r\n getAutoGroupTitle() {\r\n if (this.settings['value']) {\r\n const customGroupTitle = this.settings['value'].groupTitle;\r\n if (customGroupTitle) {\r\n return customGroupTitle;\r\n }\r\n }\r\n return this.label;\r\n }\r\n /**\r\n * Create a control group wrapper with this control as its only child.\r\n */\r\n createControlGroup() {\r\n let title = this.getAutoGroupTitle();\r\n //Some controls like the checkbox already show their own label.\r\n //Don't add a group title in that case.\r\n if (this.includesOwnLabel) {\r\n title = '';\r\n }\r\n const data = {\r\n t: 'control-group',\r\n title: title\r\n };\r\n if (this.labelTargetId) {\r\n data.labelFor = this.labelTargetId;\r\n }\r\n return new ControlGroup(data, [this], this.enabled);\r\n }\r\n }\r\n AmeCustomizable.Control = Control;\r\n function unserializeUiElement(data, findSetting, dataCustomizer) {\r\n if (typeof dataCustomizer === 'function') {\r\n dataCustomizer(data);\r\n }\r\n const dataAsRecord = data;\r\n //Unserialize children recursively.\r\n let children = [];\r\n if ((typeof dataAsRecord['children'] !== 'undefined') && Array.isArray(dataAsRecord['children'])) {\r\n for (const childData of dataAsRecord['children']) {\r\n children.push(unserializeUiElement(childData, findSetting, dataCustomizer));\r\n }\r\n }\r\n //Unserialize the \"enabled\" condition.\r\n let enabled = null;\r\n if ((data.t === 'control') || (data.t === 'control-group')) {\r\n if (typeof data.enabled !== 'undefined') {\r\n if (isSettingConditionData(data.enabled)) {\r\n const condition = SettingCondition.fromData(data.enabled, findSetting);\r\n enabled = ko.pureComputed(() => condition.evaluate());\r\n }\r\n else {\r\n enabled = ko.pureComputed(() => !!data.enabled);\r\n }\r\n }\r\n else {\r\n enabled = ko.observable(true);\r\n }\r\n }\r\n switch (data.t) {\r\n case 'section':\r\n return new Section(data, children);\r\n case 'control-group':\r\n return new ControlGroup(data, children, enabled);\r\n case 'structure':\r\n return new InterfaceStructure(data, children);\r\n case 'control':\r\n let settings = {};\r\n if (data.settings) {\r\n for (const childName in data.settings) {\r\n if (data.settings.hasOwnProperty(childName)) {\r\n const settingId = data.settings[childName];\r\n const setting = findSetting(settingId);\r\n if (setting.isDefined()) {\r\n settings[childName] = setting.get();\r\n }\r\n else {\r\n throw new Error('Unknown setting \"' + settingId + '\" referenced by control \"' + data.label + '\".');\r\n }\r\n }\r\n }\r\n }\r\n return new Control(data, settings, enabled, children);\r\n }\r\n }\r\n AmeCustomizable.unserializeUiElement = unserializeUiElement;\r\n class SettingReaderRegistry {\r\n constructor() {\r\n this.notFound = {};\r\n this.valueReaders = [];\r\n }\r\n registerValueReader(getter, idPrefix = null) {\r\n this.valueReaders.push({ getter, idPrefix });\r\n }\r\n /**\r\n * Try to find a setting in a registered setting reader.\r\n */\r\n getValue(settingId) {\r\n for (const { getter, idPrefix } of this.valueReaders) {\r\n if ((idPrefix !== null) && !(settingId.startsWith(idPrefix))) {\r\n continue;\r\n }\r\n const result = getter(settingId, this.notFound);\r\n if (result !== this.notFound) {\r\n return some(result);\r\n }\r\n }\r\n return none;\r\n }\r\n }\r\n AmeCustomizable.SettingReaderRegistry = SettingReaderRegistry;\r\n class PreviewRegistry {\r\n constructor(previewValueGetter) {\r\n this.previewValueGetter = previewValueGetter;\r\n this.settingPreviewUpdaters = {};\r\n this.notFound = {};\r\n this.allPreviewUpdaters = ko.observableArray([]);\r\n }\r\n preview(settingId, value) {\r\n if (!this.settingPreviewUpdaters.hasOwnProperty(settingId)) {\r\n return;\r\n }\r\n const updaters = this.settingPreviewUpdaters[settingId];\r\n for (const updater of updaters) {\r\n updater.preview(settingId, value, this.previewValueGetter);\r\n }\r\n }\r\n clearPreview() {\r\n for (const updater of this.allPreviewUpdaters()) {\r\n updater.clearPreview();\r\n }\r\n }\r\n registerPreviewUpdater(settingIds, updater) {\r\n for (const settingId of settingIds) {\r\n if (!this.settingPreviewUpdaters.hasOwnProperty(settingId)) {\r\n this.settingPreviewUpdaters[settingId] = [];\r\n }\r\n this.settingPreviewUpdaters[settingId].push(updater);\r\n }\r\n if (this.allPreviewUpdaters.indexOf(updater) < 0) {\r\n this.allPreviewUpdaters.push(updater);\r\n }\r\n }\r\n registerPreviewCallback(settingId, callback) {\r\n this.registerPreviewUpdater([settingId], new PreviewCallbackWrapper(callback));\r\n }\r\n canPreview(settingId) {\r\n return (this.settingPreviewUpdaters.hasOwnProperty(settingId)\r\n && (this.settingPreviewUpdaters[settingId].length > 0));\r\n }\r\n }\r\n AmeCustomizable.PreviewRegistry = PreviewRegistry;\r\n class PreviewCallbackWrapper {\r\n constructor(callback) {\r\n this.callback = callback;\r\n }\r\n preview(settingId, value, getSettingValue) {\r\n this.callback(value);\r\n }\r\n clearPreview() {\r\n //Nothing to do in this case.\r\n }\r\n }\r\n class ThrottledPreviewRegistry extends PreviewRegistry {\r\n constructor(previewValueGetter, minPreviewRefreshInterval = 40) {\r\n super(previewValueGetter);\r\n this.minPreviewRefreshInterval = minPreviewRefreshInterval;\r\n this.pendingSettings = {};\r\n this.throttledUpdate = throttleAnimationFrame(this.applyPendingUpdates.bind(this), this.minPreviewRefreshInterval);\r\n }\r\n queuePreview(settingId) {\r\n this.pendingSettings[settingId] = true;\r\n this.throttledUpdate();\r\n }\r\n applyPendingUpdates() {\r\n //Cancel any pending updates in case this method was called directly.\r\n this.throttledUpdate.cancel();\r\n const pendingSettingIds = Object.keys(this.pendingSettings);\r\n if (pendingSettingIds.length === 0) {\r\n return;\r\n }\r\n this.updatePreview(pendingSettingIds);\r\n this.pendingSettings = {};\r\n }\r\n /**\r\n * Update the preview for the specified settings.\r\n *\r\n * This method is called by the throttled update function, but it can also be called\r\n * directly if necessary, e.g. to update the preview for all settings when the user\r\n * opens a settings screen for the first time. Note that calling it will *not* cancel\r\n * pending updates.\r\n *\r\n * @param settingIds\r\n */\r\n updatePreview(settingIds) {\r\n if (settingIds.length < 1) {\r\n return;\r\n }\r\n for (const settingId of settingIds) {\r\n const value = this.previewValueGetter(settingId, this.notFound);\r\n if (value !== this.notFound) {\r\n this.preview(settingId, value);\r\n }\r\n }\r\n }\r\n clearPreview() {\r\n this.throttledUpdate.cancel();\r\n this.pendingSettings = {};\r\n super.clearPreview();\r\n }\r\n }\r\n AmeCustomizable.ThrottledPreviewRegistry = ThrottledPreviewRegistry;\r\n /**\r\n * Creates a throttled function that runs the specified callback at most once\r\n * every `minInterval` milliseconds.\r\n *\r\n * The callback is always invoked using `requestAnimationFrame()`, so it will be delayed\r\n * until the next frame even if the required interval has already passed.\r\n */\r\n function throttleAnimationFrame(callback, minInterval = 0) {\r\n /**\r\n * Expected time between animation frames. Intervals shorter than this will be ineffective.\r\n */\r\n const expectedFrameTime = 1000 / 60;\r\n /**\r\n * The threshold at which we will use `setTimeout()` instead of `requestAnimationFrame()`.\r\n */\r\n const timeoutThreshold = Math.max(1000 / 20, expectedFrameTime * 2 + 1);\r\n const epsilon = 0.001;\r\n let requestAnimationFrameId = null;\r\n let timerId = null;\r\n let lastCallTimestamp = 0;\r\n let nextCallTimestamp = 0;\r\n function animationCallback() {\r\n requestAnimationFrameId = null;\r\n const now = Date.now();\r\n if (nextCallTimestamp <= now) {\r\n lastCallTimestamp = now;\r\n callback();\r\n return;\r\n }\r\n else {\r\n requestAnimationFrameId = window.requestAnimationFrame(animationCallback);\r\n }\r\n }\r\n const invoke = () => {\r\n if ((requestAnimationFrameId !== null) || (timerId !== null)) {\r\n return; //Already scheduled.\r\n }\r\n nextCallTimestamp = lastCallTimestamp + minInterval;\r\n const now = Date.now();\r\n if (nextCallTimestamp <= now) {\r\n nextCallTimestamp = now + expectedFrameTime - epsilon;\r\n }\r\n //Two-stage throttling: If the remaining time is large, use setTimeout().\r\n //If it's small, use requestAnimationFrame() and go frame by frame.\r\n const remainingTime = nextCallTimestamp - now;\r\n if (remainingTime > timeoutThreshold) {\r\n timerId = window.setTimeout(() => {\r\n timerId = null;\r\n requestAnimationFrameId = window.requestAnimationFrame(animationCallback);\r\n }, remainingTime - (expectedFrameTime / 2));\r\n }\r\n else {\r\n //Use requestAnimationFrame.\r\n requestAnimationFrameId = window.requestAnimationFrame(animationCallback);\r\n }\r\n };\r\n invoke.cancel = () => {\r\n if (requestAnimationFrameId !== null) {\r\n window.cancelAnimationFrame(requestAnimationFrameId);\r\n requestAnimationFrameId = null;\r\n }\r\n if (timerId !== null) {\r\n window.clearTimeout(timerId);\r\n timerId = null;\r\n }\r\n };\r\n return invoke;\r\n }\r\n //endregion\r\n})(AmeCustomizable || (AmeCustomizable = {}));\r\nexport var AmeCustomizableViewModel;\r\n(function (AmeCustomizableViewModel) {\r\n var SettingCollection = AmeCustomizable.SettingCollection;\r\n var Setting = AmeCustomizable.Setting;\r\n var ThrottledPreviewRegistry = AmeCustomizable.ThrottledPreviewRegistry;\r\n var SettingReaderRegistry = AmeCustomizable.SettingReaderRegistry;\r\n var lift = AmeMiniFunc.lift;\r\n class SimpleVm extends ThrottledPreviewRegistry {\r\n constructor(extraPreviewCondition = null) {\r\n const getSettingValue = (settingId, defaultResult) => {\r\n const setting = this.getOrCreateKnownSetting(settingId);\r\n if (setting !== null) {\r\n return setting.value();\r\n }\r\n return defaultResult;\r\n };\r\n super(getSettingValue, 40);\r\n this.previewDesired = ko.observable(false);\r\n this.settings = new SettingCollection();\r\n this.settingReaders = new SettingReaderRegistry();\r\n this.isPreviewPossible = ko.pureComputed(() => {\r\n return this.allPreviewUpdaters().length > 0;\r\n });\r\n this.isPreviewEnabled = ko.computed({\r\n read: () => {\r\n if (extraPreviewCondition !== null) {\r\n if (!extraPreviewCondition()) {\r\n return false;\r\n }\r\n }\r\n return this.getPreviewActiveState();\r\n },\r\n write: (newValue) => {\r\n this.previewDesired(newValue);\r\n if (newValue && !this.getPreviewActiveState()) {\r\n //Can't actually enable preview. Reset the checkbox/other input.\r\n this.isPreviewEnabled.notifySubscribers();\r\n }\r\n }\r\n });\r\n this.isPreviewEnabled.subscribe((newValue) => {\r\n if (newValue) {\r\n this.updatePreview(this.settings.getAllSettingIds());\r\n }\r\n else {\r\n this.clearPreview();\r\n }\r\n });\r\n this.settings.addChangeListener((setting) => {\r\n if (!this.isPreviewEnabled()) {\r\n return;\r\n }\r\n this.queuePreview(setting.id);\r\n });\r\n }\r\n getSettingObservable(settingId, unusedDefaultValue = null) {\r\n const result = this.getOrCreateKnownSetting(settingId);\r\n if (result !== null) {\r\n return result.value;\r\n }\r\n throw new Error('Unknown setting ID: ' + settingId);\r\n }\r\n getOrCreateKnownSetting(settingId) {\r\n const result = this.settings.get(settingId);\r\n if (result.isDefined()) {\r\n return result.get();\r\n }\r\n const foundValue = this.settingReaders.getValue(settingId);\r\n if (foundValue.isDefined()) {\r\n const setting = new Setting(settingId, foundValue.get());\r\n this.settings.add(setting);\r\n return setting;\r\n }\r\n return null;\r\n }\r\n registerSettingReader(reader, idPrefix = null) {\r\n this.settingReaders.registerValueReader(reader, idPrefix);\r\n }\r\n getPreviewActiveState() {\r\n return this.previewDesired() && this.isPreviewPossible();\r\n }\r\n getAllSettingValues() {\r\n return this.settings.getAllSettingValues();\r\n }\r\n /**\r\n * Reread all settings from the value readers. This will be used to reload settings\r\n * in case the underlying configuration is reset or a new configuration is loaded.\r\n */\r\n reloadAllSettings() {\r\n for (const settingId of this.settings.getAllSettingIds()) {\r\n lift([this.settings.get(settingId), this.settingReaders.getValue(settingId)], (setting, newValue) => setting.value(newValue));\r\n }\r\n }\r\n }\r\n AmeCustomizableViewModel.SimpleVm = SimpleVm;\r\n // noinspection JSUnusedGlobalSymbols -- Not used right now, but kept for testing and prototyping purposes.\r\n class NullVm {\r\n constructor() {\r\n this.settings = new SettingCollection();\r\n }\r\n getSettingObservable(settingId, defaultValue = null) {\r\n const existingSetting = this.settings.get(settingId);\r\n if (existingSetting.isDefined()) {\r\n return existingSetting.get().value;\r\n }\r\n const setting = new Setting(settingId, defaultValue);\r\n this.settings.add(setting);\r\n return setting.value;\r\n }\r\n getAllSettingValues() {\r\n return this.settings.getAllSettingValues();\r\n }\r\n }\r\n AmeCustomizableViewModel.NullVm = NullVm;\r\n})(AmeCustomizableViewModel || (AmeCustomizableViewModel = {}));\r\n//# sourceMappingURL=customizable.js.map"],"names":[],"sourceRoot":""} \ No newline at end of file diff --git a/dist/menu-styler-features.bundle.js b/dist/menu-styler-features.bundle.js new file mode 100644 index 0000000..c98bc06 --- /dev/null +++ b/dist/menu-styler-features.bundle.js @@ -0,0 +1,402 @@ +"use strict"; +(self["wsAmeWebpackChunk"] = self["wsAmeWebpackChunk"] || []).push([["menu-styler-features"],{ + +/***/ "./extras/modules/menu-styler/menu-styler-features.ts": +/*!************************************************************!*\ + !*** ./extras/modules/menu-styler/menu-styler-features.ts ***! + \************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "AmeMenuStylerJsFeatures": () => (/* binding */ AmeMenuStylerJsFeatures) +/* harmony export */ }); + +var AmeMenuStylerJsFeatures; +(function (AmeMenuStylerJsFeatures) { + const $ = jQuery; + class StylerJsFeature { + constructor(config) { + this.initialSettings = config.settings; + this.activeSettings = this.initialSettings; + this.settingMap = config.settingMap; + //Note: Subclasses should call `this.update(this.initialSettings)` in their constructor. + //It is not done here because the subclass constructor may need to do some setup first. + } + clearPreview() { + this.update(this.initialSettings); + } + ; + preview(settingId, value, getSettingValue) { + const localKey = this.settingMap[settingId]; + if (typeof localKey === 'undefined') { + if (console.warn) { + console.warn('Preview failed: The feature "' + this.getFeatureId() + + '" does not use the setting "' + settingId + '".'); + } + return; + } + let newSettings = Object.assign({}, this.activeSettings); + newSettings[localKey] = value; + //Get any known but missing settings using the callback. + for (const settingId in this.settingMap) { + if (this.settingMap.hasOwnProperty(settingId)) { + const localKey = this.settingMap[settingId]; + if (!newSettings.hasOwnProperty(localKey)) { + newSettings[localKey] = getSettingValue(settingId, null); + } + } + } + this.update(newSettings); + } + update(settings) { + this.activeSettings = settings; + } + /** + * Get the setting IDs that this feature uses. The feature can preview any of these settings. + */ + getPreviewableSettingIds() { + return Object.keys(this.settingMap); + } + } + class CollapseButtonTextFeature extends StylerJsFeature { + constructor(config) { + super(config); + this.originalLabel = null; + this.update(this.initialSettings); + } + update(settings) { + super.update(settings); + const $label = $('#adminmenu #collapse-button .collapse-button-label'); + if (this.originalLabel === null) { + this.originalLabel = $label.text(); + } + if ((typeof settings['label'] === 'undefined') || (settings.label === '') || (settings.label === null)) { + $label.text(this.originalLabel); + } + else { + $label.text(settings.label); + } + } + getFeatureId() { + return 'CollapseButtonTextFeature'; + } + } + AmeMenuStylerJsFeatures.CollapseButtonTextFeature = CollapseButtonTextFeature; + class MenuLogoFeature extends StylerJsFeature { + constructor(config) { + super(config); + this.$container = null; + this.$link = null; + this.$styleElement = null; + this.logoId = 'ame_ms_admin_menu_logo'; + this.linkId = 'ame_ms_menu_logo_link'; + /* + * Note: The logo container is set up so that the logo image is inside the content + * box (i.e. it does not overlap the padding or the margin), but the logo link covers + * the padding area. This way the user can control the clickable (padding) area and + * the unclickable (margin) area separately. + */ + this.staticLogoStyles = [ + 'background-size: contain;', + 'background-repeat: no-repeat;', + 'background-position: 0;', + 'background-origin: content-box;', + 'min-height: 10px;', + 'position: relative;', + 'display: block;', + 'box-sizing: content-box;', + ]; + this.staticLinkCss = `#adminmenu #${this.linkId} { + display: block; + position: absolute; + top: 0; left: 0; right: 0; bottom: 0; + margin: 0; + padding: 0; + background: transparent; + text-decoration: none; + } + #adminmenu #${this.linkId}:hover, #adminmenu #${this.linkId}:focus { + box-shadow: none; + transition: none; + color: transparent; + }`; + this.defaultMenuMarginTop = null; + this.defaultMenuMarginBottom = null; + this.update(this.initialSettings); + } + update(config) { + super.update(config); + this.updateFromActiveSettings(); + } + updateFromActiveSettings() { + const config = this.activeSettings; //Local reference in case the config changes while loading images. + const hasBaseImage = this.settingContainsImage(config.baseImage); + const hasCollapsedImage = this.settingContainsImage(config.collapsedImage); + if (!hasBaseImage && !hasCollapsedImage) { + this.removeLogo(); + return; + } + this.withLogoImages(config, (baseImageUrl, collapsedImageUrl) => { + const [$styleElement, $link] = this.getOrCreateElements(); + let baseLogoStyles = []; + let collapsedLogoStyles = []; + let hasBaseLogo = false; + let hasCollapsedLogo = false; + if (baseImageUrl) { + hasBaseLogo = true; + baseLogoStyles.push(`background-image: url("${baseImageUrl}");`); + const baseHeight = Math.max(config.baseHeight ? config.baseHeight : 10, 10); + baseLogoStyles.push(`height: ${baseHeight}px;`); + } + else { + baseLogoStyles.push('display: none;'); + } + if (collapsedImageUrl) { + hasCollapsedLogo = true; + collapsedLogoStyles.push(`background-image: url("${collapsedImageUrl}");`); + collapsedLogoStyles.push('display: block;'); + const collapsedHeight = Math.max(config.collapsedHeight ? config.collapsedHeight : 10, 10); + collapsedLogoStyles.push(`height: ${collapsedHeight}px;`); + } + else { + collapsedLogoStyles.push('display: none;'); + } + if (config.backgroundColor) { + baseLogoStyles.push(`background-color: ${config.backgroundColor};`); + } + const linkUrl = (typeof config.linkUrl === 'string') ? config.linkUrl.trim() : ''; + if (linkUrl) { + $link.show().attr('href', linkUrl); + } + else { + $link.hide().removeAttr('href'); + } + baseLogoStyles.unshift(...this.staticLogoStyles); + const baseStyle = `#adminmenu #${this.logoId} {\n${baseLogoStyles.join('\n')} }`; + const collapsedStyle = `.folded #adminmenu #${this.logoId} {\n${collapsedLogoStyles.join('\n')} }`; + //Remove the top margin from the admin menu when the logo is visible. + //We also need to let other AME components know that the vertical margin has changed. + //This affects the "Collapse button position" setting. + const [, menuMarginBottom] = this.getDefaultVerticalMenuMargins(); + let wrapperCss = `#adminmenuwrap { --ame-ms-menu-margin-bottom: ${menuMarginBottom}px; }`; + if (hasBaseLogo) { + wrapperCss += `body:not(.folded) #adminmenu { margin-top: 0; }\n`; + wrapperCss += `body:not(.folded) #adminmenuwrap { --ame-ms-menu-margin-top: 0px; }\n`; + } + if (hasCollapsedLogo) { + wrapperCss += `.folded #adminmenu { margin-top: 0; }\n`; + wrapperCss += `.folded #adminmenuwrap { --ame-ms-menu-margin-top: 0px; }\n`; + } + $styleElement.text(baseStyle + "\n" + collapsedStyle + "\n" + this.staticLinkCss + "\n" + wrapperCss); + }); + } + settingContainsImage(setting) { + if (setting === null) { + return false; + } + return !!(((setting.attachmentId !== null) && (setting.attachmentId > 0)) || setting.externalUrl); + } + withLogoImages(config, callback) { + let imageUrls = [ + this.getImageUrl(config.baseImage), + this.getImageUrl(config.collapsedImage), + ]; + //Add the logo as quickly as possible to prevent the menu from visibly shifting. + //Promises are usually asynchronous, so let's avoid them when possible and call + //the callback immediately if both URLs are already known or invalid. + if ((typeof imageUrls[0] === 'string') && (typeof imageUrls[1] === 'string')) { + callback(imageUrls[0], imageUrls[1]); + return; + } + //Assume that ES2020 is not available, so we can't use Promise.allSettled(). + //However, we want to wait for all promises to resolve, even if some fail. + Promise.all(imageUrls.map((p) => { + //Convert known values to resolved promises. + if ((typeof p === 'string') || (p === null)) { + return Promise.resolve(p); + } + return p.then((value) => (typeof value === 'string') ? value : null, () => null //Convert errors to null. + ); + })).then((results) => { + //If the active config has changed, don't apply the results. + //The URLs that we just loaded might not be relevant any more. + if (this.activeSettings !== config) { + return; + } + const [baseImageUrl, collapsedImageUrl] = results; + callback(baseImageUrl !== null && baseImageUrl !== void 0 ? baseImageUrl : null, collapsedImageUrl !== null && collapsedImageUrl !== void 0 ? collapsedImageUrl : null); + }); + } + getOrCreateElements() { + if (!this.$container) { + this.$container = $(`
  • `); + this.$link = $(``).appendTo(this.$container); + this.$container.prependTo('#adminmenu'); + } + if (!this.$styleElement) { + this.$styleElement = $('').appendTo('head'); + } + return [this.$styleElement, this.$link]; + } + getImageUrl(imageSetting) { + if (imageSetting === null) { + return null; + } + const externalUrl = (typeof imageSetting.externalUrl === 'string') ? imageSetting.externalUrl.trim() : ''; + if (externalUrl) { + return externalUrl; + } + const attachmentId = imageSetting.attachmentId || 0; + //const attachmentSiteId = imageSetting.attachmentSiteId || 0; + if (attachmentId > 0) { + //Use the cached attachment URL if possible. + if (imageSetting.attachmentUrl) { + return imageSetting.attachmentUrl; + } + //Load the attachment URL from the server. + if ((typeof wp !== 'undefined') && wp.media && wp.media.attachment) { + //Maybe it's already loaded? + let attachmentUrl = wp.media.attachment(attachmentId).get('url'); + if (attachmentUrl) { + return attachmentUrl; + } + const deferredLoader = $.Deferred(); + wp.media.attachment(attachmentId).fetch().then( + //Success + (attachment) => { + if (attachment && attachment.url) { + deferredLoader.resolve(attachment.url); + } + else { + deferredLoader.reject(); + } + }, + //Error + () => deferredLoader.reject()); + return deferredLoader.promise(); + } + } + //No image. + return null; + } + getDefaultVerticalMenuMargins() { + if ((this.defaultMenuMarginTop === null) || (this.defaultMenuMarginBottom === null)) { + //Get the vertical margins of the admin menu. The value includes the "px" suffix, + //but parseInt() will ignore it. + const $adminmenu = $('#adminmenu'); + this.defaultMenuMarginTop = parseInt($adminmenu.css('margin-top'), 10); + this.defaultMenuMarginBottom = parseInt($adminmenu.css('margin-bottom'), 10); + if (isNaN(this.defaultMenuMarginTop)) { + this.defaultMenuMarginTop = 0; + } + if (isNaN(this.defaultMenuMarginBottom)) { + this.defaultMenuMarginBottom = 0; + } + } + return [this.defaultMenuMarginTop, this.defaultMenuMarginBottom]; + } + removeLogo() { + if (this.$container) { + this.$container.remove(); + this.$container = null; + this.$link = null; + } + if (this.$styleElement) { + this.$styleElement.remove(); + this.$styleElement = null; + } + } + getFeatureId() { + return 'MenuLogoFeature'; + } + } + AmeMenuStylerJsFeatures.MenuLogoFeature = MenuLogoFeature; + //Always initialize the features if their config is available. + //They work normally on most admin pages, and are used for preview on the settings page. + AmeMenuStylerJsFeatures.collapseButtonFeature = null; + AmeMenuStylerJsFeatures.menuLogoFeature = null; + const collapseButtonFeatureKey = 'ameMenuStyler_collapseButtonTextFt'; + const menuLogoFeatureKey = 'ameMenuStyler_menuLogoFt'; + let isInitialized = false; + function createFeatureInstances() { + if (isInitialized) { + return; + } + isInitialized = true; + //If the script is loaded multiple times, the features might already exist. + //This can happen because the script is both enqueued normally and imported + //as a module on the settings page. + //We want each feature to be initialized only once, so we'll store them + //in the window object and reuse them. + if (ameMenuStylerFeatureConfig.collapseButtonText) { + if (window[collapseButtonFeatureKey]) { + AmeMenuStylerJsFeatures.collapseButtonFeature = window[collapseButtonFeatureKey]; + } + else { + AmeMenuStylerJsFeatures.collapseButtonFeature = new CollapseButtonTextFeature(ameMenuStylerFeatureConfig.collapseButtonText); + window[collapseButtonFeatureKey] = AmeMenuStylerJsFeatures.collapseButtonFeature; + } + } + if (ameMenuStylerFeatureConfig.menuLogo) { + if (window[menuLogoFeatureKey]) { + AmeMenuStylerJsFeatures.menuLogoFeature = window[menuLogoFeatureKey]; + } + else { + AmeMenuStylerJsFeatures.menuLogoFeature = new MenuLogoFeature(ameMenuStylerFeatureConfig.menuLogo); + window[menuLogoFeatureKey] = AmeMenuStylerJsFeatures.menuLogoFeature; + } + } + /** + * Register the features with the Admin Customizer preview handler, if active. + * + * @param {AmeAdminCustomizerPreview.PreviewHandler} previewHandler + */ + function registerFeaturePreview(previewHandler) { + //Both features should exist in the AC preview, but let's check just in case. + if (!AmeMenuStylerJsFeatures.collapseButtonFeature || !AmeMenuStylerJsFeatures.menuLogoFeature) { + console.warn('Menu Styler: One or more features are not initialized in AC preview.'); + return; + } + previewHandler.registerPreviewUpdater(AmeMenuStylerJsFeatures.collapseButtonFeature.getPreviewableSettingIds(), AmeMenuStylerJsFeatures.collapseButtonFeature); + previewHandler.registerPreviewUpdater(AmeMenuStylerJsFeatures.menuLogoFeature.getPreviewableSettingIds(), AmeMenuStylerJsFeatures.menuLogoFeature); + } + if (typeof window['wsAdminCustomizerPreview'] !== 'undefined') { + registerFeaturePreview(window['wsAdminCustomizerPreview']); + } + else { + $(document).on('adminMenuEditor:acPreviewStart', (event, previewHandler) => { + registerFeaturePreview(previewHandler); + }); + } + } + //The #adminmenu element must be available before initialization. The DOMContentLoaded event + //works, but we can better avoid a visible change/FOUC by using a custom event that the plugin + //triggers immediately after WordPress outputs the admin menu. + $(document).one('adminMenuEditor:menuDomReady', createFeatureInstances); + $(createFeatureInstances); + //Register the features with the menu styler dialog. + $(document).on('adminMenuEditor:menuStylerUiRegister', function (_unused, vm) { + if (!vm) { + return; + } + createFeatureInstances(); + if (AmeMenuStylerJsFeatures.collapseButtonFeature) { + vm.registerPreviewUpdater(AmeMenuStylerJsFeatures.collapseButtonFeature.getPreviewableSettingIds(), AmeMenuStylerJsFeatures.collapseButtonFeature); + } + if (AmeMenuStylerJsFeatures.menuLogoFeature) { + vm.registerPreviewUpdater(AmeMenuStylerJsFeatures.menuLogoFeature.getPreviewableSettingIds(), AmeMenuStylerJsFeatures.menuLogoFeature); + } + }); +})(AmeMenuStylerJsFeatures || (AmeMenuStylerJsFeatures = {})); + + +/***/ }) + +}, +/******/ __webpack_require__ => { // webpackRuntimeModules +/******/ var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) +/******/ var __webpack_exports__ = (__webpack_exec__("./extras/modules/menu-styler/menu-styler-features.ts")); +/******/ } +]); +//# sourceMappingURL=menu-styler-features.bundle.js.map \ No newline at end of file diff --git a/dist/menu-styler-features.bundle.js.map b/dist/menu-styler-features.bundle.js.map new file mode 100644 index 0000000..d6fcd2b --- /dev/null +++ b/dist/menu-styler-features.bundle.js.map @@ -0,0 +1 @@ +{"version":3,"file":"menu-styler-features.bundle.js","mappings":";;;;;;;;;;;;;AAAa;AAMN,IAAU,uBAAuB,CA4evC;AA5eD,WAAiB,uBAAuB;IAGvC,MAAM,CAAC,GAAG,MAAM,CAAC;IAcjB,MAAe,eAAe;QAM7B,YAAsB,MAAwB;YAC7C,IAAI,CAAC,eAAe,GAAG,MAAM,CAAC,QAAQ,CAAC;YACvC,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,eAAe,CAAC;YAC3C,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;YACpC,wFAAwF;YACxF,uFAAuF;QACxF,CAAC;QAED,YAAY;YACX,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;QACnC,CAAC;QAAA,CAAC;QAEF,OAAO,CAAC,SAAiB,EAAE,KAAU,EAAE,eAAmD;YACzF,MAAM,QAAQ,GAAG,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;YAC5C,IAAI,OAAO,QAAQ,KAAK,WAAW,EAAE;gBACpC,IAAI,OAAO,CAAC,IAAI,EAAE;oBACjB,OAAO,CAAC,IAAI,CACX,+BAA+B,GAAG,IAAI,CAAC,YAAY,EAAE;0BACnD,8BAA8B,GAAG,SAAS,GAAG,IA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A4evC","sources":["webpack:///./extras/modules/menu-styler/menu-styler-features.ts"],"sourcesContent":["'use strict';\n\nimport {AmeCustomizable, AmeCustomizableViewModel} from '../../pro-customizables/assets/customizable.js';\n\ndeclare const ameMenuStylerFeatureConfig: AmeMenuStylerJsFeatures.FeatureScriptConfig;\n\nexport namespace AmeMenuStylerJsFeatures {\n\timport PreviewUpdater = AmeCustomizable.PreviewUpdater;\n\timport SimpleVm = AmeCustomizableViewModel.SimpleVm;\n\tconst $ = jQuery;\n\n\tinterface FeatureConfig {\n\t\tsettings: T;\n\t\tsettingMap: SettingMap;\n\t}\n\n\tinterface FeatureSettings {\n\t}\n\n\tinterface SettingMap {\n\t\t[settingId: string]: keyof T;\n\t}\n\n\tabstract class StylerJsFeature implements PreviewUpdater {\n\t\tprotected readonly initialSettings: S;\n\t\tprotected readonly settingMap: SettingMap;\n\n\t\tprotected activeSettings: S;\n\n\t\tprotected constructor(config: FeatureConfig) {\n\t\t\tthis.initialSettings = config.settings;\n\t\t\tthis.activeSettings = this.initialSettings;\n\t\t\tthis.settingMap = config.settingMap;\n\t\t\t//Note: Subclasses should call `this.update(this.initialSettings)` in their constructor.\n\t\t\t//It is not done here because the subclass constructor may need to do some setup first.\n\t\t}\n\n\t\tclearPreview(): void {\n\t\t\tthis.update(this.initialSettings);\n\t\t};\n\n\t\tpreview(settingId: string, value: any, getSettingValue: AmeCustomizable.SettingValueReader): void {\n\t\t\tconst localKey = this.settingMap[settingId];\n\t\t\tif (typeof localKey === 'undefined') {\n\t\t\t\tif (console.warn) {\n\t\t\t\t\tconsole.warn(\n\t\t\t\t\t\t'Preview failed: The feature \"' + this.getFeatureId()\n\t\t\t\t\t\t+ '\" does not use the setting \"' + settingId + '\".'\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tlet newSettings: S = {...this.activeSettings};\n\t\t\tnewSettings[localKey] = value;\n\n\t\t\t//Get any known but missing settings using the callback.\n\t\t\tfor (const settingId in this.settingMap) {\n\t\t\t\tif (this.settingMap.hasOwnProperty(settingId)) {\n\t\t\t\t\tconst localKey = this.settingMap[settingId];\n\t\t\t\t\tif (!newSettings.hasOwnProperty(localKey)) {\n\t\t\t\t\t\tnewSettings[localKey] = getSettingValue(settingId, null);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.update(newSettings);\n\t\t}\n\n\t\tprotected update(settings: S): void {\n\t\t\tthis.activeSettings = settings;\n\t\t}\n\n\t\t/**\n\t\t * Get the setting IDs that this feature uses. The feature can preview any of these settings.\n\t\t */\n\t\tgetPreviewableSettingIds(): string[] {\n\t\t\treturn Object.keys(this.settingMap);\n\t\t}\n\n\t\tabstract getFeatureId(): string;\n\t}\n\n\tinterface CollapseButtonTextSettings extends FeatureSettings {\n\t\tlabel: string;\n\t}\n\n\texport class CollapseButtonTextFeature extends StylerJsFeature {\n\t\tprotected originalLabel: string | null = null;\n\n\t\tconstructor(config: FeatureConfig) {\n\t\t\tsuper(config);\n\t\t\tthis.update(this.initialSettings);\n\t\t}\n\n\t\tprotected update(settings: CollapseButtonTextSettings): void {\n\t\t\tsuper.update(settings);\n\n\t\t\tconst $label = $('#adminmenu #collapse-button .collapse-button-label');\n\t\t\tif (this.originalLabel === null) {\n\t\t\t\tthis.originalLabel = $label.text();\n\t\t\t}\n\n\t\t\tif ((typeof settings['label'] === 'undefined') || (settings.label === '') || (settings.label === null)) {\n\t\t\t\t$label.text(this.originalLabel);\n\t\t\t} else {\n\t\t\t\t$label.text(settings.label);\n\t\t\t}\n\t\t}\n\n\t\tgetFeatureId(): string {\n\t\t\treturn 'CollapseButtonTextFeature';\n\t\t}\n\t}\n\n\tinterface ImageSettingValue {\n\t\tattachmentId: number | null;\n\t\tattachmentSiteId: number | null;\n\t\tattachmentUrl: string;\n\t\texternalUrl: string | null;\n\t\twidth: number | null;\n\t\theight: number | null;\n\t}\n\n\tinterface MenuLogoSettings extends FeatureSettings {\n\t\tbaseImage: ImageSettingValue | null;\n\t\tcollapsedImage: ImageSettingValue | null;\n\t\tlinkUrl: string | null;\n\t\tbackgroundColor: string | null;\n\t\tbaseHeight: number | null;\n\t\tcollapsedHeight: number | null;\n\t}\n\n\texport class MenuLogoFeature extends StylerJsFeature {\n\t\tprotected $container: JQuery | null = null;\n\t\tprotected $link: JQuery | null = null;\n\t\tprotected $styleElement: JQuery | null = null;\n\n\t\tprivate readonly logoId = 'ame_ms_admin_menu_logo';\n\t\tprivate readonly linkId = 'ame_ms_menu_logo_link';\n\n\t\t/*\n\t\t * Note: The logo container is set up so that the logo image is inside the content\n\t\t * box (i.e. it does not overlap the padding or the margin), but the logo link covers\n\t\t * the padding area. This way the user can control the clickable (padding) area and\n\t\t * the unclickable (margin) area separately.\n\t\t */\n\n\t\tprivate readonly staticLogoStyles = [\n\t\t\t'background-size: contain;',\n\t\t\t'background-repeat: no-repeat;',\n\t\t\t'background-position: 0;',\n\t\t\t'background-origin: content-box;',\n\t\t\t'min-height: 10px;',\n\t\t\t'position: relative;',\n\t\t\t'display: block;',\n\t\t\t'box-sizing: content-box;',\n\t\t];\n\n\t\tprivate readonly staticLinkCss = `#adminmenu #${this.linkId} {\n\t\t\tdisplay: block;\n\t\t\tposition: absolute;\n\t\t\ttop: 0; left: 0; right: 0; bottom: 0;\n\t\t\tmargin: 0;\n\t\t\tpadding: 0;\n\t\t\tbackground: transparent;\n\t\t\ttext-decoration: none;\n\t\t}\n\t\t#adminmenu #${this.linkId}:hover, #adminmenu #${this.linkId}:focus {\n\t\t\tbox-shadow: none;\n\t\t\ttransition: none;\n\t\t\tcolor: transparent;\n\t\t}`;\n\n\t\tprivate defaultMenuMarginTop: number | null = null;\n\t\tprivate defaultMenuMarginBottom: number | null = null;\n\n\t\tconstructor(config: FeatureConfig) {\n\t\t\tsuper(config);\n\t\t\tthis.update(this.initialSettings);\n\t\t}\n\n\t\tprotected update(config: MenuLogoSettings) {\n\t\t\tsuper.update(config);\n\t\t\tthis.updateFromActiveSettings();\n\t\t}\n\n\t\tprivate updateFromActiveSettings(): void {\n\t\t\tconst config = this.activeSettings; //Local reference in case the config changes while loading images.\n\n\t\t\tconst hasBaseImage = this.settingContainsImage(config.baseImage);\n\t\t\tconst hasCollapsedImage = this.settingContainsImage(config.collapsedImage);\n\t\t\tif (!hasBaseImage && !hasCollapsedImage) {\n\t\t\t\tthis.removeLogo();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.withLogoImages(config, (baseImageUrl, collapsedImageUrl) => {\n\t\t\t\tconst [$styleElement, $link] = this.getOrCreateElements();\n\t\t\t\tlet baseLogoStyles = [];\n\t\t\t\tlet collapsedLogoStyles = [];\n\n\t\t\t\tlet hasBaseLogo = false;\n\t\t\t\tlet hasCollapsedLogo = false;\n\n\t\t\t\tif (baseImageUrl) {\n\t\t\t\t\thasBaseLogo = true;\n\t\t\t\t\tbaseLogoStyles.push(`background-image: url(\"${baseImageUrl}\");`);\n\n\t\t\t\t\tconst baseHeight = Math.max(config.baseHeight ? config.baseHeight : 10, 10);\n\t\t\t\t\tbaseLogoStyles.push(`height: ${baseHeight}px;`);\n\t\t\t\t} else {\n\t\t\t\t\tbaseLogoStyles.push('display: none;')\n\t\t\t\t}\n\t\t\t\tif (collapsedImageUrl) {\n\t\t\t\t\thasCollapsedLogo = true;\n\t\t\t\t\tcollapsedLogoStyles.push(`background-image: url(\"${collapsedImageUrl}\");`);\n\t\t\t\t\tcollapsedLogoStyles.push('display: block;');\n\n\t\t\t\t\tconst collapsedHeight = Math.max(config.collapsedHeight ? config.collapsedHeight : 10, 10);\n\t\t\t\t\tcollapsedLogoStyles.push(`height: ${collapsedHeight}px;`);\n\t\t\t\t} else {\n\t\t\t\t\tcollapsedLogoStyles.push('display: none;');\n\t\t\t\t}\n\n\t\t\t\tif (config.backgroundColor) {\n\t\t\t\t\tbaseLogoStyles.push(`background-color: ${config.backgroundColor};`);\n\t\t\t\t}\n\n\t\t\t\tconst linkUrl = (typeof config.linkUrl === 'string') ? config.linkUrl.trim() : '';\n\t\t\t\tif (linkUrl) {\n\t\t\t\t\t$link.show().attr('href', linkUrl);\n\t\t\t\t} else {\n\t\t\t\t\t$link.hide().removeAttr('href');\n\t\t\t\t}\n\n\t\t\t\tbaseLogoStyles.unshift(...this.staticLogoStyles);\n\n\t\t\t\tconst baseStyle = `#adminmenu #${this.logoId} {\\n${baseLogoStyles.join('\\n')} }`;\n\t\t\t\tconst collapsedStyle = `.folded #adminmenu #${this.logoId} {\\n${collapsedLogoStyles.join('\\n')} }`;\n\n\t\t\t\t//Remove the top margin from the admin menu when the logo is visible.\n\t\t\t\t//We also need to let other AME components know that the vertical margin has changed.\n\t\t\t\t//This affects the \"Collapse button position\" setting.\n\t\t\t\tconst [, menuMarginBottom] = this.getDefaultVerticalMenuMargins();\n\t\t\t\tlet wrapperCss = `#adminmenuwrap { --ame-ms-menu-margin-bottom: ${menuMarginBottom}px; }`;\n\t\t\t\tif (hasBaseLogo) {\n\t\t\t\t\twrapperCss += `body:not(.folded) #adminmenu { margin-top: 0; }\\n`;\n\t\t\t\t\twrapperCss += `body:not(.folded) #adminmenuwrap { --ame-ms-menu-margin-top: 0px; }\\n`;\n\t\t\t\t}\n\t\t\t\tif (hasCollapsedLogo) {\n\t\t\t\t\twrapperCss += `.folded #adminmenu { margin-top: 0; }\\n`;\n\t\t\t\t\twrapperCss += `.folded #adminmenuwrap { --ame-ms-menu-margin-top: 0px; }\\n`;\n\t\t\t\t}\n\n\t\t\t\t$styleElement.text(baseStyle + \"\\n\" + collapsedStyle + \"\\n\" + this.staticLinkCss + \"\\n\" + wrapperCss);\n\t\t\t});\n\t\t}\n\n\t\tprivate settingContainsImage(setting: ImageSettingValue | null): boolean {\n\t\t\tif (setting === null) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn !!(((setting.attachmentId !== null) && (setting.attachmentId > 0)) || setting.externalUrl);\n\t\t}\n\n\t\tprivate withLogoImages(\n\t\t\tconfig: MenuLogoSettings,\n\t\t\tcallback: (baseImageUrl: string | null, collapsedImageUrl: string | null) => void\n\t\t): void {\n\t\t\tlet imageUrls = [\n\t\t\t\tthis.getImageUrl(config.baseImage),\n\t\t\t\tthis.getImageUrl(config.collapsedImage),\n\t\t\t];\n\n\t\t\t//Add the logo as quickly as possible to prevent the menu from visibly shifting.\n\t\t\t//Promises are usually asynchronous, so let's avoid them when possible and call\n\t\t\t//the callback immediately if both URLs are already known or invalid.\n\t\t\tif ((typeof imageUrls[0] === 'string') && (typeof imageUrls[1] === 'string')) {\n\t\t\t\tcallback(imageUrls[0], imageUrls[1]);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t//Assume that ES2020 is not available, so we can't use Promise.allSettled().\n\t\t\t//However, we want to wait for all promises to resolve, even if some fail.\n\t\t\tPromise.all(\n\t\t\t\timageUrls.map((p) => {\n\t\t\t\t\t//Convert known values to resolved promises.\n\t\t\t\t\tif ((typeof p === 'string') || (p === null)) {\n\t\t\t\t\t\treturn Promise.resolve(p);\n\t\t\t\t\t}\n\n\t\t\t\t\treturn p.then(\n\t\t\t\t\t\t(value) => (typeof value === 'string') ? value : null,\n\t\t\t\t\t\t() => null //Convert errors to null.\n\t\t\t\t\t) as JQueryPromise;\n\t\t\t\t})\n\t\t\t).then((results) => {\n\t\t\t\t//If the active config has changed, don't apply the results.\n\t\t\t\t//The URLs that we just loaded might not be relevant any more.\n\t\t\t\tif (this.activeSettings !== config) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst [baseImageUrl, collapsedImageUrl] = results;\n\t\t\t\tcallback(baseImageUrl ?? null, collapsedImageUrl ?? null);\n\t\t\t});\n\t\t}\n\n\t\tprivate getOrCreateElements(): [JQuery, JQuery] {\n\t\t\tif (!this.$container) {\n\t\t\t\tthis.$container = $(`
  • `);\n\t\t\t\tthis.$link = $(``).appendTo(this.$container);\n\t\t\t\tthis.$container.prependTo('#adminmenu');\n\t\t\t}\n\t\t\tif (!this.$styleElement) {\n\t\t\t\tthis.$styleElement = $('').appendTo('head');\n\t\t\t}\n\t\t\treturn [this.$styleElement, this.$link!];\n\t\t}\n\n\t\tprivate getImageUrl(imageSetting: ImageSettingValue | null): JQueryPromise | string | null {\n\t\t\tif (imageSetting === null) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tconst externalUrl = (typeof imageSetting.externalUrl === 'string') ? imageSetting.externalUrl.trim() : '';\n\t\t\tif (externalUrl) {\n\t\t\t\treturn externalUrl;\n\t\t\t}\n\n\t\t\tconst attachmentId = imageSetting.attachmentId || 0;\n\t\t\t//const attachmentSiteId = imageSetting.attachmentSiteId || 0;\n\t\t\tif (attachmentId > 0) {\n\t\t\t\t//Use the cached attachment URL if possible.\n\t\t\t\tif (imageSetting.attachmentUrl) {\n\t\t\t\t\treturn imageSetting.attachmentUrl;\n\t\t\t\t}\n\n\t\t\t\t//Load the attachment URL from the server.\n\t\t\t\tif ((typeof wp !== 'undefined') && wp.media && wp.media.attachment) {\n\t\t\t\t\t//Maybe it's already loaded?\n\t\t\t\t\tlet attachmentUrl = wp.media.attachment(attachmentId).get('url');\n\t\t\t\t\tif (attachmentUrl) {\n\t\t\t\t\t\treturn attachmentUrl;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst deferredLoader = $.Deferred();\n\t\t\t\t\twp.media.attachment(attachmentId).fetch().then(\n\t\t\t\t\t\t//Success\n\t\t\t\t\t\t(attachment: any) => {\n\t\t\t\t\t\t\tif (attachment && attachment.url) {\n\t\t\t\t\t\t\t\tdeferredLoader.resolve(attachment.url);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tdeferredLoader.reject();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\t//Error\n\t\t\t\t\t\t() => deferredLoader.reject()\n\t\t\t\t\t);\n\t\t\t\t\treturn deferredLoader.promise();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//No image.\n\t\t\treturn null;\n\t\t}\n\n\t\tprivate getDefaultVerticalMenuMargins(): [number, number] {\n\t\t\tif ((this.defaultMenuMarginTop === null) || (this.defaultMenuMarginBottom === null)) {\n\t\t\t\t//Get the vertical margins of the admin menu. The value includes the \"px\" suffix,\n\t\t\t\t//but parseInt() will ignore it.\n\t\t\t\tconst $adminmenu = $('#adminmenu');\n\t\t\t\tthis.defaultMenuMarginTop = parseInt($adminmenu.css('margin-top'), 10);\n\t\t\t\tthis.defaultMenuMarginBottom = parseInt($adminmenu.css('margin-bottom'), 10);\n\t\t\t\tif (isNaN(this.defaultMenuMarginTop)) {\n\t\t\t\t\tthis.defaultMenuMarginTop = 0;\n\t\t\t\t}\n\t\t\t\tif (isNaN(this.defaultMenuMarginBottom)) {\n\t\t\t\t\tthis.defaultMenuMarginBottom = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn [this.defaultMenuMarginTop, this.defaultMenuMarginBottom];\n\t\t}\n\n\t\tprivate removeLogo(): void {\n\t\t\tif (this.$container) {\n\t\t\t\tthis.$container.remove();\n\t\t\t\tthis.$container = null;\n\t\t\t\tthis.$link = null;\n\t\t\t}\n\t\t\tif (this.$styleElement) {\n\t\t\t\tthis.$styleElement.remove();\n\t\t\t\tthis.$styleElement = null;\n\t\t\t}\n\t\t}\n\n\t\tgetFeatureId(): string {\n\t\t\treturn 'MenuLogoFeature';\n\t\t}\n\t}\n\n\texport interface FeatureScriptConfig {\n\t\tcollapseButtonText?: FeatureConfig;\n\t\tmenuLogo?: FeatureConfig;\n\t}\n\n\t//Always initialize the features if their config is available.\n\t//They work normally on most admin pages, and are used for preview on the settings page.\n\texport let collapseButtonFeature: CollapseButtonTextFeature | null = null;\n\texport let menuLogoFeature: MenuLogoFeature | null = null;\n\tconst collapseButtonFeatureKey = 'ameMenuStyler_collapseButtonTextFt';\n\tconst menuLogoFeatureKey = 'ameMenuStyler_menuLogoFt';\n\n\tlet isInitialized = false;\n\n\tfunction createFeatureInstances() {\n\t\tif (isInitialized) {\n\t\t\treturn;\n\t\t}\n\t\tisInitialized = true;\n\n\t\t//If the script is loaded multiple times, the features might already exist.\n\t\t//This can happen because the script is both enqueued normally and imported\n\t\t//as a module on the settings page.\n\t\t//We want each feature to be initialized only once, so we'll store them\n\t\t//in the window object and reuse them.\n\t\tif (ameMenuStylerFeatureConfig.collapseButtonText) {\n\t\t\tif (window[collapseButtonFeatureKey]) {\n\t\t\t\tcollapseButtonFeature = window[collapseButtonFeatureKey];\n\t\t\t} else {\n\t\t\t\tcollapseButtonFeature = new CollapseButtonTextFeature(ameMenuStylerFeatureConfig.collapseButtonText);\n\t\t\t\twindow[collapseButtonFeatureKey] = collapseButtonFeature;\n\t\t\t}\n\t\t}\n\t\tif (ameMenuStylerFeatureConfig.menuLogo) {\n\t\t\tif (window[menuLogoFeatureKey]) {\n\t\t\t\tmenuLogoFeature = window[menuLogoFeatureKey];\n\t\t\t} else {\n\t\t\t\tmenuLogoFeature = new MenuLogoFeature(ameMenuStylerFeatureConfig.menuLogo);\n\t\t\t\twindow[menuLogoFeatureKey] = menuLogoFeature;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Register the features with the Admin Customizer preview handler, if active.\n\t\t *\n\t\t * @param {AmeAdminCustomizerPreview.PreviewHandler} previewHandler\n\t\t */\n\t\tfunction registerFeaturePreview(previewHandler: any) {\n\t\t\t//Both features should exist in the AC preview, but let's check just in case.\n\t\t\tif (!collapseButtonFeature || !menuLogoFeature) {\n\t\t\t\tconsole.warn('Menu Styler: One or more features are not initialized in AC preview.');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tpreviewHandler.registerPreviewUpdater(\n\t\t\t\tcollapseButtonFeature.getPreviewableSettingIds(),\n\t\t\t\tcollapseButtonFeature\n\t\t\t);\n\t\t\tpreviewHandler.registerPreviewUpdater(\n\t\t\t\tmenuLogoFeature.getPreviewableSettingIds(),\n\t\t\t\tmenuLogoFeature\n\t\t\t);\n\t\t}\n\n\t\tif (typeof window['wsAdminCustomizerPreview'] !== 'undefined') {\n\t\t\tregisterFeaturePreview(window['wsAdminCustomizerPreview']);\n\t\t} else {\n\t\t\t$(document).on('adminMenuEditor:acPreviewStart', (event, previewHandler) => {\n\t\t\t\tregisterFeaturePreview(previewHandler);\n\t\t\t});\n\t\t}\n\t}\n\n\t//The #adminmenu element must be available before initialization. The DOMContentLoaded event\n\t//works, but we can better avoid a visible change/FOUC by using a custom event that the plugin\n\t//triggers immediately after WordPress outputs the admin menu.\n\n\t$(document).one('adminMenuEditor:menuDomReady', createFeatureInstances);\n\t$(createFeatureInstances);\n\n\t//Register the features with the menu styler dialog.\n\t$(document).on(\n\t\t'adminMenuEditor:menuStylerUiRegister',\n\t\tfunction (_unused, vm: SimpleVm) {\n\t\t\tif (!vm) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcreateFeatureInstances();\n\n\t\t\tif (collapseButtonFeature) {\n\t\t\t\tvm.registerPreviewUpdater(collapseButtonFeature.getPreviewableSettingIds(), collapseButtonFeature);\n\t\t\t}\n\t\t\tif (menuLogoFeature) {\n\t\t\t\tvm.registerPreviewUpdater(menuLogoFeature.getPreviewableSettingIds(), menuLogoFeature);\n\t\t\t}\n\t\t}\n\t);\n}\n\ndeclare global {\n\tinterface Window {\n\t\tameMenuStyler_menuLogoFt?: AmeMenuStylerJsFeatures.MenuLogoFeature;\n\t\tameMenuStyler_collapseButtonTextFt?: AmeMenuStylerJsFeatures.CollapseButtonTextFeature;\n\t}\n}"],"names":[],"sourceRoot":""} \ No newline at end of file diff --git a/dist/menu-styler-ui.bundle.js b/dist/menu-styler-ui.bundle.js new file mode 100644 index 0000000..68f522c --- /dev/null +++ b/dist/menu-styler-ui.bundle.js @@ -0,0 +1,1223 @@ +"use strict"; +(self["wsAmeWebpackChunk"] = self["wsAmeWebpackChunk"] || []).push([["menu-styler-ui"],{ + +/***/ "./extras/modules/menu-styler/menu-styler-ui.ts": +/*!******************************************************!*\ + !*** ./extras/modules/menu-styler/menu-styler-ui.ts ***! + \******************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _style_generator_style_generator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../style-generator/style-generator.js */ "./extras/style-generator/style-generator.js"); +/* harmony import */ var _pro_customizables_assets_customizable_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../pro-customizables/assets/customizable.js */ "./extras/pro-customizables/assets/customizable.js"); +/// +/// + + +jQuery(function ($) { + const _ = wsAmeLodash; + const styleConfigKey = 'menu_styles'; + /** + * Utility class that tells WordPress to pin or unpin the admin menu as needed + * when the menu dimensions or the top margin change. + * + * Uses throttling to avoid excessive updates. + */ + class StickyMenuUpdater { + constructor() { + this.$document = $(document); + this.$adminmenu = $('#adminmenu'); + this.previousHeight = null; + this.previousWidth = null; + this.previousTopMargin = null; + this.updateMenuPinState = _.throttle(() => { + const menuHeight = this.$adminmenu.outerHeight(); + const menuWidth = this.$adminmenu.outerWidth(); + const topMargin = parseInt(this.$adminmenu.css('margin-top'), 10); + if ((menuHeight !== this.previousHeight) + || (menuWidth !== this.previousWidth) + || (topMargin !== this.previousTopMargin)) { + this.previousHeight = menuHeight; + this.previousWidth = menuWidth; + this.previousTopMargin = topMargin; + //In practice, this update doesn't always work if done immediately. + //Not sure why, maybe menu dimensions don't change instantly when, for example, + //the user adds a logo image. Adding a small delay seems to help. + window.requestAnimationFrame(() => { + //The custom "wp-pin-menu" event was added to WP core in 2015. It can be used to update + //the menu "sticky" state. I'm using triggerHandler() instead of trigger() because this + //is what /wp-admin/js/widgets.js does. Hopefully, that will improve compatibility. + this.$document.triggerHandler('wp-pin-menu'); + }); + } + }, 1000, { leading: true, trailing: true }); + } + queueUpdate() { + this.updateMenuPinState(); + } + } + class MenuStylerViewModel extends _pro_customizables_assets_customizable_js__WEBPACK_IMPORTED_MODULE_1__.AmeCustomizableViewModel.SimpleVm { + constructor() { + /** + * This observable is initially stored in a local variable because TypeScript doesn't + * allow accessing `this` in the constructor before calling super(), but we still + * want to establish a dependency on the dialog open state so that preview gets enabled + * when the dialog is open. The observable will get updated later. + */ + const extraPreviewCondition = ko.observable(false); + super(extraPreviewCondition); + this.isFirstOpen = true; + this.$dialog = null; + this.stickyMenuUpdater = new StickyMenuUpdater(); + this.dialogOpenObservable = extraPreviewCondition; + this.previewPreference = new WsAmePreferenceCookie('MsPreviewEnabled', 90, true); + //Read settings from the currently loaded admin menu configuration + //using the aux-data API. Setting ID prefixes should already be registered. + const auxDataSettingReader = (settingId, defaultValue) => { + const path = AmeEditorApi.configDataAdapter.mapSettingIdToPath(settingId); + if (path === null) { + return defaultValue; + } + const value = AmeEditorApi.configDataAdapter.getPath(path, this.notFound); + if (value !== this.notFound) { + return value; + } + else if (ameMenuStylerConfig.defaults.hasOwnProperty(settingId)) { + return ameMenuStylerConfig.defaults[settingId]; + } + else { + throw new Error('Unknown aux config setting ID: ' + settingId); + } + }; + for (const auxPrefix of AmeEditorApi.configDataAdapter.getKnownPrefixes()) { + this.registerSettingReader(auxDataSettingReader, auxPrefix); + } + for (const previewConfig of ameMenuStylerConfig.stylePreviewConfigs) { + const previewInstance = new _style_generator_style_generator_js__WEBPACK_IMPORTED_MODULE_0__.AmeStyleGenerator.Preview.StyleGeneratorPreview(previewConfig); + this.registerPreviewUpdater(previewInstance.getPreviewableSettingIDs(), previewInstance); + } + $(document).trigger('adminMenuEditor:menuStylerUiRegister', [this]); + } + saveChanges() { + const settingsById = this.getAllSettingValues(); + //Sort by length of the setting ID and then by the ID itself to ensure parent settings + //are updated before their children. For example, this matters for color presets where + //the "activePreset" setting maps to the "[global]" property of the "colorPresets" setting. + const sortedIds = Object.keys(settingsById); + sortedIds.sort((a, b) => { + if (a.length !== b.length) { + return a.length - b.length; + } + return a.localeCompare(b); + }); + //Write all settings into a new object, then save the top-level properties + //of that. This way stale and empty settings will automatically be removed. + const updatedConfig = {}; + for (const settingId of sortedIds) { + const path = AmeEditorApi.configDataAdapter.mapSettingIdToPath(settingId); + if (path === null) { + continue; + } + const value = settingsById[settingId]; + //To save space, don't store null values. This could be extended by using + //the "deleteWhenBlank" property of the setting definition. + if (value === null) { + continue; + } + _.set(updatedConfig, path, value); + } + //Special: Update the last modified timestamp for menu styles. + _.set(updatedConfig, [styleConfigKey, '_lastModified'], (new Date()).toISOString()); + //Special: Remove empty color presets. + const colorPresets = _.get(updatedConfig, ['color_presets'], {}); + for (const presetName of Object.keys(colorPresets)) { + //Remove empty string values (i.e. no color selected). This also + //covers nulls and empty arrays/objects, but that shouldn't happen. + colorPresets[presetName] = _.omit(colorPresets[presetName], _.isEmpty); + //Remove the preset if it's empty. + if (_.isEmpty(colorPresets[presetName])) { + delete colorPresets[presetName]; + } + } + //Finally, write the top-level properties to the menu configuration. + for (const key in updatedConfig) { + if (!updatedConfig.hasOwnProperty(key)) { + continue; + } + const value = updatedConfig[key]; + AmeEditorApi.configDataAdapter.setPath(key, value); + } + $(document).trigger('adminMenuEditor:menuConfigChanged'); + } + isDialogOpen(newValue = null) { + if (!this.dialogOpenObservable) { + return false; + } + if (newValue !== null) { + this.dialogOpenObservable(newValue); + return newValue; + } + return this.dialogOpenObservable(); + } + getPreviewActiveState() { + //Disable preview when the dialog is not open. + if (!this.isDialogOpen()) { + return false; + } + return super.getPreviewActiveState(); + } + updatePreview(settingIds) { + super.updatePreview(settingIds); + this.stickyMenuUpdater.queueUpdate(); + } + setDialog($dialog) { + this.$dialog = $dialog; + let $overlay = null; + $dialog.on('dialogopen', () => { + this.isDialogOpen(true); + this.onOpenDialog(); + //Add a custom class to the overlay so that we can style it. + $overlay = $dialog.closest('.ui-dialog').nextAll('.ui-widget-overlay').first(); + $overlay.addClass('ame-ms-dialog-overlay'); + }); + $dialog.on('dialogclose', () => { + this.isDialogOpen(false); + if ($overlay) { + $overlay.removeClass('ame-ms-dialog-overlay'); + $overlay = null; + } + }); + } + onOpenDialog() { + if (!this.isFirstOpen) { + this.reloadAllSettings(); + } + if (this.isFirstOpen) { + this.isFirstOpen = false; + //Load the preview state from a cookie. + this.isPreviewEnabled(this.previewPreference.readAndRefresh(true)); + } + } + // noinspection JSUnusedGlobalSymbols -- Used in the KO template. + onConfirmDialog() { + //Save the preview state in a cookie. + this.previewPreference.write(this.isPreviewEnabled()); + this.saveChanges(); + this.closeDialog(); + } + onCancelDialog() { + this.closeDialog(); + } + closeDialog() { + if (this.$dialog !== null) { + this.$dialog.dialog('close'); + } + } + } + const $styleDialog = $('#ws-ame-menu-style-settings'); + let isDialogInitialized = false; + function initializeDialog() { + $styleDialog.dialog({ + autoOpen: false, + closeText: ' ', + draggable: false, + modal: true, + //Dialog dimensions and position are set in CSS. + minWidth: 300, + height: 400, + classes: { + 'ui-dialog': 'ui-corner-all ws-ame-menu-style-dialog', + } + }); + isDialogInitialized = true; + const vm = new MenuStylerViewModel(); + window['ameMenuStylerVm'] = vm; + ko.applyBindings(vm, $styleDialog[0]); + vm.setDialog($styleDialog); + } + //Open the dialog when the user clicks the style button. + $('#ws_edit_menu_styles').on('click', () => { + //Optimization: Initialize the dialog on the first click. + if (!isDialogInitialized) { + initializeDialog(); + } + //Reset the scroll position of the tab content area. + $styleDialog.find('.ame-tp-content').scrollTop(0); + $styleDialog.dialog('open'); + }); +}); + + +/***/ }), + +/***/ "./extras/style-generator/style-generator.js": +/*!***************************************************!*\ + !*** ./extras/style-generator/style-generator.js ***! + \***************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "AmeStyleGenerator": () => (/* binding */ AmeStyleGenerator) +/* harmony export */ }); +var AmeStyleGenerator; +(function (AmeStyleGenerator) { + const $ = jQuery; + class ValueDescriptor { + } + class ConstantValue extends ValueDescriptor { + constructor(value) { + super(); + this.value = value; + } + getValue() { + return this.value; + } + } + class ArrayValue extends ValueDescriptor { + constructor(items) { + super(); + this.items = items; + } + getValue() { + return this.items.map(item => item.getValue()); + } + getItemDescriptors() { + return this.items; + } + } + class SettingReference extends ValueDescriptor { + constructor(settingId, valueGetter) { + super(); + this.settingId = settingId; + this.valueGetter = valueGetter; + } + getValue() { + return this.valueGetter(this.settingId); + } + } + class VariableReference extends ValueDescriptor { + constructor(name, valueGetter) { + super(); + this.name = name; + this.valueGetter = valueGetter; + } + getValue() { + return this.valueGetter(this.name); + } + } + class FunctionCall extends ValueDescriptor { + constructor(args, callback) { + super(); + this.args = args; + this.callback = callback; + } + getValue() { + return this.callback(this.resolveArgs(this.args)); + } + resolveArgs(args) { + if (Array.isArray(args)) { + return args.map(arg => arg.getValue()); + } + return Object.keys(args).reduce((result, key) => { + result[key] = args[key].getValue(); + return result; + }, {}); + } + } + //endregion + function isEmptyCssValue(value) { + return (typeof value === 'undefined') || (value === '') || (value === null); + } + function convertToRgba(color, opacity = 1.0) { + color = color.trim(); + if (color === '') { + return 'transparent'; + } + //Strip the leading hash, if any. + if (color[0] === '#') { + color = color.substring(1); + } + //If the color is in the shorthand format, expand it. + if (color.length === 3) { + color = color[0] + color[0] + color[1] + color[1] + color[2] + color[2]; + } + //The color should now be in the full 6-digit format. Convert it to RGBA. + if (color.length === 6) { + const red = parseInt(color.substring(0, 2), 16); + const green = parseInt(color.substring(2, 4), 16); + const blue = parseInt(color.substring(4, 6), 16); + return `rgba(${red}, ${green}, ${blue}, ${opacity})`; + } + //The color may be invalid, or it's not in a hex format we recognize. + return color; + } + function uniqueArrayValues(array) { + return array.filter((value, index) => array.indexOf(value) === index); + } + function constrain(value, min, max) { + return Math.min(Math.max(value, min), max); + } + function modifyHexColorAsHsl(args, operation) { + const color = args.color || ''; + if (isEmptyCssValue(color)) { + return ''; + } + const hue = args.hue || null; + const saturation = args.saturation || null; + const lightness = args.lightness || null; + if ((hue === null) && (saturation === null) && (lightness === null)) { + return color; + } + let output = $.Color(color); + output = operation(output, hue, saturation, lightness); + return output.toHexString(); + } + // noinspection JSUnusedGlobalSymbols -- Used dynamically by declaration generators received from the server. + const builtinFunctions = { + simpleProperty: function (args) { + if (isEmptyCssValue(args.value)) { + return []; + } + return [args.name + ': ' + args.value + ';']; + }, + formatLength: function (args) { + if (isEmptyCssValue(args.value)) { + return ''; + } + //Normalize numeric values. For example, while JS accepts "1." as a number, + //"1.px" is not a valid CSS length value, so it should be converted to "1px". + const numericValue = parseFloat(String(args.value)); + if (isNaN(numericValue)) { + return ''; + } + return '' + numericValue + (args.unit || ''); + }, + shadow: function (args) { + const mode = args.mode || 'default'; + const color = args.color || ''; + if (mode === 'default') { + return []; + } + if ((mode === 'none') || (color === '') || (color === null) || (color === 'transparent')) { + return ['box-shadow: none;']; + } + if (mode !== 'custom') { + return []; + } + const components = []; + if (args.inset) { + components.push('inset'); + } + const horizontal = args['offset-x'] || 0; + const vertical = args['offset-y'] || 0; + const blur = args.blur || 0; + const spread = args.spread || 0; + components.push(`${horizontal}px ${vertical}px ${blur}px ${spread}px`); + const colorOpacity = args.colorOpacity || 1.0; + if (colorOpacity < 1.0) { + components.push(convertToRgba(color, colorOpacity)); + } + else { + components.push(color); + } + return [`box-shadow: ${components.join(' ')};`]; + }, + boxSides: function (args) { + if (typeof args.cssPropertyPrefix !== 'string') { + throw new Error('Invalid config for the boxSides generator: missing cssPropertyPrefix'); + } + const compositeValue = args.value || {}; + const unit = compositeValue.unit || ''; + const declarations = []; + for (const side of ['top', 'right', 'bottom', 'left']) { + const value = compositeValue[side]; + if (isEmptyCssValue(value)) { + continue; + } + const property = args.cssPropertyPrefix + side; + declarations.push(`${property}: ${value}${unit};`); + } + return declarations; + }, + firstNonEmpty(args) { + for (const arg of args) { + if (!isEmptyCssValue(arg)) { + return arg; + } + } + return null; + }, + /** + * Take a HEX color, convert it to HSL to edit its components, + * then convert back to HEX. + * + * @param args + */ + editHexAsHsl: function (args) { + return modifyHexColorAsHsl(args, (color, hue, saturation, lightness) => { + if (hue !== null) { + color = color.hue(hue); + } + if (saturation !== null) { + color = color.saturation(saturation); + } + if (lightness !== null) { + color = color.lightness(lightness); + } + return color; + }); + }, + adjustHexAsHsl: function (args) { + return modifyHexColorAsHsl(args, (color, hue, saturation, lightness) => { + if (hue !== null) { + color = color.hue(constrain(color.hue() + hue, 0, 360)); + } + if (saturation !== null) { + color = color.saturation(constrain(color.saturation() + saturation, 0, 1.0)); + } + if (lightness !== null) { + color = color.lightness(constrain(color.lightness() + lightness, 0, 1.0)); + } + return color; + }); + }, + mixColors: function (args) { + const color1 = args.color1 || ''; + const color2 = args.color2 || ''; + if (isEmptyCssValue(color1) || isEmptyCssValue(color2)) { + return ''; + } + const weight = args.weight || 50; + if (weight <= 0) { + return color2; + } + else if (weight >= 100) { + return color1; + } + return $.Color(color2).transition($.Color(color1), weight / 100).toHexString(); + }, + changeLightness: function (args) { + const color = args.color || ''; + if (isEmptyCssValue(color)) { + return ''; + } + const amount = args.amount || 0; + if (amount === 0) { + return color; + } + let output = $.Color(color); + //Amount is a number between 0 and 100, while lightness is between 0.0 and 1.0. + let newLightness = output.lightness() + (amount / 100); + //Clamp to 0.0 - 1.0. + newLightness = constrain(newLightness, 0.0, 1.0); + return output.lightness(newLightness).toHexString(); + }, + darken: function (args) { + const color = args.color || ''; + const amount = args.amount || 0; + return builtinFunctions.changeLightness({ color, amount: -Math.abs(amount) }); + }, + lighten: function (args) { + const color = args.color || ''; + const amount = args.amount || 0; + return builtinFunctions.changeLightness({ color, amount: Math.abs(amount) }); + }, + compare: function (args) { + const value1 = args.value1; + const value2 = args.value2; + const operator = args.op; + const thenResult = (typeof args.thenResult !== 'undefined') ? args.thenResult : true; + const elseResult = (typeof args.elseResult !== 'undefined') ? args.elseResult : null; + let result; + switch (operator) { + case '==': + result = value1 == value2; + break; + case '!=': + result = value1 != value2; + break; + case '>': + result = value1 > value2; + break; + case '>=': + result = value1 >= value2; + break; + case '<': + result = value1 < value2; + break; + case '<=': + result = value1 <= value2; + break; + default: + throw new Error(`Unknown operator: ${operator}`); + } + return result ? thenResult : elseResult; + }, + ifTruthy: function (args) { + const value = args.value; + const thenResult = (typeof args.thenResult !== 'undefined') ? args.thenResult : true; + const elseResult = (typeof args.elseResult !== 'undefined') ? args.elseResult : null; + return value ? thenResult : elseResult; + }, + ifSome: function (args) { + const values = args.values; + const thenResult = args.thenResult; + const elseResult = (typeof args.elseResult !== 'undefined') ? args.elseResult : null; + for (const value of values) { + if (!!value) { + return thenResult; + } + } + return elseResult; + }, + ifAll: function (args) { + const values = args.values; + const thenResult = args.thenResult; + const elseResult = args.elseResult !== undefined ? args.elseResult : null; + if (!values || (values.length === 0)) { + return elseResult; + } + for (const value of values) { + if (!value) { + return elseResult; + } + } + return thenResult; + }, + ifImageSettingContainsImage: function (args) { + const thenResult = args.thenResult !== undefined ? args.thenResult : true; + const elseResult = args.elseResult !== undefined ? args.elseResult : null; + if ((typeof args.value !== 'object') || !args.value) { + return elseResult; + } + const image = args.value; + const hasAttachment = !!image.attachmentId; + const hasExternalUrl = !!image.externalUrl; + const hasImage = hasAttachment || hasExternalUrl; + return hasImage ? thenResult : elseResult; + } + }; + let Preview; + (function (Preview) { + const $ = jQuery; + function isConditionalAtRuleConfig(config) { + if ((typeof config !== 'object') || (config === null)) { + return false; + } + const configAsRecord = config; + return ((typeof configAsRecord['t'] === 'string') + && (configAsRecord['t'] === 'conditionalAtRule') + && (typeof configAsRecord['identifier'] === 'string')); + } + function isRuleSetConfig(config) { + return ((config !== null) + && (Array.isArray(config['selectors'])) + && (Array.isArray(config['generators']))); + } + const inactiveSettingMarker = { '_ame_inactive_setting': true }; + class PreviewSession { + constructor(config) { + this.settings = {}; + this.valueReaders = new Set(); + this.notFound = {}; + this.variables = {}; + this.styleBlocks = []; + this.stylesheetsToDisable = []; + this.stylesheetWasEnabled = {}; + /** + * Whether this is the first time the preview is being updated. + * This is set to false after preview() is called for the first time. + */ + this._isBeforeFirstUpdate = true; + //Optimization: Create bound getters once instead of every time we need + //to create a setting or variable reference. + this.settingValueGetter = this.getSettingPreviewValue.bind(this); + this.variableValueGetter = (variableName) => { + if (variableName in this.variables) { + return this.variables[variableName].getValue(); + } + return null; + }; + //Optionally, disable already generated custom stylesheets while the preview + //is active to prevent old settings from interfering with the preview of new settings. + if (Array.isArray(config.stylesheetsToDisable)) { + this.stylesheetsToDisable = config.stylesheetsToDisable; + } + //Variables + for (const variableName in config.variables) { + if (!config.variables.hasOwnProperty(variableName)) { + continue; + } + this.variables[variableName] = this.createValueDescriptor(config.variables[variableName], true); + } + //CSS statement groups + for (const conditionConfig of config.statementGroups) { + const statements = this.createCssStatements(conditionConfig.statements); + if (statements.length < 1) { + continue; + } + const condition = this.createValueDescriptor(conditionConfig.expression, true); + const usedSettingIds = this.getSettingIdsUsedBy(condition); + const conditionCallback = () => { + //For performance, conditions that reference settings should + //only be checked when at least one setting is active. + if (usedSettingIds.length > 0) { + if (!usedSettingIds.some((id) => this.isSettingActive(id))) { + return false; + } + } + const isTruthy = condition.getValue(); + return !!isTruthy; //Convert to boolean. + }; + this.styleBlocks.push(new PreviewStyleBlock(statements, conditionCallback)); + } + } + createValueDescriptor(data, allowUnknownVariables = false) { + switch (data.t) { + case 'constant': + return new ConstantValue(data.value); + case 'array': + return new ArrayValue(data.items.map((valueData) => this.createValueDescriptor(valueData, allowUnknownVariables))); + case 'setting': + this.registerPreviewableSettingId(data.id); + return new SettingReference(data.id, this.settingValueGetter); + case 'var': + if (!this.variables.hasOwnProperty(data.name) && !allowUnknownVariables) { + throw new Error('Unknown variable: ' + data.name); + } + return new VariableReference(data.name, this.variableValueGetter); + case 'funcCall': + let functionName; + if (data.name in builtinFunctions) { + functionName = data.name; + } + else { + throw new Error('Unknown function: ' + data.name); + } + const func = builtinFunctions[functionName]; + //Initialize the function arguments. + let args; + if (Array.isArray(data.args)) { + args = data.args.map(arg => this.createValueDescriptor(arg, allowUnknownVariables)); + } + else { + args = {}; + for (const argName in data.args) { + if (!data.args.hasOwnProperty(argName)) { + continue; + } + args[argName] = this.createValueDescriptor(data.args[argName], allowUnknownVariables); + } + } + // @ts-ignore - Can't really statically check this since the values come from the server. + return new FunctionCall(args, func); + } + } + /** + * Get the IDs of all settings that are referenced by the given descriptor. + * + * @param descriptor + * @private + */ + getSettingIdsUsedBy(descriptor) { + if (descriptor instanceof SettingReference) { + return [descriptor.settingId]; + } + if (descriptor instanceof ArrayValue) { + let result = []; + for (const item of descriptor.getItemDescriptors()) { + result = result.concat(this.getSettingIdsUsedBy(item)); + } + return uniqueArrayValues(result); + } + if (descriptor instanceof FunctionCall) { + let result = []; + const args = descriptor.args; + if (Array.isArray(args)) { + for (const arg of args) { + result = result.concat(this.getSettingIdsUsedBy(arg)); + } + } + else { + for (const argName in args) { + if (args.hasOwnProperty(argName)) { + result = result.concat(this.getSettingIdsUsedBy(args[argName])); + } + } + } + return uniqueArrayValues(result); + } + if (descriptor instanceof VariableReference) { + const varDef = this.getVariableDefinition(descriptor.name); + if (varDef === null) { + return []; + } + return this.getSettingIdsUsedBy(varDef); + } + return []; + } + getVariableDefinition(variableName) { + if (!this.variables.hasOwnProperty(variableName)) { + return null; + } + return this.variables[variableName]; + } + createCssStatements(configs) { + let results = []; + for (const config of configs) { + if (isRuleSetConfig(config)) { + results.push(this.createRuleSetFromConfig(config)); + } + else if (isConditionalAtRuleConfig(config)) { + results.push(new ConditionalAtRule(config.identifier, config.condition, (typeof config.nestedStatements === 'undefined') + ? [] + : this.createCssStatements(config.nestedStatements))); + } + else { + console.error('Unknown CSS statement type: ', config); + } + } + return results; + } + createRuleSetFromConfig(config, parent = null) { + const generatorWrappers = this.makeGeneratorWrappers(config.generators); + const ruleSet = new CssRuleSet(config.selectors, generatorWrappers, parent); + const nestedRuleSets = this.createNestedRuleSets(config.nestedStatements, ruleSet); + ruleSet.setNestedRuleSets(nestedRuleSets); + return ruleSet; + } + createNestedRuleSets(configs, parent = null) { + let results = []; + if (!configs) { + return results; + } + for (const config of configs) { + if (!isRuleSetConfig(config)) { + throw new Error('A CSS rule set can only contain other rule sets, not other types of statements.'); + } + results.push(this.createRuleSetFromConfig(config, parent)); + } + return results; + } + getPreviewableSettingIDs() { + return Object.keys(this.settings); + } + preview(settingId, value, otherSettingReader) { + if (this._isBeforeFirstUpdate) { + this._isBeforeFirstUpdate = false; + this.disableAssociatedStylesheets(); + } + this.valueReaders.add(otherSettingReader); + if (!this.settings.hasOwnProperty(settingId)) { + this.settings[settingId] = ko.observable(value); + } + else { + this.settings[settingId](value); + } + } + dispose() { + //Dispose of all style blocks. + for (const block of this.styleBlocks) { + block.dispose(); + } + this.reEnableAssociatedStylesheets(); + } + disableAssociatedStylesheets() { + for (const stylesheetSelector of this.stylesheetsToDisable) { + const $link = $(stylesheetSelector); + if ($link.length > 0) { + this.stylesheetWasEnabled[stylesheetSelector] = $link.prop('disabled'); + $link.prop('disabled', true); + } + } + } + reEnableAssociatedStylesheets() { + for (const stylesheetSelector of this.stylesheetsToDisable) { + const $link = $(stylesheetSelector); + if (($link.length > 0) && this.stylesheetWasEnabled.hasOwnProperty(stylesheetSelector)) { + $link.prop('disabled', this.stylesheetWasEnabled[stylesheetSelector]); + } + } + } + isSettingActive(settingId) { + if (this.settings.hasOwnProperty(settingId)) { + return this.settings[settingId]() !== inactiveSettingMarker; + } + return false; + } + getSettingPreviewValue(settingId) { + if (!this.settings.hasOwnProperty(settingId)) { + const value = this.getSettingFromReaders(settingId); + this.settings[settingId] = ko.observable(value).extend({ deferred: true }); + } + const observable = this.settings[settingId]; + let value = observable(); + if (value === inactiveSettingMarker) { + value = this.getSettingFromReaders(settingId); + observable(value); + } + return value; + } + getSettingFromReaders(settingId) { + for (const reader of this.valueReaders) { + const value = reader(settingId, this.notFound); + if (value !== this.notFound) { + return value; + } + } + throw new Error('Setting not found for preview: ' + settingId); + } + makeGeneratorWrappers(generatorConfigs) { + let generatorWrappers = []; + for (const generatorConfig of generatorConfigs) { + const wrapper = this.makeDeclarationGeneratorWrapper(generatorConfig); + if (wrapper !== null) { + generatorWrappers.push(wrapper); + } + } + return generatorWrappers; + } + makeDeclarationGeneratorWrapper(config) { + const generator = this.createValueDescriptor(config); + return new DeclarationGeneratorWrapper(generator, this); + } + registerPreviewableSettingId(settingId) { + if (!this.settings.hasOwnProperty(settingId)) { + this.settings[settingId] = ko.observable(inactiveSettingMarker); + } + } + get isBeforeFirstUpdate() { + return this._isBeforeFirstUpdate; + } + } + /** + * Preview manager for the style generator. + * + * This is a thin wrapper around the PreviewSession class. It initializes the session + * as needed and destroys it when the preview is cleared. This makes it simpler to manage + * active settings, style blocks, and CSS rule-sets: instead of having to carefully + * track dependencies and deactivate/reactivate them in the right order whenever the preview + * is disabled/enabled, we can just destroy the session and start over. + */ + class StyleGeneratorPreview { + constructor(config) { + this.config = config; + this.currentSession = null; + } + getOrCreateSession() { + if (this.currentSession === null) { + this.currentSession = new PreviewSession(this.config); + } + return this.currentSession; + } + getPreviewableSettingIDs() { + return this.getOrCreateSession().getPreviewableSettingIDs(); + } + preview(settingId, value, otherSettingReader) { + const session = this.getOrCreateSession(); + const shouldPreviewAll = (this.config.previewAllOnFirstUpdate && session.isBeforeFirstUpdate); + session.preview(settingId, value, otherSettingReader); + if (shouldPreviewAll) { + //Preview all registered settings the first time the preview is updated. + const notFound = {}; + for (const otherId of session.getPreviewableSettingIDs()) { + const otherValue = otherSettingReader(otherId, notFound); + if ((otherId !== settingId) && (otherValue !== notFound)) { + session.preview(otherId, otherValue, otherSettingReader); + } + } + } + } + clearPreview() { + if (this.currentSession !== null) { + this.currentSession.dispose(); + this.currentSession = null; + } + } + } + Preview.StyleGeneratorPreview = StyleGeneratorPreview; + class DeclarationGeneratorWrapper { + constructor(generator, settingSource) { + this.generator = generator; + this.settingSource = settingSource; + //Introspect the generator and see which settings it uses. + //This will be useful to determine if the generator is active. + this.usedSettingIds = DeclarationGeneratorWrapper.findReferencedSettingIds(generator, settingSource); + this.cssDeclarations = ko.computed({ + read: () => this.getDeclarations(), + deferEvaluation: true, + }).extend({ deferred: true }); + } + /** + * Recursively find all settings used by a value descriptor (such as a function call). + * + * @param {ValueDescriptor} thing + * @param variableSource Needed to get variable definitions and not just the final values. + */ + static findReferencedSettingIds(thing, variableSource) { + let settingIds = []; + if (thing instanceof SettingReference) { + settingIds.push(thing.settingId); + } + else if (thing instanceof FunctionCall) { + if (Array.isArray(thing.args)) { + for (const arg of thing.args) { + settingIds = settingIds.concat(DeclarationGeneratorWrapper.findReferencedSettingIds(arg, variableSource)); + } + } + else { + for (const key in thing.args) { + settingIds = settingIds.concat(DeclarationGeneratorWrapper.findReferencedSettingIds(thing.args[key], variableSource)); + } + } + } + else if (thing instanceof VariableReference) { + const value = variableSource.getVariableDefinition(thing.name); + if (value !== null) { + settingIds = settingIds.concat(DeclarationGeneratorWrapper.findReferencedSettingIds(value, variableSource)); + } + } + return settingIds; + } + isActive() { + //Check if any of the input settings are active. + let hasSettingLookups = false; + for (const settingId of this.usedSettingIds) { + hasSettingLookups = true; + if (this.settingSource.isSettingActive(settingId)) { + return true; + } + } + //If there are no input settings, the generator is always active: it just + //generates a fixed declaration. + return !hasSettingLookups; + } + getDeclarations() { + return this.generator.getValue(); + } + dispose() { + this.cssDeclarations.dispose(); + } + } + class CssStatement { + constructor() { + this.cssText = ko.computed({ + read: () => this.generateCss(), + deferEvaluation: true, + }).extend({ deferred: true }); + } + dispose() { + //Dispose the CSS text observable. + this.cssText.dispose(); + } + } + class CssRuleSet extends CssStatement { + constructor(selectors, declarationSources, parent = null) { + super(); + this.declarationSources = declarationSources; + this.nestedRuleSets = ko.observableArray([]); + if (parent === null) { + this.effectiveSelectors = selectors; + } + else { + this.effectiveSelectors = CssRuleSet.combineSelectors(selectors, parent.effectiveSelectors); + } + this.selectorText = this.effectiveSelectors.join(', '); + } + static combineSelectors(selectors, parentSelectors) { + const combinedSelectors = []; + for (const selector of selectors) { + if (selector === '') { + continue; + } + if (selector.includes('&')) { + //Insert the parent selectors into the current selector at the position of the "&". + for (const parentSelector of parentSelectors) { + combinedSelectors.push(selector.replace('&', parentSelector.trim())); + } + } + else { + //Just append the current selector to the parent selectors. + for (const parentSelector of parentSelectors) { + combinedSelectors.push(`${parentSelector} ${selector}`); + } + } + } + return combinedSelectors; + } + setNestedRuleSets(ruleSets) { + //Dispose the old rule sets that are not part of the new list. + for (const oldRuleSet of this.nestedRuleSets()) { + if (ruleSets.indexOf(oldRuleSet) === -1) { + oldRuleSet.dispose(); + } + } + this.nestedRuleSets(ruleSets); + } + generateCss() { + const declarations = this.getDeclarations(); + const nestedRuleSetParts = []; + for (const ruleSet of this.nestedRuleSets()) { + if (ruleSet.isActive()) { + nestedRuleSetParts.push(ruleSet.cssText()); + } + } + let css = ''; + if (declarations.length > 0) { + css += this.selectorText + ' {\n\t' + declarations.join('\n\t') + '\n}\n'; + } + if (nestedRuleSetParts.length > 0) { + css += nestedRuleSetParts.join('\n'); + } + return css; + } + isActive() { + for (const source of this.declarationSources) { + if (source.isActive()) { + return true; + } + } + for (const ruleSet of this.nestedRuleSets()) { + if (ruleSet.isActive()) { + return true; + } + } + return false; + } + getDeclarations() { + const declarations = []; + for (const source of this.declarationSources) { + if (source.isActive()) { + declarations.push(...source.cssDeclarations()); + } + } + return declarations; + } + dispose() { + //Dispose declaration sources. + for (const source of this.declarationSources) { + source.dispose(); + } + //Dispose nested rule sets. + for (const ruleSet of this.nestedRuleSets()) { + ruleSet.dispose(); + } + super.dispose(); + } + } + class ConditionalAtRule extends CssStatement { + constructor(identifier, condition, nestedStatements) { + super(); + this.identifier = identifier; + this.condition = condition; + this.nestedStatements = nestedStatements; + } + generateCss() { + const pieces = []; + for (const statement of this.nestedStatements) { + const css = statement.cssText(); + if (css !== '') { + pieces.push(css); + } + } + if (pieces.length === 0) { + return ''; + } + return this.getAtRuleText() + ' {\n\t' + pieces.join('\n\t') + '\n}'; + } + getAtRuleText() { + return '@' + this.identifier + ' ' + this.condition; + } + isActive() { + for (const statement of this.nestedStatements) { + if (statement.isActive()) { + return true; + } + } + return false; + } + dispose() { + //Dispose nested statements. + for (const statement of this.nestedStatements) { + statement.dispose(); + } + super.dispose(); + } + } + class PreviewStyleBlock { + constructor(statements, condition = null) { + this.statements = statements; + this.condition = condition; + this.$styleElement = null; + this.cssText = ko.computed({ + read: () => { + if ((condition !== null) && !condition()) { + return ''; + } + let pieces = []; + for (const statement of this.statements) { + if (statement.isActive()) { + const css = statement.cssText(); + if (css !== '') { + pieces.push(css); + } + } + } + if (pieces.length === 0) { + return ''; + } + return pieces.join('\n'); + }, + deferEvaluation: true, + }).extend({ deferred: true }); + this.updateStyleElement(this.cssText()); + this.cssChangeSubscription = this.cssText.subscribe((cssText) => { + this.updateStyleElement(cssText); + }); + } + updateStyleElement(cssText) { + if (cssText === '') { + if (this.$styleElement) { + this.$styleElement.remove(); + this.$styleElement = null; + } + return; + } + if (!this.$styleElement) { + this.$styleElement = $('').appendTo('head'); + } + this.$styleElement.text(cssText); + } + clear() { + if (this.$styleElement) { + this.$styleElement.remove(); + this.$styleElement = null; + } + } + dispose() { + //Stop listening for CSS changes. + this.cssChangeSubscription.dispose(); + this.cssText.dispose(); + //Dispose rule sets. + for (const ruleset of this.statements) { + ruleset.dispose(); + } + //Remove the style element. + this.clear(); + } + } + })(Preview = AmeStyleGenerator.Preview || (AmeStyleGenerator.Preview = {})); +})(AmeStyleGenerator || (AmeStyleGenerator = {})); +//# sourceMappingURL=style-generator.js.map + +/***/ }) + +}, +/******/ __webpack_require__ => { // webpackRuntimeModules +/******/ var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) +/******/ __webpack_require__.O(0, ["customizable"], () => (__webpack_exec__("./extras/modules/menu-styler/menu-styler-ui.ts"))); +/******/ var __webpack_exports__ = __webpack_require__.O(); +/******/ } +]); +//# sourceMappingURL=menu-styler-ui.bundle.js.map \ No newline at end of file diff --git a/dist/menu-styler-ui.bundle.js.map b/dist/menu-styler-ui.bundle.js.map new file mode 100644 index 0000000..b41aa7f --- /dev/null +++ b/dist/menu-styler-ui.bundle.js.map @@ -0,0 +1 @@ +{"version":3,"file":"menu-styler-ui.bundle.js","mappings":";;;;;;;;;;;;AAAA,8CAA8C;AAC9C,sDAAsD;AAEqB;AACa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a,CAAC,EAAE,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;QACtC,EAAE,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;IAC5B,CAAC;IAED,wDAAwD;IACxD,CAAC,CAAC,sBAAsB,CAAC,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE;QAC1C,yDAAyD;QACzD,IAAI,CAAC,mBAAmB,EAAE;YACzB,gBAAgB,EAAE,CAAC;SACnB;QAED,oDAAoD;QACpD,YAAY,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;QAElD,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAC7B,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC;;;;;;;;;;;;;;;ACpSI;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,IAAI;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,IAAI,IAAI,MAAM,IAAI,KAAK,IAAI,QAAQ;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sDAAsD;AACtD,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,WAAW,KAAK,SAAS,KAAK,KAAK,KAAK,OAAO;AAC9E;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,sBAAsB;AACzD,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,SAAS,IAAI,MAAM,EAAE,MAAM;AAChE;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,sDAAsD,kCAAkC;AACxF,SAAS;AACT;AACA;AACA;AACA,sDAAsD,iCAAiC;AACvF,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yDAAyD,SAAS;AAClE;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6EAA6E,gBAAgB;AAC7F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,WAAW,gBAAgB;AAC5C;AACA;AACA;AACA;AACA,uBAAuB,iBAAiB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,WAAW,gBAAgB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sDAAsD,gBAAgB,EAAE,SAAS;AACjF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,wCAAwC;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,kCAAkC;AACnF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA,iBAAiB,WAAW,gBAAgB;AAC5C;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,wEAAwE;AAC7E,CAAC,8CAA8C;AAC/C","sources":["webpack:///./extras/modules/menu-styler/menu-styler-ui.ts","webpack:///./extras/style-generator/style-generator.js"],"sourcesContent":["///\n///\n\nimport {AmeStyleGenerator} from '../../style-generator/style-generator.js';\nimport {AmeCustomizableViewModel} from '../../pro-customizables/assets/customizable.js';\n\ndeclare var wsAmeLodash: _.LoDashStatic;\n\ndeclare const ameMenuStylerConfig: {\n\tdefaults: Record,\n\tstylePreviewConfigs: AmeStyleGenerator.Preview.StyleGeneratorPreviewConfig[]\n};\n\njQuery(function ($: JQueryStatic) {\n\tconst _ = wsAmeLodash;\n\n\tconst styleConfigKey = 'menu_styles';\n\n\t/**\n\t * Utility class that tells WordPress to pin or unpin the admin menu as needed\n\t * when the menu dimensions or the top margin change.\n\t *\n\t * Uses throttling to avoid excessive updates.\n\t */\n\tclass StickyMenuUpdater {\n\t\tprivate readonly $document = $(document);\n\t\tprivate readonly $adminmenu = $('#adminmenu');\n\n\t\tprivate previousHeight: number | null = null;\n\t\tprivate previousWidth: number | null = null;\n\t\tprivate previousTopMargin: number | null = null;\n\n\t\tprivate readonly updateMenuPinState = _.throttle(() => {\n\t\t\tconst menuHeight = this.$adminmenu.outerHeight();\n\t\t\tconst menuWidth = this.$adminmenu.outerWidth();\n\t\t\tconst topMargin = parseInt(this.$adminmenu.css('margin-top'), 10);\n\n\t\t\tif (\n\t\t\t\t(menuHeight !== this.previousHeight)\n\t\t\t\t|| (menuWidth !== this.previousWidth)\n\t\t\t\t|| (topMargin !== this.previousTopMargin)\n\t\t\t) {\n\t\t\t\tthis.previousHeight = menuHeight;\n\t\t\t\tthis.previousWidth = menuWidth;\n\t\t\t\tthis.previousTopMargin = topMargin;\n\n\t\t\t\t//In practice, this update doesn't always work if done immediately.\n\t\t\t\t//Not sure why, maybe menu dimensions don't change instantly when, for example,\n\t\t\t\t//the user adds a logo image. Adding a small delay seems to help.\n\t\t\t\twindow.requestAnimationFrame(() => {\n\t\t\t\t\t//The custom \"wp-pin-menu\" event was added to WP core in 2015. It can be used to update\n\t\t\t\t\t//the menu \"sticky\" state. I'm using triggerHandler() instead of trigger() because this\n\t\t\t\t\t//is what /wp-admin/js/widgets.js does. Hopefully, that will improve compatibility.\n\t\t\t\t\tthis.$document.triggerHandler('wp-pin-menu');\n\t\t\t\t});\n\t\t\t}\n\t\t}, 1000, {leading: true, trailing: true});\n\n\t\tpublic queueUpdate(): void {\n\t\t\tthis.updateMenuPinState();\n\t\t}\n\t}\n\n\tclass MenuStylerViewModel extends AmeCustomizableViewModel.SimpleVm {\n\t\tprivate readonly dialogOpenObservable: KnockoutObservable;\n\t\tprivate isFirstOpen = true;\n\t\tprivate $dialog: JQuery | null = null;\n\n\t\tprivate previewPreference: WsAmePreferenceCookie;\n\n\t\tprivate stickyMenuUpdater: StickyMenuUpdater = new StickyMenuUpdater();\n\n\t\tconstructor() {\n\t\t\t/**\n\t\t\t * This observable is initially stored in a local variable because TypeScript doesn't\n\t\t\t * allow accessing `this` in the constructor before calling super(), but we still\n\t\t\t * want to establish a dependency on the dialog open state so that preview gets enabled\n\t\t\t * when the dialog is open. The observable will get updated later.\n\t\t\t */\n\t\t\tconst extraPreviewCondition = ko.observable(false);\n\n\t\t\tsuper(extraPreviewCondition);\n\n\t\t\tthis.dialogOpenObservable = extraPreviewCondition;\n\t\t\tthis.previewPreference = new WsAmePreferenceCookie('MsPreviewEnabled', 90, true);\n\n\t\t\t//Read settings from the currently loaded admin menu configuration\n\t\t\t//using the aux-data API. Setting ID prefixes should already be registered.\n\t\t\tconst auxDataSettingReader = (settingId: string, defaultValue: any): any => {\n\t\t\t\tconst path = AmeEditorApi.configDataAdapter.mapSettingIdToPath(settingId);\n\t\t\t\tif (path === null) {\n\t\t\t\t\treturn defaultValue;\n\t\t\t\t}\n\n\t\t\t\tconst value = AmeEditorApi.configDataAdapter.getPath(path, this.notFound);\n\t\t\t\tif (value !== this.notFound) {\n\t\t\t\t\treturn value;\n\t\t\t\t} else if (ameMenuStylerConfig.defaults.hasOwnProperty(settingId)) {\n\t\t\t\t\treturn ameMenuStylerConfig.defaults[settingId];\n\t\t\t\t} else {\n\t\t\t\t\tthrow new Error('Unknown aux config setting ID: ' + settingId);\n\t\t\t\t}\n\t\t\t};\n\t\t\tfor (const auxPrefix of AmeEditorApi.configDataAdapter.getKnownPrefixes()) {\n\t\t\t\tthis.registerSettingReader(auxDataSettingReader, auxPrefix);\n\t\t\t}\n\n\t\t\tfor (const previewConfig of ameMenuStylerConfig.stylePreviewConfigs) {\n\t\t\t\tconst previewInstance = new AmeStyleGenerator.Preview.StyleGeneratorPreview(previewConfig);\n\t\t\t\tthis.registerPreviewUpdater(previewInstance.getPreviewableSettingIDs(), previewInstance);\n\t\t\t}\n\n\t\t\t$(document).trigger('adminMenuEditor:menuStylerUiRegister', [this]);\n\t\t}\n\n\t\tsaveChanges() {\n\t\t\tconst settingsById = this.getAllSettingValues();\n\n\t\t\t//Sort by length of the setting ID and then by the ID itself to ensure parent settings\n\t\t\t//are updated before their children. For example, this matters for color presets where\n\t\t\t//the \"activePreset\" setting maps to the \"[global]\" property of the \"colorPresets\" setting.\n\t\t\tconst sortedIds = Object.keys(settingsById);\n\t\t\tsortedIds.sort((a, b) => {\n\t\t\t\tif (a.length !== b.length) {\n\t\t\t\t\treturn a.length - b.length;\n\t\t\t\t}\n\t\t\t\treturn a.localeCompare(b);\n\t\t\t});\n\n\t\t\t//Write all settings into a new object, then save the top-level properties\n\t\t\t//of that. This way stale and empty settings will automatically be removed.\n\t\t\tconst updatedConfig: Record = {};\n\t\t\tfor (const settingId of sortedIds) {\n\t\t\t\tconst path = AmeEditorApi.configDataAdapter.mapSettingIdToPath(settingId);\n\t\t\t\tif (path === null) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tconst value = settingsById[settingId];\n\t\t\t\t//To save space, don't store null values. This could be extended by using\n\t\t\t\t//the \"deleteWhenBlank\" property of the setting definition.\n\t\t\t\tif (value === null) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t_.set(updatedConfig, path, value);\n\t\t\t}\n\n\t\t\t//Special: Update the last modified timestamp for menu styles.\n\t\t\t_.set(updatedConfig, [styleConfigKey, '_lastModified'], (new Date()).toISOString());\n\n\t\t\t//Special: Remove empty color presets.\n\t\t\tconst colorPresets: Record = _.get(updatedConfig, ['color_presets'], {});\n\t\t\tfor (const presetName of Object.keys(colorPresets)) {\n\t\t\t\t//Remove empty string values (i.e. no color selected). This also\n\t\t\t\t//covers nulls and empty arrays/objects, but that shouldn't happen.\n\t\t\t\tcolorPresets[presetName] = _.omit(colorPresets[presetName], _.isEmpty);\n\t\t\t\t//Remove the preset if it's empty.\n\t\t\t\tif (_.isEmpty(colorPresets[presetName])) {\n\t\t\t\t\tdelete colorPresets[presetName];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//Finally, write the top-level properties to the menu configuration.\n\t\t\tfor (const key in updatedConfig) {\n\t\t\t\tif (!updatedConfig.hasOwnProperty(key)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tconst value = updatedConfig[key];\n\t\t\t\tAmeEditorApi.configDataAdapter.setPath(key, value);\n\t\t\t}\n\n\t\t\t$(document).trigger('adminMenuEditor:menuConfigChanged');\n\t\t}\n\n\t\tprotected isDialogOpen(newValue: boolean | null = null): boolean {\n\t\t\tif (!this.dialogOpenObservable) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif (newValue !== null) {\n\t\t\t\tthis.dialogOpenObservable(newValue);\n\t\t\t\treturn newValue;\n\t\t\t}\n\t\t\treturn this.dialogOpenObservable();\n\t\t}\n\n\t\tprotected getPreviewActiveState(): boolean {\n\t\t\t//Disable preview when the dialog is not open.\n\t\t\tif (!this.isDialogOpen()) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn super.getPreviewActiveState();\n\t\t}\n\n\t\tupdatePreview(settingIds: string[]) {\n\t\t\tsuper.updatePreview(settingIds);\n\t\t\tthis.stickyMenuUpdater.queueUpdate();\n\t\t}\n\n\t\tsetDialog($dialog: JQuery) {\n\t\t\tthis.$dialog = $dialog;\n\n\t\t\tlet $overlay: JQuery | null = null;\n\n\t\t\t$dialog.on('dialogopen', () => {\n\t\t\t\tthis.isDialogOpen(true);\n\t\t\t\tthis.onOpenDialog();\n\n\t\t\t\t//Add a custom class to the overlay so that we can style it.\n\t\t\t\t$overlay = $dialog.closest('.ui-dialog').nextAll('.ui-widget-overlay').first();\n\t\t\t\t$overlay.addClass('ame-ms-dialog-overlay');\n\t\t\t});\n\t\t\t$dialog.on('dialogclose', () => {\n\t\t\t\tthis.isDialogOpen(false);\n\n\t\t\t\tif ($overlay) {\n\t\t\t\t\t$overlay.removeClass('ame-ms-dialog-overlay');\n\t\t\t\t\t$overlay = null;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tprotected onOpenDialog() {\n\t\t\tif (!this.isFirstOpen) {\n\t\t\t\tthis.reloadAllSettings();\n\t\t\t}\n\n\t\t\tif (this.isFirstOpen) {\n\t\t\t\tthis.isFirstOpen = false;\n\t\t\t\t//Load the preview state from a cookie.\n\t\t\t\tthis.isPreviewEnabled(this.previewPreference.readAndRefresh(true));\n\t\t\t}\n\t\t}\n\n\t\t// noinspection JSUnusedGlobalSymbols -- Used in the KO template.\n\t\tonConfirmDialog() {\n\t\t\t//Save the preview state in a cookie.\n\t\t\tthis.previewPreference.write(this.isPreviewEnabled());\n\n\t\t\tthis.saveChanges();\n\t\t\tthis.closeDialog();\n\t\t}\n\n\t\tonCancelDialog() {\n\t\t\tthis.closeDialog();\n\t\t}\n\n\t\tprotected closeDialog() {\n\t\t\tif (this.$dialog !== null) {\n\t\t\t\tthis.$dialog.dialog('close');\n\t\t\t}\n\t\t}\n\t}\n\n\tconst $styleDialog = $('#ws-ame-menu-style-settings');\n\tlet isDialogInitialized = false;\n\n\tfunction initializeDialog() {\n\t\t$styleDialog.dialog({\n\t\t\tautoOpen: false,\n\t\t\tcloseText: ' ',\n\t\t\tdraggable: false,\n\t\t\tmodal: true,\n\t\t\t//Dialog dimensions and position are set in CSS.\n\t\t\tminWidth: 300,\n\t\t\theight: 400,\n\t\t\tclasses: {\n\t\t\t\t'ui-dialog': 'ui-corner-all ws-ame-menu-style-dialog',\n\t\t\t}\n\t\t});\n\n\t\tisDialogInitialized = true;\n\n\t\tconst vm = new MenuStylerViewModel();\n\t\t(window as any)['ameMenuStylerVm'] = vm;\n\n\t\tko.applyBindings(vm, $styleDialog[0]);\n\t\tvm.setDialog($styleDialog);\n\t}\n\n\t//Open the dialog when the user clicks the style button.\n\t$('#ws_edit_menu_styles').on('click', () => {\n\t\t//Optimization: Initialize the dialog on the first click.\n\t\tif (!isDialogInitialized) {\n\t\t\tinitializeDialog();\n\t\t}\n\n\t\t//Reset the scroll position of the tab content area.\n\t\t$styleDialog.find('.ame-tp-content').scrollTop(0);\n\n\t\t$styleDialog.dialog('open');\n\t});\n});","export var AmeStyleGenerator;\r\n(function (AmeStyleGenerator) {\r\n const $ = jQuery;\r\n class ValueDescriptor {\r\n }\r\n class ConstantValue extends ValueDescriptor {\r\n constructor(value) {\r\n super();\r\n this.value = value;\r\n }\r\n getValue() {\r\n return this.value;\r\n }\r\n }\r\n class ArrayValue extends ValueDescriptor {\r\n constructor(items) {\r\n super();\r\n this.items = items;\r\n }\r\n getValue() {\r\n return this.items.map(item => item.getValue());\r\n }\r\n getItemDescriptors() {\r\n return this.items;\r\n }\r\n }\r\n class SettingReference extends ValueDescriptor {\r\n constructor(settingId, valueGetter) {\r\n super();\r\n this.settingId = settingId;\r\n this.valueGetter = valueGetter;\r\n }\r\n getValue() {\r\n return this.valueGetter(this.settingId);\r\n }\r\n }\r\n class VariableReference extends ValueDescriptor {\r\n constructor(name, valueGetter) {\r\n super();\r\n this.name = name;\r\n this.valueGetter = valueGetter;\r\n }\r\n getValue() {\r\n return this.valueGetter(this.name);\r\n }\r\n }\r\n class FunctionCall extends ValueDescriptor {\r\n constructor(args, callback) {\r\n super();\r\n this.args = args;\r\n this.callback = callback;\r\n }\r\n getValue() {\r\n return this.callback(this.resolveArgs(this.args));\r\n }\r\n resolveArgs(args) {\r\n if (Array.isArray(args)) {\r\n return args.map(arg => arg.getValue());\r\n }\r\n return Object.keys(args).reduce((result, key) => {\r\n result[key] = args[key].getValue();\r\n return result;\r\n }, {});\r\n }\r\n }\r\n //endregion\r\n function isEmptyCssValue(value) {\r\n return (typeof value === 'undefined') || (value === '') || (value === null);\r\n }\r\n function convertToRgba(color, opacity = 1.0) {\r\n color = color.trim();\r\n if (color === '') {\r\n return 'transparent';\r\n }\r\n //Strip the leading hash, if any.\r\n if (color[0] === '#') {\r\n color = color.substring(1);\r\n }\r\n //If the color is in the shorthand format, expand it.\r\n if (color.length === 3) {\r\n color = color[0] + color[0] + color[1] + color[1] + color[2] + color[2];\r\n }\r\n //The color should now be in the full 6-digit format. Convert it to RGBA.\r\n if (color.length === 6) {\r\n const red = parseInt(color.substring(0, 2), 16);\r\n const green = parseInt(color.substring(2, 4), 16);\r\n const blue = parseInt(color.substring(4, 6), 16);\r\n return `rgba(${red}, ${green}, ${blue}, ${opacity})`;\r\n }\r\n //The color may be invalid, or it's not in a hex format we recognize.\r\n return color;\r\n }\r\n function uniqueArrayValues(array) {\r\n return array.filter((value, index) => array.indexOf(value) === index);\r\n }\r\n function constrain(value, min, max) {\r\n return Math.min(Math.max(value, min), max);\r\n }\r\n function modifyHexColorAsHsl(args, operation) {\r\n const color = args.color || '';\r\n if (isEmptyCssValue(color)) {\r\n return '';\r\n }\r\n const hue = args.hue || null;\r\n const saturation = args.saturation || null;\r\n const lightness = args.lightness || null;\r\n if ((hue === null) && (saturation === null) && (lightness === null)) {\r\n return color;\r\n }\r\n let output = $.Color(color);\r\n output = operation(output, hue, saturation, lightness);\r\n return output.toHexString();\r\n }\r\n // noinspection JSUnusedGlobalSymbols -- Used dynamically by declaration generators received from the server.\r\n const builtinFunctions = {\r\n simpleProperty: function (args) {\r\n if (isEmptyCssValue(args.value)) {\r\n return [];\r\n }\r\n return [args.name + ': ' + args.value + ';'];\r\n },\r\n formatLength: function (args) {\r\n if (isEmptyCssValue(args.value)) {\r\n return '';\r\n }\r\n //Normalize numeric values. For example, while JS accepts \"1.\" as a number,\r\n //\"1.px\" is not a valid CSS length value, so it should be converted to \"1px\".\r\n const numericValue = parseFloat(String(args.value));\r\n if (isNaN(numericValue)) {\r\n return '';\r\n }\r\n return '' + numericValue + (args.unit || '');\r\n },\r\n shadow: function (args) {\r\n const mode = args.mode || 'default';\r\n const color = args.color || '';\r\n if (mode === 'default') {\r\n return [];\r\n }\r\n if ((mode === 'none') || (color === '') || (color === null) || (color === 'transparent')) {\r\n return ['box-shadow: none;'];\r\n }\r\n if (mode !== 'custom') {\r\n return [];\r\n }\r\n const components = [];\r\n if (args.inset) {\r\n components.push('inset');\r\n }\r\n const horizontal = args['offset-x'] || 0;\r\n const vertical = args['offset-y'] || 0;\r\n const blur = args.blur || 0;\r\n const spread = args.spread || 0;\r\n components.push(`${horizontal}px ${vertical}px ${blur}px ${spread}px`);\r\n const colorOpacity = args.colorOpacity || 1.0;\r\n if (colorOpacity < 1.0) {\r\n components.push(convertToRgba(color, colorOpacity));\r\n }\r\n else {\r\n components.push(color);\r\n }\r\n return [`box-shadow: ${components.join(' ')};`];\r\n },\r\n boxSides: function (args) {\r\n if (typeof args.cssPropertyPrefix !== 'string') {\r\n throw new Error('Invalid config for the boxSides generator: missing cssPropertyPrefix');\r\n }\r\n const compositeValue = args.value || {};\r\n const unit = compositeValue.unit || '';\r\n const declarations = [];\r\n for (const side of ['top', 'right', 'bottom', 'left']) {\r\n const value = compositeValue[side];\r\n if (isEmptyCssValue(value)) {\r\n continue;\r\n }\r\n const property = args.cssPropertyPrefix + side;\r\n declarations.push(`${property}: ${value}${unit};`);\r\n }\r\n return declarations;\r\n },\r\n firstNonEmpty(args) {\r\n for (const arg of args) {\r\n if (!isEmptyCssValue(arg)) {\r\n return arg;\r\n }\r\n }\r\n return null;\r\n },\r\n /**\r\n * Take a HEX color, convert it to HSL to edit its components,\r\n * then convert back to HEX.\r\n *\r\n * @param args\r\n */\r\n editHexAsHsl: function (args) {\r\n return modifyHexColorAsHsl(args, (color, hue, saturation, lightness) => {\r\n if (hue !== null) {\r\n color = color.hue(hue);\r\n }\r\n if (saturation !== null) {\r\n color = color.saturation(saturation);\r\n }\r\n if (lightness !== null) {\r\n color = color.lightness(lightness);\r\n }\r\n return color;\r\n });\r\n },\r\n adjustHexAsHsl: function (args) {\r\n return modifyHexColorAsHsl(args, (color, hue, saturation, lightness) => {\r\n if (hue !== null) {\r\n color = color.hue(constrain(color.hue() + hue, 0, 360));\r\n }\r\n if (saturation !== null) {\r\n color = color.saturation(constrain(color.saturation() + saturation, 0, 1.0));\r\n }\r\n if (lightness !== null) {\r\n color = color.lightness(constrain(color.lightness() + lightness, 0, 1.0));\r\n }\r\n return color;\r\n });\r\n },\r\n mixColors: function (args) {\r\n const color1 = args.color1 || '';\r\n const color2 = args.color2 || '';\r\n if (isEmptyCssValue(color1) || isEmptyCssValue(color2)) {\r\n return '';\r\n }\r\n const weight = args.weight || 50;\r\n if (weight <= 0) {\r\n return color2;\r\n }\r\n else if (weight >= 100) {\r\n return color1;\r\n }\r\n return $.Color(color2).transition($.Color(color1), weight / 100).toHexString();\r\n },\r\n changeLightness: function (args) {\r\n const color = args.color || '';\r\n if (isEmptyCssValue(color)) {\r\n return '';\r\n }\r\n const amount = args.amount || 0;\r\n if (amount === 0) {\r\n return color;\r\n }\r\n let output = $.Color(color);\r\n //Amount is a number between 0 and 100, while lightness is between 0.0 and 1.0.\r\n let newLightness = output.lightness() + (amount / 100);\r\n //Clamp to 0.0 - 1.0.\r\n newLightness = constrain(newLightness, 0.0, 1.0);\r\n return output.lightness(newLightness).toHexString();\r\n },\r\n darken: function (args) {\r\n const color = args.color || '';\r\n const amount = args.amount || 0;\r\n return builtinFunctions.changeLightness({ color, amount: -Math.abs(amount) });\r\n },\r\n lighten: function (args) {\r\n const color = args.color || '';\r\n const amount = args.amount || 0;\r\n return builtinFunctions.changeLightness({ color, amount: Math.abs(amount) });\r\n },\r\n compare: function (args) {\r\n const value1 = args.value1;\r\n const value2 = args.value2;\r\n const operator = args.op;\r\n const thenResult = (typeof args.thenResult !== 'undefined') ? args.thenResult : true;\r\n const elseResult = (typeof args.elseResult !== 'undefined') ? args.elseResult : null;\r\n let result;\r\n switch (operator) {\r\n case '==':\r\n result = value1 == value2;\r\n break;\r\n case '!=':\r\n result = value1 != value2;\r\n break;\r\n case '>':\r\n result = value1 > value2;\r\n break;\r\n case '>=':\r\n result = value1 >= value2;\r\n break;\r\n case '<':\r\n result = value1 < value2;\r\n break;\r\n case '<=':\r\n result = value1 <= value2;\r\n break;\r\n default:\r\n throw new Error(`Unknown operator: ${operator}`);\r\n }\r\n return result ? thenResult : elseResult;\r\n },\r\n ifTruthy: function (args) {\r\n const value = args.value;\r\n const thenResult = (typeof args.thenResult !== 'undefined') ? args.thenResult : true;\r\n const elseResult = (typeof args.elseResult !== 'undefined') ? args.elseResult : null;\r\n return value ? thenResult : elseResult;\r\n },\r\n ifSome: function (args) {\r\n const values = args.values;\r\n const thenResult = args.thenResult;\r\n const elseResult = (typeof args.elseResult !== 'undefined') ? args.elseResult : null;\r\n for (const value of values) {\r\n if (!!value) {\r\n return thenResult;\r\n }\r\n }\r\n return elseResult;\r\n },\r\n ifAll: function (args) {\r\n const values = args.values;\r\n const thenResult = args.thenResult;\r\n const elseResult = args.elseResult !== undefined ? args.elseResult : null;\r\n if (!values || (values.length === 0)) {\r\n return elseResult;\r\n }\r\n for (const value of values) {\r\n if (!value) {\r\n return elseResult;\r\n }\r\n }\r\n return thenResult;\r\n },\r\n ifImageSettingContainsImage: function (args) {\r\n const thenResult = args.thenResult !== undefined ? args.thenResult : true;\r\n const elseResult = args.elseResult !== undefined ? args.elseResult : null;\r\n if ((typeof args.value !== 'object') || !args.value) {\r\n return elseResult;\r\n }\r\n const image = args.value;\r\n const hasAttachment = !!image.attachmentId;\r\n const hasExternalUrl = !!image.externalUrl;\r\n const hasImage = hasAttachment || hasExternalUrl;\r\n return hasImage ? thenResult : elseResult;\r\n }\r\n };\r\n let Preview;\r\n (function (Preview) {\r\n const $ = jQuery;\r\n function isConditionalAtRuleConfig(config) {\r\n if ((typeof config !== 'object') || (config === null)) {\r\n return false;\r\n }\r\n const configAsRecord = config;\r\n return ((typeof configAsRecord['t'] === 'string')\r\n && (configAsRecord['t'] === 'conditionalAtRule')\r\n && (typeof configAsRecord['identifier'] === 'string'));\r\n }\r\n function isRuleSetConfig(config) {\r\n return ((config !== null)\r\n && (Array.isArray(config['selectors']))\r\n && (Array.isArray(config['generators'])));\r\n }\r\n const inactiveSettingMarker = { '_ame_inactive_setting': true };\r\n class PreviewSession {\r\n constructor(config) {\r\n this.settings = {};\r\n this.valueReaders = new Set();\r\n this.notFound = {};\r\n this.variables = {};\r\n this.styleBlocks = [];\r\n this.stylesheetsToDisable = [];\r\n this.stylesheetWasEnabled = {};\r\n /**\r\n * Whether this is the first time the preview is being updated.\r\n * This is set to false after preview() is called for the first time.\r\n */\r\n this._isBeforeFirstUpdate = true;\r\n //Optimization: Create bound getters once instead of every time we need\r\n //to create a setting or variable reference.\r\n this.settingValueGetter = this.getSettingPreviewValue.bind(this);\r\n this.variableValueGetter = (variableName) => {\r\n if (variableName in this.variables) {\r\n return this.variables[variableName].getValue();\r\n }\r\n return null;\r\n };\r\n //Optionally, disable already generated custom stylesheets while the preview\r\n //is active to prevent old settings from interfering with the preview of new settings.\r\n if (Array.isArray(config.stylesheetsToDisable)) {\r\n this.stylesheetsToDisable = config.stylesheetsToDisable;\r\n }\r\n //Variables\r\n for (const variableName in config.variables) {\r\n if (!config.variables.hasOwnProperty(variableName)) {\r\n continue;\r\n }\r\n this.variables[variableName] = this.createValueDescriptor(config.variables[variableName], true);\r\n }\r\n //CSS statement groups\r\n for (const conditionConfig of config.statementGroups) {\r\n const statements = this.createCssStatements(conditionConfig.statements);\r\n if (statements.length < 1) {\r\n continue;\r\n }\r\n const condition = this.createValueDescriptor(conditionConfig.expression, true);\r\n const usedSettingIds = this.getSettingIdsUsedBy(condition);\r\n const conditionCallback = () => {\r\n //For performance, conditions that reference settings should\r\n //only be checked when at least one setting is active.\r\n if (usedSettingIds.length > 0) {\r\n if (!usedSettingIds.some((id) => this.isSettingActive(id))) {\r\n return false;\r\n }\r\n }\r\n const isTruthy = condition.getValue();\r\n return !!isTruthy; //Convert to boolean.\r\n };\r\n this.styleBlocks.push(new PreviewStyleBlock(statements, conditionCallback));\r\n }\r\n }\r\n createValueDescriptor(data, allowUnknownVariables = false) {\r\n switch (data.t) {\r\n case 'constant':\r\n return new ConstantValue(data.value);\r\n case 'array':\r\n return new ArrayValue(data.items.map((valueData) => this.createValueDescriptor(valueData, allowUnknownVariables)));\r\n case 'setting':\r\n this.registerPreviewableSettingId(data.id);\r\n return new SettingReference(data.id, this.settingValueGetter);\r\n case 'var':\r\n if (!this.variables.hasOwnProperty(data.name) && !allowUnknownVariables) {\r\n throw new Error('Unknown variable: ' + data.name);\r\n }\r\n return new VariableReference(data.name, this.variableValueGetter);\r\n case 'funcCall':\r\n let functionName;\r\n if (data.name in builtinFunctions) {\r\n functionName = data.name;\r\n }\r\n else {\r\n throw new Error('Unknown function: ' + data.name);\r\n }\r\n const func = builtinFunctions[functionName];\r\n //Initialize the function arguments.\r\n let args;\r\n if (Array.isArray(data.args)) {\r\n args = data.args.map(arg => this.createValueDescriptor(arg, allowUnknownVariables));\r\n }\r\n else {\r\n args = {};\r\n for (const argName in data.args) {\r\n if (!data.args.hasOwnProperty(argName)) {\r\n continue;\r\n }\r\n args[argName] = this.createValueDescriptor(data.args[argName], allowUnknownVariables);\r\n }\r\n }\r\n // @ts-ignore - Can't really statically check this since the values come from the server.\r\n return new FunctionCall(args, func);\r\n }\r\n }\r\n /**\r\n * Get the IDs of all settings that are referenced by the given descriptor.\r\n *\r\n * @param descriptor\r\n * @private\r\n */\r\n getSettingIdsUsedBy(descriptor) {\r\n if (descriptor instanceof SettingReference) {\r\n return [descriptor.settingId];\r\n }\r\n if (descriptor instanceof ArrayValue) {\r\n let result = [];\r\n for (const item of descriptor.getItemDescriptors()) {\r\n result = result.concat(this.getSettingIdsUsedBy(item));\r\n }\r\n return uniqueArrayValues(result);\r\n }\r\n if (descriptor instanceof FunctionCall) {\r\n let result = [];\r\n const args = descriptor.args;\r\n if (Array.isArray(args)) {\r\n for (const arg of args) {\r\n result = result.concat(this.getSettingIdsUsedBy(arg));\r\n }\r\n }\r\n else {\r\n for (const argName in args) {\r\n if (args.hasOwnProperty(argName)) {\r\n result = result.concat(this.getSettingIdsUsedBy(args[argName]));\r\n }\r\n }\r\n }\r\n return uniqueArrayValues(result);\r\n }\r\n if (descriptor instanceof VariableReference) {\r\n const varDef = this.getVariableDefinition(descriptor.name);\r\n if (varDef === null) {\r\n return [];\r\n }\r\n return this.getSettingIdsUsedBy(varDef);\r\n }\r\n return [];\r\n }\r\n getVariableDefinition(variableName) {\r\n if (!this.variables.hasOwnProperty(variableName)) {\r\n return null;\r\n }\r\n return this.variables[variableName];\r\n }\r\n createCssStatements(configs) {\r\n let results = [];\r\n for (const config of configs) {\r\n if (isRuleSetConfig(config)) {\r\n results.push(this.createRuleSetFromConfig(config));\r\n }\r\n else if (isConditionalAtRuleConfig(config)) {\r\n results.push(new ConditionalAtRule(config.identifier, config.condition, (typeof config.nestedStatements === 'undefined')\r\n ? []\r\n : this.createCssStatements(config.nestedStatements)));\r\n }\r\n else {\r\n console.error('Unknown CSS statement type: ', config);\r\n }\r\n }\r\n return results;\r\n }\r\n createRuleSetFromConfig(config, parent = null) {\r\n const generatorWrappers = this.makeGeneratorWrappers(config.generators);\r\n const ruleSet = new CssRuleSet(config.selectors, generatorWrappers, parent);\r\n const nestedRuleSets = this.createNestedRuleSets(config.nestedStatements, ruleSet);\r\n ruleSet.setNestedRuleSets(nestedRuleSets);\r\n return ruleSet;\r\n }\r\n createNestedRuleSets(configs, parent = null) {\r\n let results = [];\r\n if (!configs) {\r\n return results;\r\n }\r\n for (const config of configs) {\r\n if (!isRuleSetConfig(config)) {\r\n throw new Error('A CSS rule set can only contain other rule sets, not other types of statements.');\r\n }\r\n results.push(this.createRuleSetFromConfig(config, parent));\r\n }\r\n return results;\r\n }\r\n getPreviewableSettingIDs() {\r\n return Object.keys(this.settings);\r\n }\r\n preview(settingId, value, otherSettingReader) {\r\n if (this._isBeforeFirstUpdate) {\r\n this._isBeforeFirstUpdate = false;\r\n this.disableAssociatedStylesheets();\r\n }\r\n this.valueReaders.add(otherSettingReader);\r\n if (!this.settings.hasOwnProperty(settingId)) {\r\n this.settings[settingId] = ko.observable(value);\r\n }\r\n else {\r\n this.settings[settingId](value);\r\n }\r\n }\r\n dispose() {\r\n //Dispose of all style blocks.\r\n for (const block of this.styleBlocks) {\r\n block.dispose();\r\n }\r\n this.reEnableAssociatedStylesheets();\r\n }\r\n disableAssociatedStylesheets() {\r\n for (const stylesheetSelector of this.stylesheetsToDisable) {\r\n const $link = $(stylesheetSelector);\r\n if ($link.length > 0) {\r\n this.stylesheetWasEnabled[stylesheetSelector] = $link.prop('disabled');\r\n $link.prop('disabled', true);\r\n }\r\n }\r\n }\r\n reEnableAssociatedStylesheets() {\r\n for (const stylesheetSelector of this.stylesheetsToDisable) {\r\n const $link = $(stylesheetSelector);\r\n if (($link.length > 0) && this.stylesheetWasEnabled.hasOwnProperty(stylesheetSelector)) {\r\n $link.prop('disabled', this.stylesheetWasEnabled[stylesheetSelector]);\r\n }\r\n }\r\n }\r\n isSettingActive(settingId) {\r\n if (this.settings.hasOwnProperty(settingId)) {\r\n return this.settings[settingId]() !== inactiveSettingMarker;\r\n }\r\n return false;\r\n }\r\n getSettingPreviewValue(settingId) {\r\n if (!this.settings.hasOwnProperty(settingId)) {\r\n const value = this.getSettingFromReaders(settingId);\r\n this.settings[settingId] = ko.observable(value).extend({ deferred: true });\r\n }\r\n const observable = this.settings[settingId];\r\n let value = observable();\r\n if (value === inactiveSettingMarker) {\r\n value = this.getSettingFromReaders(settingId);\r\n observable(value);\r\n }\r\n return value;\r\n }\r\n getSettingFromReaders(settingId) {\r\n for (const reader of this.valueReaders) {\r\n const value = reader(settingId, this.notFound);\r\n if (value !== this.notFound) {\r\n return value;\r\n }\r\n }\r\n throw new Error('Setting not found for preview: ' + settingId);\r\n }\r\n makeGeneratorWrappers(generatorConfigs) {\r\n let generatorWrappers = [];\r\n for (const generatorConfig of generatorConfigs) {\r\n const wrapper = this.makeDeclarationGeneratorWrapper(generatorConfig);\r\n if (wrapper !== null) {\r\n generatorWrappers.push(wrapper);\r\n }\r\n }\r\n return generatorWrappers;\r\n }\r\n makeDeclarationGeneratorWrapper(config) {\r\n const generator = this.createValueDescriptor(config);\r\n return new DeclarationGeneratorWrapper(generator, this);\r\n }\r\n registerPreviewableSettingId(settingId) {\r\n if (!this.settings.hasOwnProperty(settingId)) {\r\n this.settings[settingId] = ko.observable(inactiveSettingMarker);\r\n }\r\n }\r\n get isBeforeFirstUpdate() {\r\n return this._isBeforeFirstUpdate;\r\n }\r\n }\r\n /**\r\n * Preview manager for the style generator.\r\n *\r\n * This is a thin wrapper around the PreviewSession class. It initializes the session\r\n * as needed and destroys it when the preview is cleared. This makes it simpler to manage\r\n * active settings, style blocks, and CSS rule-sets: instead of having to carefully\r\n * track dependencies and deactivate/reactivate them in the right order whenever the preview\r\n * is disabled/enabled, we can just destroy the session and start over.\r\n */\r\n class StyleGeneratorPreview {\r\n constructor(config) {\r\n this.config = config;\r\n this.currentSession = null;\r\n }\r\n getOrCreateSession() {\r\n if (this.currentSession === null) {\r\n this.currentSession = new PreviewSession(this.config);\r\n }\r\n return this.currentSession;\r\n }\r\n getPreviewableSettingIDs() {\r\n return this.getOrCreateSession().getPreviewableSettingIDs();\r\n }\r\n preview(settingId, value, otherSettingReader) {\r\n const session = this.getOrCreateSession();\r\n const shouldPreviewAll = (this.config.previewAllOnFirstUpdate && session.isBeforeFirstUpdate);\r\n session.preview(settingId, value, otherSettingReader);\r\n if (shouldPreviewAll) {\r\n //Preview all registered settings the first time the preview is updated.\r\n const notFound = {};\r\n for (const otherId of session.getPreviewableSettingIDs()) {\r\n const otherValue = otherSettingReader(otherId, notFound);\r\n if ((otherId !== settingId) && (otherValue !== notFound)) {\r\n session.preview(otherId, otherValue, otherSettingReader);\r\n }\r\n }\r\n }\r\n }\r\n clearPreview() {\r\n if (this.currentSession !== null) {\r\n this.currentSession.dispose();\r\n this.currentSession = null;\r\n }\r\n }\r\n }\r\n Preview.StyleGeneratorPreview = StyleGeneratorPreview;\r\n class DeclarationGeneratorWrapper {\r\n constructor(generator, settingSource) {\r\n this.generator = generator;\r\n this.settingSource = settingSource;\r\n //Introspect the generator and see which settings it uses.\r\n //This will be useful to determine if the generator is active.\r\n this.usedSettingIds = DeclarationGeneratorWrapper.findReferencedSettingIds(generator, settingSource);\r\n this.cssDeclarations = ko.computed({\r\n read: () => this.getDeclarations(),\r\n deferEvaluation: true,\r\n }).extend({ deferred: true });\r\n }\r\n /**\r\n * Recursively find all settings used by a value descriptor (such as a function call).\r\n *\r\n * @param {ValueDescriptor} thing\r\n * @param variableSource Needed to get variable definitions and not just the final values.\r\n */\r\n static findReferencedSettingIds(thing, variableSource) {\r\n let settingIds = [];\r\n if (thing instanceof SettingReference) {\r\n settingIds.push(thing.settingId);\r\n }\r\n else if (thing instanceof FunctionCall) {\r\n if (Array.isArray(thing.args)) {\r\n for (const arg of thing.args) {\r\n settingIds = settingIds.concat(DeclarationGeneratorWrapper.findReferencedSettingIds(arg, variableSource));\r\n }\r\n }\r\n else {\r\n for (const key in thing.args) {\r\n settingIds = settingIds.concat(DeclarationGeneratorWrapper.findReferencedSettingIds(thing.args[key], variableSource));\r\n }\r\n }\r\n }\r\n else if (thing instanceof VariableReference) {\r\n const value = variableSource.getVariableDefinition(thing.name);\r\n if (value !== null) {\r\n settingIds = settingIds.concat(DeclarationGeneratorWrapper.findReferencedSettingIds(value, variableSource));\r\n }\r\n }\r\n return settingIds;\r\n }\r\n isActive() {\r\n //Check if any of the input settings are active.\r\n let hasSettingLookups = false;\r\n for (const settingId of this.usedSettingIds) {\r\n hasSettingLookups = true;\r\n if (this.settingSource.isSettingActive(settingId)) {\r\n return true;\r\n }\r\n }\r\n //If there are no input settings, the generator is always active: it just\r\n //generates a fixed declaration.\r\n return !hasSettingLookups;\r\n }\r\n getDeclarations() {\r\n return this.generator.getValue();\r\n }\r\n dispose() {\r\n this.cssDeclarations.dispose();\r\n }\r\n }\r\n class CssStatement {\r\n constructor() {\r\n this.cssText = ko.computed({\r\n read: () => this.generateCss(),\r\n deferEvaluation: true,\r\n }).extend({ deferred: true });\r\n }\r\n dispose() {\r\n //Dispose the CSS text observable.\r\n this.cssText.dispose();\r\n }\r\n }\r\n class CssRuleSet extends CssStatement {\r\n constructor(selectors, declarationSources, parent = null) {\r\n super();\r\n this.declarationSources = declarationSources;\r\n this.nestedRuleSets = ko.observableArray([]);\r\n if (parent === null) {\r\n this.effectiveSelectors = selectors;\r\n }\r\n else {\r\n this.effectiveSelectors = CssRuleSet.combineSelectors(selectors, parent.effectiveSelectors);\r\n }\r\n this.selectorText = this.effectiveSelectors.join(', ');\r\n }\r\n static combineSelectors(selectors, parentSelectors) {\r\n const combinedSelectors = [];\r\n for (const selector of selectors) {\r\n if (selector === '') {\r\n continue;\r\n }\r\n if (selector.includes('&')) {\r\n //Insert the parent selectors into the current selector at the position of the \"&\".\r\n for (const parentSelector of parentSelectors) {\r\n combinedSelectors.push(selector.replace('&', parentSelector.trim()));\r\n }\r\n }\r\n else {\r\n //Just append the current selector to the parent selectors.\r\n for (const parentSelector of parentSelectors) {\r\n combinedSelectors.push(`${parentSelector} ${selector}`);\r\n }\r\n }\r\n }\r\n return combinedSelectors;\r\n }\r\n setNestedRuleSets(ruleSets) {\r\n //Dispose the old rule sets that are not part of the new list.\r\n for (const oldRuleSet of this.nestedRuleSets()) {\r\n if (ruleSets.indexOf(oldRuleSet) === -1) {\r\n oldRuleSet.dispose();\r\n }\r\n }\r\n this.nestedRuleSets(ruleSets);\r\n }\r\n generateCss() {\r\n const declarations = this.getDeclarations();\r\n const nestedRuleSetParts = [];\r\n for (const ruleSet of this.nestedRuleSets()) {\r\n if (ruleSet.isActive()) {\r\n nestedRuleSetParts.push(ruleSet.cssText());\r\n }\r\n }\r\n let css = '';\r\n if (declarations.length > 0) {\r\n css += this.selectorText + ' {\\n\\t' + declarations.join('\\n\\t') + '\\n}\\n';\r\n }\r\n if (nestedRuleSetParts.length > 0) {\r\n css += nestedRuleSetParts.join('\\n');\r\n }\r\n return css;\r\n }\r\n isActive() {\r\n for (const source of this.declarationSources) {\r\n if (source.isActive()) {\r\n return true;\r\n }\r\n }\r\n for (const ruleSet of this.nestedRuleSets()) {\r\n if (ruleSet.isActive()) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n getDeclarations() {\r\n const declarations = [];\r\n for (const source of this.declarationSources) {\r\n if (source.isActive()) {\r\n declarations.push(...source.cssDeclarations());\r\n }\r\n }\r\n return declarations;\r\n }\r\n dispose() {\r\n //Dispose declaration sources.\r\n for (const source of this.declarationSources) {\r\n source.dispose();\r\n }\r\n //Dispose nested rule sets.\r\n for (const ruleSet of this.nestedRuleSets()) {\r\n ruleSet.dispose();\r\n }\r\n super.dispose();\r\n }\r\n }\r\n class ConditionalAtRule extends CssStatement {\r\n constructor(identifier, condition, nestedStatements) {\r\n super();\r\n this.identifier = identifier;\r\n this.condition = condition;\r\n this.nestedStatements = nestedStatements;\r\n }\r\n generateCss() {\r\n const pieces = [];\r\n for (const statement of this.nestedStatements) {\r\n const css = statement.cssText();\r\n if (css !== '') {\r\n pieces.push(css);\r\n }\r\n }\r\n if (pieces.length === 0) {\r\n return '';\r\n }\r\n return this.getAtRuleText() + ' {\\n\\t' + pieces.join('\\n\\t') + '\\n}';\r\n }\r\n getAtRuleText() {\r\n return '@' + this.identifier + ' ' + this.condition;\r\n }\r\n isActive() {\r\n for (const statement of this.nestedStatements) {\r\n if (statement.isActive()) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n dispose() {\r\n //Dispose nested statements.\r\n for (const statement of this.nestedStatements) {\r\n statement.dispose();\r\n }\r\n super.dispose();\r\n }\r\n }\r\n class PreviewStyleBlock {\r\n constructor(statements, condition = null) {\r\n this.statements = statements;\r\n this.condition = condition;\r\n this.$styleElement = null;\r\n this.cssText = ko.computed({\r\n read: () => {\r\n if ((condition !== null) && !condition()) {\r\n return '';\r\n }\r\n let pieces = [];\r\n for (const statement of this.statements) {\r\n if (statement.isActive()) {\r\n const css = statement.cssText();\r\n if (css !== '') {\r\n pieces.push(css);\r\n }\r\n }\r\n }\r\n if (pieces.length === 0) {\r\n return '';\r\n }\r\n return pieces.join('\\n');\r\n },\r\n deferEvaluation: true,\r\n }).extend({ deferred: true });\r\n this.updateStyleElement(this.cssText());\r\n this.cssChangeSubscription = this.cssText.subscribe((cssText) => {\r\n this.updateStyleElement(cssText);\r\n });\r\n }\r\n updateStyleElement(cssText) {\r\n if (cssText === '') {\r\n if (this.$styleElement) {\r\n this.$styleElement.remove();\r\n this.$styleElement = null;\r\n }\r\n return;\r\n }\r\n if (!this.$styleElement) {\r\n this.$styleElement = $('').appendTo('head');\r\n }\r\n this.$styleElement.text(cssText);\r\n }\r\n clear() {\r\n if (this.$styleElement) {\r\n this.$styleElement.remove();\r\n this.$styleElement = null;\r\n }\r\n }\r\n dispose() {\r\n //Stop listening for CSS changes.\r\n this.cssChangeSubscription.dispose();\r\n this.cssText.dispose();\r\n //Dispose rule sets.\r\n for (const ruleset of this.statements) {\r\n ruleset.dispose();\r\n }\r\n //Remove the style element.\r\n this.clear();\r\n }\r\n }\r\n })(Preview = AmeStyleGenerator.Preview || (AmeStyleGenerator.Preview = {}));\r\n})(AmeStyleGenerator || (AmeStyleGenerator = {}));\r\n//# sourceMappingURL=style-generator.js.map"],"names":[],"sourceRoot":""} \ No newline at end of file diff --git a/extras.php b/extras.php index 5201cba..ca6fa12 100644 --- a/extras.php +++ b/extras.php @@ -976,19 +976,32 @@ function menu_editor_header($action = ''){ die("Exported data not found"); } + /* + * Compatibility workaround: Some buggy plugins add superfluous whitespace to + * the beginning of every WP response because they have whitespace after the closing + * PHP tag in one of their files. As a result, the response size doesn't match + * out Content-Length header and the browser cuts off the end of the file. + * + * To work around that, let's add some sacrificial whitespace to the end of the file. + * If some of it gets cut off, we won't lose any important data. + */ + $content = $export['menu']; + $content .= str_repeat(' ', 100); + //Force file download header("Content-Description: File Transfer"); header('Content-Disposition: attachment; filename="' . $export['filename'] . '"'); header("Content-Type: application/force-download"); header("Content-Transfer-Encoding: binary"); - header("Content-Length: " . strlen($export['menu'])); + header("Content-Length: " . strlen($content)); /* The three lines below basically make the download non-cacheable */ header("Cache-control: private"); header("Pragma: private"); header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); - echo $export['menu']; + //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Expected to be JSON. + echo $content; die(); @@ -2160,18 +2173,27 @@ public function add_fa_selector_tab($tabs) { public function output_fa_selector_tab() { echo ''; } @@ -2372,7 +2394,7 @@ public function filter_available_modules($modules) { 'path' => AME_ROOT_DIR . '/extras/modules/tweaks/tweaks.php', 'className' => 'ameTweakManager', 'title' => 'Tweaks', - 'requiredPhpVersion' => '5.4', + 'requiredPhpVersion' => '5.6', ); $modules['separator-styles'] = array( @@ -2390,21 +2412,19 @@ public function filter_available_modules($modules) { 'isAlwaysActive' => true, ); - if (defined('AME_CUSTOMIZABLE_DEV') && AME_CUSTOMIZABLE_DEV) { - $modules['admin-customizer'] = [ - 'path' => AME_ROOT_DIR . '/extras/modules/admin-customizer/admin-customizer.php', - 'className' => 'YahnisElsts\\AdminMenuEditor\\AdminCustomizer\\AmeAdminCustomizer', - 'title' => 'Admin Customizer', - 'requiredPhpVersion' => '5.6', - ]; + $modules['admin-customizer'] = [ + 'path' => AME_ROOT_DIR . '/extras/modules/admin-customizer/admin-customizer.php', + 'className' => 'YahnisElsts\\AdminMenuEditor\\AdminCustomizer\\AmeAdminCustomizer', + 'title' => 'Admin Customizer', + 'requiredPhpVersion' => '5.6', + ]; - $modules['admin-theme-builder'] = [ - 'path' => AME_ROOT_DIR . '/extras/modules/dashboard-styler/dashboard-styler.php', - 'className' => 'YahnisElsts\\AdminMenuEditor\\DashboardStyler\\DashboardStyler', - 'title' => 'Dashboard Styler', - 'requiredPhpVersion' => '5.6', - ]; - } + $modules['dashboard-styler'] = [ + 'path' => AME_ROOT_DIR . '/extras/modules/dashboard-styler/dashboard-styler.php', + 'className' => 'YahnisElsts\\AdminMenuEditor\\DashboardStyler\\DashboardStyler', + 'title' => 'Dashboard Styler', + 'requiredPhpVersion' => '5.6', + ]; $modules['menu-colors'] = array( 'path' => AME_ROOT_DIR . '/extras/modules/admin-menu-colors/admin-menu-colors.php', @@ -2416,7 +2436,7 @@ public function filter_available_modules($modules) { if (defined('AME_CUSTOMIZABLE_DEV') && AME_CUSTOMIZABLE_DEV) { $modules['sample-module'] = [ - 'path' => AME_ROOT_DIR . '/extras/customizables/SampleModule.php', + 'path' => AME_ROOT_DIR . '/customizables/SampleModule.php', 'className' => '\\YahnisElsts\\AdminMenuEditor\\Customizable\\Design\\SampleModule', 'title' => 'Sample Module', 'requiredPhpVersion' => '5.6', diff --git a/extras/dynamic-stylesheets/Stylesheet.php b/extras/dynamic-stylesheets/Stylesheet.php index 5b450f1..1223554 100644 --- a/extras/dynamic-stylesheets/Stylesheet.php +++ b/extras/dynamic-stylesheets/Stylesheet.php @@ -172,7 +172,7 @@ protected function outputHttpResponse() { $content = sprintf( '/* Cache hit. Last modified on %s */', - isset($data['lastModified']) ? gmdate('Y-m-d H:i:s', $data['lastModified']) : 'unknown' + isset($data['lastModified']) ? gmdate('Y-m-d H:i:s e', $data['lastModified']) : 'unknown' ) . "\n" . $content; } else { $content = $this->generateCss(); @@ -181,7 +181,6 @@ protected function outputHttpResponse() { header('Content-Type: text/css'); header('X-Content-Type-Options: nosniff'); - header('Content-Length: ' . strlen($content)); //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- CSS does not need to be HTML-escaped. echo $content; @@ -272,25 +271,28 @@ protected function isContentKnownEmpty($lastModified) { * @return int Unix timestamp. Can be 0 if the last modified time is unknown. */ protected function getLastModifiedTimestamp() { - //In the preview frame, the "last modified" timestamp does not get updated - //when the user changes individual style settings. Instead, let's use - //the changeset modification time. + $timestamp = 0; + if ( $this->lastModifiedCallback !== null ) { + $lastModified = call_user_func($this->lastModifiedCallback); + if ( is_int($lastModified) ) { + $timestamp = $lastModified; + } + } + + //In the preview frame, we might have a mix of existing settings and settings + //that have been modified as part of an AC changeset. Let's use the most recent + //timestamp. + //The regular "last modified" timestamp doesn't get updated in AC preview when + //the user changes individual settings, so we use the changeset modification + //time instead. $changeset = $this->getActiveAcChangeset(); if ( !empty($changeset) ) { $changesetModified = $changeset->getLastModified(); - if ( !empty($changesetModified) ) { - return $changesetModified; + if ( !empty($changesetModified) && ($changesetModified > $timestamp) ) { + $timestamp = $changesetModified; } } - if ( $this->lastModifiedCallback === null ) { - return 0; - } - - $timestamp = call_user_func($this->lastModifiedCallback); - if ( !is_int($timestamp) ) { - return 0; - } return $timestamp; } diff --git a/extras/font-awesome/scss/font-awesome.css b/extras/font-awesome/scss/font-awesome.css index 75d09dc..8f52f03 100644 --- a/extras/font-awesome/scss/font-awesome.css +++ b/extras/font-awesome/scss/font-awesome.css @@ -5497,7 +5497,8 @@ font-size: 18px !important; } -#adminmenu#adminmenu#adminmenu .ame-menu-fa .wp-menu-image { +#adminmenu#adminmenu#adminmenu .ame-menu-fa .wp-menu-image, +#adminmenu#adminmenu#adminmenu .ame-menu-fa .wp-menu-image::before { background-image: none; } diff --git a/extras/font-awesome/scss/font-awesome.css.map b/extras/font-awesome/scss/font-awesome.css.map index c769085..75aac27 100644 --- a/extras/font-awesome/scss/font-awesome.css.map +++ b/extras/font-awesome/scss/font-awesome.css.map @@ -1 +1 @@ -{"version":3,"sourceRoot":"","sources":["font-awesome.scss","_path.scss","_core.scss","_larger.scss","_fixed-width.scss","_list.scss","_variables.scss","_bordered-pulled.scss","_animated.scss","_rotated-flipped.scss","_mixins.scss","_stacked.scss","_icons.scss","_screen-reader.scss","_ame-icons.scss"],"names":[],"mappings":"AAAA;AAAA;AAAA;AAAA;ACAA;AAAA;AAGA;EACE;EACA;EACA;EAMA;EACA;;ACVF;EACE;EACA;EACA;EACA;EACA;EACA;;;ACNF;AACA;EACE;EACA;EACA;;;AAEF;EAAwB;;;AACxB;EAAwB;;;AACxB;EAAwB;;;AACxB;EAAwB;;;ACVxB;EACE;EACA;;;ACDF;EACE;EACA,aCMoB;EDLpB;;AACA;EAAO;;;AAET;EACE;EACA;EACA,OCDoB;EDEpB;EACA;;AACA;EACE;;;AEbJ;EACE;EACA;EACA;;;AAGF;EAA+B;;;AAC/B;EAAgC;;;AAG9B;EAA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;;;AQqmBf;EAAoE,SRxoBzC;;;AQyoB3B;EAAuE,SRKzC;;;AQJ9B;EAA0D,SR9lBzC;;;AQ+lBjB;EAA8E,SR9oBzC;;;AQ+oBrC;AAAA;EACsF,SRhrBzC;;;AQirB7C;AAAA;AAAA;EAEuD,SR7fzC;;;AQ8fd;EAAwD,SR7YzC;;;AQ8Yf;EAA0D,SR7YzC;;;AQ8YjB;AAAA;EACgE,SRrJzC;;;AQsJvB;EAA6D,SR7SzC;;;AQ8SpB;EAAyD,SRfzC;;;AQgBhB;EAAgE,SRfzC;;;AQgBvB;EAA2D,SR7IzC;;;AQ8IlB;EAAiE,SR7IzC;;;AQ8IxB;EAAkE,SR7IzC;;;AQ8IzB;EAA6D,SR3OzC;;;AQ4OpB;EAA8D,SRhczC;;;AQicrB;EAAwD,SRazC;;;AQZf;EAA4D,SRlFzC;;;AQmFnB;AAAA;EACuE,SRtZzC;;;AQuZ9B;AAAA;EAC+D,SRzbzC;;;AN1QtB;EACC;EACA;;;AAKD;EACC;;;AAGD;EACC;;;AAKD;EACC;EACA;EACA;EACA;EAEA;;AAEA;EACC;;;AAIF;EACC;;AAEA;EACC;EACA;EACA;EAEA;EACA","file":"font-awesome.css"} \ No newline at end of file +{"version":3,"sourceRoot":"","sources":["font-awesome.scss","_path.scss","_core.scss","_larger.scss","_fixed-width.scss","_list.scss","_variables.scss","_bordered-pulled.scss","_animated.scss","_rotated-flipped.scss","_mixins.scss","_stacked.scss","_icons.scss","_screen-reader.scss","_ame-icons.scss"],"names":[],"mappings":"AAAA;AAAA;AAAA;AAAA;ACAA;AAAA;AAGA;EACE;EACA;EACA;EAMA;EACA;;ACVF;EACE;EACA;EACA;EACA;EACA;EACA;;;ACNF;AACA;EACE;EACA;EACA;;;AAEF;EAAwB;;;AACxB;EAAwB;;;AACxB;EAAwB;;;AACxB;EAAwB;;;ACVxB;EACE;EACA;;;ACDF;EACE;EACA,aCMoB;EDLpB;;AACA;EAAO;;;AAET;EACE;EACA;EACA,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dhB;EAAmE,SRhBzC;;;AQiB1B;EAAiE,SRmBzC;;;AQlBxB;EAAoE,SR/LzC;;;AQgM3B;EAAwD,SRpmBzC;;;AQqmBf;EAAoE,SRxoBzC;;;AQyoB3B;EAAuE,SRKzC;;;AQJ9B;EAA0D,SR9lBzC;;;AQ+lBjB;EAA8E,SR9oBzC;;;AQ+oBrC;AAAA;EACsF,SRhrBzC;;;AQirB7C;AAAA;AAAA;EAEuD,SR7fzC;;;AQ8fd;EAAwD,SR7YzC;;;AQ8Yf;EAA0D,SR7YzC;;;AQ8YjB;AAAA;EACgE,SRrJzC;;;AQsJvB;EAA6D,SR7SzC;;;AQ8SpB;EAAyD,SRfzC;;;AQgBhB;EAAgE,SRfzC;;;AQgBvB;EAA2D,SR7IzC;;;AQ8IlB;EAAiE,SR7IzC;;;AQ8IxB;EAAkE,SR7IzC;;;AQ8IzB;EAA6D,SR3OzC;;;AQ4OpB;EAA8D,SRhczC;;;AQicrB;EAAwD,SRazC;;;AQZf;EAA4D,SRlFzC;;;AQmFnB;AAAA;EACuE,SRtZzC;;;AQuZ9B;AAAA;EAC+D,SRzbzC;;;AN1QtB;EACC;EACA;;;AAKD;AAAA;EAEC;;;AAGD;EACC;;;AAKD;EACC;EACA;EACA;EACA;EAEA;;AAEA;EACC;;;AAIF;EACC;;AAEA;EACC;EACA;EACA;EAEA;EACA","file":"font-awesome.css"} \ No newline at end of file diff --git a/extras/font-awesome/scss/font-awesome.scss b/extras/font-awesome/scss/font-awesome.scss index bb6f004..fab03c3 100644 --- a/extras/font-awesome/scss/font-awesome.scss +++ b/extras/font-awesome/scss/font-awesome.scss @@ -29,7 +29,8 @@ } //Override icons set as background images. -#adminmenu#adminmenu#adminmenu #{$ame-menu-prefix} .wp-menu-image { +#adminmenu#adminmenu#adminmenu #{$ame-menu-prefix} .wp-menu-image, +#adminmenu#adminmenu#adminmenu #{$ame-menu-prefix} .wp-menu-image::before { background-image: none; } diff --git a/extras/ko-extensions.js b/extras/ko-extensions.js index 50f89b2..262d741 100644 --- a/extras/ko-extensions.js +++ b/extras/ko-extensions.js @@ -11,11 +11,20 @@ class AmeBaseKnockoutDialog { this.options = { buttons: [] }; - const confirmButtonLabel = this.getConfirmButtonLabel(); + this.firstInitDone = false; + this.confirmButtonId = AmeBaseKnockoutDialog.autoIdPrefix + 'confirm-' + AmeBaseKnockoutDialog.autoIdCounter++; + } + onBeforeInit() { + if (this.firstInitDone) { + return; + } + this.firstInitDone = true; + const confirmButtonLabel = this.confirmButtonLabel(); if (confirmButtonLabel !== null) { this.options.buttons.push({ text: confirmButtonLabel, 'class': 'button button-primary ame-dialog-confirm-button', + id: this.confirmButtonId, click: this.handleConfirmButtonClick.bind(this), disabled: true //Should be enabled by using the isConfirmButtonEnabled observable. }); @@ -40,10 +49,9 @@ class AmeBaseKnockoutDialog { event.preventDefault(); } } - getConfirmButtonLabel() { - return null; - } } +AmeBaseKnockoutDialog.autoIdPrefix = 'ws-ame-dialogAuto-'; +AmeBaseKnockoutDialog.autoIdCounter = 0; /* * jQuery Dialog binding for Knockout. * @@ -60,6 +68,9 @@ ko.bindingHandlers.ameDialog = { init: function (element, valueAccessor) { const dialog = ko.utils.unwrapObservable(valueAccessor()); const _ = wsAmeLodash; + if (dialog.onBeforeInit) { + dialog.onBeforeInit(); + } let options = dialog.options ? dialog.options : {}; if (!dialog.hasOwnProperty('isOpen')) { dialog.isOpen = ko.observable(false); @@ -110,6 +121,14 @@ ko.bindingHandlers.ameDialog = { dialog.title.subscribe(function (newTitle) { jQuery(element).dialog('option', 'title', newTitle); }); + if (dialog.confirmButtonId && dialog.confirmButtonLabel) { + dialog.confirmButtonLabel.subscribe(function (newLabel) { + if (newLabel === null) { + return; + } + jQuery('#' + dialog.confirmButtonId).button('option', 'label', newLabel); + }); + } if (ko.utils.unwrapObservable(dialog.isOpen)) { jQuery(element).dialog('open'); } @@ -158,8 +177,8 @@ ko.bindingHandlers.ameOpenDialog = { * You can apply it to any element inside a dialog, or the dialog itself. * * Usage: - *
    ...
    - *
    ...
    + *
    ...
    + *
    ...
    * * If you omit the selector, the binding will enable/disable the first button that has the "button-primary" CSS class. */ diff --git a/extras/ko-extensions.js.map b/extras/ko-extensions.js.map index e7a5bb1..0ebb5dd 100644 --- a/extras/ko-extensions.js.map +++ b/extras/ko-extensions.js.map @@ -1 +1 @@ -{"version":3,"file":"ko-extensions.js","sourceRoot":"","sources":["ko-extensions.ts"],"names":[],"mappings":";AAAA,0CAA0C;AAC1C,4CAA4C;AAC5C,0CAA0C;AAC1C,+CAA+C;AAiB/C,MAAe,qBAAqB;IAWnC;QAVA,WAAM,GAAgC,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QAC3D,iBAAY,GAAkB,IAAI,CAAC;QACnC,UAAK,GAAsC,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QAE/D,YAAO,GAAwB;YAC9B,OAAO,EAAE,EAAE;SACX,CAAC;QAKD,MAAM,kBAAkB,GAAG,IAAI,CAAC,qBAAqB,EAAE,CAAC;QACxD,IAAI,kBAAkB,KAAK,IAAI,EAAE;YAChC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC;gBACzB,IAAI,EAAE,kBAAkB;gBACxB,OAAO,EAAE,iDAAiD;gBAC1D,KAAK,EAAE,IAAI,CAAC,wBAAwB,CAAC,IAAI,CAAC,IAAI,CAAC;gBAC/C,QAAQ,EAAE,IAAI,CAAC,mEAAmE;aAClF,CAAC,CAAC;SACH;IACF,CAAC;IAES,wBAAwB,CAAC,KAAwB;QAC1D,IAAI,CAAC,IAAI,CAAC,sBAAsB,EAAE,EAAE;YACnC,KAAK,CAAC,cAAc,EAAE,CAAC;YACvB,OAAO;SACP;QACD,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IACvB,CAAC;IAED,SAAS,CAAC,KAAwB;QACjC,yBAAyB;QACzB,KAAK,CAAC,cAAc,EAAE,CAAC;IACxB,CAAC;IAED,QAAQ,CAAC,KAAwB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;aACvB;YACD,IAAI,mBAAmB,EAAE;gBACxB,mBAAmB,CAAC,OAAO,EAAE,CAAC;aAC9B;YACD,IAAI,aAAa,EAAE;gBAClB,EAAE,CAAC,GAAG,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;aACjC;YAED,kCAAkC;YAClC,MAAM,CAAC,EAAE,CAAC,iBAAiB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;QACzC,CAAC,CAAC,CAAC;IACJ,CAAC;CACD,CAAC"} \ No newline at end of file diff --git a/extras/ko-extensions.ts b/extras/ko-extensions.ts index ca49069..eb013ff 100644 --- a/extras/ko-extensions.ts +++ b/extras/ko-extensions.ts @@ -12,10 +12,14 @@ interface AmeKnockoutDialog { autoCancelButton?: boolean; jQueryWidget: JQuery | null; title: KnockoutObservable; + confirmButtonLabel?: KnockoutObservable; + confirmButtonId?: string; onOpen?(event: JQueryEventObject, ui: any): void; onClose?(event: JQueryEventObject, ui: any): void; + + onBeforeInit?(): void; } abstract class AmeBaseKnockoutDialog implements AmeKnockoutDialog { @@ -28,13 +32,30 @@ abstract class AmeBaseKnockoutDialog implements AmeKnockoutDialog { }; abstract isConfirmButtonEnabled: KnockoutObservable; + public abstract readonly confirmButtonLabel: KnockoutObservable; + public readonly confirmButtonId: string; + + private firstInitDone: boolean = false; + + protected static readonly autoIdPrefix: string = 'ws-ame-dialogAuto-'; + protected static autoIdCounter: number = 0; protected constructor() { - const confirmButtonLabel = this.getConfirmButtonLabel(); + this.confirmButtonId = AmeBaseKnockoutDialog.autoIdPrefix + 'confirm-' + AmeBaseKnockoutDialog.autoIdCounter++; + } + + onBeforeInit(): void { + if (this.firstInitDone) { + return; + } + this.firstInitDone = true; + + const confirmButtonLabel = this.confirmButtonLabel(); if (confirmButtonLabel !== null) { this.options.buttons.push({ text: confirmButtonLabel, 'class': 'button button-primary ame-dialog-confirm-button', + id: this.confirmButtonId, click: this.handleConfirmButtonClick.bind(this), disabled: true //Should be enabled by using the isConfirmButtonEnabled observable. }); @@ -61,10 +82,6 @@ abstract class AmeBaseKnockoutDialog implements AmeKnockoutDialog { event.preventDefault(); } } - - protected getConfirmButtonLabel(): string | null { - return null; - } } /* @@ -84,6 +101,10 @@ ko.bindingHandlers.ameDialog = { const dialog = ko.utils.unwrapObservable(valueAccessor()) as AmeKnockoutDialog; const _ = wsAmeLodash; + if (dialog.onBeforeInit) { + dialog.onBeforeInit(); + } + let options: JQueryUI.DialogOptions = dialog.options ? dialog.options : {}; if (!dialog.hasOwnProperty('isOpen')) { dialog.isOpen = ko.observable(false); @@ -141,6 +162,15 @@ ko.bindingHandlers.ameDialog = { jQuery(element).dialog('option', 'title', newTitle); }); + if (dialog.confirmButtonId && dialog.confirmButtonLabel) { + dialog.confirmButtonLabel.subscribe(function (newLabel) { + if (newLabel === null) { + return; + } + jQuery('#' + dialog.confirmButtonId).button('option', 'label', newLabel); + }); + } + if (ko.utils.unwrapObservable(dialog.isOpen)) { jQuery(element).dialog('open'); } @@ -199,8 +229,8 @@ ko.bindingHandlers.ameOpenDialog = { * You can apply it to any element inside a dialog, or the dialog itself. * * Usage: - *
    ...
    - *
    ...
    + *
    ...
    + *
    ...
    * * If you omit the selector, the binding will enable/disable the first button that has the "button-primary" CSS class. */ diff --git a/extras/menu-headings/ameMenuHeadingStyler.php b/extras/menu-headings/ameMenuHeadingStyler.php index 636fa8c..8d54e20 100644 --- a/extras/menu-headings/ameMenuHeadingStyler.php +++ b/extras/menu-headings/ameMenuHeadingStyler.php @@ -16,13 +16,13 @@ public function __construct($menuEditor) { //Put the heading stylesheet before the admin colors stylesheet to make it easier //to override the heading colors for individual items (using the "Color scheme" field). - add_action('admin_enqueue_scripts', array($this, 'enqueueHeadingCustomizations'), 5); - add_action('wp_ajax_' . self::CSS_AJAX_ACTION, array($this, 'ajaxOutputCss')); + add_action('admin_enqueue_scripts', [$this, 'enqueueHeadingCustomizations'], 5); + add_action('wp_ajax_' . self::CSS_AJAX_ACTION, [$this, 'ajaxOutputCss']); - add_action('admin_menu_editor-enqueue_styles-editor', array($this, 'enqueueEditorStyles')); + add_action('admin_menu_editor-enqueue_styles-editor', [$this, 'enqueueEditorStyles']); if ( !empty($_COOKIE['ame-collapsed-menu-headings']) ) { - add_action('in_admin_header', array($this, 'outputRestorationTrigger')); + add_action('in_admin_header', [$this, 'outputRestorationTrigger']); } } @@ -56,10 +56,13 @@ public function ajaxOutputCss() { header('Content-Type: text/css'); header('X-Content-Type-Options: nosniff'); + //phpcs:disable WordPress.Security.ValidatedSanitizedInput.InputNotSanitized,WordPress.Security.NonceVerification.Recommended + //This is not form input, and the config ID can be treated as opaque. load_custom_menu() will validate it. $configId = null; - if ( isset($_GET['ame_config_id']) && !empty($_GET['ame_config_id']) ) { + if ( !empty($_GET['ame_config_id']) ) { $configId = (string)($_GET['ame_config_id']); } + //phpcs:enable $customMenu = $this->menuEditor->load_custom_menu($configId); if ( empty($customMenu) || empty($customMenu['menu_headings']) ) { @@ -70,9 +73,11 @@ public function ajaxOutputCss() { $timestamp = (int)ameUtils::get($customMenu, 'menu_headings.modificationTimestamp', time()); //Support the If-Modified-Since header. $omitResponseBody = false; - if ( isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) && !empty($_SERVER['HTTP_IF_MODIFIED_SINCE']) ) { + if ( !empty($_SERVER['HTTP_IF_MODIFIED_SINCE']) ) { + //strtotime() will return false if the input is not a valid timestamp. + //phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized $threshold = strtotime((string)$_SERVER['HTTP_IF_MODIFIED_SINCE']); - if ( $timestamp <= $threshold ) { + if ( ($threshold !== false) && ($timestamp <= $threshold) ) { header('HTTP/1.1 304 Not Modified'); $omitResponseBody = true; } @@ -90,24 +95,24 @@ public function ajaxOutputCss() { } $output = $this->generateCss($customMenu['menu_headings']); + //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- The output is CSS. echo $output; exit; } protected function generateCss($settings) { $textColor = null; - $backgroundColor = null; + if ( ameUtils::get($settings, 'textColorType') === 'custom' ) { + $textColor = ameUtils::get($settings, 'textColor'); + } //General heading appearance. $linkStyles = ['cursor' => 'default']; $hoverStyles = ['background-color' => 'transparent']; - if ( ameUtils::get($settings, 'textColorType') === 'custom' ) { - $textColor = ameUtils::get($settings, 'textColor'); - if ( !empty($textColor) ) { - $linkStyles['color'] = $textColor; - $hoverStyles['color'] = $textColor; - } + if ( !empty($textColor) ) { + $linkStyles['color'] = $textColor; + $hoverStyles['color'] = $textColor; } if ( ameUtils::get($settings, 'backgroundColorType') === 'custom' ) { $backgroundColor = ameUtils::get($settings, 'backgroundColor'); @@ -172,6 +177,7 @@ protected function generateCss($settings) { //The icon. $iconStyles = []; $collapsedIconStyles = []; + $iconHoverStyles = []; $iconVisibility = ameUtils::get($settings, 'iconVisibility', 'always'); if ( $iconVisibility !== 'always' ) { $iconStyles['display'] = 'none'; @@ -184,10 +190,14 @@ protected function generateCss($settings) { $paddingStyles['padding-left'] = '9px'; } } + if ( !empty($textColor) ) { + $iconStyles['color'] = $textColor; + $iconHoverStyles['color'] = $textColor; + } $output = [ $this->makeCssRule( - ['& a'], + ['& > a'], $linkStyles ), $this->makeCssRule( @@ -199,7 +209,15 @@ protected function generateCss($settings) { $borderStyles ), $this->makeCssRule( - ['&:hover', '&:active', '&:focus', '& a:hover', '&.menu-top a:active', '&.menu-top a:focus',], + [ + '&:hover', + '&:active', + '&:focus', + '& > a:hover', + '&.menu-top > a:active', + '&.menu-top > a:focus', + '&.opensub > a.menu-top', + ], $hoverStyles ), $this->makeCssRule( @@ -211,12 +229,20 @@ protected function generateCss($settings) { $collapsedIconStyles ), $this->makeCssRule( - ['&.ame-collapsible-heading a'], + [ + '&:hover div.wp-menu-image::before', + '& > a:focus div.wp-menu-image::before', + '&.opensub div.wp-menu-image::before', + ], + $iconHoverStyles + ), + $this->makeCssRule( + ['&.ame-collapsible-heading > a'], ['cursor' => 'pointer'] ), //Remove the colored bar from item unless the heading is clickable. $this->makeCssRule( - ['&:not(.ame-collapsible-heading) a'], + ['&:not(.ame-collapsible-heading) > a'], ['box-shadow' => 'none'] ), ]; diff --git a/extras/menu-headings/menu-headings-template.php b/extras/menu-headings/menu-headings-template.php index 2378b43..79f9cb2 100644 --- a/extras/menu-headings/menu-headings-template.php +++ b/extras/menu-headings/menu-headings-template.php @@ -214,7 +214,7 @@ class="ame-inline-select-with-input"
    -
    diff --git a/extras/menu-headings/menu-headings.js b/extras/menu-headings/menu-headings.js index 14a4985..915e209 100644 --- a/extras/menu-headings/menu-headings.js +++ b/extras/menu-headings/menu-headings.js @@ -135,6 +135,9 @@ class AmeMenuHeadingSettingsScreen { this.settings.modificationTimestamp(Math.round(Date.now() / 1000)); this.currentSavedSettings = this.settings.getAll(); this.closeDialog(); + if (jQuery) { + jQuery(document).trigger('adminMenuEditor:menuConfigChanged'); + } } onCancel() { this.discardChanges(); diff --git a/extras/menu-headings/menu-headings.js.map b/extras/menu-headings/menu-headings.js.map index 5b23540..5a47029 100644 --- a/extras/menu-headings/menu-headings.js.map +++ b/extras/menu-headings/menu-headings.js.map @@ -1 +1 @@ -{"version":3,"file":"menu-headings.js","sourceRoot":"","sources":["menu-headings.ts"],"names":[],"mappings":";AAAA,2CAA2C;AAC3C,gDAAgD;AAChD,2CAA2C;AAY3C,6FAA6F;AAC7F,MAAM,2BAA2B;IAAjC;QACC,eAAU,GAAqB,QAAQ,CAAC;QACxC,kBAAa,GAAW,EAAE,CAAC;QAC3B,iBAAY,GAAoB,IAAI,CAAC;QACrC,eAAU,GAAkB,IAAI,CAAC;QAEjC,kBAAa,GAA2B,MAAM,CAAC;QAE/C,kBAAa,GAAwB,SAAS,CAAC;QAC/C,cAAS,GAAW,EAAE,CAAC;QACvB,wBAAmB,GAAwB,SAAS,CAAC;QACrD,oBAAe,GAAW,EAAE,CAAC;QAE7B,eAAU,GAAW,CAAC,CAAC;QACvB,kBAAa,GAAW,CAAC,CAAC;QAC1B,gBAAW,GAAW,EAAE,CAAC;QACzB,iBAAY,GAAW,CAAC,CAAC;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M,EAAE,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QAChD,CAAC;QAED,CAAC,CAAC,yBAAyB,CAAC,CAAC,EAAE,CAAC,OAAO,EAAE;YACxC,IAAI,CAAC,mBAAmB,EAAE;gBACzB,uBAAuB,EAAE,CAAC;aAC1B;YAED,IAAI,MAAM,EAAE;gBACX,MAAM,CAAC,cAAc,EAAE,CAAC;aACxB;YACD,aAAa,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QAC9B,CAAC,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC"} \ No newline at end of file diff --git a/extras/menu-headings/menu-headings.ts b/extras/menu-headings/menu-headings.ts index 29a2aee..aacf1a9 100644 --- a/extras/menu-headings/menu-headings.ts +++ b/extras/menu-headings/menu-headings.ts @@ -203,6 +203,10 @@ class AmeMenuHeadingSettingsScreen { this.settings.modificationTimestamp(Math.round(Date.now() / 1000)); this.currentSavedSettings = this.settings.getAll(); this.closeDialog(); + + if (jQuery) { + jQuery(document).trigger('adminMenuEditor:menuConfigChanged'); + } } onCancel() { diff --git a/extras/modules/admin-customizer/admin-customizer-template.php b/extras/modules/admin-customizer/admin-customizer-template.php index fcdc85a..3b2bd68 100644 --- a/extras/modules/admin-customizer/admin-customizer-template.php +++ b/extras/modules/admin-customizer/admin-customizer-template.php @@ -46,7 +46,7 @@ } $bodyClasses[] = ' locale-' . sanitize_html_class(strtolower(str_replace('_', '-', get_user_locale()))); -$pageTitle = 'Admin Customizer'; +$pageTitle = apply_filters('admin_menu_editor-ac_page_title', 'Admin Customizer'); ?> <?php echo esc_html($pageTitle); ?> '; if ( empty($currentChangeset) ) { wp_die('Changeset not defined'); } -if ( empty($currentChangeset->getName()) ) { - wp_die('Changeset does not have a name'); -} + +$defaultButtonsEnabled = apply_filters('admin_menu_editor-ac_default_buttons_enabled', true); + ?>
    - Close + + + Close + + -
    - 'ame-ac-apply-changes', - 'data-default-text' => 'Save Changes', - 'data-published-text' => 'Saved', - 'disabled' => 'disabled', - //Disabled by default, enabled when changes are detected. - ] - ); - - echo '' - ?> -
    + ?> +
    - - + + +
    @@ -166,6 +176,7 @@ class="button button-primary dashicons dashicons-admin-generic"
    +