Version Description
- Feature: Brand new recipe modal
- Feature: Brand new manage page
- Feature: Save revisions for recipes
- Feature: Copy to JSON when saving fails
- Feature: Autosuggest existing ingredients
- Feature: Ratings on the Manage page
- Feature: Output 0 for cook and prep time in metadata
- Feature: Show "0" in template for cook, prep or custom times
- Feature: Link image and name block to recipe URL (for roundup)
- Improvement: Allow links in ingredient and instruction group headers
- Improvement: Reduce rating queries
- Improvement: Support more formats for custom icon
- Improvement: Keywords and total time in WP Tasty import
- Improvement: Replace WP Tasty recipes in Gutenberg after import
- Improvement: Use recipe name placeholder in roundup link
- Improvement: Adjustable servings in recipe roundup
- Fix: Prevent closing bracket from breaking shortcode in Template Editor
- Fix: Double block properties when editing roundup template
Download this release
Release Info
Developer | BrechtVds |
Plugin | WP Recipe Maker |
Version | 5.0.0 |
Comparing to | |
See all releases |
Code changes from version 4.3.0 to 5.0.0
- assets/css/admin/addons.scss +6 -0
- assets/css/admin/faq.scss +6 -0
- assets/css/admin/manage.scss +0 -99
- assets/css/admin/manage/app.scss +116 -0
- assets/css/admin/manage/general.scss +0 -9
- assets/css/admin/manage/notices.scss +28 -0
- assets/css/admin/manage/nutrition.scss +21 -0
- assets/css/admin/manage/recipes.scss +125 -0
- assets/css/admin/manage/select-columns.scss +35 -8
- assets/css/admin/manage/table.scss +78 -0
- assets/css/admin/manage/taxonomies.scss +18 -0
- assets/css/admin/modal.scss +0 -8
- assets/css/admin/modal/_container.scss +0 -512
- assets/css/admin/modal/_form.scss +0 -61
- assets/css/admin/modal/_import-text.scss +0 -41
- assets/css/admin/modal/_loader.scss +0 -63
- assets/css/admin/modal/_recipe-details.scss +0 -30
- assets/css/admin/modal/_recipe-ingredients.scss +0 -120
- assets/css/admin/modal/_recipe-notes.scss +0 -24
- assets/css/admin/modal/_shortcode-builder.scss +0 -46
- assets/css/admin/modal/app.scss +95 -0
- assets/css/admin/modal/bulk-edit.scss +41 -0
- assets/css/admin/modal/general/edit-mode.scss +58 -0
- assets/css/admin/modal/general/fields.scss +158 -0
- assets/css/admin/modal/general/rich-text.scss +118 -0
- assets/css/admin/modal/menu.scss +44 -0
- assets/css/admin/modal/nutrition.scss +28 -0
- assets/css/admin/modal/recipe.scss +36 -0
- assets/css/admin/modal/recipe/fields/general.scss +46 -0
- assets/css/admin/modal/recipe/fields/import.scss +5 -0
- assets/css/admin/modal/recipe/fields/ingredients.scss +223 -0
- assets/css/admin/modal/recipe/fields/instructions.scss +143 -0
- assets/css/admin/modal/recipe/fields/media.scss +44 -0
- assets/css/admin/modal/recipe/fields/notes.scss +18 -0
- assets/css/admin/modal/recipe/fields/nutrition.scss +50 -0
- assets/css/admin/modal/recipe/fields/times.scss +44 -0
- assets/css/admin/modal/recipe/ingredient-links.scss +77 -0
- assets/css/admin/modal/recipe/nutrition-calculation.scss +236 -0
- assets/css/admin/modal/recipe/unit-conversion.scss +129 -0
- assets/css/admin/modal/select.scss +7 -0
- assets/css/admin/modal/taxonomy.scss +9 -0
- assets/css/admin/modal/text-import.scss +64 -0
- assets/css/admin/settings/layout.scss +4 -1
- assets/css/admin/shared/button.scss +4 -0
- assets/css/admin/shared/error-boundary.scss +14 -0
- assets/css/admin/shared/icon.scss +9 -0
- assets/css/admin/shared/loader.scss +17 -0
- assets/css/blocks/modal.scss +0 -10
- assets/css/shortcodes/_image.scss +5 -0
- assets/icons/admin/adjustable.svg +1 -0
- assets/icons/admin/bold.svg +1 -0
- assets/icons/admin/checkbox-alternate.svg +1 -0
- assets/icons/admin/checkbox-checked.svg +1 -0
- assets/icons/admin/checkbox-empty.svg +1 -0
- assets/icons/admin/checkmark.svg +1 -0
- assets/icons/admin/clock.svg +1 -0
- assets/icons/admin/close.svg +1 -0
- assets/icons/admin/drag.svg +1 -0
- assets/icons/admin/duplicate.svg +1 -0
- assets/icons/admin/eye.svg +1 -0
- assets/icons/admin/italic.svg +1 -0
- assets/icons/admin/link.svg +1 -0
- assets/icons/admin/merge.svg +1 -0
- assets/icons/admin/pencil.svg +1 -0
- assets/icons/admin/question.svg +1 -0
- assets/icons/admin/star-empty.svg +1 -0
- assets/icons/admin/star-full.svg +1 -0
- assets/icons/admin/subscript.svg +1 -0
- assets/icons/admin/superscript.svg +1 -0
- assets/icons/admin/trash.svg +1 -0
- assets/icons/admin/underline.svg +1 -0
- assets/icons/admin/unlink.svg +1 -0
- assets/images/faq/classic-editor.png +0 -0
- assets/images/faq/gutenberg.png +0 -0
- assets/images/faq/recipe-placeholder.png +0 -0
- assets/images/faq/wp-recipe-maker-button.png +0 -0
- assets/js/admin-manage.js +12 -4
- assets/js/admin-manage/App.js +26 -82
- assets/js/admin-manage/Columns.js +0 -170
- assets/js/admin-manage/DataTable.js +263 -0
- assets/js/admin-manage/DataTableConfig.js +200 -0
- assets/js/admin-manage/Menu.js +23 -0
- assets/js/admin-manage/Notices.js +56 -0
- assets/js/admin-manage/SelectColumns.js +0 -31
- assets/js/admin-manage/collections/Api.js +23 -0
- assets/js/admin-manage/collections/Columns.js +79 -0
- assets/js/admin-manage/custom-taxonomies/Columns.js +65 -0
- assets/js/admin-manage/general/Api.js +139 -10
- assets/js/admin-manage/general/Icon.js +0 -31
- assets/js/admin-manage/general/SelectColumns.js +42 -0
- assets/js/admin-manage/general/TextFilter.js +59 -0
- assets/js/admin-manage/general/Totals.js +32 -0
- assets/js/admin-manage/general/bulkEditCheckbox.js +33 -0
- assets/js/admin-manage/nutrition/Columns.js +112 -0
- assets/js/admin-manage/ratings/Api.js +47 -0
- assets/js/admin-manage/ratings/Columns.js +208 -0
- assets/js/admin-manage/recipe-submission/Api.js +28 -0
- assets/js/admin-manage/recipe-submission/Columns.js +131 -0
- assets/js/admin-manage/recipes/Columns.js +620 -0
- assets/js/admin-manage/recipes/SeoIndicator.js +34 -0
- assets/js/admin-manage/revisions/Columns.js +89 -0
- assets/js/admin-manage/taxonomies/Columns.js +197 -0
- assets/js/admin-modal.js +16 -0
- assets/js/admin-modal/App.js +110 -0
- assets/js/admin-modal/bulk-edit/ActionsIngredient.js +103 -0
- assets/js/admin-modal/bulk-edit/ActionsRating.js +40 -0
- assets/js/admin-modal/bulk-edit/ActionsRecipe.js +185 -0
- assets/js/admin-modal/bulk-edit/ActionsTaxonomy.js +49 -0
- assets/js/admin-modal/bulk-edit/Api.js +30 -0
- assets/js/admin-modal/bulk-edit/index.js +128 -0
- assets/js/admin-modal/fields/FieldCategory.js +73 -0
- assets/js/admin-modal/fields/FieldContainer.js +39 -0
- assets/js/admin-modal/fields/FieldDropdown.js +47 -0
- assets/js/admin-modal/fields/FieldGroup.js +27 -0
- assets/js/admin-modal/fields/FieldImage.js +46 -0
- assets/js/admin-modal/fields/FieldIngredient.js +140 -0
- assets/js/admin-modal/fields/FieldInstruction.js +112 -0
- assets/js/admin-modal/fields/FieldRadio.js +25 -0
- assets/js/admin-modal/fields/FieldRichText/Toolbar/ButtonAction.js +21 -0
- assets/js/admin-modal/fields/FieldRichText/Toolbar/ButtonCharacter.js +22 -0
- assets/js/admin-modal/fields/FieldRichText/Toolbar/ButtonLink.js +60 -0
- assets/js/admin-modal/fields/FieldRichText/Toolbar/ButtonMark.js +23 -0
- assets/js/admin-modal/fields/FieldRichText/Toolbar/Spacer.js +8 -0
- assets/js/admin-modal/fields/FieldRichText/Toolbar/ToolbarLink.js +81 -0
- assets/js/admin-modal/fields/FieldRichText/Toolbar/ToolbarSuggest.js +88 -0
- assets/js/admin-modal/fields/FieldRichText/Toolbar/index.js +97 -0
- assets/js/admin-modal/fields/FieldRichText/index.js +212 -0
- assets/js/admin-modal/fields/FieldRichText/rules.js +107 -0
- assets/js/admin-modal/fields/FieldText.js +22 -0
- assets/js/admin-modal/fields/FieldTextArea.js +14 -0
- assets/js/admin-modal/fields/FieldTime.js +73 -0
- assets/js/admin-modal/fields/FieldTinymce.js +118 -0
- assets/js/admin-modal/fields/FieldVideo.js +77 -0
- assets/js/admin-modal/general/Api.js +43 -0
- assets/js/admin-modal/general/EditMode.js +32 -0
- assets/js/admin-modal/general/Footer.js +20 -0
- assets/js/admin-modal/general/Header.js +22 -0
- assets/js/admin-modal/general/Media.js +52 -0
- assets/js/admin-modal/general/Toolbar.js +23 -0
- assets/js/admin-modal/menu/index.js +237 -0
- assets/js/admin-modal/nutrition/index.js +196 -0
- assets/js/admin-modal/recipe/edit-ingredient-links/index.js +109 -0
- assets/js/admin-modal/recipe/edit/RecipeCategories.js +44 -0
- assets/js/admin-modal/recipe/edit/RecipeGeneral.js +109 -0
- assets/js/admin-modal/recipe/edit/RecipeImport.js +43 -0
- assets/js/admin-modal/recipe/edit/RecipeIngredients/IngredientLinks/Api.js +52 -0
- assets/js/admin-modal/recipe/edit/RecipeIngredients/IngredientLinks/IngredientLink.js +100 -0
- assets/js/admin-modal/recipe/edit/RecipeIngredients/IngredientLinks/index.js +140 -0
- assets/js/admin-modal/recipe/edit/RecipeIngredients/IngredientsEdit.js +161 -0
- assets/js/admin-modal/recipe/edit/RecipeIngredients/IngredientsPreview.js +51 -0
- assets/js/admin-modal/recipe/edit/RecipeIngredients/UnitConversion/Api.js +28 -0
- assets/js/admin-modal/recipe/edit/RecipeIngredients/UnitConversion/UnitConversionIngredient.js +120 -0
- assets/js/admin-modal/recipe/edit/RecipeIngredients/UnitConversion/index.js +198 -0
- assets/js/admin-modal/recipe/edit/RecipeIngredients/index.js +109 -0
- assets/js/admin-modal/recipe/edit/RecipeInstructions.js +163 -0
- assets/js/admin-modal/recipe/edit/RecipeMedia.js +66 -0
- assets/js/admin-modal/recipe/edit/RecipeNotes.js +22 -0
- assets/js/admin-modal/recipe/edit/RecipeNutrition.js +108 -0
- assets/js/admin-modal/recipe/edit/RecipeTimes.js +87 -0
- assets/js/admin-modal/recipe/edit/index.js +258 -0
- assets/js/admin-modal/recipe/index.js +245 -0
- assets/js/admin-modal/recipe/nutrition-calculation/Api.js +150 -0
- assets/js/admin-modal/recipe/nutrition-calculation/Nutrients.js +43 -0
- assets/js/admin-modal/recipe/nutrition-calculation/StepCustom.js +224 -0
- assets/js/admin-modal/recipe/nutrition-calculation/StepCustomIngredient.js +51 -0
- assets/js/admin-modal/recipe/nutrition-calculation/StepMatch.js +159 -0
- assets/js/admin-modal/recipe/nutrition-calculation/StepSource.js +104 -0
- assets/js/admin-modal/recipe/nutrition-calculation/StepSummary.js +146 -0
- assets/js/admin-modal/recipe/nutrition-calculation/index.js +347 -0
- assets/js/admin-modal/recipe/text-import/Api.js +28 -0
- assets/js/admin-modal/recipe/text-import/SelectGroups.js +34 -0
- assets/js/admin-modal/recipe/text-import/index.js +326 -0
- assets/js/admin-modal/select/SelectRecipe.js +42 -0
- assets/js/admin-modal/select/index.js +98 -0
- assets/js/admin-modal/taxonomy/Api.js +54 -0
- assets/js/admin-modal/taxonomy/index.js +180 -0
- assets/js/admin-template/general/Helpers.js +2 -1
- assets/js/admin-template/main/preview-template/Block.js +1 -0
- assets/js/admin-template/main/preview-template/index.js +1 -1
- assets/js/admin.js +1 -8
- assets/js/admin/editor.js +53 -11
- assets/js/admin/import/after_import.js +4 -7
- assets/js/admin/manage.js +0 -10
- assets/js/admin/manage/api.js +0 -66
- assets/js/admin/manage/datatable.js +0 -199
- assets/js/admin/manage/interactions.js +0 -140
- assets/js/admin/modal.js +0 -14
- assets/js/admin/modal/Modal.js +0 -64
- assets/js/admin/modal/ModalInit.js +0 -142
- assets/js/admin/modal/Recipe.js +0 -394
- assets/js/admin/modal/RecipeInit.js +0 -138
- assets/js/admin/modal/RichEditor.js +0 -121
- assets/js/admin/modal/RichEditorLinks.js +0 -576
- assets/js/admin/modal/tabs/import-text.js +0 -288
- assets/js/admin/modal/tabs/recipe-snippets.js +0 -70
- assets/js/admin/modal/tabs/recipe.js +0 -173
- assets/js/admin/modal/utils.js +0 -137
- assets/js/blocks/recipe-roundup/index.js +10 -8
- assets/js/blocks/recipe/index.js +33 -29
- assets/js/other/{shortcode-preview-tinymce.js → tinymce-shortcode-preview.js} +11 -4
- assets/js/other/{shortcode-button-tinymce.js → tinymce-toolbar-button.js} +4 -1
- assets/js/public/print.js +19 -5
- assets/js/shared/Api.js +113 -0
- assets/js/shared/Button.js +53 -0
- assets/js/shared/ErrorBoundary.js +47 -0
- assets/js/shared/Icon.js +79 -0
- assets/js/shared/Loader.js +10 -0
- assets/js/shared/Tooltip.js +18 -0
- assets/js/shared/Translations.js +7 -0
- dist/admin-manage.css +1 -1
- dist/admin-manage.js +4 -5
assets/css/admin/addons.scss
CHANGED
@@ -4,10 +4,16 @@
|
|
4 |
box-sizing: border-box;
|
5 |
width: 30%;
|
6 |
float: left;
|
|
|
7 |
margin-right: 1%;
|
8 |
padding: 0 20px 20px 20px;
|
9 |
border: 1px dashed gray;
|
10 |
|
|
|
|
|
|
|
|
|
|
|
11 |
h2,
|
12 |
h3,
|
13 |
.wprm-addons-button-container {
|
4 |
box-sizing: border-box;
|
5 |
width: 30%;
|
6 |
float: left;
|
7 |
+
margin-top: 15px;
|
8 |
margin-right: 1%;
|
9 |
padding: 0 20px 20px 20px;
|
10 |
border: 1px dashed gray;
|
11 |
|
12 |
+
ul {
|
13 |
+
list-style-type: square;
|
14 |
+
margin-left: 10px;
|
15 |
+
}
|
16 |
+
|
17 |
h2,
|
18 |
h3,
|
19 |
.wprm-addons-button-container {
|
assets/css/admin/faq.scss
CHANGED
@@ -3,6 +3,12 @@
|
|
3 |
max-width: 650px;
|
4 |
}
|
5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
ul {
|
7 |
list-style-type: square;
|
8 |
}
|
3 |
max-width: 650px;
|
4 |
}
|
5 |
|
6 |
+
img {
|
7 |
+
width: 100%;
|
8 |
+
max-width: 500px;
|
9 |
+
height: auto;
|
10 |
+
}
|
11 |
+
|
12 |
ul {
|
13 |
list-style-type: square;
|
14 |
}
|
assets/css/admin/manage.scss
DELETED
@@ -1,99 +0,0 @@
|
|
1 |
-
@import 'manage/general';
|
2 |
-
@import 'manage/select-columns';
|
3 |
-
|
4 |
-
.wprm-manage {
|
5 |
-
|
6 |
-
.wprm-manage-header {
|
7 |
-
margin-top: 20px;
|
8 |
-
}
|
9 |
-
|
10 |
-
.wprm-manage-recipes-filters {
|
11 |
-
.wprm-manage-recipes-filter,
|
12 |
-
.select2_wprm-container {
|
13 |
-
margin-left: 5px;
|
14 |
-
z-index: 100;
|
15 |
-
}
|
16 |
-
|
17 |
-
.select2_wprm-container {
|
18 |
-
max-width: 300px;
|
19 |
-
}
|
20 |
-
}
|
21 |
-
|
22 |
-
.wprm-manage-datatable {
|
23 |
-
display: none;
|
24 |
-
|
25 |
-
.wprm-icon {
|
26 |
-
cursor: pointer;
|
27 |
-
color: #444;
|
28 |
-
}
|
29 |
-
}
|
30 |
-
|
31 |
-
.dataTables_wrapper {
|
32 |
-
margin-top: 20px;
|
33 |
-
|
34 |
-
.wprm-manage-datatable {
|
35 |
-
display: table;
|
36 |
-
}
|
37 |
-
}
|
38 |
-
|
39 |
-
.wprm-manage-recipes-rating-details {
|
40 |
-
font-size: 0.7em;
|
41 |
-
}
|
42 |
-
|
43 |
-
.wprm-manage-recipes-seo {
|
44 |
-
margin: 0 auto;
|
45 |
-
width: 15px;
|
46 |
-
height: 15px;
|
47 |
-
border: 1px solid #444;
|
48 |
-
border-radius: 50%;
|
49 |
-
|
50 |
-
&.wprm-manage-recipes-seo-bad {
|
51 |
-
background-color: #e74c3c;
|
52 |
-
}
|
53 |
-
&.wprm-manage-recipes-seo-warning {
|
54 |
-
background-color: #e67e22;
|
55 |
-
}
|
56 |
-
&.wprm-manage-recipes-seo-rating {
|
57 |
-
background-color: #f1c40f;
|
58 |
-
}
|
59 |
-
&.wprm-manage-recipes-seo-good {
|
60 |
-
background-color: #27ae60;
|
61 |
-
}
|
62 |
-
|
63 |
-
&:hover {
|
64 |
-
cursor: pointer;
|
65 |
-
}
|
66 |
-
}
|
67 |
-
.wprm-manage-recipes-seo-tooltip {
|
68 |
-
display: none;
|
69 |
-
}
|
70 |
-
|
71 |
-
.wprm-manage-action-icon {
|
72 |
-
cursor: pointer;
|
73 |
-
margin-left: 5px;
|
74 |
-
}
|
75 |
-
}
|
76 |
-
|
77 |
-
.wprm-manage-recipes-actions-tooltip,
|
78 |
-
.wprm-manage-ingredients-actions-tooltip,
|
79 |
-
.wprm-manage-taxonomies-actions-tooltip,
|
80 |
-
.wprm-manage-custom-taxonomies-actions-tooltip {
|
81 |
-
text-align: right;
|
82 |
-
min-width: 250px;
|
83 |
-
font-size: 14px;
|
84 |
-
|
85 |
-
.tooltip-header {
|
86 |
-
margin-bottom: 5px;
|
87 |
-
font-weight: bold;
|
88 |
-
}
|
89 |
-
|
90 |
-
a {
|
91 |
-
color: white;
|
92 |
-
display: block;
|
93 |
-
text-decoration: none;
|
94 |
-
|
95 |
-
&:hover {
|
96 |
-
text-decoration: underline;
|
97 |
-
}
|
98 |
-
}
|
99 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/css/admin/manage/app.scss
ADDED
@@ -0,0 +1,116 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#update-nag,
|
2 |
+
.update-nag,
|
3 |
+
.updated,
|
4 |
+
.error,
|
5 |
+
.is-dismissible {
|
6 |
+
display: none;
|
7 |
+
}
|
8 |
+
|
9 |
+
#wprm-admin-manage-header {
|
10 |
+
.wprm-admin-manage-menu {
|
11 |
+
margin: -5px;
|
12 |
+
margin-bottom: 15px;
|
13 |
+
border-bottom: none;
|
14 |
+
|
15 |
+
.nav-tab {
|
16 |
+
box-sizing: border-box;
|
17 |
+
height: 36px;
|
18 |
+
|
19 |
+
margin-left: 5px;
|
20 |
+
margin-top: 5px;
|
21 |
+
border-bottom: 1px solid #ccc;
|
22 |
+
|
23 |
+
&.nav-tab-active {
|
24 |
+
margin-bottom: 0;
|
25 |
+
}
|
26 |
+
}
|
27 |
+
}
|
28 |
+
}
|
29 |
+
|
30 |
+
#wprm-admin-manage-content {
|
31 |
+
.wprm-admin-manage-header {
|
32 |
+
display: flex;
|
33 |
+
flex-wrap: wrap-reverse;
|
34 |
+
justify-content: space-between;
|
35 |
+
align-items: center;
|
36 |
+
margin-bottom: 15px;
|
37 |
+
|
38 |
+
.wprm-admin-manage-header-buttons {
|
39 |
+
display: flex;
|
40 |
+
align-items: center;
|
41 |
+
margin-bottom: 10px;
|
42 |
+
|
43 |
+
.button:not(.button-primary) {
|
44 |
+
margin-right: 10px;
|
45 |
+
}
|
46 |
+
}
|
47 |
+
}
|
48 |
+
|
49 |
+
.wprm-admin-manage-page {
|
50 |
+
.wprm-admin-manage-table-container {
|
51 |
+
.wprm-admin-manage-table {
|
52 |
+
height: calc(100vh - 50px);
|
53 |
+
|
54 |
+
.wprm-admin-manage-actions {
|
55 |
+
width: 100%;
|
56 |
+
display: flex;
|
57 |
+
justify-content: space-evenly;
|
58 |
+
align-items: center;
|
59 |
+
}
|
60 |
+
|
61 |
+
.wprm-admin-manage-text-filter {
|
62 |
+
width: 100%;
|
63 |
+
}
|
64 |
+
}
|
65 |
+
}
|
66 |
+
}
|
67 |
+
}
|
68 |
+
|
69 |
+
@media screen and (min-width: 782px) {
|
70 |
+
#wprm-admin-manage-content {
|
71 |
+
.wprm-admin-manage-header {
|
72 |
+
flex-wrap: nowrap;
|
73 |
+
.wprm-admin-manage-header-buttons {
|
74 |
+
margin-bottom: 0;
|
75 |
+
}
|
76 |
+
}
|
77 |
+
}
|
78 |
+
}
|
79 |
+
|
80 |
+
@media screen and (min-height: 768px) {
|
81 |
+
#wprm-admin-manage {
|
82 |
+
height: calc(100vh - 65px);
|
83 |
+
display: flex;
|
84 |
+
flex-direction: column;
|
85 |
+
|
86 |
+
#wprm-admin-manage-content {
|
87 |
+
flex: 1;
|
88 |
+
|
89 |
+
.wprm-admin-manage-page {
|
90 |
+
height: 100%;
|
91 |
+
display: flex;
|
92 |
+
flex-direction: column;
|
93 |
+
|
94 |
+
.wprm-admin-manage-table-container {
|
95 |
+
flex: 1;
|
96 |
+
display: flex;
|
97 |
+
flex-direction: column;
|
98 |
+
|
99 |
+
.wprm-admin-manage-table-inner {
|
100 |
+
flex: 1;
|
101 |
+
position: relative;
|
102 |
+
|
103 |
+
.wprm-admin-manage-table {
|
104 |
+
position: absolute;
|
105 |
+
top: 0;
|
106 |
+
bottom: 0;
|
107 |
+
left: 0;
|
108 |
+
right: 0;
|
109 |
+
height: 100%;
|
110 |
+
}
|
111 |
+
}
|
112 |
+
}
|
113 |
+
}
|
114 |
+
}
|
115 |
+
}
|
116 |
+
}
|
assets/css/admin/manage/general.scss
DELETED
@@ -1,9 +0,0 @@
|
|
1 |
-
.wprm-manage-recipes-recipe-actions {
|
2 |
-
display: flex;
|
3 |
-
justify-content: space-between;
|
4 |
-
align-items: center;
|
5 |
-
|
6 |
-
.wprm-manage-icon {
|
7 |
-
cursor: pointer;
|
8 |
-
}
|
9 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/css/admin/manage/notices.scss
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.wprm-admin-manage-notices {
|
2 |
+
.wprm-admin-notice {
|
3 |
+
margin-bottom: 15px;
|
4 |
+
|
5 |
+
background-color: white;
|
6 |
+
border: 1px solid #0073aa;
|
7 |
+
border-radius: 4px;
|
8 |
+
padding: 10px;
|
9 |
+
|
10 |
+
display: flex;
|
11 |
+
align-items: center;
|
12 |
+
|
13 |
+
.wprm-admin-notice-content {
|
14 |
+
flex: 1;
|
15 |
+
|
16 |
+
.wprm-admin-notice-title {
|
17 |
+
font-weight: bold;
|
18 |
+
margin-bottom: 5px;
|
19 |
+
}
|
20 |
+
}
|
21 |
+
|
22 |
+
.wprm-admin-notice-dismiss {
|
23 |
+
.wprm-admin-icon {
|
24 |
+
opacity: 1;
|
25 |
+
}
|
26 |
+
}
|
27 |
+
}
|
28 |
+
}
|
assets/css/admin/manage/nutrition.scss
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.wprm-manage-nutrition-nutrition-container {
|
2 |
+
width: 100%;
|
3 |
+
|
4 |
+
.wprm-manage-nutrition-nutrition {
|
5 |
+
display: flex;
|
6 |
+
width: 100%;
|
7 |
+
|
8 |
+
.wprm-manage-nutrition-nutrition-label {
|
9 |
+
flex: auto;
|
10 |
+
margin-right: 5px;
|
11 |
+
}
|
12 |
+
.wprm-manage-nutrition-nutrition-value-unit {
|
13 |
+
flex: 0 0 75px;
|
14 |
+
|
15 |
+
.wprm-manage-nutrition-nutrition-unit {
|
16 |
+
margin-left: 2px;
|
17 |
+
font-size: 10px;
|
18 |
+
}
|
19 |
+
}
|
20 |
+
}
|
21 |
+
}
|
assets/css/admin/manage/recipes.scss
ADDED
@@ -0,0 +1,125 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.wprm-manage-recipes-nutrition-container {
|
2 |
+
width: 100%;
|
3 |
+
|
4 |
+
.wprm-manage-recipes-nutrition {
|
5 |
+
display: flex;
|
6 |
+
width: 100%;
|
7 |
+
|
8 |
+
.wprm-manage-recipes-nutrition-label {
|
9 |
+
flex: auto;
|
10 |
+
margin-right: 5px;
|
11 |
+
}
|
12 |
+
.wprm-manage-recipes-nutrition-value-unit {
|
13 |
+
flex: 0 0 75px;
|
14 |
+
|
15 |
+
.wprm-manage-recipes-nutrition-unit {
|
16 |
+
margin-left: 2px;
|
17 |
+
font-size: 10px;
|
18 |
+
}
|
19 |
+
}
|
20 |
+
}
|
21 |
+
}
|
22 |
+
|
23 |
+
.wprm-admin-manage-image {
|
24 |
+
display: block;
|
25 |
+
|
26 |
+
max-width: 75px;
|
27 |
+
max-height: 75px;
|
28 |
+
|
29 |
+
margin: 0 auto;
|
30 |
+
}
|
31 |
+
|
32 |
+
.wprm-admin-manage-seo-indicator {
|
33 |
+
width: 100%;
|
34 |
+
height: 14px;
|
35 |
+
|
36 |
+
border: 1px solid #23282d;
|
37 |
+
border-radius: 4px;
|
38 |
+
background-color: white;
|
39 |
+
|
40 |
+
display: flex;
|
41 |
+
cursor: pointer;
|
42 |
+
|
43 |
+
.wprm-admin-manage-seo-indicator-block {
|
44 |
+
flex: 0 0 25%;
|
45 |
+
height: 100%;
|
46 |
+
|
47 |
+
&:nth-child(1) {
|
48 |
+
border-top-left-radius: 3px;
|
49 |
+
border-bottom-left-radius: 3px;
|
50 |
+
}
|
51 |
+
&:nth-child(4) {
|
52 |
+
border-top-right-radius: 3px;
|
53 |
+
border-bottom-right-radius: 3px;
|
54 |
+
}
|
55 |
+
}
|
56 |
+
|
57 |
+
&.wprm-admin-manage-seo-indicator-other {
|
58 |
+
display: block;
|
59 |
+
font-size: 10px;
|
60 |
+
line-height: 10px;
|
61 |
+
text-align: center;
|
62 |
+
}
|
63 |
+
&.wprm-admin-manage-seo-indicator-bad {
|
64 |
+
border-color: darken( #e74c3c, 25% );
|
65 |
+
.wprm-admin-manage-seo-indicator-block {
|
66 |
+
&:nth-child(1) {
|
67 |
+
background-color: #e74c3c;
|
68 |
+
}
|
69 |
+
}
|
70 |
+
}
|
71 |
+
&.wprm-admin-manage-seo-indicator-warning {
|
72 |
+
border-color: darken( #e67e22, 25% );
|
73 |
+
.wprm-admin-manage-seo-indicator-block {
|
74 |
+
&:nth-child(1), &:nth-child(2) {
|
75 |
+
background-color: #e67e22;
|
76 |
+
}
|
77 |
+
}
|
78 |
+
}
|
79 |
+
&.wprm-admin-manage-seo-indicator-rating {
|
80 |
+
border-color: darken( #f1c40f, 25% );
|
81 |
+
.wprm-admin-manage-seo-indicator-block {
|
82 |
+
&:nth-child(1), &:nth-child(2), &:nth-child(3) {
|
83 |
+
background-color: #f1c40f;
|
84 |
+
}
|
85 |
+
}
|
86 |
+
}
|
87 |
+
&.wprm-admin-manage-seo-indicator-good {
|
88 |
+
border-color: darken( #27ae60, 25% );
|
89 |
+
.wprm-admin-manage-seo-indicator-block {
|
90 |
+
background-color: #27ae60;
|
91 |
+
}
|
92 |
+
}
|
93 |
+
}
|
94 |
+
|
95 |
+
.wprm-admin-manage-recipes-ratings-container {
|
96 |
+
width: 100%;
|
97 |
+
display: flex;
|
98 |
+
align-items: center;
|
99 |
+
|
100 |
+
.wprm-admin-manage-recipes-ratings-average {
|
101 |
+
flex: 0 0 40px;
|
102 |
+
margin-right: 10px;
|
103 |
+
text-align: right;
|
104 |
+
font-weight: bold;
|
105 |
+
}
|
106 |
+
.wprm-admin-manage-recipes-ratings-details {
|
107 |
+
font-size: 10px;
|
108 |
+
display: flex;
|
109 |
+
flex-direction: column;
|
110 |
+
|
111 |
+
.wprm-admin-manage-recipes-ratings-details-none {
|
112 |
+
opacity: 0.5;
|
113 |
+
}
|
114 |
+
|
115 |
+
a {
|
116 |
+
margin-left: 2px;
|
117 |
+
opacity: 0.7;
|
118 |
+
text-decoration: none;
|
119 |
+
|
120 |
+
&:hover {
|
121 |
+
opacity: 1;
|
122 |
+
}
|
123 |
+
}
|
124 |
+
}
|
125 |
+
}
|
assets/css/admin/manage/select-columns.scss
CHANGED
@@ -1,15 +1,42 @@
|
|
1 |
-
.wprm-manage-
|
2 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
display: inline-flex;
|
4 |
align-items: center;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
|
6 |
-
|
7 |
-
|
8 |
-
margin-bottom: 0;
|
9 |
}
|
10 |
|
11 |
-
|
12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
|
14 |
-
|
|
|
|
|
|
|
|
|
|
|
15 |
}
|
1 |
+
.wprm-admin-manage-select-columns-container {
|
2 |
+
h4 {
|
3 |
+
margin: 0 0 5px 0;
|
4 |
+
}
|
5 |
+
}
|
6 |
+
|
7 |
+
.wprm-admin-manage-select-columns {
|
8 |
+
margin: -3px;
|
9 |
+
|
10 |
+
.wprm-admin-manage-select-columns-column {
|
11 |
display: inline-flex;
|
12 |
align-items: center;
|
13 |
+
margin: 3px;
|
14 |
+
padding: 2px 4px;
|
15 |
+
|
16 |
+
border-radius: 4px;
|
17 |
+
border: 1px solid #23282d;
|
18 |
+
|
19 |
+
opacity: 0.5;
|
20 |
+
cursor: pointer;
|
21 |
|
22 |
+
&:hover {
|
23 |
+
opacity: 1;
|
|
|
24 |
}
|
25 |
|
26 |
+
&.wprm-admin-manage-select-columns-column-selected {
|
27 |
+
opacity: 1;
|
28 |
+
background-color: #23282d;
|
29 |
+
color: white;
|
30 |
+
|
31 |
+
&:hover {
|
32 |
+
opacity: 0.8;
|
33 |
+
}
|
34 |
+
}
|
35 |
|
36 |
+
&.wprm-admin-manage-select-columns-column-filtered {
|
37 |
+
background-color: #0073aa;
|
38 |
+
border-color:#0073aa;
|
39 |
+
cursor: not-allowed;
|
40 |
+
}
|
41 |
+
}
|
42 |
}
|
assets/css/admin/manage/table.scss
ADDED
@@ -0,0 +1,78 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.wprm-admin-table-totals {
|
2 |
+
font-style: italic;
|
3 |
+
}
|
4 |
+
|
5 |
+
.ReactTable.wprm-admin-table {
|
6 |
+
border-color: #23282d;
|
7 |
+
border-radius: 4px;
|
8 |
+
|
9 |
+
.rt-thead,
|
10 |
+
.pagination-bottom {
|
11 |
+
background-color: #23282d;
|
12 |
+
color: white;
|
13 |
+
z-index: 3;
|
14 |
+
}
|
15 |
+
|
16 |
+
.rt-thead {
|
17 |
+
&.-header {
|
18 |
+
box-shadow: none;
|
19 |
+
}
|
20 |
+
|
21 |
+
.rt-th {
|
22 |
+
font-weight: 500;
|
23 |
+
|
24 |
+
&.wprm-admin-table-help-text {
|
25 |
+
font-weight: 300;
|
26 |
+
font-size: 12px;
|
27 |
+
text-align: left;
|
28 |
+
display: flex;
|
29 |
+
align-items: center;
|
30 |
+
}
|
31 |
+
}
|
32 |
+
|
33 |
+
.rt-th.-sort-asc,
|
34 |
+
.rt-td.-sort-asc {
|
35 |
+
box-shadow: inset 0 4px 0 0 #0073aa;
|
36 |
+
background-color: #32373c;
|
37 |
+
}
|
38 |
+
|
39 |
+
.rt-th.-sort-desc,
|
40 |
+
.rt-td.-sort-desc {
|
41 |
+
box-shadow: inset 0 -4px 0 0 #0073aa;
|
42 |
+
background-color: #32373c;
|
43 |
+
}
|
44 |
+
}
|
45 |
+
|
46 |
+
.wprm-admin-table-checkbox-container {
|
47 |
+
font-size: 0;
|
48 |
+
display: flex;
|
49 |
+
align-items: center;
|
50 |
+
justify-content: center;
|
51 |
+
|
52 |
+
input[type=checkbox] {
|
53 |
+
-webkit-appearance: checkbox;
|
54 |
+
appearance: checkbox;
|
55 |
+
margin-top: 2px;
|
56 |
+
|
57 |
+
&:before {
|
58 |
+
display: none;
|
59 |
+
}
|
60 |
+
}
|
61 |
+
}
|
62 |
+
|
63 |
+
.rt-td {
|
64 |
+
display: flex;
|
65 |
+
align-items: center;
|
66 |
+
|
67 |
+
overflow-wrap: break-word;
|
68 |
+
word-break: break-all;
|
69 |
+
white-space: normal
|
70 |
+
}
|
71 |
+
|
72 |
+
.pagination-bottom {
|
73 |
+
.-btn {
|
74 |
+
color: white;
|
75 |
+
background: rgba(255,255,255,0.1);
|
76 |
+
}
|
77 |
+
}
|
78 |
+
}
|
assets/css/admin/manage/taxonomies.scss
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.wprm-manage-ingredients-group-container {
|
2 |
+
display: flex;
|
3 |
+
align-items: center;
|
4 |
+
|
5 |
+
span {
|
6 |
+
margin-left: 5px;
|
7 |
+
}
|
8 |
+
}
|
9 |
+
|
10 |
+
.wprm-manage-ingredients-link-container {
|
11 |
+
display: flex;
|
12 |
+
align-items: center;
|
13 |
+
|
14 |
+
a {
|
15 |
+
margin-left: 5px;
|
16 |
+
font-size: 11px;
|
17 |
+
}
|
18 |
+
}
|
assets/css/admin/modal.scss
DELETED
@@ -1,8 +0,0 @@
|
|
1 |
-
@import "modal/container";
|
2 |
-
@import "modal/form";
|
3 |
-
@import "modal/import-text";
|
4 |
-
@import "modal/loader";
|
5 |
-
@import "modal/recipe-details";
|
6 |
-
@import "modal/recipe-ingredients";
|
7 |
-
@import "modal/recipe-notes";
|
8 |
-
@import "modal/shortcode-builder";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/css/admin/modal/_container.scss
DELETED
@@ -1,512 +0,0 @@
|
|
1 |
-
// main: ../modal.scss
|
2 |
-
|
3 |
-
.wprm-giveaway-notice {
|
4 |
-
border: 1px solid darkgreen;
|
5 |
-
background-color: rgba(0,255,0,0.15);
|
6 |
-
padding: 10px;
|
7 |
-
margin-bottom: 10px;
|
8 |
-
}
|
9 |
-
|
10 |
-
.wprm-feedback-notice {
|
11 |
-
border: 1px solid #0085ba;
|
12 |
-
background-color: rgba(0,133,186,0.15);
|
13 |
-
padding: 10px;
|
14 |
-
margin-bottom: 10px;
|
15 |
-
|
16 |
-
button {
|
17 |
-
margin: 5px 5px 0 0 !important;
|
18 |
-
}
|
19 |
-
}
|
20 |
-
|
21 |
-
.wprm-easyrecipe-warning {
|
22 |
-
display: none;
|
23 |
-
border: 1px solid darkred;
|
24 |
-
background-color: rgba(255,0,0,0.15);
|
25 |
-
padding: 10px;
|
26 |
-
padding-bottom: 0;
|
27 |
-
margin-bottom: 10px;
|
28 |
-
}
|
29 |
-
|
30 |
-
.mce-floatpanel {
|
31 |
-
z-index: 100101 !important;
|
32 |
-
}
|
33 |
-
|
34 |
-
.select2_wprm-container {
|
35 |
-
z-index: 100075;
|
36 |
-
|
37 |
-
&.select2_wprm-container--focus .select2_wprm-selection {
|
38 |
-
border-color: #5b9dd9;
|
39 |
-
}
|
40 |
-
|
41 |
-
li {
|
42 |
-
margin: 0;
|
43 |
-
}
|
44 |
-
|
45 |
-
.select2_wprm-selection {
|
46 |
-
border-color: #ddd;
|
47 |
-
}
|
48 |
-
}
|
49 |
-
|
50 |
-
.medium-editor-toolbar,
|
51 |
-
.medium-editor-anchor-preview {
|
52 |
-
z-index: 100080;
|
53 |
-
}
|
54 |
-
|
55 |
-
.medium-editor-anchor-preview {
|
56 |
-
font-size: 12px;
|
57 |
-
}
|
58 |
-
|
59 |
-
.medium-editor-element {
|
60 |
-
border: 1px solid #ddd;
|
61 |
-
-webkit-box-shadow: inset 0 1px 2px rgba(0,0,0,.07);
|
62 |
-
box-shadow: inset 0 1px 2px rgba(0,0,0,.07);
|
63 |
-
min-height: 68px;
|
64 |
-
padding: 3px 5px;
|
65 |
-
|
66 |
-
&:focus {
|
67 |
-
border-color: #5b9dd9;
|
68 |
-
-webkit-box-shadow: 0 0 2px rgba(30,140,190,.8);
|
69 |
-
box-shadow: 0 0 2px rgba(30,140,190,.8);
|
70 |
-
}
|
71 |
-
|
72 |
-
&:after {
|
73 |
-
font-style: normal;
|
74 |
-
color: #999;
|
75 |
-
opacity: 0.5;
|
76 |
-
font-size: 14px;
|
77 |
-
line-height: 28px;
|
78 |
-
}
|
79 |
-
|
80 |
-
p:first-child {
|
81 |
-
margin-top: 0;
|
82 |
-
}
|
83 |
-
|
84 |
-
p:last-child {
|
85 |
-
margin-bottom: 0;
|
86 |
-
}
|
87 |
-
}
|
88 |
-
|
89 |
-
.wprm-modal-hint {
|
90 |
-
max-width: 400px;
|
91 |
-
margin-bottom: 20px;
|
92 |
-
|
93 |
-
.wprm-modal-hint-header {
|
94 |
-
font-weight: bold;
|
95 |
-
font-variant: small-caps;
|
96 |
-
}
|
97 |
-
|
98 |
-
.wprm-modal-hint-text {
|
99 |
-
font-style: italic;
|
100 |
-
}
|
101 |
-
}
|
102 |
-
|
103 |
-
/* Media Modal Replication */
|
104 |
-
.wprm-modal-container {
|
105 |
-
display: none;
|
106 |
-
}
|
107 |
-
|
108 |
-
.wprm-modal-backdrop {
|
109 |
-
position: fixed;
|
110 |
-
top: 0;
|
111 |
-
left: 0;
|
112 |
-
right: 0;
|
113 |
-
bottom: 0;
|
114 |
-
min-height: 360px;
|
115 |
-
background: #000;
|
116 |
-
opacity: 0.7;
|
117 |
-
z-index: 100000;
|
118 |
-
}
|
119 |
-
|
120 |
-
.wprm-modal {
|
121 |
-
position: fixed;
|
122 |
-
top: 30px;
|
123 |
-
left: 30px;
|
124 |
-
right: 30px;
|
125 |
-
bottom: 30px;
|
126 |
-
z-index: 100050;
|
127 |
-
|
128 |
-
* {
|
129 |
-
-webkit-box-sizing: border-box;
|
130 |
-
-moz-box-sizing: border-box;
|
131 |
-
box-sizing: border-box;
|
132 |
-
}
|
133 |
-
}
|
134 |
-
|
135 |
-
.wprm-modal-close {
|
136 |
-
position: absolute;
|
137 |
-
top: 0;
|
138 |
-
right: 0;
|
139 |
-
width: 50px;
|
140 |
-
height: 50px;
|
141 |
-
padding: 0;
|
142 |
-
z-index: 1000;
|
143 |
-
text-decoration: none !important;
|
144 |
-
-webkit-transition: color 0.1s ease-in-out,background 0.1s ease-in-out;
|
145 |
-
transition: color 0.1s ease-in-out,background 0.1s ease-in-out;
|
146 |
-
|
147 |
-
.wprm-modal-icon:before {
|
148 |
-
content: "\f158";
|
149 |
-
font: 400 20px/1 dashicons;
|
150 |
-
speak: none;
|
151 |
-
vertical-align: middle;
|
152 |
-
-webkit-font-smoothing: antialiased;
|
153 |
-
-moz-osx-font-smoothing: grayscale;
|
154 |
-
color: #666;
|
155 |
-
}
|
156 |
-
|
157 |
-
&:hover .wprm-modal-icon:before {
|
158 |
-
color: #00a0d2;
|
159 |
-
}
|
160 |
-
}
|
161 |
-
|
162 |
-
.wprm-modal-content {
|
163 |
-
position: absolute;
|
164 |
-
top: 0;
|
165 |
-
left: 0;
|
166 |
-
right: 0;
|
167 |
-
bottom: 0;
|
168 |
-
overflow: auto;
|
169 |
-
min-height: 300px;
|
170 |
-
-webkit-box-shadow: 0 5px 15px rgba(0,0,0,.7);
|
171 |
-
box-shadow: 0 5px 15px rgba(0,0,0,.7);
|
172 |
-
background: #fcfcfc;
|
173 |
-
-webkit-font-smoothing: subpixel-antialiased;
|
174 |
-
|
175 |
-
::-webkit-input-placeholder {
|
176 |
-
color: #999;
|
177 |
-
opacity: 0.5;
|
178 |
-
}
|
179 |
-
|
180 |
-
:-moz-placeholder {
|
181 |
-
color: #999;
|
182 |
-
opacity: 0.5;
|
183 |
-
}
|
184 |
-
|
185 |
-
::-moz-placeholder {
|
186 |
-
color: #999;
|
187 |
-
opacity: 0.5;
|
188 |
-
}
|
189 |
-
|
190 |
-
:-ms-input-placeholder {
|
191 |
-
color: #999;
|
192 |
-
opacity: 0.5;
|
193 |
-
}
|
194 |
-
}
|
195 |
-
|
196 |
-
.wprm-frame {
|
197 |
-
overflow: hidden;
|
198 |
-
right: 0;
|
199 |
-
}
|
200 |
-
|
201 |
-
.wprm-frame,
|
202 |
-
.wprm-frame-menu {
|
203 |
-
position: absolute;
|
204 |
-
left: 0;
|
205 |
-
bottom: 0;
|
206 |
-
top: 0;
|
207 |
-
}
|
208 |
-
|
209 |
-
.wprm-frame-menu {
|
210 |
-
width: 200px;
|
211 |
-
z-index: 150;
|
212 |
-
}
|
213 |
-
|
214 |
-
.wprm-frame-title .dashicons,
|
215 |
-
.wprm-frame.hide-router .wprm-frame-router {
|
216 |
-
display: none;
|
217 |
-
}
|
218 |
-
|
219 |
-
.wprm-frame-title {
|
220 |
-
top: 0;
|
221 |
-
height: 50px;
|
222 |
-
}
|
223 |
-
|
224 |
-
.wprm-frame-router,
|
225 |
-
.wprm-frame-title {
|
226 |
-
z-index: 200;
|
227 |
-
left: 200px;
|
228 |
-
position: absolute;
|
229 |
-
right: 0;
|
230 |
-
}
|
231 |
-
|
232 |
-
.wprm-menu-item {
|
233 |
-
-webkit-box-sizing: content-box;
|
234 |
-
-moz-box-sizing: content-box;
|
235 |
-
box-sizing: content-box;
|
236 |
-
}
|
237 |
-
|
238 |
-
.wprm-menu {
|
239 |
-
position: absolute;
|
240 |
-
left: 0;
|
241 |
-
margin: 0;
|
242 |
-
padding: 10px 0;
|
243 |
-
border-right-width: 1px;
|
244 |
-
border-right-style: solid;
|
245 |
-
border-right-color: #ccc;
|
246 |
-
user-select: none;
|
247 |
-
}
|
248 |
-
|
249 |
-
.wprm-menu-hidden {
|
250 |
-
padding: 5px 5px 0 10px;
|
251 |
-
font-style: italic;
|
252 |
-
}
|
253 |
-
|
254 |
-
.wprm-menu,
|
255 |
-
.wprm-sidebar {
|
256 |
-
top: 0;
|
257 |
-
bottom: 0;
|
258 |
-
background: #f3f3f3;
|
259 |
-
right: 0;
|
260 |
-
}
|
261 |
-
|
262 |
-
.wprm-menu .active,
|
263 |
-
.wprm-menu .active:hover {
|
264 |
-
color: #23282d;
|
265 |
-
font-weight: 700;
|
266 |
-
}
|
267 |
-
|
268 |
-
.wprm-menu > a {
|
269 |
-
display: block;
|
270 |
-
position: relative;
|
271 |
-
padding: 8px 20px;
|
272 |
-
margin: 0;
|
273 |
-
color: #0073aa;
|
274 |
-
}
|
275 |
-
|
276 |
-
.wprm-menu > a,
|
277 |
-
.wprm-router > a {
|
278 |
-
line-height: 18px;
|
279 |
-
font-size: 14px;
|
280 |
-
text-decoration: none;
|
281 |
-
}
|
282 |
-
|
283 |
-
.wprm-frame a {
|
284 |
-
border-bottom: none;
|
285 |
-
color: #0073aa;
|
286 |
-
}
|
287 |
-
|
288 |
-
.wprm-frame .hidden {
|
289 |
-
display: none;
|
290 |
-
}
|
291 |
-
|
292 |
-
.wprm-menu .separator {
|
293 |
-
height: 0;
|
294 |
-
margin: 12px 20px;
|
295 |
-
padding: 0;
|
296 |
-
border-top: 1px solid #ddd;
|
297 |
-
}
|
298 |
-
|
299 |
-
.wprm-frame-title h1 {
|
300 |
-
padding: 0 16px;
|
301 |
-
font-size: 22px;
|
302 |
-
line-height: 50px;
|
303 |
-
margin: 0;
|
304 |
-
}
|
305 |
-
|
306 |
-
.wprm-frame-router {
|
307 |
-
top: 50px;
|
308 |
-
height: 36px;
|
309 |
-
}
|
310 |
-
|
311 |
-
.wprm-router {
|
312 |
-
position: relative;
|
313 |
-
padding: 0 6px;
|
314 |
-
margin: 0;
|
315 |
-
clear: both;
|
316 |
-
user-select: none;
|
317 |
-
|
318 |
-
&:not(.active) {
|
319 |
-
display: none;
|
320 |
-
}
|
321 |
-
}
|
322 |
-
|
323 |
-
.wprm-router > a {
|
324 |
-
position: relative;
|
325 |
-
float: left;
|
326 |
-
padding: 8px 10px 9px;
|
327 |
-
margin: 0;
|
328 |
-
height: 18px;
|
329 |
-
}
|
330 |
-
|
331 |
-
.wprm-router a {
|
332 |
-
-webkit-transition: none;
|
333 |
-
transition: none;
|
334 |
-
}
|
335 |
-
|
336 |
-
.wprm-router > a:last-child {
|
337 |
-
border-right: 0;
|
338 |
-
}
|
339 |
-
|
340 |
-
.wprm-router .active,
|
341 |
-
.wprm-router > a.active:last-child {
|
342 |
-
margin: -1px -1px 0;
|
343 |
-
background: #fff;
|
344 |
-
border: 1px solid #ddd;
|
345 |
-
border-bottom: none;
|
346 |
-
}
|
347 |
-
|
348 |
-
.wprm-router .active,
|
349 |
-
.wprm-router .active:hover {
|
350 |
-
color: #32373c;
|
351 |
-
}
|
352 |
-
|
353 |
-
.wprm-frame-content {
|
354 |
-
position: absolute;
|
355 |
-
top: 84px;
|
356 |
-
left: 200px;
|
357 |
-
right: 0;
|
358 |
-
bottom: 61px;
|
359 |
-
height: auto;
|
360 |
-
width: auto;
|
361 |
-
margin: 0;
|
362 |
-
overflow: auto;
|
363 |
-
background: #fff;
|
364 |
-
border-top: 1px solid #ddd;
|
365 |
-
border-bottom: 1px solid #ddd;
|
366 |
-
}
|
367 |
-
|
368 |
-
.wprm-frame-content-tab {
|
369 |
-
margin: 20px;
|
370 |
-
|
371 |
-
&:not(.active) {
|
372 |
-
display: none;
|
373 |
-
}
|
374 |
-
}
|
375 |
-
|
376 |
-
.wprm-frame-toolbar {
|
377 |
-
position: absolute;
|
378 |
-
left: 200px;
|
379 |
-
right: 0;
|
380 |
-
bottom: 0;
|
381 |
-
height: 60px;
|
382 |
-
z-index: 100;
|
383 |
-
}
|
384 |
-
|
385 |
-
.wprm-toolbar {
|
386 |
-
position: absolute;
|
387 |
-
top: 0;
|
388 |
-
left: 0;
|
389 |
-
right: 0;
|
390 |
-
z-index: 100;
|
391 |
-
height: 60px;
|
392 |
-
padding: 0 16px;
|
393 |
-
border: 0 solid #ddd;
|
394 |
-
overflow: hidden;
|
395 |
-
}
|
396 |
-
|
397 |
-
.wprm-modal-content .wprm-toolbar-primary.search-form {
|
398 |
-
width: 33%;
|
399 |
-
}
|
400 |
-
|
401 |
-
.wprm-toolbar-primary {
|
402 |
-
float: right;
|
403 |
-
height: 100%;
|
404 |
-
}
|
405 |
-
|
406 |
-
.wprm-modal-content .wprm-toolbar-primary .wprm-button {
|
407 |
-
float: right;
|
408 |
-
}
|
409 |
-
|
410 |
-
.wprm-button-action-save {
|
411 |
-
display: none;
|
412 |
-
}
|
413 |
-
|
414 |
-
.wprm-toolbar-primary > .wprm-button,
|
415 |
-
.wprm-toolbar-primary > .wprm-button-group {
|
416 |
-
margin-left: 10px;
|
417 |
-
float: left;
|
418 |
-
margin-top: 15px;
|
419 |
-
}
|
420 |
-
@media all and (max-width: 900px) {
|
421 |
-
.wprm-frame:not(.hide-menu) .wprm-frame-title .dashicons {
|
422 |
-
display: inline-block;
|
423 |
-
line-height: 50px;
|
424 |
-
}
|
425 |
-
|
426 |
-
.wprm-frame:not(.hide-menu) .wprm-frame-menu {
|
427 |
-
position: static;
|
428 |
-
width: 0;
|
429 |
-
}
|
430 |
-
|
431 |
-
.wprm-frame:not(.hide-menu) .wprm-frame-title {
|
432 |
-
left: 0;
|
433 |
-
}
|
434 |
-
|
435 |
-
.wprm-frame:not(.hide-menu) .wprm-frame-content,
|
436 |
-
.wprm-frame:not(.hide-menu) .wprm-frame-router,
|
437 |
-
.wprm-frame:not(.hide-menu) .wprm-frame-title,
|
438 |
-
.wprm-frame:not(.hide-menu) .wprm-frame-toolbar {
|
439 |
-
left: 0;
|
440 |
-
}
|
441 |
-
|
442 |
-
.wprm-frame:not(.hide-menu) .wprm-menu.visible {
|
443 |
-
left: 0;
|
444 |
-
}
|
445 |
-
|
446 |
-
.wprm-frame:not(.hide-menu) .wprm-menu {
|
447 |
-
width: auto;
|
448 |
-
max-width: 80%;
|
449 |
-
overflow: auto;
|
450 |
-
z-index: 2000;
|
451 |
-
top: 50px;
|
452 |
-
left: -300px;
|
453 |
-
right: auto;
|
454 |
-
bottom: auto;
|
455 |
-
padding: 5px 0;
|
456 |
-
border: 1px solid #ccc;
|
457 |
-
}
|
458 |
-
|
459 |
-
.wprm-frame:not(.hide-menu) .wprm-menu > a.active {
|
460 |
-
display: none;
|
461 |
-
}
|
462 |
-
|
463 |
-
.wprm-frame:not(.hide-menu) .wprm-menu > a {
|
464 |
-
padding: 12px 16px;
|
465 |
-
font-size: 16px;
|
466 |
-
}
|
467 |
-
|
468 |
-
.wprm-frame:not(.hide-menu) .wprm-menu .separator {
|
469 |
-
margin: 5px 10px;
|
470 |
-
}
|
471 |
-
|
472 |
-
.wprm-frame:not(.hide-menu) .wprm-frame-title h1 {
|
473 |
-
color: #0073aa;
|
474 |
-
line-height: 3;
|
475 |
-
font-size: 18px;
|
476 |
-
float: left;
|
477 |
-
cursor: pointer;
|
478 |
-
}
|
479 |
-
}
|
480 |
-
@media all and (max-width: 640px), screen and (max-height: 400px) {
|
481 |
-
.wprm-modal {
|
482 |
-
position: fixed;
|
483 |
-
top: 0;
|
484 |
-
left: 0;
|
485 |
-
right: 0;
|
486 |
-
bottom: 0;
|
487 |
-
|
488 |
-
.wprm-frame-title {
|
489 |
-
height: 40px;
|
490 |
-
}
|
491 |
-
}
|
492 |
-
}
|
493 |
-
@media all and (max-width: 480px) {
|
494 |
-
.wprm-frame:not(.hide-menu) .wprm-frame-title .dashicons {
|
495 |
-
line-height: 40px;
|
496 |
-
}
|
497 |
-
|
498 |
-
.wprm-frame-router,
|
499 |
-
.wprm-frame:not(.hide-menu) .wprm-menu {
|
500 |
-
top: 40px;
|
501 |
-
}
|
502 |
-
|
503 |
-
.wprm-frame:not(.hide-menu) .wprm-frame-title h1,
|
504 |
-
.wprm-modal .wprm-frame-title h1 {
|
505 |
-
font-size: 18px;
|
506 |
-
line-height: 40px;
|
507 |
-
}
|
508 |
-
|
509 |
-
.wprm-frame-content {
|
510 |
-
top: 74px;
|
511 |
-
}
|
512 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/css/admin/modal/_form.scss
DELETED
@@ -1,61 +0,0 @@
|
|
1 |
-
// main: ../modal.scss
|
2 |
-
.wprm-recipe-form {
|
3 |
-
max-width: 600px;
|
4 |
-
|
5 |
-
.wprm-recipe-form-container {
|
6 |
-
margin-bottom: 15px;
|
7 |
-
vertical-align: top;
|
8 |
-
}
|
9 |
-
|
10 |
-
.wprm-recipe-form-container-halfs {
|
11 |
-
display: inline-block;
|
12 |
-
width: 50%;
|
13 |
-
}
|
14 |
-
|
15 |
-
.wprm-recipe-form-container-thirds {
|
16 |
-
display: inline-block;
|
17 |
-
width: 33.3%;
|
18 |
-
}
|
19 |
-
|
20 |
-
label {
|
21 |
-
display: block;
|
22 |
-
font-weight: bold;
|
23 |
-
margin-bottom: 5px;
|
24 |
-
}
|
25 |
-
|
26 |
-
input[type="text"],
|
27 |
-
input[type="number"] {
|
28 |
-
margin: 0;
|
29 |
-
width: 100%;
|
30 |
-
max-width: 120px;
|
31 |
-
height: 34px;
|
32 |
-
line-height: 34px;
|
33 |
-
|
34 |
-
&[type="number"] {
|
35 |
-
max-width: 65px;
|
36 |
-
}
|
37 |
-
|
38 |
-
&.select2_wprm-search__field {
|
39 |
-
height: 18px;
|
40 |
-
line-height: 18px;
|
41 |
-
}
|
42 |
-
}
|
43 |
-
|
44 |
-
select {
|
45 |
-
width: 100%;
|
46 |
-
}
|
47 |
-
|
48 |
-
textarea {
|
49 |
-
width: 100%;
|
50 |
-
resize: vertical;
|
51 |
-
}
|
52 |
-
}
|
53 |
-
@media all and (max-width: 480px) {
|
54 |
-
.wprm-recipe-form {
|
55 |
-
.wprm-recipe-form-container-halfs,
|
56 |
-
.wprm-recipe-form-container-thirds {
|
57 |
-
display: block;
|
58 |
-
width: 100%;
|
59 |
-
}
|
60 |
-
}
|
61 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/css/admin/modal/_import-text.scss
DELETED
@@ -1,41 +0,0 @@
|
|
1 |
-
// main: ../modal.scss
|
2 |
-
|
3 |
-
.wprm-recipe-import-text-form {
|
4 |
-
.import-text-buttons {
|
5 |
-
margin-bottom: 10px;
|
6 |
-
}
|
7 |
-
|
8 |
-
.import-text-step {
|
9 |
-
display: none;
|
10 |
-
|
11 |
-
&#import-text-step-input {
|
12 |
-
display: block;
|
13 |
-
}
|
14 |
-
}
|
15 |
-
|
16 |
-
.import-text-input,
|
17 |
-
#import-text-highlight-sandbox {
|
18 |
-
margin-top: 10px;
|
19 |
-
}
|
20 |
-
|
21 |
-
#import-text-ingredient-groups,
|
22 |
-
#import-text-instruction-groups {
|
23 |
-
label {
|
24 |
-
display: inline;
|
25 |
-
font-weight: normal;
|
26 |
-
}
|
27 |
-
}
|
28 |
-
|
29 |
-
.import-text-group-warning {
|
30 |
-
margin-top: 10px;
|
31 |
-
display: none;
|
32 |
-
}
|
33 |
-
|
34 |
-
#import-text-highlight-sandbox {
|
35 |
-
display: none;
|
36 |
-
max-height: 400px;
|
37 |
-
overflow: scroll;
|
38 |
-
padding: 10px;
|
39 |
-
border: 1px dashed #999;
|
40 |
-
}
|
41 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/css/admin/modal/_loader.scss
DELETED
@@ -1,63 +0,0 @@
|
|
1 |
-
// main: ../modal.scss
|
2 |
-
|
3 |
-
.wprm-loader {
|
4 |
-
display: none;
|
5 |
-
}
|
6 |
-
|
7 |
-
.wprm-loader,
|
8 |
-
.wprm-loader:before,
|
9 |
-
.wprm-loader:after {
|
10 |
-
border-radius: 50%;
|
11 |
-
width: 1.5em;
|
12 |
-
height: 1.5em;
|
13 |
-
-webkit-animation-fill-mode: both;
|
14 |
-
animation-fill-mode: both;
|
15 |
-
-webkit-animation: load7 1.8s infinite ease-in-out;
|
16 |
-
animation: load7 1.8s infinite ease-in-out;
|
17 |
-
}
|
18 |
-
.wprm-loader {
|
19 |
-
color: #444444;
|
20 |
-
font-size: 10px;
|
21 |
-
margin: 20px auto;
|
22 |
-
position: relative;
|
23 |
-
text-indent: -9999em;
|
24 |
-
-webkit-transform: translateZ(0);
|
25 |
-
-ms-transform: translateZ(0);
|
26 |
-
transform: translateZ(0);
|
27 |
-
-webkit-animation-delay: -0.16s;
|
28 |
-
animation-delay: -0.16s;
|
29 |
-
}
|
30 |
-
.wprm-loader:before,
|
31 |
-
.wprm-loader:after {
|
32 |
-
content: '';
|
33 |
-
position: absolute;
|
34 |
-
top: 0;
|
35 |
-
}
|
36 |
-
.wprm-loader:before {
|
37 |
-
left: -2.5em;
|
38 |
-
-webkit-animation-delay: -0.32s;
|
39 |
-
animation-delay: -0.32s;
|
40 |
-
}
|
41 |
-
.wprm-loader:after {
|
42 |
-
left: 2.5em;
|
43 |
-
}
|
44 |
-
@-webkit-keyframes load7 {
|
45 |
-
0%,
|
46 |
-
80%,
|
47 |
-
100% {
|
48 |
-
box-shadow: 0 2.5em 0 -1.3em;
|
49 |
-
}
|
50 |
-
40% {
|
51 |
-
box-shadow: 0 2.5em 0 0;
|
52 |
-
}
|
53 |
-
}
|
54 |
-
@keyframes load7 {
|
55 |
-
0%,
|
56 |
-
80%,
|
57 |
-
100% {
|
58 |
-
box-shadow: 0 2.5em 0 -1.3em;
|
59 |
-
}
|
60 |
-
40% {
|
61 |
-
box-shadow: 0 2.5em 0 0;
|
62 |
-
}
|
63 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/css/admin/modal/_recipe-details.scss
DELETED
@@ -1,30 +0,0 @@
|
|
1 |
-
// main: ../modal.scss
|
2 |
-
.wprm-recipe-details-form {
|
3 |
-
input {
|
4 |
-
&#wprm-recipe-name {
|
5 |
-
max-width: 450px;
|
6 |
-
}
|
7 |
-
|
8 |
-
&#wprm-recipe-author-name,
|
9 |
-
&#wprm-recipe-author-link {
|
10 |
-
max-width: none;
|
11 |
-
}
|
12 |
-
|
13 |
-
&#wprm-recipe-calories {
|
14 |
-
max-width: 70px;
|
15 |
-
}
|
16 |
-
}
|
17 |
-
|
18 |
-
.wprm-recipe-image-preview {
|
19 |
-
max-width: 100px;
|
20 |
-
|
21 |
-
img {
|
22 |
-
max-width: 100%;
|
23 |
-
height: auto;
|
24 |
-
}
|
25 |
-
}
|
26 |
-
|
27 |
-
.wprm-recipe-summary-container {
|
28 |
-
clear: both;
|
29 |
-
}
|
30 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/css/admin/modal/_recipe-ingredients.scss
DELETED
@@ -1,120 +0,0 @@
|
|
1 |
-
// main: ../modal.scss
|
2 |
-
.wprm-recipe-ingredients-form,
|
3 |
-
.wprm-recipe-instructions-form {
|
4 |
-
max-width: 750px;
|
5 |
-
margin-bottom: 15px;
|
6 |
-
input {
|
7 |
-
margin: 0;
|
8 |
-
width: 100%;
|
9 |
-
height: 34px;
|
10 |
-
line-height: 34px;
|
11 |
-
}
|
12 |
-
textarea {
|
13 |
-
width: 100%;
|
14 |
-
resize: vertical;
|
15 |
-
}
|
16 |
-
::-webkit-input-placeholder {
|
17 |
-
color: #999;
|
18 |
-
opacity: 0.5;
|
19 |
-
}
|
20 |
-
:-moz-placeholder {
|
21 |
-
color: #999;
|
22 |
-
opacity: 0.5;
|
23 |
-
}
|
24 |
-
::-moz-placeholder {
|
25 |
-
color: #999;
|
26 |
-
opacity: 0.5;
|
27 |
-
}
|
28 |
-
:-ms-input-placeholder {
|
29 |
-
color: #999;
|
30 |
-
opacity: 0.5;
|
31 |
-
}
|
32 |
-
table {
|
33 |
-
width: 100%;
|
34 |
-
&.wprm-recipe-ingredients-container {
|
35 |
-
th {
|
36 |
-
text-align: left;
|
37 |
-
&:nth-child(1),
|
38 |
-
&:nth-child(6) {
|
39 |
-
width: 5%;
|
40 |
-
text-align: center;
|
41 |
-
}
|
42 |
-
&:nth-child(2) {
|
43 |
-
width: 10%;
|
44 |
-
}
|
45 |
-
&:nth-child(3) {
|
46 |
-
width: 15%;
|
47 |
-
}
|
48 |
-
&:nth-child(4) {
|
49 |
-
width: 40%;
|
50 |
-
}
|
51 |
-
&:nth-child(5) {
|
52 |
-
width: 25%;
|
53 |
-
}
|
54 |
-
}
|
55 |
-
}
|
56 |
-
&.wprm-recipe-instructions-container {
|
57 |
-
th {
|
58 |
-
text-align: left;
|
59 |
-
&:nth-child(1),
|
60 |
-
&:nth-child(4) {
|
61 |
-
width: 5%;
|
62 |
-
text-align: center;
|
63 |
-
}
|
64 |
-
&:nth-child(2) {
|
65 |
-
width: 65%;
|
66 |
-
}
|
67 |
-
&:nth-child(3) {
|
68 |
-
width: 25%;
|
69 |
-
}
|
70 |
-
}
|
71 |
-
}
|
72 |
-
.wprm-recipe-ingredients-placeholder,
|
73 |
-
.wprm-recipe-instructions-placeholder {
|
74 |
-
display: none;
|
75 |
-
}
|
76 |
-
td {
|
77 |
-
text-align: left;
|
78 |
-
vertical-align: top;
|
79 |
-
&:first-child,
|
80 |
-
&:last-child {
|
81 |
-
text-align: center;
|
82 |
-
vertical-align: middle;
|
83 |
-
}
|
84 |
-
}
|
85 |
-
}
|
86 |
-
.ui-sortable-helper {
|
87 |
-
display: table;
|
88 |
-
.wprm-recipe-instruction-text {
|
89 |
-
min-width: 200px;
|
90 |
-
}
|
91 |
-
}
|
92 |
-
.wprm-recipe-ingredients-instructions-sort {
|
93 |
-
cursor: move;
|
94 |
-
}
|
95 |
-
.wprm-recipe-ingredients-instructions-delete {
|
96 |
-
cursor: pointer;
|
97 |
-
}
|
98 |
-
.wprm-recipe-ingredients-instructions-delete,
|
99 |
-
.wprm-recipe-ingredients-instructions-sort {
|
100 |
-
color: #999;
|
101 |
-
opacity: 0.5;
|
102 |
-
&:hover {
|
103 |
-
color: #444;
|
104 |
-
opacity: 1;
|
105 |
-
}
|
106 |
-
}
|
107 |
-
.wprm-recipe-ingredients-actions,
|
108 |
-
.wprm-recipe-instructions-actions {
|
109 |
-
margin: 10px;
|
110 |
-
}
|
111 |
-
.wprm-recipe-image-preview {
|
112 |
-
max-width: 75px;
|
113 |
-
|
114 |
-
img {
|
115 |
-
max-width: 100%;
|
116 |
-
height: auto;
|
117 |
-
}
|
118 |
-
}
|
119 |
-
}
|
120 |
-
@media all and (max-width: 480px) {}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/css/admin/modal/_recipe-notes.scss
DELETED
@@ -1,24 +0,0 @@
|
|
1 |
-
// main: ../modal.scss
|
2 |
-
.wprm-recipe-notes-form {
|
3 |
-
.wprm-recipe-video-preview {
|
4 |
-
float: right;
|
5 |
-
max-width: 100px;
|
6 |
-
|
7 |
-
img {
|
8 |
-
max-width: 100%;
|
9 |
-
height: auto;
|
10 |
-
}
|
11 |
-
}
|
12 |
-
|
13 |
-
.wprm-recipe-form-container {
|
14 |
-
clear: both;
|
15 |
-
}
|
16 |
-
}
|
17 |
-
@media all and (max-width: 480px) {
|
18 |
-
.wprm-recipe-notes-form {
|
19 |
-
.wprm-recipe-video-preview {
|
20 |
-
float: none;
|
21 |
-
margin: 10px auto;
|
22 |
-
}
|
23 |
-
}
|
24 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/css/admin/modal/_shortcode-builder.scss
DELETED
@@ -1,46 +0,0 @@
|
|
1 |
-
// main: ../modal.scss
|
2 |
-
.wprm-shortcode-builder {
|
3 |
-
.wprm-shortcode-builder-container {
|
4 |
-
margin-bottom: 15px;
|
5 |
-
vertical-align: top;
|
6 |
-
}
|
7 |
-
|
8 |
-
.wprm-shortcode-builder-container-halfs {
|
9 |
-
display: inline-block;
|
10 |
-
width: 50%;
|
11 |
-
}
|
12 |
-
|
13 |
-
.wprm-shortcode-builder-container-thirds {
|
14 |
-
display: inline-block;
|
15 |
-
width: 33.3%;
|
16 |
-
}
|
17 |
-
|
18 |
-
label {
|
19 |
-
display: block;
|
20 |
-
font-weight: bold;
|
21 |
-
margin-bottom: 5px;
|
22 |
-
}
|
23 |
-
|
24 |
-
.wprm-shortcode-builder-helper {
|
25 |
-
margin-left: 5px;
|
26 |
-
font-size: 0.8em;
|
27 |
-
font-style: italic;
|
28 |
-
}
|
29 |
-
|
30 |
-
input {
|
31 |
-
margin: 0;
|
32 |
-
width: 100%;
|
33 |
-
max-width: 250px;
|
34 |
-
height: 34px;
|
35 |
-
line-height: 34px;
|
36 |
-
|
37 |
-
&.select2_wprm-search__field {
|
38 |
-
height: 18px;
|
39 |
-
line-height: 18px;
|
40 |
-
}
|
41 |
-
}
|
42 |
-
|
43 |
-
select {
|
44 |
-
width: 250px;
|
45 |
-
}
|
46 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/css/admin/modal/app.scss
ADDED
@@ -0,0 +1,95 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.wprm-admin-modal-overlay {
|
2 |
+
position: fixed;
|
3 |
+
top: 0px;
|
4 |
+
left: 0px;
|
5 |
+
right: 0px;
|
6 |
+
bottom: 0px;
|
7 |
+
background-color: rgba(0,0,0,0.7);
|
8 |
+
z-index: 99999;
|
9 |
+
|
10 |
+
display: flex;
|
11 |
+
align-items: center;
|
12 |
+
justify-content: center;
|
13 |
+
}
|
14 |
+
|
15 |
+
.wprm-admin-modal {
|
16 |
+
box-sizing: border-box;
|
17 |
+
border: 1px solid black;
|
18 |
+
background-color: white;
|
19 |
+
border-radius: 4px;
|
20 |
+
outline: none;
|
21 |
+
width: 90%;
|
22 |
+
height: auto;
|
23 |
+
max-height: 95%;
|
24 |
+
|
25 |
+
display: flex;
|
26 |
+
flex-flow: column nowrap;
|
27 |
+
|
28 |
+
* {
|
29 |
+
box-sizing: border-box;
|
30 |
+
}
|
31 |
+
|
32 |
+
.wprm-admin-modal-header {
|
33 |
+
flex: none;
|
34 |
+
padding: 10px;
|
35 |
+
background-color: #23282d;
|
36 |
+
|
37 |
+
display: flex;
|
38 |
+
justify-content: space-between;
|
39 |
+
align-content: center;
|
40 |
+
|
41 |
+
h2 {
|
42 |
+
margin: 0;
|
43 |
+
color: white;
|
44 |
+
}
|
45 |
+
|
46 |
+
.wprm-admin-modal-close {
|
47 |
+
margin-bottom: -2px;
|
48 |
+
svg line {
|
49 |
+
stroke: white;
|
50 |
+
}
|
51 |
+
}
|
52 |
+
}
|
53 |
+
|
54 |
+
.wprm-admin-modal-content {
|
55 |
+
flex: 1 1 auto;
|
56 |
+
overflow: auto;
|
57 |
+
|
58 |
+
padding: 10px;
|
59 |
+
}
|
60 |
+
|
61 |
+
.wprm-admin-modal-footer {
|
62 |
+
flex: none;
|
63 |
+
padding: 10px;
|
64 |
+
background-color: #23282d;
|
65 |
+
|
66 |
+
display: flex;
|
67 |
+
justify-content: center;
|
68 |
+
align-items: center;
|
69 |
+
|
70 |
+
a {
|
71 |
+
color: white;
|
72 |
+
text-decoration: none;
|
73 |
+
|
74 |
+
&:hover {
|
75 |
+
text-decoration: underline;
|
76 |
+
}
|
77 |
+
}
|
78 |
+
|
79 |
+
a, .button {
|
80 |
+
margin: 0 5px;
|
81 |
+
}
|
82 |
+
}
|
83 |
+
}
|
84 |
+
|
85 |
+
@media screen and (min-width: 782px) {
|
86 |
+
.wprm-admin-modal {
|
87 |
+
.wprm-admin-modal-footer {
|
88 |
+
justify-content: flex-end;
|
89 |
+
|
90 |
+
.button:last-child {
|
91 |
+
margin-right: 0;
|
92 |
+
}
|
93 |
+
}
|
94 |
+
}
|
95 |
+
}
|
assets/css/admin/modal/bulk-edit.scss
ADDED
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.wprm-admin-modal-bulk-edit {
|
2 |
+
max-width: 500px;
|
3 |
+
|
4 |
+
.wprm-admin-modal-bulk-edit-container {
|
5 |
+
overflow: scroll;
|
6 |
+
padding: 10px;
|
7 |
+
}
|
8 |
+
|
9 |
+
.wprm-admin-modal-bulk-edit-label {
|
10 |
+
font-weight: bold;
|
11 |
+
font-size: 16px;
|
12 |
+
margin-top: 20px;
|
13 |
+
margin-bottom: 5px;
|
14 |
+
|
15 |
+
&:first-child {
|
16 |
+
margin-top: 0;
|
17 |
+
}
|
18 |
+
}
|
19 |
+
|
20 |
+
.wprm-admin-modal-bulk-edit-action {
|
21 |
+
margin-bottom: 5px;
|
22 |
+
|
23 |
+
input {
|
24 |
+
width: 16px;
|
25 |
+
height: 16px;
|
26 |
+
margin-top: 1px;
|
27 |
+
border-color: hsl(0,0%,80%);
|
28 |
+
|
29 |
+
&:checked:before {
|
30 |
+
margin: 3px;
|
31 |
+
width: 8px;
|
32 |
+
height: 8px;
|
33 |
+
}
|
34 |
+
}
|
35 |
+
|
36 |
+
label {
|
37 |
+
font-size: 14px;
|
38 |
+
line-height: 20px;
|
39 |
+
}
|
40 |
+
}
|
41 |
+
}
|
assets/css/admin/modal/general/edit-mode.scss
ADDED
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.wprm-admin-modal-field-edit-mode-container {
|
2 |
+
margin-top: -10px;
|
3 |
+
margin-bottom: 20px;
|
4 |
+
font-size: 14px;
|
5 |
+
|
6 |
+
.wprm-admin-modal-field-edit-mode {
|
7 |
+
display: block;
|
8 |
+
margin: 5px;
|
9 |
+
text-align: center;
|
10 |
+
text-decoration: none;
|
11 |
+
opacity: 0.7;
|
12 |
+
|
13 |
+
&:hover,
|
14 |
+
&.wprm-admin-modal-field-edit-mode-selected {
|
15 |
+
opacity: 1;
|
16 |
+
text-decoration: underline;
|
17 |
+
}
|
18 |
+
|
19 |
+
&.wprm-admin-modal-field-edit-mode-selected {
|
20 |
+
font-weight: bold;
|
21 |
+
}
|
22 |
+
}
|
23 |
+
}
|
24 |
+
|
25 |
+
|
26 |
+
@media screen and (min-width: 500px) {
|
27 |
+
.wprm-admin-modal-field-edit-mode-container {
|
28 |
+
display: flex;
|
29 |
+
align-items: center;
|
30 |
+
justify-content: space-between;
|
31 |
+
}
|
32 |
+
}
|
33 |
+
|
34 |
+
@media screen and (min-width: 782px) {
|
35 |
+
.wprm-admin-modal-field-edit-mode-container {
|
36 |
+
margin-top: 0;
|
37 |
+
justify-content: flex-start;
|
38 |
+
border-bottom: 1px solid #999;
|
39 |
+
|
40 |
+
.wprm-admin-modal-field-edit-mode {
|
41 |
+
padding: 5px 10px 3px;
|
42 |
+
margin-top: 0;
|
43 |
+
margin-bottom: -1px;
|
44 |
+
|
45 |
+
&:hover,
|
46 |
+
&.wprm-admin-modal-field-edit-mode-selected {
|
47 |
+
text-decoration: none;
|
48 |
+
}
|
49 |
+
|
50 |
+
&.wprm-admin-modal-field-edit-mode-selected {
|
51 |
+
border: 1px solid #999;
|
52 |
+
border-top-left-radius: 4px;
|
53 |
+
border-top-right-radius: 4px;
|
54 |
+
border-bottom-color: white;
|
55 |
+
}
|
56 |
+
}
|
57 |
+
}
|
58 |
+
}
|
assets/css/admin/modal/general/fields.scss
ADDED
@@ -0,0 +1,158 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.wprm-admin-modal {
|
2 |
+
|
3 |
+
input[type=checkbox] {
|
4 |
+
border-radius: 4px;
|
5 |
+
border-color: hsl(0,0%,80%);
|
6 |
+
}
|
7 |
+
|
8 |
+
input[type=text],
|
9 |
+
input[type=number],
|
10 |
+
input[type=url],
|
11 |
+
textarea {
|
12 |
+
width: 100%;
|
13 |
+
border-radius: 4px;
|
14 |
+
border-color: hsl(0,0%,80%);
|
15 |
+
padding: 10px;
|
16 |
+
margin: 0;
|
17 |
+
|
18 |
+
&::placeholder {
|
19 |
+
color: #444;
|
20 |
+
opacity: 0.333;
|
21 |
+
}
|
22 |
+
|
23 |
+
&[type=number] {
|
24 |
+
height: 39px;
|
25 |
+
padding-right: 5px;
|
26 |
+
}
|
27 |
+
}
|
28 |
+
|
29 |
+
.wprm-admin-modal-field-radio-option {
|
30 |
+
margin-bottom: 5px;
|
31 |
+
|
32 |
+
&:first-child {
|
33 |
+
margin-top: 8px;
|
34 |
+
}
|
35 |
+
|
36 |
+
input {
|
37 |
+
width: 16px;
|
38 |
+
height: 16px;
|
39 |
+
margin-top: 1px;
|
40 |
+
border-color: hsl(0,0%,80%);
|
41 |
+
|
42 |
+
&:checked:before {
|
43 |
+
margin: 3px;
|
44 |
+
width: 8px;
|
45 |
+
height: 8px;
|
46 |
+
}
|
47 |
+
}
|
48 |
+
|
49 |
+
label {
|
50 |
+
font-size: 16px;
|
51 |
+
line-height: 20px;
|
52 |
+
}
|
53 |
+
}
|
54 |
+
|
55 |
+
.wprm-admin-modal-fields-group {
|
56 |
+
padding-bottom: 40px;
|
57 |
+
}
|
58 |
+
|
59 |
+
.wprm-admin-modal-fields-group-header {
|
60 |
+
text-align: center;
|
61 |
+
font-size: 18px;
|
62 |
+
font-weight: 300;
|
63 |
+
text-transform: uppercase;
|
64 |
+
color: #999;
|
65 |
+
border-bottom: 1px solid #999;
|
66 |
+
margin-bottom: 20px;
|
67 |
+
padding-bottom: 10px;
|
68 |
+
}
|
69 |
+
|
70 |
+
.wprm-admin-modal-field-label {
|
71 |
+
font-weight: bold;
|
72 |
+
margin-top: 10px;
|
73 |
+
margin-bottom: 2px;
|
74 |
+
font-size: 14px;
|
75 |
+
}
|
76 |
+
|
77 |
+
.wprm-admin-icon-help {
|
78 |
+
display: inline-block;
|
79 |
+
margin-top: 0;
|
80 |
+
margin-left: 5px;
|
81 |
+
|
82 |
+
border: 1px solid #444;
|
83 |
+
border-radius: 100%;
|
84 |
+
opacity: 1;
|
85 |
+
|
86 |
+
width: 16px;
|
87 |
+
height: 16px;
|
88 |
+
text-align: center;
|
89 |
+
font-size: 12px;
|
90 |
+
|
91 |
+
svg {
|
92 |
+
width: 10px;
|
93 |
+
height: 9px;
|
94 |
+
margin-bottom: 2px;
|
95 |
+
}
|
96 |
+
|
97 |
+
&:hover {
|
98 |
+
background-color: #444;
|
99 |
+
|
100 |
+
svg {
|
101 |
+
g,
|
102 |
+
path {
|
103 |
+
fill: white;
|
104 |
+
}
|
105 |
+
}
|
106 |
+
}
|
107 |
+
}
|
108 |
+
|
109 |
+
.wprm-admin-modal-field {
|
110 |
+
margin-bottom: 30px;
|
111 |
+
}
|
112 |
+
}
|
113 |
+
|
114 |
+
@media screen and (min-width: 782px) {
|
115 |
+
.wprm-admin-modal {
|
116 |
+
.wprm-admin-modal-field-radio-option {
|
117 |
+
label {
|
118 |
+
font-size: 14px;
|
119 |
+
line-height: 18px;
|
120 |
+
}
|
121 |
+
}
|
122 |
+
|
123 |
+
.wprm-admin-modal-fields-group-header {
|
124 |
+
text-align: left;
|
125 |
+
}
|
126 |
+
|
127 |
+
.wprm-admin-modal-fields-group {
|
128 |
+
padding-bottom: 50px;
|
129 |
+
}
|
130 |
+
|
131 |
+
.wprm-admin-modal-fields {
|
132 |
+
padding: 0 20px;
|
133 |
+
}
|
134 |
+
|
135 |
+
.wprm-admin-modal-field-container {
|
136 |
+
display: flex;
|
137 |
+
width: 100%;
|
138 |
+
}
|
139 |
+
|
140 |
+
.wprm-admin-modal-field-label {
|
141 |
+
flex-shrink: 0;
|
142 |
+
width: 180px;
|
143 |
+
text-align: right;
|
144 |
+
padding-right: 20px;
|
145 |
+
}
|
146 |
+
|
147 |
+
.wprm-admin-modal-field-container-radio {
|
148 |
+
.wprm-admin-modal-field-label {
|
149 |
+
margin-top: 2px;
|
150 |
+
}
|
151 |
+
}
|
152 |
+
|
153 |
+
.wprm-admin-modal-field {
|
154 |
+
flex: auto;
|
155 |
+
margin-bottom: 15px;
|
156 |
+
}
|
157 |
+
}
|
158 |
+
}
|
assets/css/admin/modal/general/rich-text.scss
ADDED
@@ -0,0 +1,118 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.wprm-admin-modal-toolbar {
|
2 |
+
flex: none;
|
3 |
+
background-color: #ebebeb;
|
4 |
+
border-top: 1px solid #999;
|
5 |
+
padding: 2px;
|
6 |
+
|
7 |
+
.wprm-admin-modal-toolbar-link {
|
8 |
+
display: flex;
|
9 |
+
padding: 2px;
|
10 |
+
|
11 |
+
.wprm-admin-icon {
|
12 |
+
opacity: 1;
|
13 |
+
margin-right: 3px;
|
14 |
+
}
|
15 |
+
.wprm-admin-modal-toolbar-link-value {
|
16 |
+
cursor: pointer;
|
17 |
+
}
|
18 |
+
}
|
19 |
+
|
20 |
+
.wprm-admin-modal-toolbar-suggest {
|
21 |
+
padding: 0 2px;
|
22 |
+
min-height: 30px;
|
23 |
+
display: flex;
|
24 |
+
flex-wrap: wrap;
|
25 |
+
align-items: center;
|
26 |
+
|
27 |
+
strong {
|
28 |
+
margin-right: 5px;
|
29 |
+
}
|
30 |
+
|
31 |
+
.wprm-admin-modal-toolbar-suggestion {
|
32 |
+
display: inline-block;
|
33 |
+
padding: 2px 5px;
|
34 |
+
margin: 2px;
|
35 |
+
|
36 |
+
border: 1px solid #999;
|
37 |
+
border-radius: 4px;
|
38 |
+
|
39 |
+
background-color: white;
|
40 |
+
|
41 |
+
.wprm-admin-modal-toolbar-suggestion-text {
|
42 |
+
opacity: 0.5;
|
43 |
+
color: #111111;
|
44 |
+
}
|
45 |
+
|
46 |
+
&:hover {
|
47 |
+
cursor: pointer;
|
48 |
+
border-color: black;
|
49 |
+
|
50 |
+
.wprm-admin-modal-toolbar-suggestion-text {
|
51 |
+
opacity: 1;
|
52 |
+
}
|
53 |
+
}
|
54 |
+
}
|
55 |
+
}
|
56 |
+
|
57 |
+
.wprm-admin-modal-toolbar-buttons {
|
58 |
+
display: flex;
|
59 |
+
}
|
60 |
+
|
61 |
+
.wprm-admin-modal-toolbar-button {
|
62 |
+
display: inline-flex;
|
63 |
+
justify-content: center;
|
64 |
+
align-items: center;
|
65 |
+
width: 24px;
|
66 |
+
height: 24px;
|
67 |
+
margin: 2px;
|
68 |
+
|
69 |
+
border: 1px solid #999;
|
70 |
+
border-radius: 4px;
|
71 |
+
|
72 |
+
background-color: white;
|
73 |
+
|
74 |
+
.wprm-admin-modal-toolbar-button-character {
|
75 |
+
opacity: 0.5;
|
76 |
+
color: #111111;
|
77 |
+
font-size: 14px;
|
78 |
+
}
|
79 |
+
|
80 |
+
&:hover {
|
81 |
+
cursor: pointer;
|
82 |
+
border-color: black;
|
83 |
+
|
84 |
+
.wprm-admin-modal-toolbar-button-character,
|
85 |
+
.wprm-admin-icon {
|
86 |
+
opacity: 1;
|
87 |
+
}
|
88 |
+
}
|
89 |
+
|
90 |
+
&.wprm-admin-modal-toolbar-button-active {
|
91 |
+
border-color: black;
|
92 |
+
|
93 |
+
.wprm-admin-icon {
|
94 |
+
opacity: 1;
|
95 |
+
}
|
96 |
+
}
|
97 |
+
}
|
98 |
+
|
99 |
+
.wprm-admin-modal-toolbar-spacer {
|
100 |
+
display: inline-block;
|
101 |
+
width: 10px;
|
102 |
+
}
|
103 |
+
}
|
104 |
+
|
105 |
+
.wprm-admin-modal-field-richtext {
|
106 |
+
border: 1px solid hsl(0,0%,80%);
|
107 |
+
border-radius: 4px;
|
108 |
+
padding: 0 10px;
|
109 |
+
|
110 |
+
p {
|
111 |
+
font-size: 14px;
|
112 |
+
}
|
113 |
+
|
114 |
+
.wprm-admin-modal-field-richtext-singleline {
|
115 |
+
font-size: 14px;
|
116 |
+
margin: 10px 0;
|
117 |
+
}
|
118 |
+
}
|
assets/css/admin/modal/menu.scss
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.wprm-admin-modal-menu {
|
2 |
+
max-width: 600px;
|
3 |
+
|
4 |
+
.wprm-admin-modal-menu-container {
|
5 |
+
padding: 10px;
|
6 |
+
overflow: scroll;
|
7 |
+
}
|
8 |
+
|
9 |
+
h2 {
|
10 |
+
text-align: center;
|
11 |
+
margin-bottom: 10px;
|
12 |
+
margin-top: 20px;
|
13 |
+
|
14 |
+
&:first-child {
|
15 |
+
margin-top: 0;
|
16 |
+
}
|
17 |
+
}
|
18 |
+
|
19 |
+
.wprm-admin-modal-menu-buttons {
|
20 |
+
button {
|
21 |
+
display: block;
|
22 |
+
margin: 5px auto;
|
23 |
+
}
|
24 |
+
}
|
25 |
+
}
|
26 |
+
|
27 |
+
@media screen and (min-width: 400px) {
|
28 |
+
.wprm-admin-modal-menu {
|
29 |
+
h2 {
|
30 |
+
text-align: left;
|
31 |
+
}
|
32 |
+
|
33 |
+
.wprm-admin-modal-menu-buttons {
|
34 |
+
display: flex;
|
35 |
+
flex-wrap: wrap;
|
36 |
+
align-items: center;
|
37 |
+
margin: -5px;
|
38 |
+
|
39 |
+
button {
|
40 |
+
margin: 5px;
|
41 |
+
}
|
42 |
+
}
|
43 |
+
}
|
44 |
+
}
|
assets/css/admin/modal/nutrition.scss
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.wprm-admin-modal-nutrition {
|
2 |
+
max-width: 715px; // This fits 3 nutrient columns.
|
3 |
+
|
4 |
+
.wprm-admin-modal-nutrition-container {
|
5 |
+
padding: 10px;
|
6 |
+
|
7 |
+
.wprm-admin-modal-nutrition-custom-ingredient {
|
8 |
+
display: flex;
|
9 |
+
align-items: center;
|
10 |
+
margin-bottom: 10px;
|
11 |
+
|
12 |
+
input {
|
13 |
+
margin-right: 5px;
|
14 |
+
|
15 |
+
&:nth-child(1) { max-width: 85px; }
|
16 |
+
&:nth-child(2) { max-width: 100px; }
|
17 |
+
&:nth-child(3) {
|
18 |
+
max-width: 250px;
|
19 |
+
margin-right: 0;
|
20 |
+
}
|
21 |
+
}
|
22 |
+
}
|
23 |
+
|
24 |
+
#wprm-admin-modal-recipe-nutrition-calculation-nutrients-modal {
|
25 |
+
margin-bottom: 0;
|
26 |
+
}
|
27 |
+
}
|
28 |
+
}
|
assets/css/admin/modal/recipe.scss
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.wprm-admin-modal-recipe {
|
2 |
+
max-width: 1000px;
|
3 |
+
|
4 |
+
.wprm-admin-modal-recipe-quicklinks {
|
5 |
+
flex: none;
|
6 |
+
text-align: center;
|
7 |
+
padding: 5px 0;
|
8 |
+
background-color: #ebebeb;
|
9 |
+
border-bottom: 1px solid #999;
|
10 |
+
|
11 |
+
a {
|
12 |
+
display: inline-block;
|
13 |
+
margin: 2px 5px;
|
14 |
+
text-decoration: none;
|
15 |
+
cursor: pointer;
|
16 |
+
opacity: 0.7;
|
17 |
+
|
18 |
+
&:hover, &.active {
|
19 |
+
text-decoration: underline;
|
20 |
+
opacity: 1;
|
21 |
+
}
|
22 |
+
}
|
23 |
+
}
|
24 |
+
|
25 |
+
#wprm-admin-modal-recipe-content {
|
26 |
+
position: relative;
|
27 |
+
}
|
28 |
+
}
|
29 |
+
|
30 |
+
@media screen and (max-height: 600px) {
|
31 |
+
.wprm-admin-modal-recipe {
|
32 |
+
.wprm-admin-modal-recipe-quicklinks {
|
33 |
+
display: none;
|
34 |
+
}
|
35 |
+
}
|
36 |
+
}
|
assets/css/admin/modal/recipe/fields/general.scss
ADDED
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.wprm-admin-modal-field-container-name {
|
2 |
+
input {
|
3 |
+
max-width: 500px;
|
4 |
+
}
|
5 |
+
}
|
6 |
+
|
7 |
+
.wprm-admin-modal-field-container-summary {
|
8 |
+
.wprm-admin-modal-field-richtext {
|
9 |
+
max-width: 650px;
|
10 |
+
}
|
11 |
+
}
|
12 |
+
|
13 |
+
.wprm-admin-modal-field-container-author-name,
|
14 |
+
.wprm-admin-modal-field-container-author-link {
|
15 |
+
margin-top: -10px;
|
16 |
+
|
17 |
+
.wprm-admin-modal-field-label {
|
18 |
+
font-weight: normal;
|
19 |
+
}
|
20 |
+
|
21 |
+
.wprm-admin-modal-field {
|
22 |
+
margin-bottom: 5px;
|
23 |
+
}
|
24 |
+
|
25 |
+
input {
|
26 |
+
max-width: 300px;
|
27 |
+
}
|
28 |
+
}
|
29 |
+
.wprm-admin-modal-field-container-author-link {
|
30 |
+
margin-top: 0;
|
31 |
+
margin-bottom: 10px;
|
32 |
+
|
33 |
+
input {
|
34 |
+
max-width: 500px;
|
35 |
+
}
|
36 |
+
}
|
37 |
+
|
38 |
+
.wprm-admin-modal-field-container-servings {
|
39 |
+
input[type=number] {
|
40 |
+
max-width: 65px;
|
41 |
+
margin-right: 5px;
|
42 |
+
}
|
43 |
+
input[type=text] {
|
44 |
+
max-width: 130px;
|
45 |
+
}
|
46 |
+
}
|
assets/css/admin/modal/recipe/fields/import.scss
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#wprm-admin-modal-fields-group-import {
|
2 |
+
textarea {
|
3 |
+
height: 40px;
|
4 |
+
}
|
5 |
+
}
|
assets/css/admin/modal/recipe/fields/ingredients.scss
ADDED
@@ -0,0 +1,223 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.wprm-admin-modal-field-ingredient,
|
2 |
+
.wprm-admin-modal-field-ingredient-group {
|
3 |
+
display: flex;
|
4 |
+
align-items: center;
|
5 |
+
margin-bottom: 10px;
|
6 |
+
background-color: white;
|
7 |
+
|
8 |
+
.wprm-admin-modal-field-ingredient-handle {
|
9 |
+
flex-shrink: 0;
|
10 |
+
|
11 |
+
.wprm-admin-icon {
|
12 |
+
margin: 0 5px;
|
13 |
+
cursor: move;
|
14 |
+
}
|
15 |
+
}
|
16 |
+
}
|
17 |
+
|
18 |
+
.wprm-admin-modal-field-ingredient-group {
|
19 |
+
.wprm-admin-modal-field-ingredient-group-name-container {
|
20 |
+
flex: auto;
|
21 |
+
|
22 |
+
.wprm-admin-modal-field-richtext-singleline {
|
23 |
+
font-weight: bold;
|
24 |
+
}
|
25 |
+
}
|
26 |
+
|
27 |
+
.wprm-admin-icon {
|
28 |
+
flex-shrink: 0;
|
29 |
+
margin: 0 5px;
|
30 |
+
}
|
31 |
+
}
|
32 |
+
|
33 |
+
.wprm-admin-modal-field-ingredient-header-container {
|
34 |
+
display: flex;
|
35 |
+
align-items: center;
|
36 |
+
margin: 0 26px 10px 26px;
|
37 |
+
font-weight: bold;
|
38 |
+
|
39 |
+
.wprm-admin-modal-field-ingredient-header {
|
40 |
+
&:nth-child(1),
|
41 |
+
&:nth-child(2) {
|
42 |
+
flex: 0 0 50%;
|
43 |
+
}
|
44 |
+
|
45 |
+
&:nth-child(3),
|
46 |
+
&:nth-child(4) {
|
47 |
+
display: none;
|
48 |
+
}
|
49 |
+
|
50 |
+
.wprm-admin-modal-field-ingredient-header-required {
|
51 |
+
font-size: 0.8em;
|
52 |
+
font-weight: normal;
|
53 |
+
color: darkred;
|
54 |
+
}
|
55 |
+
}
|
56 |
+
}
|
57 |
+
|
58 |
+
.wprm-admin-modal-field-ingredient {
|
59 |
+
.wprm-admin-modal-field-ingredient-text-container {
|
60 |
+
display: flex;
|
61 |
+
flex: auto;
|
62 |
+
flex-wrap: wrap;
|
63 |
+
align-items: center;
|
64 |
+
|
65 |
+
.wprm-admin-modal-field-richtext {
|
66 |
+
&:nth-child(1),
|
67 |
+
&:nth-child(2) {
|
68 |
+
flex: 0 0 50%;
|
69 |
+
}
|
70 |
+
|
71 |
+
&:nth-child(3),
|
72 |
+
&:nth-child(4) {
|
73 |
+
flex: 0 0 100%;
|
74 |
+
}
|
75 |
+
}
|
76 |
+
}
|
77 |
+
.wprm-admin-modal-field-ingredient-after-container {
|
78 |
+
.wprm-admin-icon {
|
79 |
+
margin: 5px;
|
80 |
+
}
|
81 |
+
}
|
82 |
+
}
|
83 |
+
|
84 |
+
.wprm-admin-modal-field-ingredient-actions {
|
85 |
+
margin-left: 26px;
|
86 |
+
margin-top: 10px;
|
87 |
+
|
88 |
+
.button {
|
89 |
+
margin-top: 5px;
|
90 |
+
margin-right: 5px;
|
91 |
+
}
|
92 |
+
|
93 |
+
p {
|
94 |
+
font-style: italic;
|
95 |
+
}
|
96 |
+
}
|
97 |
+
|
98 |
+
@media screen and (min-width: 550px) {
|
99 |
+
.wprm-admin-modal-field-ingredient-header-container {
|
100 |
+
.wprm-admin-modal-field-ingredient-header {
|
101 |
+
&:nth-child(1),
|
102 |
+
&:nth-child(2) {
|
103 |
+
flex: 0 0 25%;
|
104 |
+
}
|
105 |
+
|
106 |
+
&:nth-child(3) {
|
107 |
+
display: block;
|
108 |
+
flex: 0 0 50%;
|
109 |
+
}
|
110 |
+
}
|
111 |
+
}
|
112 |
+
|
113 |
+
.wprm-admin-modal-field-ingredient {
|
114 |
+
.wprm-admin-modal-field-ingredient-text-container {
|
115 |
+
.wprm-admin-modal-field-richtext {
|
116 |
+
&:nth-child(1),
|
117 |
+
&:nth-child(2) {
|
118 |
+
flex: 0 0 25%;
|
119 |
+
}
|
120 |
+
|
121 |
+
&:nth-child(3) {
|
122 |
+
flex: 0 0 50%;
|
123 |
+
}
|
124 |
+
}
|
125 |
+
}
|
126 |
+
}
|
127 |
+
}
|
128 |
+
|
129 |
+
@media screen and (min-width: 782px) {
|
130 |
+
.wprm-admin-modal-field-ingredient,
|
131 |
+
.wprm-admin-modal-field-ingredient-group {
|
132 |
+
margin-bottom: 5px;
|
133 |
+
}
|
134 |
+
|
135 |
+
.wprm-admin-modal-field-ingredient-header-container {
|
136 |
+
.wprm-admin-modal-field-ingredient-header {
|
137 |
+
&:nth-child(1) {
|
138 |
+
flex: 0 0 75px;
|
139 |
+
margin-right: 5px;
|
140 |
+
}
|
141 |
+
&:nth-child(2) {
|
142 |
+
flex: 0 0 90px;
|
143 |
+
margin-right: 5px;
|
144 |
+
}
|
145 |
+
&:nth-child(3) {
|
146 |
+
flex: 0 0 250px;
|
147 |
+
margin-right: 5px;
|
148 |
+
}
|
149 |
+
&:nth-child(4) {
|
150 |
+
display: block;
|
151 |
+
flex: auto;
|
152 |
+
}
|
153 |
+
}
|
154 |
+
}
|
155 |
+
|
156 |
+
.wprm-admin-modal-field-ingredient {
|
157 |
+
display: flex;
|
158 |
+
align-items: center;
|
159 |
+
|
160 |
+
.wprm-admin-modal-field-ingredient-text-container {
|
161 |
+
flex-wrap: nowrap;
|
162 |
+
|
163 |
+
.wprm-admin-modal-field-richtext {
|
164 |
+
&:nth-child(1) {
|
165 |
+
flex: 0 0 75px;
|
166 |
+
margin-right: 5px;
|
167 |
+
}
|
168 |
+
&:nth-child(2) {
|
169 |
+
flex: 0 0 90px;
|
170 |
+
margin-right: 5px;
|
171 |
+
}
|
172 |
+
&:nth-child(3) {
|
173 |
+
flex: 0 0 250px;
|
174 |
+
margin-right: 5px;
|
175 |
+
}
|
176 |
+
&:nth-child(4) {
|
177 |
+
flex: auto;
|
178 |
+
}
|
179 |
+
}
|
180 |
+
}
|
181 |
+
}
|
182 |
+
}
|
183 |
+
|
184 |
+
@media screen and (min-width: 900px) {
|
185 |
+
.wprm-admin-modal-field-ingredient-header-container {
|
186 |
+
.wprm-admin-modal-field-ingredient-header {
|
187 |
+
&:nth-child(3) {
|
188 |
+
flex: 0 0 300px;
|
189 |
+
}
|
190 |
+
}
|
191 |
+
}
|
192 |
+
|
193 |
+
.wprm-admin-modal-field-ingredient {
|
194 |
+
.wprm-admin-modal-field-ingredient-text-container {
|
195 |
+
.wprm-admin-modal-field-richtext {
|
196 |
+
&:nth-child(3) {
|
197 |
+
flex: 0 0 300px;
|
198 |
+
};
|
199 |
+
}
|
200 |
+
}
|
201 |
+
}
|
202 |
+
}
|
203 |
+
|
204 |
+
@media screen and (min-width: 1024px) {
|
205 |
+
.wprm-admin-modal-field-ingredient-header-container {
|
206 |
+
.wprm-admin-modal-field-ingredient-header {
|
207 |
+
&:nth-child(3) {
|
208 |
+
flex: 0 0 350px;
|
209 |
+
}
|
210 |
+
}
|
211 |
+
}
|
212 |
+
|
213 |
+
.wprm-admin-modal-field-ingredient {
|
214 |
+
.wprm-admin-modal-field-ingredient-text-container {
|
215 |
+
|
216 |
+
.wprm-admin-modal-field-richtext {
|
217 |
+
&:nth-child(3) {
|
218 |
+
flex: 0 0 350px;
|
219 |
+
};
|
220 |
+
}
|
221 |
+
}
|
222 |
+
}
|
223 |
+
}
|
assets/css/admin/modal/recipe/fields/instructions.scss
ADDED
@@ -0,0 +1,143 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.wprm-admin-modal-field-instruction,
|
2 |
+
.wprm-admin-modal-field-instruction-group {
|
3 |
+
margin-bottom: 5px;
|
4 |
+
background-color: white;
|
5 |
+
|
6 |
+
.wprm-admin-modal-field-instruction-main-container {
|
7 |
+
display: flex;
|
8 |
+
flex: auto;
|
9 |
+
align-items: center;
|
10 |
+
|
11 |
+
.wprm-admin-modal-field-instruction-handle {
|
12 |
+
flex-shrink: 0;
|
13 |
+
|
14 |
+
.wprm-admin-icon {
|
15 |
+
margin: 0 5px;
|
16 |
+
cursor: move;
|
17 |
+
}
|
18 |
+
}
|
19 |
+
}
|
20 |
+
}
|
21 |
+
|
22 |
+
.wprm-admin-modal-field-instruction-group {
|
23 |
+
display: flex;
|
24 |
+
align-items: center;
|
25 |
+
|
26 |
+
.wprm-admin-modal-field-instruction-group-name-container {
|
27 |
+
flex: auto;
|
28 |
+
|
29 |
+
.wprm-admin-modal-field-richtext-singleline {
|
30 |
+
font-weight: bold;
|
31 |
+
}
|
32 |
+
}
|
33 |
+
|
34 |
+
.wprm-admin-icon {
|
35 |
+
flex-shrink: 0;
|
36 |
+
margin: 0 5px;
|
37 |
+
}
|
38 |
+
}
|
39 |
+
|
40 |
+
.wprm-admin-modal-field-instruction {
|
41 |
+
.wprm-admin-modal-field-instruction-text-container {
|
42 |
+
flex: auto;
|
43 |
+
display: flex;
|
44 |
+
align-items: center;
|
45 |
+
|
46 |
+
.wprm-admin-icon {
|
47 |
+
flex-shrink: 0;
|
48 |
+
margin: 0 5px;
|
49 |
+
cursor: move;
|
50 |
+
}
|
51 |
+
|
52 |
+
.wprm-admin-modal-field-richtext {
|
53 |
+
flex: auto;
|
54 |
+
}
|
55 |
+
}
|
56 |
+
.wprm-admin-modal-field-instruction-after-container {
|
57 |
+
display: flex;
|
58 |
+
flex-direction: row-reverse;
|
59 |
+
justify-content: space-between;
|
60 |
+
|
61 |
+
.wprm-admin-modal-field-image {
|
62 |
+
padding-left: 26px;
|
63 |
+
|
64 |
+
.button, a {
|
65 |
+
opacity: 0.5;
|
66 |
+
|
67 |
+
&:hover {
|
68 |
+
opacity: 1;
|
69 |
+
}
|
70 |
+
}
|
71 |
+
}
|
72 |
+
.wprm-admin-icon {
|
73 |
+
margin: 5px;
|
74 |
+
}
|
75 |
+
.wprm-admin-modal-field-image-preview {
|
76 |
+
display: flex;
|
77 |
+
flex-direction: column;
|
78 |
+
align-items: flex-start;
|
79 |
+
|
80 |
+
img {
|
81 |
+
cursor: pointer;
|
82 |
+
max-width: 75px;
|
83 |
+
height: auto;
|
84 |
+
margin-top: 5px;
|
85 |
+
}
|
86 |
+
}
|
87 |
+
}
|
88 |
+
}
|
89 |
+
|
90 |
+
.wprm-admin-modal-field-instruction-actions {
|
91 |
+
margin-left: 26px;
|
92 |
+
margin-top: 10px;
|
93 |
+
|
94 |
+
.button {
|
95 |
+
margin-top: 5px;
|
96 |
+
margin-right: 5px;
|
97 |
+
}
|
98 |
+
|
99 |
+
p {
|
100 |
+
font-style: italic;
|
101 |
+
}
|
102 |
+
}
|
103 |
+
|
104 |
+
@media screen and (min-width: 782px) {
|
105 |
+
.wprm-admin-modal-field-instruction,
|
106 |
+
.wprm-admin-modal-field-instruction-group {
|
107 |
+
.wprm-admin-modal-field-instruction-main-container {
|
108 |
+
flex: 0 0 68%;
|
109 |
+
}
|
110 |
+
.wprm-admin-modal-field-instruction-after-container {
|
111 |
+
flex: auto;
|
112 |
+
}
|
113 |
+
}
|
114 |
+
|
115 |
+
.wprm-admin-modal-field-instruction {
|
116 |
+
display: flex;
|
117 |
+
align-items: center;
|
118 |
+
|
119 |
+
.wprm-admin-modal-field-instruction-after-container {
|
120 |
+
flex-direction: row;
|
121 |
+
flex-wrap: wrap;
|
122 |
+
align-items: center;
|
123 |
+
|
124 |
+
.wprm-admin-modal-field-image-preview {
|
125 |
+
align-items: flex-end;
|
126 |
+
margin-right: 5px;
|
127 |
+
}
|
128 |
+
|
129 |
+
.wprm-admin-modal-field-image {
|
130 |
+
padding-left: 10px;
|
131 |
+
|
132 |
+
.button {
|
133 |
+
margin-top: 0;
|
134 |
+
}
|
135 |
+
}
|
136 |
+
.wprm-admin-modal-field-image-preview {
|
137 |
+
img {
|
138 |
+
margin-top: 0;
|
139 |
+
}
|
140 |
+
}
|
141 |
+
}
|
142 |
+
}
|
143 |
+
}
|
assets/css/admin/modal/recipe/fields/media.scss
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.wprm-admin-modal-field-image,
|
2 |
+
.wprm-admin-modal-field-video {
|
3 |
+
|
4 |
+
.wprm-admin-modal-field-image-preview,
|
5 |
+
.wprm-admin-modal-field-video-preview {
|
6 |
+
display: flex;
|
7 |
+
flex-direction: column;
|
8 |
+
align-items: flex-start;
|
9 |
+
max-width: 150px;
|
10 |
+
|
11 |
+
img {
|
12 |
+
cursor: pointer;
|
13 |
+
max-width: 100%;
|
14 |
+
height: auto;
|
15 |
+
}
|
16 |
+
}
|
17 |
+
|
18 |
+
.button {
|
19 |
+
margin-top: 5px;
|
20 |
+
margin-right: 5px;
|
21 |
+
}
|
22 |
+
|
23 |
+
textarea {
|
24 |
+
min-height: 110px;
|
25 |
+
}
|
26 |
+
}
|
27 |
+
|
28 |
+
@media screen and (min-width: 782px) {
|
29 |
+
#wprm-admin-modal-fields-group-media {
|
30 |
+
.wprm-admin-modal-fields {
|
31 |
+
display: flex;
|
32 |
+
|
33 |
+
.wprm-admin-modal-field-container {
|
34 |
+
flex: 1;
|
35 |
+
flex-direction: column;
|
36 |
+
|
37 |
+
.wprm-admin-modal-field-label {
|
38 |
+
width: auto;
|
39 |
+
text-align: left;
|
40 |
+
}
|
41 |
+
}
|
42 |
+
}
|
43 |
+
}
|
44 |
+
}
|
assets/css/admin/modal/recipe/fields/notes.scss
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#wprm-admin-modal-notes-placeholder {
|
2 |
+
display: none;
|
3 |
+
}
|
4 |
+
|
5 |
+
#wprm-admin-modal-field-tinymce-container {
|
6 |
+
max-width: 650px;
|
7 |
+
height: 100%;
|
8 |
+
|
9 |
+
* {
|
10 |
+
box-sizing: content-box;
|
11 |
+
}
|
12 |
+
|
13 |
+
textarea {
|
14 |
+
border-radius: 0;
|
15 |
+
box-sizing: border-box;
|
16 |
+
min-height: 350px;
|
17 |
+
}
|
18 |
+
}
|
assets/css/admin/modal/recipe/fields/nutrition.scss
ADDED
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#wprm-admin-modal-fields-group-nutrition {
|
2 |
+
.wprm-admin-modal-field-nutrition-container {
|
3 |
+
input[type=number] {
|
4 |
+
max-width: 80px;
|
5 |
+
margin-right: 5px;
|
6 |
+
}
|
7 |
+
input[type=text] {
|
8 |
+
max-width: 80px;
|
9 |
+
}
|
10 |
+
}
|
11 |
+
}
|
12 |
+
|
13 |
+
@media screen and (min-width: 500px) {
|
14 |
+
#wprm-admin-modal-fields-group-nutrition {
|
15 |
+
.wprm-admin-modal-field-nutrition-container {
|
16 |
+
display: flex;
|
17 |
+
flex-wrap: wrap;
|
18 |
+
|
19 |
+
.wprm-admin-modal-field-container {
|
20 |
+
flex: 0 0 50%;
|
21 |
+
flex-direction: column;
|
22 |
+
|
23 |
+
.wprm-admin-modal-field-label {
|
24 |
+
width: auto;
|
25 |
+
text-align: left;
|
26 |
+
}
|
27 |
+
}
|
28 |
+
}
|
29 |
+
}
|
30 |
+
}
|
31 |
+
|
32 |
+
@media screen and (min-width: 782px) {
|
33 |
+
#wprm-admin-modal-fields-group-nutrition {
|
34 |
+
.wprm-admin-modal-field-nutrition-container {
|
35 |
+
.wprm-admin-modal-field-container {
|
36 |
+
flex: 0 0 33%;
|
37 |
+
}
|
38 |
+
}
|
39 |
+
}
|
40 |
+
}
|
41 |
+
|
42 |
+
@media screen and (min-width: 900px) {
|
43 |
+
#wprm-admin-modal-fields-group-nutrition {
|
44 |
+
.wprm-admin-modal-field-nutrition-container {
|
45 |
+
.wprm-admin-modal-field-container {
|
46 |
+
flex: 0 0 25%;
|
47 |
+
}
|
48 |
+
}
|
49 |
+
}
|
50 |
+
}
|
assets/css/admin/modal/recipe/fields/times.scss
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.wprm-admin-modal-field-time {
|
2 |
+
.wprm-admin-modal-field-time-parts {
|
3 |
+
input[type=number] {
|
4 |
+
max-width: 65px;
|
5 |
+
margin-left: 15px;
|
6 |
+
|
7 |
+
&:first-child {
|
8 |
+
margin-left: 0;
|
9 |
+
}
|
10 |
+
}
|
11 |
+
}
|
12 |
+
|
13 |
+
.wprm-admin-modal-field-time-none {
|
14 |
+
margin-top: 10px;
|
15 |
+
display: flex;
|
16 |
+
align-items: center;
|
17 |
+
opacity: 0.5;
|
18 |
+
|
19 |
+
&:hover {
|
20 |
+
opacity: 1;
|
21 |
+
}
|
22 |
+
|
23 |
+
label {
|
24 |
+
margin-bottom: 5px;
|
25 |
+
}
|
26 |
+
}
|
27 |
+
}
|
28 |
+
|
29 |
+
.wprm-admin-modal-field-container-custom-time-label {
|
30 |
+
input {
|
31 |
+
max-width: 295px;
|
32 |
+
}
|
33 |
+
}
|
34 |
+
|
35 |
+
@media screen and (min-width: 900px) {
|
36 |
+
.wprm-admin-modal-field-time {
|
37 |
+
display: flex;
|
38 |
+
align-items: center;
|
39 |
+
|
40 |
+
.wprm-admin-modal-field-time-none {
|
41 |
+
margin: 0 0 -5px 20px;
|
42 |
+
}
|
43 |
+
}
|
44 |
+
}
|
assets/css/admin/modal/recipe/ingredient-links.scss
ADDED
@@ -0,0 +1,77 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.wprm-admin-modal-field-ingredient-links-edit-container {
|
2 |
+
padding: 10px;
|
3 |
+
overflow: scroll;
|
4 |
+
|
5 |
+
.wprm-admin-modal-field-ingredient-links {
|
6 |
+
margin-bottom: 80px; // Make sure last dropdown fits.
|
7 |
+
}
|
8 |
+
.wprm-admin-modal-field-ingredient-links-link-ingredient-count {
|
9 |
+
font-size: 12px;
|
10 |
+
font-style: italic;
|
11 |
+
color: darkred;
|
12 |
+
}
|
13 |
+
}
|
14 |
+
|
15 |
+
.wprm-admin-modal-field-ingredient-links-container {
|
16 |
+
.wprm-admin-modal-field-container.wprm-admin-modal-field-container-link-type {
|
17 |
+
display: block;
|
18 |
+
|
19 |
+
.wprm-admin-modal-field-label {
|
20 |
+
width: 100%;
|
21 |
+
text-align: left;
|
22 |
+
padding: 0;
|
23 |
+
}
|
24 |
+
}
|
25 |
+
|
26 |
+
.wprm-admin-modal-field-ingredient-links-link-container {
|
27 |
+
min-height: 39px;
|
28 |
+
margin-bottom: 20px;
|
29 |
+
|
30 |
+
.wprm-admin-modal-field-ingredient-links-link-ingredient {
|
31 |
+
font-size: 16px;
|
32 |
+
}
|
33 |
+
|
34 |
+
input {
|
35 |
+
margin: 5px 0;
|
36 |
+
}
|
37 |
+
}
|
38 |
+
}
|
39 |
+
|
40 |
+
@media screen and (min-width: 782px) {
|
41 |
+
.wprm-admin-modal-field-ingredient-links-container {
|
42 |
+
.wprm-admin-modal-field-ingredient-links-link-container {
|
43 |
+
display: flex;
|
44 |
+
align-items: center;
|
45 |
+
margin-bottom: 5px;
|
46 |
+
|
47 |
+
.wprm-admin-modal-field-ingredient-links-link-ingredient {
|
48 |
+
font-size: 14px;
|
49 |
+
flex: 0 0 200px;
|
50 |
+
}
|
51 |
+
|
52 |
+
.wprm-admin-modal-field-ingredient-links-link-url,
|
53 |
+
input {
|
54 |
+
flex: 1;
|
55 |
+
margin: 0 5px;
|
56 |
+
}
|
57 |
+
|
58 |
+
.wprm-admin-modal-field-ingredient-links-link-url-none {
|
59 |
+
opacity: 0.5;
|
60 |
+
}
|
61 |
+
|
62 |
+
.wprm-admin-modal-field-ingredient-links-link-nofollow {
|
63 |
+
flex: 0 0 205px;
|
64 |
+
}
|
65 |
+
}
|
66 |
+
}
|
67 |
+
}
|
68 |
+
|
69 |
+
@media screen and (min-width: 1000px) {
|
70 |
+
.wprm-admin-modal-field-ingredient-links-container {
|
71 |
+
.wprm-admin-modal-field-ingredient-links-link-container {
|
72 |
+
.wprm-admin-modal-field-ingredient-links-link-ingredient {
|
73 |
+
flex: 0 0 250px;
|
74 |
+
}
|
75 |
+
}
|
76 |
+
}
|
77 |
+
}
|
assets/css/admin/modal/recipe/nutrition-calculation.scss
ADDED
@@ -0,0 +1,236 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.wprm-admin-modal-recipe-nutrition-calculation {
|
2 |
+
padding: 10px;
|
3 |
+
overflow: scroll;
|
4 |
+
}
|
5 |
+
|
6 |
+
.wprm-admin-modal-recipe-nutrition-calculation-source {
|
7 |
+
margin-bottom: 80px; // Make sure last dropdown fits.
|
8 |
+
|
9 |
+
thead {
|
10 |
+
display: none;
|
11 |
+
}
|
12 |
+
|
13 |
+
tr {
|
14 |
+
display: block;
|
15 |
+
margin-bottom: 30px;
|
16 |
+
}
|
17 |
+
|
18 |
+
td {
|
19 |
+
display: block;
|
20 |
+
font-size: 16px;
|
21 |
+
|
22 |
+
&:first-child {
|
23 |
+
display: none;
|
24 |
+
}
|
25 |
+
|
26 |
+
input {
|
27 |
+
max-width: 100px;
|
28 |
+
margin-right: 5px !important;
|
29 |
+
|
30 |
+
&[type=number] {
|
31 |
+
max-width: 80px;
|
32 |
+
}
|
33 |
+
}
|
34 |
+
}
|
35 |
+
|
36 |
+
.wprm-admin-modal-recipe-nutrition-calculation-source-no-match {
|
37 |
+
color: darkred;
|
38 |
+
}
|
39 |
+
}
|
40 |
+
|
41 |
+
.wprm-admin-modal-recipe-nutrition-calculation-match {
|
42 |
+
|
43 |
+
.wprm-admin-modal-recipe-nutrition-calculation-match-search {
|
44 |
+
display: flex;
|
45 |
+
align-items: center;
|
46 |
+
|
47 |
+
input {
|
48 |
+
max-width: 300px;
|
49 |
+
}
|
50 |
+
|
51 |
+
button {
|
52 |
+
margin-left: 5px;
|
53 |
+
}
|
54 |
+
}
|
55 |
+
|
56 |
+
.wprm-admin-loader {
|
57 |
+
margin-top: 15px;
|
58 |
+
}
|
59 |
+
|
60 |
+
.wprm-admin-modal-recipe-nutrition-calculation-matches {
|
61 |
+
margin: -5px;
|
62 |
+
display: flex;
|
63 |
+
flex-wrap: wrap;
|
64 |
+
|
65 |
+
.wprm-admin-modal-recipe-nutrition-calculation-matches-option {
|
66 |
+
flex: 0 0 150px;
|
67 |
+
display: flex;
|
68 |
+
flex-direction: column;
|
69 |
+
align-items: center;
|
70 |
+
justify-content: center;
|
71 |
+
|
72 |
+
border: 1px dashed black;
|
73 |
+
border-radius: 4px;
|
74 |
+
|
75 |
+
margin: 5px;
|
76 |
+
padding: 5px;
|
77 |
+
|
78 |
+
&:hover {
|
79 |
+
border-style: solid;
|
80 |
+
cursor: pointer;
|
81 |
+
}
|
82 |
+
|
83 |
+
img {
|
84 |
+
max-width: 100px;
|
85 |
+
}
|
86 |
+
|
87 |
+
div {
|
88 |
+
text-align: center;
|
89 |
+
}
|
90 |
+
}
|
91 |
+
}
|
92 |
+
}
|
93 |
+
|
94 |
+
.wprm-admin-modal-recipe-nutrition-calculation-custom {
|
95 |
+
.wprm-admin-modal-recipe-nutrition-calculation-custom-ingredient {
|
96 |
+
display: flex;
|
97 |
+
align-items: center;
|
98 |
+
margin-bottom: 10px;
|
99 |
+
|
100 |
+
input {
|
101 |
+
margin-right: 5px;
|
102 |
+
|
103 |
+
&:nth-child(1) { max-width: 85px; }
|
104 |
+
&:nth-child(2) { max-width: 100px; }
|
105 |
+
&:nth-child(3) {
|
106 |
+
max-width: 250px;
|
107 |
+
margin-right: 0;
|
108 |
+
}
|
109 |
+
}
|
110 |
+
}
|
111 |
+
|
112 |
+
.button {
|
113 |
+
margin-right: 5px !important;
|
114 |
+
}
|
115 |
+
|
116 |
+
.wprm-admin-modal-recipe-nutrition-calculation-custom-saved-ingredient {
|
117 |
+
margin-bottom: 20px;
|
118 |
+
|
119 |
+
strong {
|
120 |
+
display: block;
|
121 |
+
margin-bottom: 5px;
|
122 |
+
}
|
123 |
+
|
124 |
+
input {
|
125 |
+
max-width: 80px;
|
126 |
+
}
|
127 |
+
}
|
128 |
+
}
|
129 |
+
|
130 |
+
.wprm-admin-modal-recipe-nutrition-calculation-nutrients {
|
131 |
+
margin-bottom: 20px;
|
132 |
+
display: flex;
|
133 |
+
flex-wrap: wrap;
|
134 |
+
|
135 |
+
.wprm-admin-modal-recipe-nutrition-calculation-nutrient {
|
136 |
+
flex: 0 0 230px;
|
137 |
+
display: inline-flex;
|
138 |
+
align-items: center;
|
139 |
+
margin-bottom: 2px;
|
140 |
+
|
141 |
+
input {
|
142 |
+
max-width: 60px;
|
143 |
+
margin-right: 5px;
|
144 |
+
height: 32px;
|
145 |
+
padding: 2px 5px;
|
146 |
+
}
|
147 |
+
}
|
148 |
+
}
|
149 |
+
|
150 |
+
.wprm-admin-modal-recipe-nutrition-calculation-summary {
|
151 |
+
.wprm-admin-modal-recipe-nutrition-calculation-summary-ingredient {
|
152 |
+
display: flex;
|
153 |
+
align-items: center;
|
154 |
+
margin-bottom: 10px;
|
155 |
+
font-size: 16px;
|
156 |
+
|
157 |
+
&.wprm-admin-modal-recipe-nutrition-calculation-summary-ingredient-not-used {
|
158 |
+
text-decoration: line-through;
|
159 |
+
}
|
160 |
+
|
161 |
+
.wprm-admin-modal-recipe-nutrition-calculation-summary-ingredient-select {
|
162 |
+
flex: 0 0 40%;
|
163 |
+
}
|
164 |
+
|
165 |
+
.wprm-admin-modal-recipe-nutrition-calculation-summary-ingredient-match,
|
166 |
+
.wprm-admin-modal-recipe-nutrition-calculation-summary-ingredient-no-match {
|
167 |
+
flex: auto;
|
168 |
+
margin-left: 5px;
|
169 |
+
|
170 |
+
&.wprm-admin-modal-recipe-nutrition-calculation-summary-ingredient-no-match {
|
171 |
+
color: darkred;
|
172 |
+
}
|
173 |
+
}
|
174 |
+
}
|
175 |
+
}
|
176 |
+
|
177 |
+
@media screen and (min-width: 782px) {
|
178 |
+
.wprm-admin-modal-recipe-nutrition-calculation-source {
|
179 |
+
thead {
|
180 |
+
display: table-header-group;
|
181 |
+
|
182 |
+
th {
|
183 |
+
text-align: left;
|
184 |
+
padding-right: 10px;
|
185 |
+
|
186 |
+
&:first-child {
|
187 |
+
display: none;
|
188 |
+
}
|
189 |
+
}
|
190 |
+
}
|
191 |
+
|
192 |
+
tr {
|
193 |
+
display: table-row;
|
194 |
+
margin-bottom: 0;
|
195 |
+
}
|
196 |
+
|
197 |
+
td {
|
198 |
+
display: table-cell;
|
199 |
+
font-size: 14px;
|
200 |
+
padding-right: 10px;
|
201 |
+
|
202 |
+
&:nth-child(2) {
|
203 |
+
display: flex;
|
204 |
+
align-items: center;
|
205 |
+
}
|
206 |
+
|
207 |
+
&:nth-child(3) {
|
208 |
+
min-width: 160px;
|
209 |
+
}
|
210 |
+
}
|
211 |
+
}
|
212 |
+
|
213 |
+
.wprm-admin-modal-recipe-nutrition-calculation-summary {
|
214 |
+
.wprm-admin-modal-recipe-nutrition-calculation-summary-ingredient {
|
215 |
+
font-size: 14px;
|
216 |
+
margin-bottom: 3px;
|
217 |
+
}
|
218 |
+
}
|
219 |
+
}
|
220 |
+
|
221 |
+
@media screen and (min-width: 900px) {
|
222 |
+
.wprm-admin-modal-recipe-nutrition-calculation-source {
|
223 |
+
thead {
|
224 |
+
th {
|
225 |
+
&:first-child {
|
226 |
+
display: table-cell;
|
227 |
+
}
|
228 |
+
}
|
229 |
+
}
|
230 |
+
td {
|
231 |
+
&:first-child {
|
232 |
+
display: table-cell;
|
233 |
+
}
|
234 |
+
}
|
235 |
+
}
|
236 |
+
}
|
assets/css/admin/modal/recipe/unit-conversion.scss
ADDED
@@ -0,0 +1,129 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.wprm-admin-modal-field-ingredient-unit-conversion-systems {
|
2 |
+
display: flex;
|
3 |
+
flex-wrap: wrap;
|
4 |
+
|
5 |
+
font-size: 14px;
|
6 |
+
margin-bottom: 25px;
|
7 |
+
|
8 |
+
strong {
|
9 |
+
flex: 0 0 100%;
|
10 |
+
}
|
11 |
+
|
12 |
+
a {
|
13 |
+
margin: 0 5px;
|
14 |
+
text-decoration: none;
|
15 |
+
|
16 |
+
&:first-child {
|
17 |
+
margin-left: 0;
|
18 |
+
}
|
19 |
+
}
|
20 |
+
}
|
21 |
+
|
22 |
+
.wprm-admin-modal-field-ingredient-unit-conversion-container {
|
23 |
+
button {
|
24 |
+
margin: 10px 0 0 3px !important;
|
25 |
+
}
|
26 |
+
}
|
27 |
+
|
28 |
+
.wprm-admin-modal-field-ingredient-unit-conversion {
|
29 |
+
width: 100%;
|
30 |
+
|
31 |
+
thead {
|
32 |
+
display: none;
|
33 |
+
}
|
34 |
+
|
35 |
+
tr {
|
36 |
+
display: block;
|
37 |
+
margin-bottom: 10px;
|
38 |
+
|
39 |
+
td:first-child {
|
40 |
+
display: block;
|
41 |
+
}
|
42 |
+
|
43 |
+
td:nth-child(2) {
|
44 |
+
width: 175px;
|
45 |
+
}
|
46 |
+
|
47 |
+
.wprm-admin-modal-field-ingredient-unit-conversion-fields {
|
48 |
+
display: flex;
|
49 |
+
align-items: center;
|
50 |
+
|
51 |
+
.wprm-admin-modal-field-richtext {
|
52 |
+
&:nth-child(1) {
|
53 |
+
flex: 0 0 75px;
|
54 |
+
margin-right: 5px;
|
55 |
+
}
|
56 |
+
&:nth-child(2) {
|
57 |
+
flex: 0 0 90px;
|
58 |
+
}
|
59 |
+
}
|
60 |
+
}
|
61 |
+
}
|
62 |
+
}
|
63 |
+
|
64 |
+
.wprm-admin-modal-field-ingredient-unit-conversion-item {
|
65 |
+
margin: 5px 0;
|
66 |
+
font-size: 14px;
|
67 |
+
|
68 |
+
strong {
|
69 |
+
display: block;
|
70 |
+
margin-top: 20px;
|
71 |
+
}
|
72 |
+
|
73 |
+
.wprm-admin-modal-field-ingredient-unit-conversion-ingredient {
|
74 |
+
display: flex;
|
75 |
+
flex-wrap: wrap;
|
76 |
+
align-items: center;
|
77 |
+
margin-bottom: 20px;
|
78 |
+
|
79 |
+
.wprm-admin-modal-field-ingredient-unit-conversion-ingredient-system-1 {
|
80 |
+
margin-right: 10px;
|
81 |
+
flex: 0 0 100px;
|
82 |
+
}
|
83 |
+
|
84 |
+
.wprm-admin-modal-field-ingredient-unit-conversion-ingredient-system-2 {
|
85 |
+
margin: 0 10px;
|
86 |
+
}
|
87 |
+
}
|
88 |
+
}
|
89 |
+
|
90 |
+
@media screen and (min-width: 500px) {
|
91 |
+
.wprm-admin-modal-field-ingredient-unit-conversion {
|
92 |
+
thead {
|
93 |
+
display: table-header-group;
|
94 |
+
|
95 |
+
th {
|
96 |
+
text-align: left;
|
97 |
+
}
|
98 |
+
}
|
99 |
+
|
100 |
+
tr {
|
101 |
+
display: table-row;
|
102 |
+
margin-bottom: 0;
|
103 |
+
|
104 |
+
td:first-child {
|
105 |
+
display: table-cell;
|
106 |
+
width: 155px;
|
107 |
+
}
|
108 |
+
}
|
109 |
+
}
|
110 |
+
}
|
111 |
+
|
112 |
+
@media screen and (min-width: 782px) {
|
113 |
+
.wprm-admin-modal-field-ingredient-unit-conversion-systems {
|
114 |
+
strong {
|
115 |
+
flex: none;
|
116 |
+
}
|
117 |
+
}
|
118 |
+
|
119 |
+
.wprm-admin-modal-field-ingredient-unit-conversion {
|
120 |
+
tr {
|
121 |
+
td:first-child {
|
122 |
+
width: 175px;
|
123 |
+
}
|
124 |
+
td:nth-child(2) {
|
125 |
+
width: 195px;
|
126 |
+
}
|
127 |
+
}
|
128 |
+
}
|
129 |
+
}
|
assets/css/admin/modal/select.scss
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.wprm-admin-modal-select {
|
2 |
+
max-width: 600px;
|
3 |
+
|
4 |
+
.wprm-admin-modal-select-container {
|
5 |
+
padding: 10px;
|
6 |
+
}
|
7 |
+
}
|
assets/css/admin/modal/taxonomy.scss
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.wprm-admin-modal-taxonomy {
|
2 |
+
max-width: 500px;
|
3 |
+
|
4 |
+
.wprm-admin-modal-taxonomy-container {
|
5 |
+
padding: 10px;
|
6 |
+
padding-bottom: 0;
|
7 |
+
margin-bottom: -5px;
|
8 |
+
}
|
9 |
+
}
|
assets/css/admin/modal/text-import.scss
ADDED
@@ -0,0 +1,64 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.wprm-admin-modal-field-text-import-container {
|
2 |
+
padding: 10px;
|
3 |
+
overflow: scroll;
|
4 |
+
|
5 |
+
h2 {
|
6 |
+
&:first-child {
|
7 |
+
margin-top: 0;
|
8 |
+
}
|
9 |
+
}
|
10 |
+
|
11 |
+
.wprm-admin-modal-field-text-import-selection {
|
12 |
+
.wprm-admin-modal-field-text-import-buttons {
|
13 |
+
margin: -2px;
|
14 |
+
margin-bottom: 7px;
|
15 |
+
|
16 |
+
button {
|
17 |
+
margin: 2px;
|
18 |
+
|
19 |
+
&.wprm-selection-made {
|
20 |
+
border-color: darkgreen;
|
21 |
+
background-color: #bdffc2;
|
22 |
+
}
|
23 |
+
}
|
24 |
+
}
|
25 |
+
|
26 |
+
textarea {
|
27 |
+
height: 400px;
|
28 |
+
}
|
29 |
+
}
|
30 |
+
|
31 |
+
.wprm-admin-modal-field-text-import-groups {
|
32 |
+
.wprm-admin-modal-field-text-import-groups-field {
|
33 |
+
display: flex;
|
34 |
+
align-items: center;
|
35 |
+
margin: 5px 0;
|
36 |
+
|
37 |
+
input[type="text"] {
|
38 |
+
flex: auto;
|
39 |
+
}
|
40 |
+
}
|
41 |
+
}
|
42 |
+
}
|
43 |
+
|
44 |
+
@media screen and (min-width: 782px) {
|
45 |
+
.wprm-admin-modal-field-text-import-container {
|
46 |
+
.wprm-admin-modal-field-text-import-selection {
|
47 |
+
display: flex;
|
48 |
+
|
49 |
+
.wprm-admin-modal-field-text-import-buttons {
|
50 |
+
display: flex;
|
51 |
+
flex-direction: column;
|
52 |
+
|
53 |
+
flex-shrink: 0;
|
54 |
+
width: 180px;
|
55 |
+
margin: 0;
|
56 |
+
padding-right: 20px;
|
57 |
+
}
|
58 |
+
|
59 |
+
textarea {
|
60 |
+
flex: auto;
|
61 |
+
}
|
62 |
+
}
|
63 |
+
}
|
64 |
+
}
|
assets/css/admin/settings/layout.scss
CHANGED
@@ -266,11 +266,14 @@
|
|
266 |
#wprm-settings-sidebar {
|
267 |
position: fixed;
|
268 |
width: 200px;
|
|
|
269 |
max-height: calc(100% - 50px);
|
270 |
-
|
|
|
271 |
}
|
272 |
|
273 |
#wprm-settings-menu {
|
|
|
274 |
height: 100%;
|
275 |
overflow-y: scroll;
|
276 |
}
|
266 |
#wprm-settings-sidebar {
|
267 |
position: fixed;
|
268 |
width: 200px;
|
269 |
+
height: 100%;
|
270 |
max-height: calc(100% - 50px);
|
271 |
+
display: flex;
|
272 |
+
flex-direction: column;
|
273 |
}
|
274 |
|
275 |
#wprm-settings-menu {
|
276 |
+
flex: 1;
|
277 |
height: 100%;
|
278 |
overflow-y: scroll;
|
279 |
}
|
assets/css/admin/shared/button.scss
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
.wprm-button-required {
|
2 |
+
opacity: 0.4 !important;
|
3 |
+
cursor: help !important;
|
4 |
+
}
|
assets/css/admin/shared/error-boundary.scss
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.wprm-error-boundary {
|
2 |
+
overflow: scroll;
|
3 |
+
margin: 10px;
|
4 |
+
padding: 0 10px;
|
5 |
+
border: 1px dashed darkred;
|
6 |
+
|
7 |
+
strong {
|
8 |
+
color: darkred;
|
9 |
+
}
|
10 |
+
|
11 |
+
pre {
|
12 |
+
white-space: pre-wrap;
|
13 |
+
}
|
14 |
+
}
|
assets/css/admin/shared/icon.scss
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.wprm-admin-icon {
|
2 |
+
opacity: 0.5;
|
3 |
+
margin-top: 2px;
|
4 |
+
|
5 |
+
&:hover {
|
6 |
+
opacity: 1;
|
7 |
+
cursor: pointer;
|
8 |
+
}
|
9 |
+
}
|
assets/css/admin/shared/loader.scss
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.wprm-admin-loader {
|
2 |
+
display: inline-block;
|
3 |
+
width: 10px;
|
4 |
+
height: 10px;
|
5 |
+
border: 2px solid rgba(200, 200, 200, 0.3);
|
6 |
+
border-radius: 50%;
|
7 |
+
border-top-color: #444;
|
8 |
+
animation: spin 1s ease-in-out infinite;
|
9 |
+
-webkit-animation: spin 1s ease-in-out infinite;
|
10 |
+
}
|
11 |
+
|
12 |
+
@keyframes spin {
|
13 |
+
to { -webkit-transform: rotate(360deg); }
|
14 |
+
}
|
15 |
+
@-webkit-keyframes spin {
|
16 |
+
to { -webkit-transform: rotate(360deg); }
|
17 |
+
}
|
assets/css/blocks/modal.scss
DELETED
@@ -1,10 +0,0 @@
|
|
1 |
-
.wprm-frame-menu {
|
2 |
-
display: none !important;
|
3 |
-
}
|
4 |
-
|
5 |
-
.wprm-frame-router,
|
6 |
-
.wprm-frame-title,
|
7 |
-
.wprm-frame-content,
|
8 |
-
.wprm-frame-toolbar {
|
9 |
-
left: 0 !important;
|
10 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/css/shortcodes/_image.scss
CHANGED
@@ -3,6 +3,11 @@
|
|
3 |
display: block;
|
4 |
margin: 0 auto;
|
5 |
}
|
|
|
|
|
|
|
|
|
|
|
6 |
}
|
7 |
|
8 |
.wprm-block-image-circle img {
|
3 |
display: block;
|
4 |
margin: 0 auto;
|
5 |
}
|
6 |
+
|
7 |
+
// Compatibility.
|
8 |
+
.dpsp-pin-it-wrapper {
|
9 |
+
margin: 0 auto;
|
10 |
+
}
|
11 |
}
|
12 |
|
13 |
.wprm-block-image-circle img {
|
assets/icons/admin/adjustable.svg
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><g class="nc-icon-wrapper" stroke-width="1" fill="#111111" stroke="#111111"><line fill="none" stroke="#111111" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="12.5" y1="12.5" x2="15.5" y2="12.5"></line> <line fill="none" stroke="#111111" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="0.5" y1="3.5" x2="3.5" y2="3.5"></line> <line fill="none" stroke="#111111" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="9.5" y1="3.5" x2="15.5" y2="3.5"></line> <rect data-color="color-2" x="3.5" y="0.5" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" width="3" height="6"></rect> <rect data-color="color-2" x="9.5" y="9.5" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" width="3" height="6"></rect> <line fill="none" stroke="#111111" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="0.5" y1="12.5" x2="6.5" y2="12.5"></line> </g></svg>
|
assets/icons/admin/bold.svg
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><g class="nc-icon-wrapper" stroke-width="1" fill="#111111" stroke="#111111"><path d="M2.5,1.5h6a3,3,0,0,1,3,3h0a3,3,0,0,1-3,3h-4" fill="none" stroke="#111111" stroke-linecap="round" stroke-linejoin="round"></path> <path d="M4.5,7.5H10A3.5,3.5,0,0,1,13.5,11h0A3.5,3.5,0,0,1,10,14.5H2.5" fill="none" stroke="#111111" stroke-linecap="round" stroke-linejoin="round"></path> <line x1="4.5" y1="1.5" x2="4.5" y2="14.5" fill="none" stroke="#111111" stroke-linecap="round" stroke-linejoin="round"></line></g></svg>
|
assets/icons/admin/checkbox-alternate.svg
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><g class="nc-icon-wrapper" stroke-width="1" fill="#111111" stroke="#111111"><polyline data-color="color-2" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" points=" 4.5,6.5 7.5,9.5 15.5,1.5 "/> <path fill="none" stroke="#111111" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" d="M13.5,7.5v6 c0,0.552-0.448,1-1,1h-11c-0.552,0-1-0.448-1-1v-11c0-0.552,0.448-1,1-1h9"/> </g></svg>
|
assets/icons/admin/checkbox-checked.svg
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 16 16" xml:space="preserve" width="16" height="16"><g class="nc-icon-wrapper" fill="#444444"><polyline data-color="color-2" fill="none" stroke="#444444" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" points="4.5,7.5 7,10 12,5 "></polyline><path fill="none" stroke="#444444" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" d="M14.5,15.5h-13c-0.552,0-1-0.448-1-1v-13c0-0.552,0.448-1,1-1h13c0.552,0,1,0.448,1,1v13C15.5,15.052,15.052,15.5,14.5,15.5z"></path></g></svg>
|
assets/icons/admin/checkbox-empty.svg
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 16 16" xml:space="preserve" width="16" height="16"><g class="nc-icon-wrapper" fill="#444444"><path fill="none" stroke="#444444" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" d="M14.5,15.5h-13c-0.552,0-1-0.448-1-1v-13c0-0.552,0.448-1,1-1h13c0.552,0,1,0.448,1,1v13C15.5,15.052,15.052,15.5,14.5,15.5z"></path></g></svg>
|
assets/icons/admin/checkmark.svg
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><g class="nc-icon-wrapper" stroke-width="1" fill="#111111" stroke="#111111"><polyline points="1 9.5 5.5 14 15 1.5" fill="none" stroke="#111111" stroke-linecap="square"/></g></svg>
|
assets/icons/admin/clock.svg
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><g class="nc-icon-wrapper" stroke-width="1" fill="#111111" stroke="#111111"><circle fill="none" stroke="#111111" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" cx="8.5" cy="8.5" r="7"></circle> <polyline data-color="color-2" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" points=" 5.5,5.5 8.5,8.5 13.5,8.5 "></polyline> <line data-color="color-2" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="8.5" y1="3.5" x2="8.5" y2="4.5"></line> <line data-color="color-2" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="8.5" y1="13.5" x2="8.5" y2="12.5"></line> <line data-color="color-2" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="3.5" y1="8.5" x2="4.5" y2="8.5"></line> </g></svg>
|
assets/icons/admin/close.svg
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><g class="nc-icon-wrapper" stroke-width="1" fill="#111111" stroke="#111111"><line fill="none" stroke="#111111" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="13.5" y1="2.5" x2="2.5" y2="13.5" data-cap="butt"></line> <line fill="none" stroke="#111111" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="2.5" y1="2.5" x2="13.5" y2="13.5" data-cap="butt"></line> </g></svg>
|
assets/icons/admin/drag.svg
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><g class="nc-icon-wrapper" stroke-width="1" fill="#111111" stroke="#111111"><line x1="0.5" y1="5.5" x2="15.5" y2="5.5" fill="none" stroke="#111111" stroke-linecap="round" stroke-linejoin="round"/><line x1="0.5" y1="10.5" x2="15.5" y2="10.5" fill="none" stroke-linecap="round" stroke-linejoin="round" data-color="color-2"/></g></svg>
|
assets/icons/admin/duplicate.svg
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><g class="nc-icon-wrapper" stroke-width="1" fill="#111111" stroke="#111111"><rect x="0.5" y="0.5" width="11" height="11" fill="none" stroke="#111111" stroke-linecap="round" stroke-linejoin="round" data-cap="butt"/> <polyline points="13.5 4.5 15.5 4.5 15.5 15.5 4.5 15.5 4.5 13.5" fill="none" stroke-linecap="round" stroke-linejoin="round" data-cap="butt" data-color="color-2"/></g></svg>
|
assets/icons/admin/eye.svg
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><g class="nc-icon-wrapper" stroke-width="1" fill="#111111" stroke="#111111"><path fill="none" stroke="#111111" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" d="M0.5,8 c0,0,3-5.5,7.5-5.5S15.5,8,15.5,8s-3,5.5-7.5,5.5S0.5,8,0.5,8z"/> <circle data-color="color-2" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" cx="8" cy="8" r="2.5"/> </g></svg>
|
assets/icons/admin/italic.svg
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><g class="nc-icon-wrapper" stroke-width="1" fill="#111111" stroke="#111111"><line x1="6.5" y1="0.5" x2="12.5" y2="0.5" fill="none" stroke="#111111" stroke-linecap="round" stroke-linejoin="round"></line> <line x1="3.5" y1="15.5" x2="9.5" y2="15.5" fill="none" stroke="#111111" stroke-linecap="round" stroke-linejoin="round"></line> <line x1="9.5" y1="0.5" x2="6.5" y2="15.5" fill="none" stroke="#111111" stroke-linecap="round" stroke-linejoin="round"></line></g></svg>
|
assets/icons/admin/link.svg
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><g class="nc-icon-wrapper" stroke-width="1" fill="#111111" stroke="#111111"><path fill="none" stroke="#111111" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" d="M12,9l1.975-2.025 c1.367-1.367,1.367-3.583,0-4.95l0,0c-1.367-1.367-3.583-1.367-4.95,0L7,4" data-cap="butt"></path> <path fill="none" stroke="#111111" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" d="M9,12l-2.025,1.975 c-1.367,1.367-3.583,1.367-4.95,0l0,0c-1.367-1.367-1.367-3.583,0-4.95L4,7" data-cap="butt"></path> <line fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="5" y1="11" x2="11" y2="5" data-cap="butt" data-color="color-2"></line> </g></svg>
|
assets/icons/admin/merge.svg
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><g class="nc-icon-wrapper" stroke-width="1" fill="#111111" stroke="#111111"><line fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="10.5" y1="12.5" x2="13.5" y2="15.5" data-color="color-2"></line> <polyline fill="none" stroke="#111111" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" points="4.5,4.5 8.5,0.5 12.5,4.5 "></polyline> <polyline fill="none" stroke="#111111" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" points="8.5,0.5 8.5,10.5 3.5,15.5 "></polyline></g></svg>
|
assets/icons/admin/pencil.svg
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><g class="nc-icon-wrapper" fill="#111111"><polygon data-color="color-2" fill="none" stroke="#111111" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" points=" 13,0.5 15.5,3 7.5,11 4,12 5,8.5 "></polygon> <line data-color="color-2" fill="none" stroke="#111111" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="11" y1="2.5" x2="13.5" y2="5"></line> <path fill="none" stroke="#111111" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" d="M13.5,9.5v5 c0,0.552-0.448,1-1,1h-11c-0.552,0-1-0.448-1-1v-11c0-0.552,0.448-1,1-1h5"></path> </g></svg>
|
assets/icons/admin/question.svg
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><g class="nc-icon-wrapper" fill="#111111"><circle data-color="color-2" cx="8" cy="13.5" r="1.5"/> <path fill="#111111" d="M8,0C6.309,0,4.792,1.072,4.229,2.667L3.895,3.609L5.78,4.276l0.333-0.943C6.396,2.536,7.154,2,8,2 c1.103,0,2,0.897,2,2c0,0.632-0.245,0.839-0.952,1.347C8.184,5.967,7,6.817,7,9v1h2V9c0-1.157,0.482-1.503,1.214-2.028 C10.968,6.431,12,5.69,12,4C12,1.794,10.206,0,8,0z"/></g></svg>
|
assets/icons/admin/star-empty.svg
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="16px" height="16px" viewBox="0 0 24 24"><g transform="translate(0, 0)"><polygon fill="none" stroke="#343434" stroke-width="2" stroke-linecap="square" stroke-miterlimit="10" points="12,2.6 15,9 21.4,9 16.7,13.9 18.6,21.4 12,17.6 5.4,21.4 7.3,13.9 2.6,9 9,9 " stroke-linejoin="miter"/></g></svg>
|
assets/icons/admin/star-full.svg
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="16px" height="16px" viewBox="0 0 24 24"><g ><path fill="#343434" d="M12.712,1.942l2.969,6.015l6.638,0.965c0.651,0.095,0.911,0.895,0.44,1.354l-4.804,4.682l1.134,6.612c0.111,0.649-0.57,1.143-1.152,0.837L12,19.286l-5.938,3.122C5.48,22.714,4.799,22.219,4.91,21.57l1.134-6.612l-4.804-4.682c-0.471-0.459-0.211-1.26,0.44-1.354l6.638-0.965l2.969-6.015C11.579,1.352,12.421,1.352,12.712,1.942z"/></g></svg>
|
assets/icons/admin/subscript.svg
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><g class="nc-icon-wrapper" stroke-width="1" fill="#111111" stroke="#111111"><polyline points="2.5 4.5 2.5 2.5 12.5 2.5 12.5 4.5" fill="none" stroke="#111111" stroke-linecap="round" stroke-linejoin="round"></polyline> <line x1="7.5" y1="2.5" x2="7.5" y2="13.5" fill="none" stroke="#111111" stroke-linecap="round" stroke-linejoin="round"></line> <line x1="5.5" y1="13.5" x2="9.5" y2="13.5" fill="none" stroke="#111111" stroke-linecap="round" stroke-linejoin="round"></line> <path d="M15,15.324H11.907v-.758l1.04-1.053q.447-.465.584-.636a1.437,1.437,0,0,0,.191-.293.65.65,0,0,0,.053-.257.335.335,0,0,0-.107-.262.444.444,0,0,0-.3-.1.82.82,0,0,0-.406.115,2.935,2.935,0,0,0-.465.34l-.633-.741a3.454,3.454,0,0,1,.554-.421,1.972,1.972,0,0,1,.488-.193A2.354,2.354,0,0,1,13.5,11a1.8,1.8,0,0,1,.739.146,1.155,1.155,0,0,1,.5.416,1.063,1.063,0,0,1,.179.6,1.572,1.572,0,0,1-.256.883,2.943,2.943,0,0,1-.349.433q-.218.226-.925.863v.029H15Z" data-cap="butt" data-color="color-2" data-stroke="none" stroke="none"></path></g></svg>
|
assets/icons/admin/superscript.svg
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><g class="nc-icon-wrapper" stroke-width="1" fill="#111111" stroke="#111111"><polyline points="0.5 4.5 0.5 2.5 10.5 2.5 10.5 4.5" fill="none" stroke="#111111" stroke-linecap="round" stroke-linejoin="round"></polyline> <line x1="5.5" y1="2.5" x2="5.5" y2="13.5" fill="none" stroke="#111111" stroke-linecap="round" stroke-linejoin="round"></line> <line x1="3.5" y1="13.5" x2="7.5" y2="13.5" fill="none" stroke="#111111" stroke-linecap="round" stroke-linejoin="round"></line> <path d="M16,4.324H12.907V3.566l1.04-1.053q.447-.465.584-.636a1.437,1.437,0,0,0,.191-.293.65.65,0,0,0,.053-.257.335.335,0,0,0-.107-.262.444.444,0,0,0-.3-.1.82.82,0,0,0-.406.115,2.935,2.935,0,0,0-.465.34L12.86.682a3.454,3.454,0,0,1,.554-.421A1.972,1.972,0,0,1,13.9.068,2.354,2.354,0,0,1,14.5,0a1.8,1.8,0,0,1,.739.146,1.155,1.155,0,0,1,.5.416,1.063,1.063,0,0,1,.179.6,1.627,1.627,0,0,1-.063.464,1.64,1.64,0,0,1-.193.419,2.943,2.943,0,0,1-.349.433q-.218.226-.925.863v.029H16Z" data-cap="butt" data-color="color-2" data-stroke="none" stroke="none"></path></g></svg>
|
assets/icons/admin/trash.svg
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><g class="nc-icon-wrapper" stroke-width="1" fill="#111111" stroke="#111111"><path fill="none" stroke="#111111" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" d="M2.5,6.5v7 c0,1.105,0.895,2,2,2h8c1.105,0,2-0.895,2-2v-7"/> <line data-color="color-2" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="1.5" y1="3.5" x2="15.5" y2="3.5"/> <polyline data-color="color-2" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" points=" 6.5,3.5 6.5,0.5 10.5,0.5 10.5,3.5 "/> <line fill="none" stroke="#111111" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="8.5" y1="7.5" x2="8.5" y2="12.5"/> <line fill="none" stroke="#111111" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="11.5" y1="7.5" x2="11.5" y2="12.5"/> <line fill="none" stroke="#111111" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="5.5" y1="7.5" x2="5.5" y2="12.5"/> </g></svg>
|
assets/icons/admin/underline.svg
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><g class="nc-icon-wrapper" stroke-width="1" fill="#111111" stroke="#111111"><line x1="0.5" y1="15.5" x2="15.5" y2="15.5" fill="none" stroke-linecap="round" stroke-linejoin="round" data-color="color-2"></line> <path d="M12.5,1.5V8A4.5,4.5,0,0,1,8,12.5H8A4.5,4.5,0,0,1,3.5,8V1.5" fill="none" stroke="#111111" stroke-linecap="round" stroke-linejoin="round"></path> <line x1="1.5" y1="1.5" x2="5.5" y2="1.5" fill="none" stroke="#111111" stroke-linecap="round" stroke-linejoin="round"></line> <line x1="10.5" y1="1.5" x2="14.5" y2="1.5" fill="none" stroke="#111111" stroke-linecap="round" stroke-linejoin="round"></line></g></svg>
|
assets/icons/admin/unlink.svg
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><g class="nc-icon-wrapper" stroke-width="1" fill="#111111" stroke="#111111"><path fill="none" stroke="#111111" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" d="M12,9l1.975-2.025 c1.367-1.367,1.367-3.583,0-4.95l0,0c-1.367-1.367-3.583-1.367-4.95,0L7,4" data-cap="butt"></path> <path fill="none" stroke="#111111" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" d="M9,12l-2.025,1.975 c-1.367,1.367-3.583,1.367-4.95,0l0,0c-1.367-1.367-1.367-3.583,0-4.95L4,7" data-cap="butt"></path> <line fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="5" y1="11" x2="11" y2="5" data-cap="butt" data-color="color-2"></line> <line fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="1.5" y1="1.5" x2="4" y2="4" data-cap="butt" data-color="color-2"></line> <line fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="12" y1="12" x2="14.5" y2="14.5" data-cap="butt" data-color="color-2"></line> </g></svg>
|
assets/images/faq/classic-editor.png
ADDED
Binary file
|
assets/images/faq/gutenberg.png
ADDED
Binary file
|
assets/images/faq/recipe-placeholder.png
DELETED
Binary file
|
assets/images/faq/wp-recipe-maker-button.png
DELETED
Binary file
|
assets/js/admin-manage.js
CHANGED
@@ -1,9 +1,17 @@
|
|
1 |
if (!global._babelPolyfill) { require('babel-polyfill'); }
|
2 |
import ReactDOM from 'react-dom';
|
3 |
import React from 'react';
|
|
|
|
|
4 |
import App from './admin-manage/App';
|
5 |
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
|
|
|
|
|
|
|
|
|
|
|
1 |
if (!global._babelPolyfill) { require('babel-polyfill'); }
|
2 |
import ReactDOM from 'react-dom';
|
3 |
import React from 'react';
|
4 |
+
import { HashRouter } from 'react-router-dom';
|
5 |
+
|
6 |
import App from './admin-manage/App';
|
7 |
|
8 |
+
let appContainer = document.getElementById( 'wprm-admin-manage' );
|
9 |
+
|
10 |
+
if (appContainer) {
|
11 |
+
ReactDOM.render(
|
12 |
+
<HashRouter>
|
13 |
+
<App/>
|
14 |
+
</HashRouter>,
|
15 |
+
appContainer
|
16 |
+
);
|
17 |
+
}
|
assets/js/admin-manage/App.js
CHANGED
@@ -1,90 +1,34 @@
|
|
1 |
-
import React, { Component } from 'react';
|
2 |
-
import
|
3 |
-
import 'react-table/react-table.css'
|
4 |
|
5 |
-
import
|
6 |
-
import
|
7 |
-
import
|
8 |
-
import '../../css/admin/manage.scss';
|
9 |
|
10 |
-
|
11 |
-
|
12 |
-
constructor(props) {
|
13 |
-
super(props);
|
14 |
-
|
15 |
-
this.state = {
|
16 |
-
data: [],
|
17 |
-
pages: null,
|
18 |
-
loading: true,
|
19 |
-
columns: Columns.getColumns( this.refreshData.bind(this) ),
|
20 |
-
selectedColumns: ['id', 'name', 'parent_post_id', 'actions'],
|
21 |
-
}
|
22 |
-
}
|
23 |
-
|
24 |
-
refreshData() {
|
25 |
-
this.refReactTable.fireFetchData();
|
26 |
-
}
|
27 |
-
|
28 |
-
fetchData(state, instance) {
|
29 |
-
this.setState({ loading: true });
|
30 |
-
|
31 |
-
Api.getRecipes({
|
32 |
-
pageSize: state.pageSize,
|
33 |
-
page: state.page,
|
34 |
-
sorted: state.sorted,
|
35 |
-
filtered: state.filtered,
|
36 |
-
}).then(data => {
|
37 |
-
console.log(data.recipes);
|
38 |
-
this.setState({
|
39 |
-
data: data.recipes,
|
40 |
-
pages: data.pages,
|
41 |
-
loading: false
|
42 |
-
});
|
43 |
-
});
|
44 |
-
}
|
45 |
-
|
46 |
-
onColumnsChange(id, checked) {
|
47 |
-
let selectedColumns = this.state.selectedColumns;
|
48 |
-
|
49 |
-
if (checked) {
|
50 |
-
selectedColumns.push(id);
|
51 |
-
} else {
|
52 |
-
selectedColumns = selectedColumns.filter(c => c !== id);
|
53 |
-
}
|
54 |
-
|
55 |
-
this.setState({
|
56 |
-
selectedColumns
|
57 |
-
});
|
58 |
-
}
|
59 |
|
|
|
60 |
render() {
|
61 |
-
const { data, pages, loading } = this.state;
|
62 |
-
const selectedColumns = this.state.columns.filter(column => 'actions' === column.id || this.state.selectedColumns.includes(column.id));
|
63 |
-
|
64 |
return (
|
65 |
-
<
|
66 |
-
<
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
}]}
|
84 |
-
filterable
|
85 |
-
className="-striped"
|
86 |
-
/>
|
87 |
-
</div>
|
88 |
);
|
89 |
}
|
90 |
}
|
1 |
+
import React, { Component, Fragment } from 'react';
|
2 |
+
import { Route } from 'react-router-dom';
|
|
|
3 |
|
4 |
+
import Menu from './Menu';
|
5 |
+
import Notices from './Notices';
|
6 |
+
import DataTable from './DataTable';
|
|
|
7 |
|
8 |
+
import '../../css/admin/manage/app.scss';
|
9 |
+
import datatables from './DataTableConfig';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
|
11 |
+
export default class App extends Component {
|
12 |
render() {
|
|
|
|
|
|
|
13 |
return (
|
14 |
+
<Fragment>
|
15 |
+
<div id="wprm-admin-manage-header">
|
16 |
+
<Menu />
|
17 |
+
<Notices />
|
18 |
+
</div>
|
19 |
+
<div id="wprm-admin-manage-content">
|
20 |
+
<Route path="/:type?" render={( {match} ) => {
|
21 |
+
let type = 'recipe';
|
22 |
+
if ( match.params.type && Object.keys(datatables).includes( match.params.type ) ) {
|
23 |
+
type = match.params.type;
|
24 |
+
}
|
25 |
+
|
26 |
+
return (
|
27 |
+
<DataTable type={ type } />
|
28 |
+
)
|
29 |
+
}} />
|
30 |
+
</div>
|
31 |
+
</Fragment>
|
|
|
|
|
|
|
|
|
|
|
32 |
);
|
33 |
}
|
34 |
}
|
assets/js/admin-manage/Columns.js
DELETED
@@ -1,170 +0,0 @@
|
|
1 |
-
import React from 'react';
|
2 |
-
import Icon from './general/Icon';
|
3 |
-
import Api from './general/Api';
|
4 |
-
|
5 |
-
export default {
|
6 |
-
getColumns(refreshData) {
|
7 |
-
let columns = [{
|
8 |
-
Header: 'ID',
|
9 |
-
id: 'id',
|
10 |
-
accessor: 'id',
|
11 |
-
style: { textAlign: 'center' },
|
12 |
-
maxWidth: 65,
|
13 |
-
},{
|
14 |
-
Header: 'Name',
|
15 |
-
id: 'name',
|
16 |
-
accessor: 'name',
|
17 |
-
},{
|
18 |
-
Header: 'Parent Post',
|
19 |
-
id: 'parent_post_id',
|
20 |
-
accessor: 'parent_post_id',
|
21 |
-
sortable: false,
|
22 |
-
Filter: ({ filter, onChange }) => (
|
23 |
-
<select
|
24 |
-
onChange={event => onChange(event.target.value)}
|
25 |
-
style={{ width: '100%', fontSize: '1em' }}
|
26 |
-
value={filter ? filter.value : 'all'}
|
27 |
-
>
|
28 |
-
<option value="all">Show All</option>
|
29 |
-
<option value="yes">Has Parent Post</option>
|
30 |
-
<option value="no">Does not have Parent Post</option>
|
31 |
-
</select>
|
32 |
-
),
|
33 |
-
Cell: row => {
|
34 |
-
let parent_post = row.original.parent_post;
|
35 |
-
|
36 |
-
if ( ! parent_post ) {
|
37 |
-
return (<div></div>);
|
38 |
-
} else {
|
39 |
-
return (
|
40 |
-
<div>{row.original.parent_post.ID} - {row.original.parent_post.post_title}</div>
|
41 |
-
)
|
42 |
-
}
|
43 |
-
},
|
44 |
-
}];
|
45 |
-
|
46 |
-
// Taxonomies.
|
47 |
-
// TODO Prefilter when coming from taxonomy manage tag.
|
48 |
-
for (let key in wprm_admin_manage.taxonomies) {
|
49 |
-
const name = wprm_admin_manage.taxonomies[key].name;
|
50 |
-
const tag = key.substr(5);
|
51 |
-
|
52 |
-
let terms = Object.entries(wprm_admin_manage.terms[key]).map(e => { return {id: e[0], label: e[1] } } );
|
53 |
-
terms.sort((a,b) => a.label.localeCompare(b.label));
|
54 |
-
|
55 |
-
columns.push({
|
56 |
-
Header: name,
|
57 |
-
id: tag,
|
58 |
-
accessor: d => d.tags[tag],
|
59 |
-
sortable: false,
|
60 |
-
Filter: ({ filter, onChange }) => (
|
61 |
-
<select
|
62 |
-
onChange={event => onChange(event.target.value)}
|
63 |
-
style={{ width: '100%', fontSize: '1em' }}
|
64 |
-
value={filter ? filter.value : 'all'}
|
65 |
-
>
|
66 |
-
<option value="all">All {name}</option>
|
67 |
-
<option value="none">No {name}</option>
|
68 |
-
{
|
69 |
-
terms.map((term, index) => (
|
70 |
-
<option value={term.id} key={index}>{ term.label }</option>
|
71 |
-
))
|
72 |
-
}
|
73 |
-
</select>
|
74 |
-
),
|
75 |
-
Cell: row => {
|
76 |
-
const names = row.value.map(t => t.name);
|
77 |
-
|
78 |
-
if ( 'ingredient' === tag ) {
|
79 |
-
return (
|
80 |
-
<div>
|
81 |
-
{
|
82 |
-
row.original.ingredients.map( (group, index) => (
|
83 |
-
<div key={index}>
|
84 |
-
{ group.name && <div style={{ fontWeight: 'bold' }}>{ group.name }</div> }
|
85 |
-
{
|
86 |
-
group.ingredients.map( (ingredient, ingredient_index) => {
|
87 |
-
let fields = [];
|
88 |
-
|
89 |
-
if ( ingredient.amount ) { fields.push( ingredient.amount ); }
|
90 |
-
if ( ingredient.unit ) { fields.push( ingredient.unit ); }
|
91 |
-
if ( ingredient.name ) { fields.push( ingredient.name ); }
|
92 |
-
if ( ingredient.notes ) { fields.push( ingredient.notes ); }
|
93 |
-
|
94 |
-
if ( fields.length ) {
|
95 |
-
return (
|
96 |
-
<div key={ingredient_index}>{ fields.join( ' ' ) }</div>
|
97 |
-
)
|
98 |
-
}
|
99 |
-
})
|
100 |
-
}
|
101 |
-
</div>
|
102 |
-
))
|
103 |
-
}
|
104 |
-
</div>
|
105 |
-
)
|
106 |
-
} else {
|
107 |
-
return (
|
108 |
-
<div>{ names.join(', ') }</div>
|
109 |
-
)
|
110 |
-
}
|
111 |
-
},
|
112 |
-
});
|
113 |
-
}
|
114 |
-
|
115 |
-
columns.push({
|
116 |
-
Header: 'Nutrition',
|
117 |
-
id: 'nutrition',
|
118 |
-
accessor: 'nutrition',
|
119 |
-
sortable: false,
|
120 |
-
filterable: false,
|
121 |
-
Cell: row => (
|
122 |
-
<div>
|
123 |
-
{
|
124 |
-
Object.keys(row.value).map((nutrition, index) => {
|
125 |
-
const value = row.value[nutrition];
|
126 |
-
|
127 |
-
if ( false !== value ) {
|
128 |
-
return (
|
129 |
-
<div
|
130 |
-
className="wprm-manage-recipes-recipe-nutrition"
|
131 |
-
key={index}
|
132 |
-
>{`${nutrition}: ${value}`}</div>
|
133 |
-
)
|
134 |
-
}
|
135 |
-
})
|
136 |
-
}
|
137 |
-
</div>
|
138 |
-
),
|
139 |
-
},{
|
140 |
-
Header: '',
|
141 |
-
id: 'actions',
|
142 |
-
sortable: false,
|
143 |
-
filterable: false,
|
144 |
-
maxWidth: 50,
|
145 |
-
Cell: row => (
|
146 |
-
<div className="wprm-manage-recipes-recipe-actions">
|
147 |
-
<Icon
|
148 |
-
type="edit"
|
149 |
-
onClick={() => {
|
150 |
-
WPRecipeMaker.admin.Modal.open(false, {
|
151 |
-
recipe_id: row.original.id,
|
152 |
-
callback: () => refreshData(),
|
153 |
-
});
|
154 |
-
}}
|
155 |
-
/>
|
156 |
-
<Icon
|
157 |
-
type="delete"
|
158 |
-
onClick={() => {
|
159 |
-
if(confirm(`Are you sure you want to delete the "${row.original.name}" recipe?`)) {
|
160 |
-
Api.deleteRecipe(row.original.id).then(() => refreshData());
|
161 |
-
}
|
162 |
-
}}
|
163 |
-
/>
|
164 |
-
</div>
|
165 |
-
),
|
166 |
-
});
|
167 |
-
|
168 |
-
return columns;
|
169 |
-
}
|
170 |
-
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/admin-manage/DataTable.js
ADDED
@@ -0,0 +1,263 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import React, { Component } from 'react';
|
2 |
+
import ReactTable from 'react-table';
|
3 |
+
import 'react-table/react-table.css';
|
4 |
+
|
5 |
+
import '../../css/admin/manage/table.scss';
|
6 |
+
|
7 |
+
import { __wprm } from '../shared/Translations';
|
8 |
+
import SelectColumns from './general/SelectColumns';
|
9 |
+
import Api from './general/Api';
|
10 |
+
import Totals from './general/Totals';
|
11 |
+
|
12 |
+
import datatables from './DataTableConfig';
|
13 |
+
|
14 |
+
const initState = {
|
15 |
+
data: [],
|
16 |
+
pages: null,
|
17 |
+
filtered: [],
|
18 |
+
countFiltered: false,
|
19 |
+
countTotal: false,
|
20 |
+
loading: true,
|
21 |
+
columns: [],
|
22 |
+
selectedColumns: false,
|
23 |
+
selectedRows: {},
|
24 |
+
selectedAllRows: 0,
|
25 |
+
};
|
26 |
+
|
27 |
+
export default class DataTable extends Component {
|
28 |
+
constructor(props) {
|
29 |
+
super(props);
|
30 |
+
|
31 |
+
this.state = {
|
32 |
+
...initState,
|
33 |
+
};
|
34 |
+
|
35 |
+
this.initDataTable = this.initDataTable.bind(this);
|
36 |
+
this.refreshData = this.refreshData.bind(this);
|
37 |
+
this.fetchData = this.fetchData.bind(this);
|
38 |
+
this.toggleSelectRow = this.toggleSelectRow.bind(this);
|
39 |
+
this.toggleSelectAll = this.toggleSelectAll.bind(this);
|
40 |
+
this.getSelectedRows = this.getSelectedRows.bind(this);
|
41 |
+
this.onColumnsChange = this.onColumnsChange.bind(this);
|
42 |
+
}
|
43 |
+
|
44 |
+
componentDidMount() {
|
45 |
+
this.initDataTable();
|
46 |
+
}
|
47 |
+
|
48 |
+
componentDidUpdate( prevProps ) {
|
49 |
+
if ( this.props.type !== prevProps.type ) {
|
50 |
+
this.initDataTable( true );
|
51 |
+
}
|
52 |
+
}
|
53 |
+
|
54 |
+
initDataTable( forceRefresh = false ) {
|
55 |
+
this.options = datatables[ this.props.type ];
|
56 |
+
|
57 |
+
// Use default selectedColumns or restore from LocalStorage.
|
58 |
+
let selectedColumns = this.options.selectedColumns;
|
59 |
+
|
60 |
+
if ( false !== selectedColumns ) {
|
61 |
+
let savedSelectedColumns = localStorage.getItem( `wprm-admin-manage-${ this.options.id }-columns` );
|
62 |
+
|
63 |
+
if ( savedSelectedColumns ) {
|
64 |
+
savedSelectedColumns = JSON.parse(savedSelectedColumns);
|
65 |
+
|
66 |
+
if (Array.isArray(savedSelectedColumns)) {
|
67 |
+
selectedColumns = savedSelectedColumns;
|
68 |
+
}
|
69 |
+
}
|
70 |
+
}
|
71 |
+
|
72 |
+
this.setState({
|
73 |
+
...initState,
|
74 |
+
columns: this.options.columns.getColumns( this ),
|
75 |
+
selectedColumns: selectedColumns,
|
76 |
+
}, () => {
|
77 |
+
if ( forceRefresh ) {
|
78 |
+
this.refreshData();
|
79 |
+
}
|
80 |
+
});
|
81 |
+
}
|
82 |
+
|
83 |
+
toggleSelectRow(id) {
|
84 |
+
let newSelected = { ...this.state.selectedRows };
|
85 |
+
|
86 |
+
newSelected[id] = !newSelected[id];
|
87 |
+
|
88 |
+
const nbrSelected = Object.values(newSelected).filter(value => value).length;
|
89 |
+
let selectedAllRows = 2;
|
90 |
+
|
91 |
+
if ( 0 === nbrSelected ) {
|
92 |
+
selectedAllRows = 0;
|
93 |
+
} else if ( this.state.data.length === nbrSelected ) {
|
94 |
+
selectedAllRows = 1;
|
95 |
+
}
|
96 |
+
|
97 |
+
this.setState({
|
98 |
+
selectedRows: newSelected,
|
99 |
+
selectedAllRows,
|
100 |
+
});
|
101 |
+
}
|
102 |
+
|
103 |
+
toggleSelectAll() {
|
104 |
+
const bulkEditKey = 'taxonomy' === this.options.route ? 'term_id' : 'id';
|
105 |
+
let newSelected = {};
|
106 |
+
|
107 |
+
if ( 0 === this.state.selectedAllRows ) {
|
108 |
+
for ( let row of this.state.data ) {
|
109 |
+
newSelected[ row[ bulkEditKey ] ] = true;
|
110 |
+
}
|
111 |
+
}
|
112 |
+
|
113 |
+
this.setState({
|
114 |
+
selectedRows: newSelected,
|
115 |
+
selectedAllRows: 0 === this.state.selectedAllRows ? 1 : 0,
|
116 |
+
});
|
117 |
+
}
|
118 |
+
|
119 |
+
getSelectedRows() {
|
120 |
+
return Object.keys(this.state.selectedRows).filter(id => this.state.selectedRows[id]).map(id => parseInt(id));
|
121 |
+
}
|
122 |
+
|
123 |
+
refreshData() {
|
124 |
+
this.refReactTable.fireFetchData();
|
125 |
+
}
|
126 |
+
|
127 |
+
fetchData(state, instance) {
|
128 |
+
const currentData = state.data;
|
129 |
+
|
130 |
+
this.setState({
|
131 |
+
loading: true,
|
132 |
+
}, () => {
|
133 |
+
Api.getData({
|
134 |
+
route: this.options.route,
|
135 |
+
type: this.options.id,
|
136 |
+
pageSize: state.pageSize,
|
137 |
+
page: state.page,
|
138 |
+
sorted: state.sorted,
|
139 |
+
filtered: state.filtered,
|
140 |
+
}).then(data => {
|
141 |
+
if ( data ) {
|
142 |
+
let newState = {
|
143 |
+
data: data.rows,
|
144 |
+
pages: data.pages,
|
145 |
+
countFiltered: data.filtered,
|
146 |
+
countTotal: data.total,
|
147 |
+
loading: false,
|
148 |
+
};
|
149 |
+
|
150 |
+
const bulkEditKey = 'taxonomy' === this.options.route ? 'term_id' : 'id';
|
151 |
+
if ( JSON.stringify( data.rows.map( row => row[ bulkEditKey ] ) ) !== JSON.stringify( currentData.map( row => row[ bulkEditKey ] ) ) ) {
|
152 |
+
newState.selectedRows = {};
|
153 |
+
newState.selectedAllRows = 0;
|
154 |
+
}
|
155 |
+
|
156 |
+
this.setState(newState);
|
157 |
+
}
|
158 |
+
});
|
159 |
+
});
|
160 |
+
}
|
161 |
+
|
162 |
+
onColumnsChange(id, checked) {
|
163 |
+
let selectedColumns = [ ...this.state.selectedColumns ];
|
164 |
+
|
165 |
+
if (checked) {
|
166 |
+
selectedColumns.push(id);
|
167 |
+
} else {
|
168 |
+
selectedColumns = selectedColumns.filter(c => c !== id);
|
169 |
+
}
|
170 |
+
|
171 |
+
this.setState({
|
172 |
+
selectedColumns
|
173 |
+
});
|
174 |
+
|
175 |
+
localStorage.setItem( `wprm-admin-manage-${ this.options.id }-columns`, JSON.stringify( selectedColumns ) );
|
176 |
+
}
|
177 |
+
|
178 |
+
render() {
|
179 |
+
if ( ! this.options ) {
|
180 |
+
return null;
|
181 |
+
}
|
182 |
+
|
183 |
+
const { data, pages, loading } = this.state;
|
184 |
+
const selectedColumns = this.state.columns.filter(column => 'actions' === column.id || false === this.state.selectedColumns || this.state.selectedColumns.includes(column.id));
|
185 |
+
const filteredColumns = this.state.filtered.filter( filter => '' !== filter.value && 'all' !== filter.value ).map( filter => filter.id );
|
186 |
+
|
187 |
+
return (
|
188 |
+
<div className="wprm-admin-manage-page">
|
189 |
+
<div className="wprm-admin-manage-header">
|
190 |
+
{
|
191 |
+
false === this.state.selectedColumns
|
192 |
+
?
|
193 |
+
<div></div>
|
194 |
+
:
|
195 |
+
<SelectColumns
|
196 |
+
onColumnsChange={this.onColumnsChange}
|
197 |
+
columns={this.state.columns}
|
198 |
+
selectedColumns={this.state.selectedColumns}
|
199 |
+
filteredColumns={filteredColumns}
|
200 |
+
/>
|
201 |
+
}
|
202 |
+
<div className="wprm-admin-manage-header-buttons">
|
203 |
+
{
|
204 |
+
( false === this.state.selectedColumns || this.state.selectedColumns.includes( 'bulk_edit' ) )
|
205 |
+
&& this.options.bulkEdit
|
206 |
+
&& <button
|
207 |
+
className="button"
|
208 |
+
onClick={ () => {
|
209 |
+
WPRM_Modal.open( 'bulk-edit', {
|
210 |
+
route: this.options.bulkEdit.route,
|
211 |
+
type: this.options.bulkEdit.type,
|
212 |
+
ids: this.getSelectedRows(),
|
213 |
+
saveCallback: () => this.refreshData(),
|
214 |
+
} );
|
215 |
+
}}
|
216 |
+
disabled={ 0 === this.getSelectedRows().length }
|
217 |
+
>{ __wprm( 'Bulk Edit' ) } { this.getSelectedRows().length } { 1 === this.getSelectedRows().length ? this.options.label.singular : this.options.label.plural }...</button>
|
218 |
+
}
|
219 |
+
{
|
220 |
+
this.options.createButton
|
221 |
+
?
|
222 |
+
<button
|
223 |
+
className="button button-primary"
|
224 |
+
onClick={ () => this.options.createButton( this ) }
|
225 |
+
>{ `${__wprm( 'Create' )} ${ this.options.label.singular }` }</button>
|
226 |
+
:
|
227 |
+
null
|
228 |
+
}
|
229 |
+
</div>
|
230 |
+
</div>
|
231 |
+
<div className="wprm-admin-manage-table-container">
|
232 |
+
<Totals
|
233 |
+
filtered={this.state.countFiltered}
|
234 |
+
total={this.state.countTotal}
|
235 |
+
/>
|
236 |
+
<div className="wprm-admin-manage-table-inner">
|
237 |
+
<ReactTable
|
238 |
+
ref={(refReactTable) => {this.refReactTable = refReactTable;}}
|
239 |
+
manual
|
240 |
+
columns={selectedColumns}
|
241 |
+
data={data}
|
242 |
+
pages={pages}
|
243 |
+
filtered={this.state.filtered}
|
244 |
+
onFilteredChange={ filtered => {
|
245 |
+
this.setState( { filtered } );
|
246 |
+
} }
|
247 |
+
loading={ loading }
|
248 |
+
onFetchData={this.fetchData}
|
249 |
+
defaultPageSize={25}
|
250 |
+
defaultSorted={[{
|
251 |
+
id: 'rating' === this.props.type ? 'date' : 'id',
|
252 |
+
desc: true
|
253 |
+
}]}
|
254 |
+
filterable
|
255 |
+
resizable={false}
|
256 |
+
className="wprm-admin-manage-table wprm-admin-table -highlight"
|
257 |
+
/>
|
258 |
+
</div>
|
259 |
+
</div>
|
260 |
+
</div>
|
261 |
+
);
|
262 |
+
}
|
263 |
+
}
|
assets/js/admin-manage/DataTableConfig.js
ADDED
@@ -0,0 +1,200 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { __wprm } from '../shared/Translations';
|
2 |
+
|
3 |
+
import Api from './general/Api';
|
4 |
+
import ColumnsCollections from './collections/Columns';
|
5 |
+
import ColumnsNutrition from './nutrition/Columns';
|
6 |
+
import ColumnsRatings from './ratings/Columns';
|
7 |
+
import ColumnsRecipe from './recipes/Columns';
|
8 |
+
import ColumnsRecipeSubmission from './recipe-submission/Columns';
|
9 |
+
import ColumnsRevision from './revisions/Columns';
|
10 |
+
import ColumnsTaxonomies from './taxonomies/Columns';
|
11 |
+
import ColumnsCustomTaxonomies from './custom-taxonomies/Columns';
|
12 |
+
|
13 |
+
let datatables = {
|
14 |
+
'recipe': {
|
15 |
+
id: 'recipe',
|
16 |
+
route: 'recipe',
|
17 |
+
label: {
|
18 |
+
singular: __wprm( 'Recipe' ),
|
19 |
+
plural: __wprm( 'Recipes' ),
|
20 |
+
},
|
21 |
+
bulkEdit: {
|
22 |
+
route: 'recipe',
|
23 |
+
type: 'recipe',
|
24 |
+
},
|
25 |
+
createButton: (datatable) => {
|
26 |
+
WPRM_Modal.open( 'recipe', {
|
27 |
+
saveCallback: () => datatable.refreshData(),
|
28 |
+
} );
|
29 |
+
},
|
30 |
+
selectedColumns: ['seo','id','date','name','parent_post', 'rating'],
|
31 |
+
columns: ColumnsRecipe,
|
32 |
+
}
|
33 |
+
}
|
34 |
+
|
35 |
+
if ( wprm_admin_manage.revisions ) {
|
36 |
+
datatables.revision = {
|
37 |
+
id: 'revision',
|
38 |
+
route: 'revision',
|
39 |
+
label: {
|
40 |
+
singular: __wprm( 'Revision' ),
|
41 |
+
plural: __wprm( 'Revisions' ),
|
42 |
+
},
|
43 |
+
bulkEdit: false,
|
44 |
+
createButton: false,
|
45 |
+
selectedColumns: false,
|
46 |
+
columns: ColumnsRevision,
|
47 |
+
};
|
48 |
+
}
|
49 |
+
|
50 |
+
datatables.ingredient = {
|
51 |
+
id: 'ingredient',
|
52 |
+
route: 'taxonomy',
|
53 |
+
label: {
|
54 |
+
singular: __wprm( 'Ingredient' ),
|
55 |
+
plural: __wprm( 'Ingredients' ),
|
56 |
+
},
|
57 |
+
bulkEdit: {
|
58 |
+
route: 'taxonomy',
|
59 |
+
type: 'ingredient',
|
60 |
+
},
|
61 |
+
createButton: (datatable) => {
|
62 |
+
let name = prompt( __wprm( 'What do you want to be the name of this new ingredient?' ) );
|
63 |
+
if( name && name.trim() ) {
|
64 |
+
Api.createTerm('ingredient', name).then((data) => {
|
65 |
+
if ( ! data ) {
|
66 |
+
alert( __wprm( 'We were not able to create this ingredient. Make sure it does not exist yet.' ) );
|
67 |
+
} else {
|
68 |
+
datatable.refreshData();
|
69 |
+
}
|
70 |
+
});
|
71 |
+
}
|
72 |
+
},
|
73 |
+
selectedColumns: wprm_admin.addons.premium ? ['id','name','count', 'link', 'link_nofollow'] : false,
|
74 |
+
columns: ColumnsTaxonomies,
|
75 |
+
};
|
76 |
+
|
77 |
+
|
78 |
+
datatables.rating = {
|
79 |
+
id: 'rating',
|
80 |
+
route: 'rating',
|
81 |
+
label: {
|
82 |
+
singular: __wprm( 'Rating' ),
|
83 |
+
plural: __wprm( 'Ratings' ),
|
84 |
+
},
|
85 |
+
bulkEdit: {
|
86 |
+
route: 'rating',
|
87 |
+
type: 'rating',
|
88 |
+
},
|
89 |
+
createButton: false,
|
90 |
+
selectedColumns: ['date','rating','type', 'user_id','ip'],
|
91 |
+
columns: ColumnsRatings,
|
92 |
+
}
|
93 |
+
|
94 |
+
// Taxonomies.
|
95 |
+
Object.keys(wprm_admin_manage.taxonomies).map((taxonomy) => {
|
96 |
+
const labels = wprm_admin_manage.taxonomies[ taxonomy ];
|
97 |
+
const id = taxonomy.substr(5);
|
98 |
+
|
99 |
+
datatables[ id ] = {
|
100 |
+
id,
|
101 |
+
route: 'taxonomy',
|
102 |
+
label: {
|
103 |
+
singular: labels.singular_name,
|
104 |
+
plural: labels.name,
|
105 |
+
},
|
106 |
+
bulkEdit: {
|
107 |
+
route: 'taxonomy',
|
108 |
+
type: id,
|
109 |
+
},
|
110 |
+
createButton: (datatable) => {
|
111 |
+
let name = prompt( __wprm( 'What do you want to be the name of this new term?' ) );
|
112 |
+
if( name && name.trim() ) {
|
113 |
+
Api.createTerm(id, name).then((data) => {
|
114 |
+
if ( ! data ) {
|
115 |
+
alert( __( 'We were not able to create this term. Make sure it does not exist yet.' ) );
|
116 |
+
} else {
|
117 |
+
datatable.refreshData();
|
118 |
+
wprm_admin_modal.categories[ id ].terms.push({
|
119 |
+
term_id: data.id,
|
120 |
+
name: data.name,
|
121 |
+
count: 0,
|
122 |
+
});
|
123 |
+
}
|
124 |
+
});
|
125 |
+
}
|
126 |
+
},
|
127 |
+
selectedColumns: false,
|
128 |
+
columns: ColumnsTaxonomies,
|
129 |
+
}
|
130 |
+
});
|
131 |
+
|
132 |
+
if ( wprm_admin.addons.premium ) {
|
133 |
+
datatables.taxonomies = {
|
134 |
+
id: 'taxonomies',
|
135 |
+
route: 'taxonomies',
|
136 |
+
label: {
|
137 |
+
singular: __wprm( 'Custom Taxonomy' ),
|
138 |
+
plural: __wprm( 'Custom Taxonomies' ),
|
139 |
+
},
|
140 |
+
bulkEdit: false,
|
141 |
+
createButton: (datatable) => {
|
142 |
+
WPRM_Modal.open( 'taxonomy', {
|
143 |
+
saveCallback: () => datatable.refreshData(),
|
144 |
+
} );
|
145 |
+
},
|
146 |
+
selectedColumns: false,
|
147 |
+
columns: ColumnsCustomTaxonomies,
|
148 |
+
};
|
149 |
+
}
|
150 |
+
|
151 |
+
if ( wprm_admin.addons.pro ) {
|
152 |
+
datatables.nutrition = {
|
153 |
+
id: 'nutrition_ingredient',
|
154 |
+
route: 'taxonomy',
|
155 |
+
label: {
|
156 |
+
singular: __wprm( 'Custom Nutrition Ingredient' ),
|
157 |
+
plural: __wprm( 'Custom Nutrition' ),
|
158 |
+
},
|
159 |
+
bulkEdit: false,
|
160 |
+
createButton: (datatable) => {
|
161 |
+
WPRM_Modal.open( 'nutrition', {
|
162 |
+
saveCallback: () => datatable.refreshData(),
|
163 |
+
} );
|
164 |
+
},
|
165 |
+
selectedColumns: false,
|
166 |
+
columns: ColumnsNutrition,
|
167 |
+
};
|
168 |
+
}
|
169 |
+
|
170 |
+
if ( wprm_admin.addons.elite ) {
|
171 |
+
datatables.collections = {
|
172 |
+
id: 'collections',
|
173 |
+
route: 'saved-collections',
|
174 |
+
label: {
|
175 |
+
singular: __wprm( 'Saved Collection' ),
|
176 |
+
plural: __wprm( 'Saved Collections' ),
|
177 |
+
},
|
178 |
+
bulkEdit: false,
|
179 |
+
createButton: (datatable) => {
|
180 |
+
window.location = wprm_admin_manage.collections_url;
|
181 |
+
},
|
182 |
+
selectedColumns: false,
|
183 |
+
columns: ColumnsCollections,
|
184 |
+
};
|
185 |
+
|
186 |
+
datatables['recipe-submission'] = {
|
187 |
+
id: 'recipe-submission',
|
188 |
+
route: 'recipe-submission',
|
189 |
+
label: {
|
190 |
+
singular: __wprm( 'Recipe Submissions' ),
|
191 |
+
plural: `${ __wprm( 'Recipe Submissions' ) }${ wprm_admin_manage.recipe_submissions ? ` (${ wprm_admin_manage.recipe_submissions })` : '' }`,
|
192 |
+
},
|
193 |
+
bulkEdit: false,
|
194 |
+
createButton: false,
|
195 |
+
selectedColumns: false,
|
196 |
+
columns: ColumnsRecipeSubmission,
|
197 |
+
};
|
198 |
+
}
|
199 |
+
|
200 |
+
export default datatables;
|
assets/js/admin-manage/Menu.js
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import React, { Component } from 'react';
|
2 |
+
import { NavLink } from 'react-router-dom';
|
3 |
+
|
4 |
+
import datatables from './DataTableConfig';
|
5 |
+
|
6 |
+
export default class Menu extends Component {
|
7 |
+
render() {
|
8 |
+
return (
|
9 |
+
<div className="wprm-admin-manage-menu nav-tab-wrapper">
|
10 |
+
{
|
11 |
+
Object.keys(datatables).map((id, index) => {
|
12 |
+
const datatable = datatables[ id ];
|
13 |
+
const link = 'recipe' === id ? '/' : `/${id}`;
|
14 |
+
|
15 |
+
return (
|
16 |
+
<NavLink to={ link } className="nav-tab" activeClassName="nav-tab-active" key={ index } exact>{ datatable.label.plural }</NavLink>
|
17 |
+
)
|
18 |
+
})
|
19 |
+
}
|
20 |
+
</div>
|
21 |
+
);
|
22 |
+
}
|
23 |
+
}
|
assets/js/admin-manage/Notices.js
ADDED
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import React, { Component } from 'react';
|
2 |
+
|
3 |
+
import '../../css/admin/manage/notices.scss';
|
4 |
+
|
5 |
+
import Api from '../shared/Api';
|
6 |
+
import Icon from '../shared/Icon';
|
7 |
+
import { __wprm } from '../shared/Translations';
|
8 |
+
|
9 |
+
export default class Notices extends Component {
|
10 |
+
render() {
|
11 |
+
if ( ! wprm_admin_modal.notices || ! wprm_admin_modal.notices.length ) {
|
12 |
+
return null;
|
13 |
+
}
|
14 |
+
|
15 |
+
return (
|
16 |
+
<div className="wprm-admin-manage-notices">
|
17 |
+
{
|
18 |
+
wprm_admin_modal.notices.map((notice, index) => {
|
19 |
+
if ( notice.dismissed ) {
|
20 |
+
return null;
|
21 |
+
}
|
22 |
+
|
23 |
+
return (
|
24 |
+
<div className="wprm-admin-notice" key={ index }>
|
25 |
+
<div className="wprm-admin-notice-content">
|
26 |
+
{
|
27 |
+
notice.title
|
28 |
+
?
|
29 |
+
<div className="wprm-admin-notice-title">{ notice.title }</div>
|
30 |
+
:
|
31 |
+
null
|
32 |
+
}
|
33 |
+
<div
|
34 |
+
className="wprm-admin-notice-text"
|
35 |
+
dangerouslySetInnerHTML={ { __html: notice.text } }
|
36 |
+
/>
|
37 |
+
</div>
|
38 |
+
<div className="wprm-admin-notice-dismiss">
|
39 |
+
<Icon
|
40 |
+
title={ __wprm( 'Remove Notice' ) }
|
41 |
+
type="close"
|
42 |
+
onClick={() => {
|
43 |
+
Api.dismissNotice( notice.id );
|
44 |
+
notice.dismissed = true;
|
45 |
+
this.forceUpdate();
|
46 |
+
}}
|
47 |
+
/>
|
48 |
+
</div>
|
49 |
+
</div>
|
50 |
+
)
|
51 |
+
})
|
52 |
+
}
|
53 |
+
</div>
|
54 |
+
);
|
55 |
+
}
|
56 |
+
}
|
assets/js/admin-manage/SelectColumns.js
DELETED
@@ -1,31 +0,0 @@
|
|
1 |
-
import React from 'react';
|
2 |
-
|
3 |
-
const SelectColumns = (props) => {
|
4 |
-
return (
|
5 |
-
<div className="wprm-manage-recipes-select-columns-container">
|
6 |
-
<h4>Show/Hide Columns:</h4>
|
7 |
-
<div className="wprm-manage-recipes-select-columns">
|
8 |
-
{
|
9 |
-
props.columns.map( (column, index) => {
|
10 |
-
if ( 'actions' === column.id ) {
|
11 |
-
return null;
|
12 |
-
}
|
13 |
-
|
14 |
-
return (
|
15 |
-
<span className="wprm-manage-recipes-select-columns-column" key={index}>
|
16 |
-
<input
|
17 |
-
id={`wprm-manage-recipes-select-columns-column-${column.id}`}
|
18 |
-
type="checkbox"
|
19 |
-
checked={ props.selectedColumns.includes(column.id) }
|
20 |
-
onChange={(event) => props.onColumnsChange(column.id, event.target.checked)}
|
21 |
-
/>
|
22 |
-
<label htmlFor={`wprm-manage-recipes-select-columns-column-${column.id}`}>{ column.Header }</label>
|
23 |
-
</span>
|
24 |
-
);
|
25 |
-
})
|
26 |
-
}
|
27 |
-
</div>
|
28 |
-
</div>
|
29 |
-
);
|
30 |
-
}
|
31 |
-
export default SelectColumns;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/admin-manage/collections/Api.js
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
const collectionsEndpoint = wprm_admin.endpoints.collections;
|
2 |
+
|
3 |
+
export default {
|
4 |
+
deleteCollection(id) {
|
5 |
+
return fetch(`${collectionsEndpoint}/${id}`, {
|
6 |
+
method: 'DELETE',
|
7 |
+
headers: {
|
8 |
+
'X-WP-Nonce': wprm_admin.api_nonce,
|
9 |
+
'Accept': 'application/json',
|
10 |
+
'Content-Type': 'application/json',
|
11 |
+
},
|
12 |
+
credentials: 'same-origin',
|
13 |
+
}).then(function (response) {
|
14 |
+
if ( response.ok ) {
|
15 |
+
return response.json();
|
16 |
+
} else {
|
17 |
+
console.log(response);
|
18 |
+
alert( 'Something went wrong. Please contact support.' );
|
19 |
+
return false;
|
20 |
+
}
|
21 |
+
});
|
22 |
+
},
|
23 |
+
};
|
assets/js/admin-manage/collections/Columns.js
ADDED
@@ -0,0 +1,79 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import React from 'react';
|
2 |
+
import he from 'he';
|
3 |
+
|
4 |
+
import TextFilter from '../general/TextFilter';
|
5 |
+
import Api from './Api';
|
6 |
+
import Icon from '../../shared/Icon';
|
7 |
+
import { __wprm } from '../../shared/Translations';
|
8 |
+
|
9 |
+
export default {
|
10 |
+
getColumns( datatable ) {
|
11 |
+
let columns = [{
|
12 |
+
Header: __wprm( 'Sort:' ),
|
13 |
+
id: 'actions',
|
14 |
+
headerClassName: 'wprm-admin-table-help-text',
|
15 |
+
sortable: false,
|
16 |
+
width: 100,
|
17 |
+
Filter: () => (
|
18 |
+
<div>
|
19 |
+
{ __wprm( 'Filter:' ) }
|
20 |
+
</div>
|
21 |
+
),
|
22 |
+
Cell: row => (
|
23 |
+
<div className="wprm-admin-manage-actions">
|
24 |
+
<Icon
|
25 |
+
type="pencil"
|
26 |
+
title={ __wprm( 'Edit Saved Collection' ) }
|
27 |
+
onClick={() => {
|
28 |
+
const url = `${wprm_admin_manage.collections_url}&id=${row.original.id}`;
|
29 |
+
window.location = url;
|
30 |
+
}}
|
31 |
+
/>
|
32 |
+
<Icon
|
33 |
+
type="duplicate"
|
34 |
+
title={ __wprm( 'Duplicate Saved Collection' ) }
|
35 |
+
onClick={() => {
|
36 |
+
const url = `${wprm_admin_manage.collections_url}&action=duplicate&id=${row.original.id}`;
|
37 |
+
window.location = url;
|
38 |
+
}}
|
39 |
+
/>
|
40 |
+
<Icon
|
41 |
+
type="trash"
|
42 |
+
title={ __wprm( 'Delete Saved Collection' ) }
|
43 |
+
onClick={() => {
|
44 |
+
if( confirm( `${ __wprm( 'Are you sure you want to delete' ) } "${row.original.name}"?` ) ) {
|
45 |
+
Api.deleteCollection(row.original.id).then(() => datatable.refreshData());
|
46 |
+
}
|
47 |
+
}}
|
48 |
+
/>
|
49 |
+
</div>
|
50 |
+
),
|
51 |
+
},{
|
52 |
+
Header: __wprm( 'ID' ),
|
53 |
+
id: 'id',
|
54 |
+
accessor: 'id',
|
55 |
+
width: 65,
|
56 |
+
Filter: (props) => (<TextFilter {...props}/>),
|
57 |
+
},{
|
58 |
+
Header: __wprm( 'Date' ),
|
59 |
+
id: 'date',
|
60 |
+
accessor: 'date',
|
61 |
+
width: 150,
|
62 |
+
Filter: (props) => (<TextFilter {...props}/>),
|
63 |
+
},{
|
64 |
+
Header: __wprm( 'Name' ),
|
65 |
+
id: 'name',
|
66 |
+
accessor: 'name',
|
67 |
+
Filter: (props) => (<TextFilter {...props}/>),
|
68 |
+
Cell: row => he.decode(row.value),
|
69 |
+
},{
|
70 |
+
Header: __wprm( '# Items' ),
|
71 |
+
id: 'nbrItems',
|
72 |
+
accessor: 'nbrItems',
|
73 |
+
width: 65,
|
74 |
+
Filter: (props) => (<TextFilter {...props}/>),
|
75 |
+
}];
|
76 |
+
|
77 |
+
return columns;
|
78 |
+
}
|
79 |
+
};
|
assets/js/admin-manage/custom-taxonomies/Columns.js
ADDED
@@ -0,0 +1,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import React from 'react';
|
2 |
+
import he from 'he';
|
3 |
+
|
4 |
+
import Api from '../../admin-modal/taxonomy/Api';
|
5 |
+
import Icon from '../../shared/Icon';
|
6 |
+
import { __wprm } from '../../shared/Translations';
|
7 |
+
|
8 |
+
export default {
|
9 |
+
getColumns( datatable ) {
|
10 |
+
let columns = [{
|
11 |
+
Header: '',
|
12 |
+
id: 'actions',
|
13 |
+
headerClassName: 'wprm-admin-table-help-text',
|
14 |
+
sortable: false,
|
15 |
+
filterable: false,
|
16 |
+
width: 70,
|
17 |
+
Cell: row => (
|
18 |
+
<div className="wprm-admin-manage-actions">
|
19 |
+
<Icon
|
20 |
+
type="pencil"
|
21 |
+
title={ __wprm( 'Edit Taxonomy' ) }
|
22 |
+
onClick={() => {
|
23 |
+
WPRM_Modal.open( 'taxonomy', {
|
24 |
+
taxonomy: row.original,
|
25 |
+
saveCallback: () => datatable.refreshData(),
|
26 |
+
} );
|
27 |
+
}}
|
28 |
+
/>
|
29 |
+
<Icon
|
30 |
+
type="trash"
|
31 |
+
title={ __wprm( 'Delete Taxonomy' ) }
|
32 |
+
onClick={() => {
|
33 |
+
if( confirm( `${ __wprm( 'Are you sure you want to delete' ) } "wprm_${row.original.key}"?` ) ) {
|
34 |
+
Api.deleteCustomTaxonomy(row.original.key).then(() => datatable.refreshData());
|
35 |
+
}
|
36 |
+
}}
|
37 |
+
/>
|
38 |
+
</div>
|
39 |
+
),
|
40 |
+
},{
|
41 |
+
Header: __wprm( 'Key' ),
|
42 |
+
id: 'key',
|
43 |
+
accessor: 'key',
|
44 |
+
sortable: false,
|
45 |
+
filterable: false,
|
46 |
+
Cell: row => (<div>wprm_{ row.value }</div>),
|
47 |
+
},{
|
48 |
+
Header: __wprm( 'Singular Name' ),
|
49 |
+
id: 'singular_name',
|
50 |
+
accessor: 'singular_name',
|
51 |
+
sortable: false,
|
52 |
+
filterable: false,
|
53 |
+
Cell: row => he.decode(row.value),
|
54 |
+
},{
|
55 |
+
Header: __wprm( 'Plural Name' ),
|
56 |
+
id: 'name',
|
57 |
+
accessor: 'name',
|
58 |
+
sortable: false,
|
59 |
+
filterable: false,
|
60 |
+
Cell: row => he.decode(row.value),
|
61 |
+
}];
|
62 |
+
|
63 |
+
return columns;
|
64 |
+
}
|
65 |
+
};
|
assets/js/admin-manage/general/Api.js
CHANGED
@@ -1,10 +1,23 @@
|
|
1 |
-
const recipeEndpoint = wprm_admin.endpoints.recipe;
|
2 |
const manageEndpoint = wprm_admin.endpoints.manage;
|
|
|
|
|
|
|
|
|
|
|
3 |
|
4 |
export default {
|
5 |
-
|
6 |
-
|
7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
method: 'POST',
|
9 |
headers: {
|
10 |
'X-WP-Nonce': wprm_admin.api_nonce,
|
@@ -13,14 +26,80 @@ export default {
|
|
13 |
},
|
14 |
credentials: 'same-origin',
|
15 |
body: JSON.stringify(args),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
}).then(response => {
|
17 |
-
|
18 |
-
return
|
19 |
-
}
|
|
|
|
|
20 |
});
|
21 |
},
|
22 |
-
|
23 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
method: 'DELETE',
|
25 |
headers: {
|
26 |
'X-WP-Nonce': wprm_admin.api_nonce,
|
@@ -29,5 +108,55 @@ export default {
|
|
29 |
},
|
30 |
credentials: 'same-origin',
|
31 |
});
|
32 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
};
|
|
|
1 |
const manageEndpoint = wprm_admin.endpoints.manage;
|
2 |
+
const ratingEndpoint = wprm_admin.endpoints.rating;
|
3 |
+
const taxonomyEndpoint = wprm_admin.endpoints.taxonomy;
|
4 |
+
|
5 |
+
let gettingData = false;
|
6 |
+
let gettingDataNextArgs = false;
|
7 |
|
8 |
export default {
|
9 |
+
getData(args) {
|
10 |
+
if ( ! gettingData ) {
|
11 |
+
return this.getDataDebounced(args);
|
12 |
+
} else {
|
13 |
+
gettingDataNextArgs = args;
|
14 |
+
return new Promise(r => r(false));
|
15 |
+
}
|
16 |
+
},
|
17 |
+
getDataDebounced(args) {
|
18 |
+
gettingData = true;
|
19 |
+
|
20 |
+
return fetch(`${manageEndpoint}/${args.route}`, {
|
21 |
method: 'POST',
|
22 |
headers: {
|
23 |
'X-WP-Nonce': wprm_admin.api_nonce,
|
26 |
},
|
27 |
credentials: 'same-origin',
|
28 |
body: JSON.stringify(args),
|
29 |
+
}).then(function (response) {
|
30 |
+
if ( response.ok ) {
|
31 |
+
return response.json().then(json => {
|
32 |
+
// Check if another request is queued.
|
33 |
+
if ( gettingDataNextArgs ) {
|
34 |
+
const newArgs = gettingDataNextArgs;
|
35 |
+
gettingDataNextArgs = false;
|
36 |
+
|
37 |
+
return this.getDataDebounced(newArgs);
|
38 |
+
} else {
|
39 |
+
// Return this request.
|
40 |
+
gettingData = false;
|
41 |
+
return response.ok ? json : false;
|
42 |
+
}
|
43 |
+
});
|
44 |
+
} else {
|
45 |
+
console.log(response);
|
46 |
+
alert( 'Something went wrong. Please contact support.' );
|
47 |
+
return false;
|
48 |
+
}
|
49 |
+
}.bind(this));
|
50 |
+
},
|
51 |
+
deleteUserRatings(id) {
|
52 |
+
return fetch(`${ratingEndpoint}/recipe/${id}`, {
|
53 |
+
method: 'DELETE',
|
54 |
+
headers: {
|
55 |
+
'X-WP-Nonce': wprm_admin.api_nonce,
|
56 |
+
'Accept': 'application/json',
|
57 |
+
'Content-Type': 'application/json',
|
58 |
+
},
|
59 |
+
credentials: 'same-origin',
|
60 |
+
});
|
61 |
+
},
|
62 |
+
getTerm(type, id) {
|
63 |
+
return fetch(`${taxonomyEndpoint}${type}/${id}`, {
|
64 |
+
method: 'GET',
|
65 |
+
headers: {
|
66 |
+
'X-WP-Nonce': wprm_admin.api_nonce,
|
67 |
+
'Accept': 'application/json',
|
68 |
+
'Content-Type': 'application/json',
|
69 |
+
},
|
70 |
+
credentials: 'same-origin',
|
71 |
}).then(response => {
|
72 |
+
if ( ! response.ok ) {
|
73 |
+
return false;
|
74 |
+
} else {
|
75 |
+
return response.json().then(json => json);
|
76 |
+
}
|
77 |
});
|
78 |
},
|
79 |
+
createTerm(type, name) {
|
80 |
+
const data = {
|
81 |
+
name,
|
82 |
+
};
|
83 |
+
|
84 |
+
return fetch(`${taxonomyEndpoint}${type}`, {
|
85 |
+
method: 'POST',
|
86 |
+
headers: {
|
87 |
+
'X-WP-Nonce': wprm_admin.api_nonce,
|
88 |
+
'Accept': 'application/json',
|
89 |
+
'Content-Type': 'application/json',
|
90 |
+
},
|
91 |
+
credentials: 'same-origin',
|
92 |
+
body: JSON.stringify(data),
|
93 |
+
}).then(response => {
|
94 |
+
if ( ! response.ok ) {
|
95 |
+
return false;
|
96 |
+
} else {
|
97 |
+
return response.json().then(json => json);
|
98 |
+
}
|
99 |
+
});
|
100 |
+
},
|
101 |
+
deleteTerm(type, id) {
|
102 |
+
return fetch(`${taxonomyEndpoint}${type}/${id}?force=true`, {
|
103 |
method: 'DELETE',
|
104 |
headers: {
|
105 |
'X-WP-Nonce': wprm_admin.api_nonce,
|
108 |
},
|
109 |
credentials: 'same-origin',
|
110 |
});
|
111 |
+
},
|
112 |
+
renameTerm(type, id, name) {
|
113 |
+
const data = {
|
114 |
+
name,
|
115 |
+
};
|
116 |
+
|
117 |
+
return fetch(`${taxonomyEndpoint}${type}/${id}`, {
|
118 |
+
method: 'POST',
|
119 |
+
headers: {
|
120 |
+
'X-WP-Nonce': wprm_admin.api_nonce,
|
121 |
+
'Accept': 'application/json',
|
122 |
+
'Content-Type': 'application/json',
|
123 |
+
},
|
124 |
+
credentials: 'same-origin',
|
125 |
+
body: JSON.stringify(data),
|
126 |
+
});
|
127 |
+
},
|
128 |
+
mergeTerm(type, oldId, newId) {
|
129 |
+
const data = {
|
130 |
+
type,
|
131 |
+
oldId,
|
132 |
+
newId,
|
133 |
+
};
|
134 |
+
|
135 |
+
return fetch(`${manageEndpoint}/taxonomy/merge`, {
|
136 |
+
method: 'POST',
|
137 |
+
headers: {
|
138 |
+
'X-WP-Nonce': wprm_admin.api_nonce,
|
139 |
+
'Accept': 'application/json',
|
140 |
+
'Content-Type': 'application/json',
|
141 |
+
},
|
142 |
+
credentials: 'same-origin',
|
143 |
+
body: JSON.stringify(data),
|
144 |
+
});
|
145 |
+
},
|
146 |
+
updateIngredientMeta(id, meta) {
|
147 |
+
const data = {
|
148 |
+
ingredient: meta,
|
149 |
+
};
|
150 |
+
|
151 |
+
return fetch(`${taxonomyEndpoint}ingredient/${id}`, {
|
152 |
+
method: 'POST',
|
153 |
+
headers: {
|
154 |
+
'X-WP-Nonce': wprm_admin.api_nonce,
|
155 |
+
'Accept': 'application/json',
|
156 |
+
'Content-Type': 'application/json',
|
157 |
+
},
|
158 |
+
credentials: 'same-origin',
|
159 |
+
body: JSON.stringify(data),
|
160 |
+
});
|
161 |
+
},
|
162 |
};
|
assets/js/admin-manage/general/Icon.js
DELETED
@@ -1,31 +0,0 @@
|
|
1 |
-
import React from 'react';
|
2 |
-
import SVG from 'react-inlinesvg';
|
3 |
-
|
4 |
-
import IconEdit from '../../../icons/manage/edit.svg';
|
5 |
-
import IconDelete from '../../../icons/manage/delete.svg';
|
6 |
-
|
7 |
-
const icons = {
|
8 |
-
edit: IconEdit,
|
9 |
-
delete: IconDelete,
|
10 |
-
};
|
11 |
-
|
12 |
-
const Icon = (props) => {
|
13 |
-
let icon = icons.hasOwnProperty(props.type) ? icons[props.type] : false;
|
14 |
-
|
15 |
-
if ( !icon ) {
|
16 |
-
return null;
|
17 |
-
}
|
18 |
-
|
19 |
-
return (
|
20 |
-
<span
|
21 |
-
className='wprm-manage-icon'
|
22 |
-
onClick={props.onClick}
|
23 |
-
>
|
24 |
-
<SVG
|
25 |
-
src={icon}
|
26 |
-
|
27 |
-
/>
|
28 |
-
</span>
|
29 |
-
);
|
30 |
-
}
|
31 |
-
export default Icon;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/admin-manage/general/SelectColumns.js
ADDED
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import React from 'react';
|
2 |
+
|
3 |
+
import { __wprm } from '../../shared/Translations';
|
4 |
+
|
5 |
+
import '../../../css/admin/manage/select-columns.scss';
|
6 |
+
|
7 |
+
const SelectColumns = (props) => {
|
8 |
+
return (
|
9 |
+
<div className="wprm-admin-manage-select-columns-container">
|
10 |
+
<div className="wprm-admin-manage-select-columns">
|
11 |
+
{
|
12 |
+
props.columns.map( (column, index) => {
|
13 |
+
if ( 'actions' === column.id ) {
|
14 |
+
return null;
|
15 |
+
}
|
16 |
+
|
17 |
+
const selected = props.selectedColumns.includes(column.id);
|
18 |
+
const filtered = props.filteredColumns.includes(column.id);
|
19 |
+
|
20 |
+
let classNames = ['wprm-admin-manage-select-columns-column'];
|
21 |
+
if ( selected ) { classNames.push( 'wprm-admin-manage-select-columns-column-selected' ) }
|
22 |
+
if ( filtered ) { classNames.push( 'wprm-admin-manage-select-columns-column-filtered' ) }
|
23 |
+
|
24 |
+
return (
|
25 |
+
<span
|
26 |
+
className={ classNames.join( ' ' ) }
|
27 |
+
onClick={(e) => {
|
28 |
+
e.preventDefault();
|
29 |
+
if ( ! filtered ) {
|
30 |
+
props.onColumnsChange( column.id, ! selected );
|
31 |
+
}
|
32 |
+
}}
|
33 |
+
key={index}
|
34 |
+
>{ column.Header }</span>
|
35 |
+
);
|
36 |
+
})
|
37 |
+
}
|
38 |
+
</div>
|
39 |
+
</div>
|
40 |
+
);
|
41 |
+
}
|
42 |
+
export default SelectColumns;
|
assets/js/admin-manage/general/TextFilter.js
ADDED
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import React, { Component } from 'react';
|
2 |
+
|
3 |
+
export default class TextFilter extends Component {
|
4 |
+
constructor(props) {
|
5 |
+
super(props);
|
6 |
+
|
7 |
+
this.debouncedTimer = false;
|
8 |
+
|
9 |
+
let value = '';
|
10 |
+
|
11 |
+
// Check for initial value.
|
12 |
+
if ( props.filter && props.filter.value ) {
|
13 |
+
value = props.filter.value;
|
14 |
+
}
|
15 |
+
|
16 |
+
this.state = {
|
17 |
+
value: value,
|
18 |
+
passedValue: value,
|
19 |
+
};
|
20 |
+
|
21 |
+
this.onChange = this.onChange.bind(this);
|
22 |
+
this.updateFilter = this.updateFilter.bind(this);
|
23 |
+
}
|
24 |
+
|
25 |
+
onChange(value) {
|
26 |
+
// Cancel existing timer.
|
27 |
+
clearTimeout( this.debouncedTimer );
|
28 |
+
|
29 |
+
// Value different? Need to pass along soon.
|
30 |
+
if ( value !== this.state.passedValue ) {
|
31 |
+
this.debouncedTimer = setTimeout(() => {
|
32 |
+
this.updateFilter( value );
|
33 |
+
}, 500);
|
34 |
+
}
|
35 |
+
|
36 |
+
this.setState({
|
37 |
+
value,
|
38 |
+
});
|
39 |
+
}
|
40 |
+
|
41 |
+
updateFilter(value) {
|
42 |
+
this.props.onChange(value);
|
43 |
+
|
44 |
+
this.setState({
|
45 |
+
passedValue: value,
|
46 |
+
});
|
47 |
+
}
|
48 |
+
|
49 |
+
render() {
|
50 |
+
return (
|
51 |
+
<input
|
52 |
+
className="wprm-admin-manage-text-filter"
|
53 |
+
type="text"
|
54 |
+
value={ this.state.value }
|
55 |
+
onChange={ (e) => this.onChange(e.target.value) }
|
56 |
+
/>
|
57 |
+
);
|
58 |
+
}
|
59 |
+
}
|
assets/js/admin-manage/general/Totals.js
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import React, { Fragment } from 'react';
|
2 |
+
|
3 |
+
import { __wprm } from '../../shared/Translations';
|
4 |
+
|
5 |
+
const Totals = (props) => {
|
6 |
+
if ( ! props.filtered && ! props.total ) {
|
7 |
+
return null;
|
8 |
+
}
|
9 |
+
|
10 |
+
const isFiltered = false !== props.filtered && props.filtered != props.total;
|
11 |
+
|
12 |
+
return (
|
13 |
+
<div className="wprm-admin-table-totals">
|
14 |
+
{
|
15 |
+
props.total
|
16 |
+
?
|
17 |
+
<Fragment>
|
18 |
+
{
|
19 |
+
isFiltered
|
20 |
+
?
|
21 |
+
`${ __wprm( 'Showing' ) } ${ Number(props.filtered).toLocaleString() } ${ __wprm( 'filtered of' ) } ${ Number(props.total).toLocaleString() } ${ __wprm( 'total' ) }`
|
22 |
+
:
|
23 |
+
`${ __wprm( 'Showing' ) } ${ Number(props.total).toLocaleString() } ${ __wprm( 'total' ) }`
|
24 |
+
}
|
25 |
+
</Fragment>
|
26 |
+
:
|
27 |
+
`${ Number(props.filtered).toLocaleString() } ${ __wprm( 'rows' ) }`
|
28 |
+
}
|
29 |
+
</div>
|
30 |
+
);
|
31 |
+
}
|
32 |
+
export default Totals;
|
assets/js/admin-manage/general/bulkEditCheckbox.js
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import React from 'react';
|
2 |
+
|
3 |
+
import { __wprm } from '../../shared/Translations';
|
4 |
+
|
5 |
+
const bulkEditCheckbox = ( datatable, key = 'id' ) => ({
|
6 |
+
Header: __wprm( 'Bulk Edit' ),
|
7 |
+
id: 'bulk_edit',
|
8 |
+
className: 'wprm-admin-table-checkbox-container',
|
9 |
+
headerClassName: 'wprm-admin-table-checkbox-container',
|
10 |
+
sortable: false,
|
11 |
+
width: 30,
|
12 |
+
Filter: () => (
|
13 |
+
<input
|
14 |
+
type="checkbox"
|
15 |
+
checked={ 1 === datatable.state.selectedAllRows }
|
16 |
+
ref={ input => {
|
17 |
+
if (input) {
|
18 |
+
input.indeterminate = datatable.state.selectedAllRows === 2;
|
19 |
+
}
|
20 |
+
}}
|
21 |
+
onChange={ () => datatable.toggleSelectAll() }
|
22 |
+
/>
|
23 |
+
),
|
24 |
+
Cell: (row) => (
|
25 |
+
<input
|
26 |
+
type="checkbox"
|
27 |
+
checked={ true === datatable.state.selectedRows[row.original[ key ]] }
|
28 |
+
onChange={ () => datatable.toggleSelectRow(row.original[ key ]) }
|
29 |
+
/>
|
30 |
+
),
|
31 |
+
});
|
32 |
+
|
33 |
+
export default bulkEditCheckbox;
|
assets/js/admin-manage/nutrition/Columns.js
ADDED
@@ -0,0 +1,112 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import React from 'react';
|
2 |
+
import he from 'he';
|
3 |
+
|
4 |
+
import TextFilter from '../general/TextFilter';
|
5 |
+
import Api from '../general/Api';
|
6 |
+
import Icon from '../../shared/Icon';
|
7 |
+
import { __wprm } from '../../shared/Translations';
|
8 |
+
|
9 |
+
import '../../../css/admin/manage/nutrition.scss';
|
10 |
+
|
11 |
+
export default {
|
12 |
+
getColumns( datatable ) {
|
13 |
+
let columns = [{
|
14 |
+
Header: __wprm( 'Sort:' ),
|
15 |
+
id: 'actions',
|
16 |
+
headerClassName: 'wprm-admin-table-help-text',
|
17 |
+
sortable: false,
|
18 |
+
width: 70,
|
19 |
+
Filter: () => (
|
20 |
+
<div>
|
21 |
+
{ __wprm( 'Filter:' ) }
|
22 |
+
</div>
|
23 |
+
),
|
24 |
+
Cell: row => (
|
25 |
+
<div className="wprm-admin-manage-actions">
|
26 |
+
<Icon
|
27 |
+
type="pencil"
|
28 |
+
title={ __wprm( 'Edit Custom Ingredient' ) }
|
29 |
+
onClick={() => {
|
30 |
+
let ingredient = JSON.parse(JSON.stringify(row.original));
|
31 |
+
ingredient.id = ingredient.term_id;
|
32 |
+
|
33 |
+
WPRM_Modal.open( 'nutrition', {
|
34 |
+
ingredient,
|
35 |
+
saveCallback: () => datatable.refreshData(),
|
36 |
+
} );
|
37 |
+
}}
|
38 |
+
/>
|
39 |
+
<Icon
|
40 |
+
type="trash"
|
41 |
+
title={ __wprm( 'Delete Custom Ingredient' ) }
|
42 |
+
onClick={() => {
|
43 |
+
if( confirm( `${ __wprm( 'Are you sure you want to delete' ) } "${row.original.name}"?` ) ) {
|
44 |
+
Api.deleteTerm('nutrition_ingredient', row.original.term_id).then(() => datatable.refreshData());
|
45 |
+
}
|
46 |
+
}}
|
47 |
+
/>
|
48 |
+
</div>
|
49 |
+
),
|
50 |
+
},{
|
51 |
+
Header: __wprm( 'ID' ),
|
52 |
+
id: 'id',
|
53 |
+
accessor: 'term_id',
|
54 |
+
width: 65,
|
55 |
+
Filter: (props) => (<TextFilter {...props}/>),
|
56 |
+
},{
|
57 |
+
Header: __wprm( 'Amount' ),
|
58 |
+
id: 'amount',
|
59 |
+
accessor: 'amount',
|
60 |
+
width: 125,
|
61 |
+
sortable: false,
|
62 |
+
filterable: false,
|
63 |
+
Cell: row => (<div>{ `${row.value} ${row.original.unit}` }</div>),
|
64 |
+
},{
|
65 |
+
Header: __wprm( 'Name' ),
|
66 |
+
id: 'name',
|
67 |
+
accessor: 'name',
|
68 |
+
Filter: (props) => (<TextFilter {...props}/>),
|
69 |
+
Cell: row => he.decode(row.value),
|
70 |
+
},{
|
71 |
+
Header: __wprm( 'Nutrition Facts' ),
|
72 |
+
id: 'facts',
|
73 |
+
accessor: 'facts',
|
74 |
+
width: 250,
|
75 |
+
sortable: false,
|
76 |
+
filterable: false,
|
77 |
+
Cell: row => (
|
78 |
+
<div className="wprm-manage-nutrition-nutrition-container">
|
79 |
+
{
|
80 |
+
Object.keys(wprm_admin_modal.nutrition).map((nutrient, index ) => {
|
81 |
+
const options = wprm_admin_modal.nutrition[nutrient];
|
82 |
+
const value = row.value.hasOwnProperty(nutrient) ? row.value[nutrient] : false;
|
83 |
+
|
84 |
+
if ( false === value || '' === value ) {
|
85 |
+
return null;
|
86 |
+
}
|
87 |
+
|
88 |
+
if ( 'calories' !== nutrient && ! wprm_admin.addons.premium ) {
|
89 |
+
return null;
|
90 |
+
}
|
91 |
+
|
92 |
+
return (
|
93 |
+
<div
|
94 |
+
className="wprm-manage-nutrition-nutrition"
|
95 |
+
key={index}
|
96 |
+
>
|
97 |
+
<div className="wprm-manage-nutrition-nutrition-label">{ options.label }</div>
|
98 |
+
<div className="wprm-manage-nutrition-nutrition-value-unit">
|
99 |
+
<span className="wprm-manage-nutrition-nutrition-value">{ value }</span>
|
100 |
+
<span className="wprm-manage-nutrition-nutrition-unit">{ options.unit }</span>
|
101 |
+
</div>
|
102 |
+
</div>
|
103 |
+
)
|
104 |
+
})
|
105 |
+
}
|
106 |
+
</div>
|
107 |
+
),
|
108 |
+
}];
|
109 |
+
|
110 |
+
return columns;
|
111 |
+
}
|
112 |
+
};
|
assets/js/admin-manage/ratings/Api.js
ADDED
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
const ratingEndpoint = wprm_admin.endpoints.rating;
|
2 |
+
|
3 |
+
export default {
|
4 |
+
updateRating(rating) {
|
5 |
+
const data = {
|
6 |
+
rating,
|
7 |
+
}
|
8 |
+
|
9 |
+
return fetch(`${ratingEndpoint}`, {
|
10 |
+
method: 'POST',
|
11 |
+
headers: {
|
12 |
+
'X-WP-Nonce': wprm_admin.api_nonce,
|
13 |
+
'Accept': 'application/json',
|
14 |
+
'Content-Type': 'application/json',
|
15 |
+
},
|
16 |
+
credentials: 'same-origin',
|
17 |
+
body: JSON.stringify(data),
|
18 |
+
}).then(function (response) {
|
19 |
+
if ( response.ok ) {
|
20 |
+
return response.json();
|
21 |
+
} else {
|
22 |
+
console.log(response);
|
23 |
+
alert( 'Something went wrong. Please contact support.' );
|
24 |
+
return false;
|
25 |
+
}
|
26 |
+
});
|
27 |
+
},
|
28 |
+
deleteRating(id) {
|
29 |
+
return fetch(`${ratingEndpoint}/${id}`, {
|
30 |
+
method: 'DELETE',
|
31 |
+
headers: {
|
32 |
+
'X-WP-Nonce': wprm_admin.api_nonce,
|
33 |
+
'Accept': 'application/json',
|
34 |
+
'Content-Type': 'application/json',
|
35 |
+
},
|
36 |
+
credentials: 'same-origin',
|
37 |
+
}).then(function (response) {
|
38 |
+
if ( response.ok ) {
|
39 |
+
return response.json();
|
40 |
+
} else {
|
41 |
+
console.log(response);
|
42 |
+
alert( 'Something went wrong. Please contact support.' );
|
43 |
+
return false;
|
44 |
+
}
|
45 |
+
});
|
46 |
+
},
|
47 |
+
};
|
assets/js/admin-manage/ratings/Columns.js
ADDED
@@ -0,0 +1,208 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import React from 'react';
|
2 |
+
import he from 'he';
|
3 |
+
|
4 |
+
import TextFilter from '../general/TextFilter';
|
5 |
+
import bulkEditCheckbox from '../general/bulkEditCheckbox';
|
6 |
+
import Api from './Api';
|
7 |
+
import Icon from '../../shared/Icon';
|
8 |
+
import { __wprm } from '../../shared/Translations';
|
9 |
+
|
10 |
+
export default {
|
11 |
+
getColumns( datatable ) {
|
12 |
+
let columns = [
|
13 |
+
bulkEditCheckbox( datatable ),
|
14 |
+
{
|
15 |
+
Header: __wprm( 'Sort:' ),
|
16 |
+
id: 'actions',
|
17 |
+
headerClassName: 'wprm-admin-table-help-text',
|
18 |
+
sortable: false,
|
19 |
+
width: 70,
|
20 |
+
Filter: () => (
|
21 |
+
<div>
|
22 |
+
{ __wprm( 'Filter:' ) }
|
23 |
+
</div>
|
24 |
+
),
|
25 |
+
Cell: row => (
|
26 |
+
<div className="wprm-admin-manage-actions">
|
27 |
+
<Icon
|
28 |
+
type="pencil"
|
29 |
+
title={ __wprm( 'Click on the stars to edit the rating.' ) }
|
30 |
+
onClick={() => {
|
31 |
+
alert( __wprm( 'Click on the stars to edit the rating.' ) );
|
32 |
+
}}
|
33 |
+
/>
|
34 |
+
<Icon
|
35 |
+
type="trash"
|
36 |
+
title={ __wprm( 'Delete Rating' ) }
|
37 |
+
onClick={() => {
|
38 |
+
if( confirm( __wprm( 'Are you sure you want to delete this rating?' ) ) ) {
|
39 |
+
Api.deleteRating(row.original.id).then(() => datatable.refreshData());
|
40 |
+
}
|
41 |
+
}}
|
42 |
+
/>
|
43 |
+
</div>
|
44 |
+
),
|
45 |
+
},{
|
46 |
+
Header: __wprm( 'Date' ),
|
47 |
+
id: 'date',
|
48 |
+
accessor: 'date',
|
49 |
+
width: 150,
|
50 |
+
Filter: (props) => (<TextFilter {...props}/>),
|
51 |
+
},{
|
52 |
+
Header: __wprm( 'Rating' ),
|
53 |
+
id: 'rating',
|
54 |
+
accessor: 'rating',
|
55 |
+
width: 100,
|
56 |
+
Filter: ({ filter, onChange }) => (
|
57 |
+
<select
|
58 |
+
onChange={event => onChange(event.target.value)}
|
59 |
+
style={{ width: '100%', fontSize: '1em' }}
|
60 |
+
value={filter ? filter.value : 'all'}
|
61 |
+
>
|
62 |
+
<option value="all">{ __wprm( 'All Ratings' ) }</option>
|
63 |
+
<option value="1">{ `1 ${ __wprm( 'star' ) }` }</option>
|
64 |
+
<option value="2">{ `2 ${ __wprm( 'stars' ) }` }</option>
|
65 |
+
<option value="3">{ `3 ${ __wprm( 'stars' ) }` }</option>
|
66 |
+
<option value="4">{ `4 ${ __wprm( 'stars' ) }` }</option>
|
67 |
+
<option value="5">{ `5 ${ __wprm( 'stars' ) }` }</option>
|
68 |
+
</select>
|
69 |
+
),
|
70 |
+
Cell: row => {
|
71 |
+
return (
|
72 |
+
<div className="wprm-admin-manage-ratings-rating">
|
73 |
+
{
|
74 |
+
[1,2,3,4,5].map((rating, index) => {
|
75 |
+
return (
|
76 |
+
<Icon
|
77 |
+
type={ rating <= row.value ? 'star-full' : 'star-empty' }
|
78 |
+
title={ `${__wprm( 'Click to change this rating to:' )} ${rating}` }
|
79 |
+
onClick={() => {
|
80 |
+
const newRating = {
|
81 |
+
...row.original,
|
82 |
+
rating,
|
83 |
+
}
|
84 |
+
Api.updateRating(newRating).then(() => datatable.refreshData());
|
85 |
+
}}
|
86 |
+
key={index}
|
87 |
+
/>
|
88 |
+
);
|
89 |
+
})
|
90 |
+
}
|
91 |
+
</div>
|
92 |
+
);
|
93 |
+
},
|
94 |
+
},{
|
95 |
+
Header: __wprm( 'Type' ),
|
96 |
+
id: 'type',
|
97 |
+
accessor: 'type',
|
98 |
+
width: 150,
|
99 |
+
sortable: false,
|
100 |
+
Filter: ({ filter, onChange }) => (
|
101 |
+
<select
|
102 |
+
onChange={event => onChange(event.target.value)}
|
103 |
+
style={{ width: '100%', fontSize: '1em' }}
|
104 |
+
value={filter ? filter.value : 'all'}
|
105 |
+
>
|
106 |
+
<option value="all">{ __wprm( 'All Types' ) }</option>
|
107 |
+
<option value="user">{ __wprm( 'User Rating' ) }</option>
|
108 |
+
<option value="comment">{ __wprm( 'Comment Rating' ) }</option>
|
109 |
+
</select>
|
110 |
+
),
|
111 |
+
Cell: row => (
|
112 |
+
<div>
|
113 |
+
{ 'user' === row.value ? __wprm( 'User Rating' ) : __wprm( 'Comment Rating' ) }
|
114 |
+
</div>
|
115 |
+
),
|
116 |
+
},{
|
117 |
+
Header: __wprm( 'User ID' ),
|
118 |
+
id: 'user_id',
|
119 |
+
accessor: 'user_id',
|
120 |
+
width: 150,
|
121 |
+
Filter: (props) => (<TextFilter {...props}/>),
|
122 |
+
Cell: row => {
|
123 |
+
if ( ! row.value || '0' === row.value ) {
|
124 |
+
return (<div></div>);
|
125 |
+
}
|
126 |
+
|
127 |
+
const label = `${ row.value } - ${ row.original.user ? row.original.user : __wprm( 'n/a' ) }`;
|
128 |
+
return (
|
129 |
+
<div>
|
130 |
+
{
|
131 |
+
row.original.user_link
|
132 |
+
?
|
133 |
+
<a href={ he.decode( row.original.user_link ) } target="_blank">{ label }</a>
|
134 |
+
:
|
135 |
+
label
|
136 |
+
}
|
137 |
+
</div>
|
138 |
+
)
|
139 |
+
},
|
140 |
+
},{
|
141 |
+
Header: __wprm( 'IP' ),
|
142 |
+
id: 'ip',
|
143 |
+
accessor: 'ip',
|
144 |
+
width: 150,
|
145 |
+
Filter: (props) => (<TextFilter {...props}/>),
|
146 |
+
},{
|
147 |
+
Header: __wprm( 'Comment ID' ),
|
148 |
+
id: 'comment_id',
|
149 |
+
accessor: 'comment_id',
|
150 |
+
width: 350,
|
151 |
+
Filter: (props) => (<TextFilter {...props}/>),
|
152 |
+
Cell: row => {
|
153 |
+
if ( ! row.value || '0' === row.value ) {
|
154 |
+
return (<div></div>);
|
155 |
+
}
|
156 |
+
|
157 |
+
const label = `${ row.value } - ${ row.original.comment ? `${row.original.comment}` : __wprm( 'n/a' ) }`;
|
158 |
+
return (
|
159 |
+
<div>
|
160 |
+
{
|
161 |
+
row.original.comment_link
|
162 |
+
?
|
163 |
+
<a href={ he.decode( row.original.comment_link ) } target="_blank">{ label }</a>
|
164 |
+
:
|
165 |
+
label
|
166 |
+
}
|
167 |
+
</div>
|
168 |
+
)
|
169 |
+
},
|
170 |
+
},{
|
171 |
+
Header: __wprm( 'Recipe ID' ),
|
172 |
+
id: 'recipe_id',
|
173 |
+
accessor: 'recipe_id',
|
174 |
+
width: 350,
|
175 |
+
Filter: (props) => (<TextFilter {...props}/>),
|
176 |
+
Cell: row => {
|
177 |
+
if ( ! row.value || '0' === row.value ) {
|
178 |
+
return (<div></div>);
|
179 |
+
}
|
180 |
+
|
181 |
+
const label = `${ row.value } - ${ row.original.recipe ? row.original.recipe : __wprm( 'n/a' ) }`;
|
182 |
+
return (
|
183 |
+
<div>
|
184 |
+
{
|
185 |
+
row.original.recipe
|
186 |
+
?
|
187 |
+
<a
|
188 |
+
href="#"
|
189 |
+
onClick={(e) => {
|
190 |
+
e.preventDefault();
|
191 |
+
WPRM_Modal.open( 'recipe', {
|
192 |
+
recipeId: row.value,
|
193 |
+
saveCallback: () => datatable.refreshData(),
|
194 |
+
} );
|
195 |
+
}}
|
196 |
+
>{ label }</a>
|
197 |
+
:
|
198 |
+
label
|
199 |
+
}
|
200 |
+
</div>
|
201 |
+
)
|
202 |
+
},
|
203 |
+
}
|
204 |
+
];
|
205 |
+
|
206 |
+
return columns;
|
207 |
+
}
|
208 |
+
};
|
assets/js/admin-manage/recipe-submission/Api.js
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
const submissionEndpoint = wprm_admin.endpoints.recipe_submission;
|
2 |
+
|
3 |
+
export default {
|
4 |
+
approveSubmission(id, createPost) {
|
5 |
+
const data = {
|
6 |
+
createPost,
|
7 |
+
}
|
8 |
+
|
9 |
+
return fetch(`${submissionEndpoint}/approve/${id}`, {
|
10 |
+
method: 'POST',
|
11 |
+
headers: {
|
12 |
+
'X-WP-Nonce': wprm_admin.api_nonce,
|
13 |
+
'Accept': 'application/json',
|
14 |
+
'Content-Type': 'application/json',
|
15 |
+
},
|
16 |
+
credentials: 'same-origin',
|
17 |
+
body: JSON.stringify(data),
|
18 |
+
}).then(function (response) {
|
19 |
+
if ( response.ok ) {
|
20 |
+
return response.json();
|
21 |
+
} else {
|
22 |
+
console.log(response);
|
23 |
+
alert( 'Something went wrong. Please contact support.' );
|
24 |
+
return false;
|
25 |
+
}
|
26 |
+
});
|
27 |
+
},
|
28 |
+
};
|
assets/js/admin-manage/recipe-submission/Columns.js
ADDED
@@ -0,0 +1,131 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import React from 'react';
|
2 |
+
import he from 'he';
|
3 |
+
|
4 |
+
import TextFilter from '../general/TextFilter';
|
5 |
+
import SubmissionApi from './Api';
|
6 |
+
import RecipeApi from '../../shared/Api';
|
7 |
+
import Icon from '../../shared/Icon';
|
8 |
+
import { __wprm } from '../../shared/Translations';
|
9 |
+
|
10 |
+
export default {
|
11 |
+
getColumns( datatable ) {
|
12 |
+
let columns = [{
|
13 |
+
Header: __wprm( 'Sort:' ),
|
14 |
+
id: 'actions',
|
15 |
+
headerClassName: 'wprm-admin-table-help-text',
|
16 |
+
sortable: false,
|
17 |
+
width: 130,
|
18 |
+
Filter: () => (
|
19 |
+
<div>
|
20 |
+
{ __wprm( 'Filter:' ) }
|
21 |
+
</div>
|
22 |
+
),
|
23 |
+
Cell: row => (
|
24 |
+
<div className="wprm-admin-manage-actions">
|
25 |
+
<Icon
|
26 |
+
type="pencil"
|
27 |
+
title={ __wprm( 'Edit Recipe Submission' ) }
|
28 |
+
onClick={() => {
|
29 |
+
WPRM_Modal.open( 'recipe', {
|
30 |
+
recipe: row.original,
|
31 |
+
saveCallback: () => datatable.refreshData(),
|
32 |
+
} );
|
33 |
+
}}
|
34 |
+
/>
|
35 |
+
<Icon
|
36 |
+
type="checkmark"
|
37 |
+
title={ __wprm( 'Approve Submission' ) }
|
38 |
+
onClick={() => {
|
39 |
+
SubmissionApi.approveSubmission( row.original.id, false ).then(() => datatable.refreshData());
|
40 |
+
}}
|
41 |
+
/>
|
42 |
+
<Icon
|
43 |
+
type="checkbox-alternate"
|
44 |
+
title={ __wprm( 'Approve Submission & Add to new Post' ) }
|
45 |
+
onClick={() => {
|
46 |
+
SubmissionApi.approveSubmission( row.original.id, true ).then((data) => {
|
47 |
+
if ( data && data.edit_link ) {
|
48 |
+
window.location = data.edit_link;
|
49 |
+
} else {
|
50 |
+
datatable.refreshData();
|
51 |
+
}
|
52 |
+
})
|
53 |
+
}}
|
54 |
+
/>
|
55 |
+
<Icon
|
56 |
+
type="trash"
|
57 |
+
title={ __wprm( 'Delete Recipe Submission' ) }
|
58 |
+
onClick={() => {
|
59 |
+
if( confirm( `${ __wprm( 'Are you sure you want to delete' ) } "${row.original.name}"?` ) ) {
|
60 |
+
RecipeApi.deleteRecipe(row.original.id).then(() => datatable.refreshData());
|
61 |
+
}
|
62 |
+
}}
|
63 |
+
/>
|
64 |
+
</div>
|
65 |
+
),
|
66 |
+
},{
|
67 |
+
Header: __wprm( 'ID' ),
|
68 |
+
id: 'id',
|
69 |
+
accessor: 'id',
|
70 |
+
width: 65,
|
71 |
+
Filter: (props) => (<TextFilter {...props}/>),
|
72 |
+
},{
|
73 |
+
Header: __wprm( 'Date' ),
|
74 |
+
id: 'date',
|
75 |
+
accessor: 'date',
|
76 |
+
width: 150,
|
77 |
+
Filter: (props) => (<TextFilter {...props}/>),
|
78 |
+
},{
|
79 |
+
Header: __wprm( 'User' ),
|
80 |
+
id: 'submission_author',
|
81 |
+
accessor: 'submission_author',
|
82 |
+
width: 300,
|
83 |
+
sortable: false,
|
84 |
+
filterable: false,
|
85 |
+
Cell: row => {
|
86 |
+
const user = row.value;
|
87 |
+
if ( ! user ) {
|
88 |
+
return null;
|
89 |
+
}
|
90 |
+
|
91 |
+
const name = user.name ? user.name : ( row.original.submission_author_user_name ? row.original.submission_author_user_name : '' );
|
92 |
+
|
93 |
+
return (
|
94 |
+
<div className="wprm-admin-manage-recipe-submission-user">
|
95 |
+
<div className="wprm-admin-manage-recipe-submission-user-name">
|
96 |
+
{
|
97 |
+
user.id
|
98 |
+
?
|
99 |
+
<a href={ row.original.submission_author_user_link } target="_blank">#{ user.id }</a>
|
100 |
+
:
|
101 |
+
null
|
102 |
+
}
|
103 |
+
{
|
104 |
+
name
|
105 |
+
?
|
106 |
+
<span> - { name }</span>
|
107 |
+
:
|
108 |
+
null
|
109 |
+
}
|
110 |
+
</div>
|
111 |
+
{
|
112 |
+
user.email
|
113 |
+
?
|
114 |
+
<div className="wprm-admin-manage-recipe-submission-user-email">{ user.email }</div>
|
115 |
+
:
|
116 |
+
null
|
117 |
+
}
|
118 |
+
</div>
|
119 |
+
)
|
120 |
+
},
|
121 |
+
},{
|
122 |
+
Header: __wprm( 'Name' ),
|
123 |
+
id: 'name',
|
124 |
+
accessor: 'name',
|
125 |
+
Filter: (props) => (<TextFilter {...props}/>),
|
126 |
+
Cell: row => he.decode(row.value),
|
127 |
+
}];
|
128 |
+
|
129 |
+
return columns;
|
130 |
+
}
|
131 |
+
};
|
assets/js/admin-manage/recipes/Columns.js
ADDED
@@ -0,0 +1,620 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import React from 'react';
|
2 |
+
import he from 'he';
|
3 |
+
|
4 |
+
import bulkEditCheckbox from '../general/bulkEditCheckbox';
|
5 |
+
import TextFilter from '../general/TextFilter';
|
6 |
+
import ManageApi from '../general/Api';
|
7 |
+
import RecipeApi from '../../shared/Api';
|
8 |
+
import Icon from '../../shared/Icon';
|
9 |
+
import { __wprm } from '../../shared/Translations';
|
10 |
+
|
11 |
+
import '../../../css/admin/manage/recipes.scss';
|
12 |
+
import SeoIndicator from './SeoIndicator';
|
13 |
+
|
14 |
+
const getFormattedTime = ( timeMins, showZero = false ) => {
|
15 |
+
const time = parseInt( timeMins );
|
16 |
+
|
17 |
+
let days = 0,
|
18 |
+
hours = 0,
|
19 |
+
minutes = 0,
|
20 |
+
formatted = '';
|
21 |
+
|
22 |
+
if ( time > 0 ) {
|
23 |
+
days = Math.floor( time / 24 / 60 );
|
24 |
+
hours = Math.floor( time / 60 % 24 );
|
25 |
+
minutes = Math.floor( time % 60 );
|
26 |
+
|
27 |
+
if ( days ) { formatted += `${days} ${days === 1 ? __wprm( 'day' ) : __wprm( 'days' ) } `; }
|
28 |
+
if ( hours ) { formatted += `${hours} ${hours === 1 ? __wprm( 'hr' ) : __wprm( 'hrs' ) } `; }
|
29 |
+
if ( minutes ) { formatted += `${minutes} ${minutes === 1 ? __wprm( 'min' ) : __wprm( 'mins' ) } `; }
|
30 |
+
} else {
|
31 |
+
if ( showZero ) {
|
32 |
+
formatted = `0 ${ __wprm( 'mins' ) }`;
|
33 |
+
}
|
34 |
+
}
|
35 |
+
|
36 |
+
return formatted.trim();
|
37 |
+
}
|
38 |
+
|
39 |
+
export default {
|
40 |
+
getColumns( recipes ) {
|
41 |
+
let columns = [
|
42 |
+
bulkEditCheckbox( recipes ),
|
43 |
+
{
|
44 |
+
Header: __wprm( 'Sort:' ),
|
45 |
+
id: 'actions',
|
46 |
+
headerClassName: 'wprm-admin-table-help-text',
|
47 |
+
sortable: false,
|
48 |
+
width: wprm_admin.addons.premium ? 100 : 70,
|
49 |
+
Filter: () => (
|
50 |
+
<div>
|
51 |
+
{ __wprm( 'Filter:' ) }
|
52 |
+
</div>
|
53 |
+
),
|
54 |
+
Cell: row => (
|
55 |
+
<div className="wprm-admin-manage-actions">
|
56 |
+
<Icon
|
57 |
+
type="pencil"
|
58 |
+
title={ __wprm( 'Edit Recipe' ) }
|
59 |
+
onClick={() => {
|
60 |
+
WPRM_Modal.open( 'recipe', {
|
61 |
+
recipe: row.original,
|
62 |
+
saveCallback: () => recipes.refreshData(),
|
63 |
+
} );
|
64 |
+
}}
|
65 |
+
/>
|
66 |
+
{
|
67 |
+
true === wprm_admin.addons.premium
|
68 |
+
&&
|
69 |
+
<Icon
|
70 |
+
type="duplicate"
|
71 |
+
title={ __wprm( 'Clone Recipe' ) }
|
72 |
+
onClick={() => {
|
73 |
+
WPRM_Modal.open( 'recipe', {
|
74 |
+
recipeId: row.original.id,
|
75 |
+
cloneRecipe: true,
|
76 |
+
saveCallback: () => recipes.refreshData(),
|
77 |
+
}, true );
|
78 |
+
}}
|
79 |
+
/>
|
80 |
+
}
|
81 |
+
<Icon
|
82 |
+
type="trash"
|
83 |
+
title={ __wprm( 'Delete Recipe' ) }
|
84 |
+
onClick={() => {
|
85 |
+
if( confirm( `${ __wprm( 'Are you sure you want to delete' ) } "${row.original.name}"?` ) ) {
|
86 |
+
RecipeApi.deleteRecipe(row.original.id).then(() => recipes.refreshData());
|
87 |
+
}
|
88 |
+
}}
|
89 |
+
/>
|
90 |
+
</div>
|
91 |
+
),
|
92 |
+
},{
|
93 |
+
Header: __wprm( 'SEO' ),
|
94 |
+
id: 'seo',
|
95 |
+
accessor: 'seo',
|
96 |
+
width: 65,
|
97 |
+
sortable: false,
|
98 |
+
filterable: false,
|
99 |
+
Cell: row => (
|
100 |
+
<SeoIndicator
|
101 |
+
seo={ row.value }
|
102 |
+
/>
|
103 |
+
),
|
104 |
+
},{
|
105 |
+
Header: __wprm( 'ID' ),
|
106 |
+
id: 'id',
|
107 |
+
accessor: 'id',
|
108 |
+
width: 65,
|
109 |
+
Filter: (props) => (<TextFilter {...props}/>),
|
110 |
+
},{
|
111 |
+
Header: __wprm( 'Date' ),
|
112 |
+
id: 'date',
|
113 |
+
accessor: 'date',
|
114 |
+
width: 150,
|
115 |
+
Filter: (props) => (<TextFilter {...props}/>),
|
116 |
+
},{
|
117 |
+
Header: __wprm( 'Image' ),
|
118 |
+
id: 'image',
|
119 |
+
accessor: 'image_url',
|
120 |
+
width: 100,
|
121 |
+
sortable: false,
|
122 |
+
Filter: ({ filter, onChange }) => (
|
123 |
+
<select
|
124 |
+
onChange={event => onChange(event.target.value)}
|
125 |
+
style={{ width: '100%', fontSize: '1em' }}
|
126 |
+
value={filter ? filter.value : 'all'}
|
127 |
+
>
|
128 |
+
<option value="all">{ __wprm( 'Show All' ) }</option>
|
129 |
+
<option value="yes">{ __wprm( 'Has Recipe Image' ) }</option>
|
130 |
+
<option value="no">{ __wprm( 'Does not have Recipe Image' ) }</option>
|
131 |
+
</select>
|
132 |
+
),
|
133 |
+
Cell: row => (
|
134 |
+
<div style={ { width: '100%' } }>
|
135 |
+
{
|
136 |
+
row.value
|
137 |
+
?
|
138 |
+
<img src={ row.value } className="wprm-admin-manage-image" />
|
139 |
+
:
|
140 |
+
null
|
141 |
+
}
|
142 |
+
</div>
|
143 |
+
),
|
144 |
+
},{
|
145 |
+
Header: __wprm( 'Name' ),
|
146 |
+
id: 'name',
|
147 |
+
accessor: 'name',
|
148 |
+
width: 300,
|
149 |
+
Filter: (props) => (<TextFilter {...props}/>),
|
150 |
+
},{
|
151 |
+
Header: __wprm( 'Author' ),
|
152 |
+
id: 'post_author',
|
153 |
+
accessor: 'post_author',
|
154 |
+
width: 150,
|
155 |
+
Filter: ({ filter, onChange }) => (
|
156 |
+
<select
|
157 |
+
onChange={event => onChange(event.target.value)}
|
158 |
+
style={{ width: '100%', fontSize: '1em' }}
|
159 |
+
value={filter ? filter.value : 'all'}
|
160 |
+
>
|
161 |
+
<option value="all">{ __wprm( 'All Authors' ) }</option>
|
162 |
+
{
|
163 |
+
Object.keys(wprm_admin_manage.authors).map((author, index) => {
|
164 |
+
const data = wprm_admin_manage.authors[ author ].data;
|
165 |
+
return (
|
166 |
+
<option value={ data.ID } key={index}>{ data.ID } - { he.decode( data.display_name ) }</option>
|
167 |
+
)
|
168 |
+
})
|
169 |
+
}
|
170 |
+
</select>
|
171 |
+
),
|
172 |
+
Cell: row => (
|
173 |
+
<div>
|
174 |
+
{
|
175 |
+
row.value
|
176 |
+
?
|
177 |
+
<a href={ row.original.post_author_link } target="_blank">{ row.value } - { row.original.post_author_name }</a>
|
178 |
+
:
|
179 |
+
null
|
180 |
+
}
|
181 |
+
</div>
|
182 |
+
),
|
183 |
+
},{
|
184 |
+
Header: __wprm( 'Display Author Type' ),
|
185 |
+
id: 'author_display',
|
186 |
+
accessor: 'author_display',
|
187 |
+
width: 250,
|
188 |
+
Filter: ({ filter, onChange }) => (
|
189 |
+
<select
|
190 |
+
onChange={event => onChange(event.target.value)}
|
191 |
+
style={{ width: '100%', fontSize: '1em' }}
|
192 |
+
value={filter ? filter.value : 'all'}
|
193 |
+
>
|
194 |
+
<option value="all">{ __wprm( 'All Display Author Types' ) }</option>
|
195 |
+
{
|
196 |
+
wprm_admin_modal.options.author.map((author, index) => {
|
197 |
+
if ( 'same' === author.value ) {
|
198 |
+
return null;
|
199 |
+
}
|
200 |
+
|
201 |
+
return (
|
202 |
+
<option value={ author.value } key={index}>{ author.label }</option>
|
203 |
+
)
|
204 |
+
})
|
205 |
+
}
|
206 |
+
</select>
|
207 |
+
),
|
208 |
+
Cell: row => {
|
209 |
+
const author = wprm_admin_modal.options.author.find((option) => option.value === row.value );
|
210 |
+
|
211 |
+
if ( ! author ) {
|
212 |
+
return (<div></div>);
|
213 |
+
}
|
214 |
+
|
215 |
+
return (
|
216 |
+
<div>{ author.label }</div>
|
217 |
+
)
|
218 |
+
},
|
219 |
+
},{
|
220 |
+
Header: __wprm( 'Display Author' ),
|
221 |
+
id: 'author',
|
222 |
+
accessor: 'author',
|
223 |
+
width: 150,
|
224 |
+
sortable: false,
|
225 |
+
filterable: false,
|
226 |
+
Cell: row => {
|
227 |
+
if ( ! row.value ) {
|
228 |
+
return ( <div></div> );
|
229 |
+
}
|
230 |
+
return ( <div dangerouslySetInnerHTML={ { __html: row.original.author } } /> );
|
231 |
+
},
|
232 |
+
},{
|
233 |
+
Header: __wprm( 'Status' ),
|
234 |
+
id: 'status',
|
235 |
+
accessor: 'post_status',
|
236 |
+
width: 120,
|
237 |
+
sortable: false,
|
238 |
+
Filter: ({ filter, onChange }) => (
|
239 |
+
<select
|
240 |
+
onChange={event => onChange(event.target.value)}
|
241 |
+
style={{ width: '100%', fontSize: '1em' }}
|
242 |
+
value={filter ? filter.value : 'all'}
|
243 |
+
>
|
244 |
+
<option value="all">{ __wprm( 'All Statuses' ) }</option>
|
245 |
+
{
|
246 |
+
Object.keys(wprm_admin_manage.post_statuses).map((status, index) => (
|
247 |
+
<option value={status} key={index}>{ he.decode( wprm_admin_manage.post_statuses[status] ) }</option>
|
248 |
+
))
|
249 |
+
}
|
250 |
+
</select>
|
251 |
+
),
|
252 |
+
Cell: row => {
|
253 |
+
const postStatusLabel = Object.keys(wprm_admin_manage.post_statuses).includes(row.value) ? wprm_admin_manage.post_statuses[row.value] : row.value;
|
254 |
+
|
255 |
+
return (
|
256 |
+
<div>{ postStatusLabel }</div>
|
257 |
+
);
|
258 |
+
},
|
259 |
+
},{
|
260 |
+
Header: __wprm( 'Parent ID' ),
|
261 |
+
id: 'parent_post_id',
|
262 |
+
accessor: 'parent_post_id',
|
263 |
+
width: 65,
|
264 |
+
Filter: (props) => (<TextFilter {...props}/>),
|
265 |
+
Cell: row => {
|
266 |
+
if ( ! row.value ) {
|
267 |
+
return (<div></div>);
|
268 |
+
} else {
|
269 |
+
return (
|
270 |
+
<div>{ row.value }</div>
|
271 |
+
)
|
272 |
+
}
|
273 |
+
},
|
274 |
+
},{
|
275 |
+
Header: __wprm( 'Parent Name' ),
|
276 |
+
id: 'parent_post',
|
277 |
+
accessor: 'parent_post',
|
278 |
+
width: 300,
|
279 |
+
sortable: false,
|
280 |
+
Filter: ({ filter, onChange }) => (
|
281 |
+
<select
|
282 |
+
onChange={event => onChange(event.target.value)}
|
283 |
+
style={{ width: '100%', fontSize: '1em' }}
|
284 |
+
value={filter ? filter.value : 'all'}
|
285 |
+
>
|
286 |
+
<option value="all">{ __wprm( 'Show All' ) }</option>
|
287 |
+
<option value="yes">{ __wprm( 'Has Parent Post' ) }</option>
|
288 |
+
<option value="no">{ __wprm( 'Does not have Parent Post' ) }</option>
|
289 |
+
</select>
|
290 |
+
),
|
291 |
+
Cell: row => {
|
292 |
+
const parent_post = row.value;
|
293 |
+
const parent_url = he.decode( row.original.parent_post_edit_url );
|
294 |
+
|
295 |
+
if ( ! parent_post ) {
|
296 |
+
return (<div></div>);
|
297 |
+
} else {
|
298 |
+
if ( parent_url ) {
|
299 |
+
return (
|
300 |
+
<a href={ parent_url } target="_blank">{ parent_post.post_title }</a>
|
301 |
+
)
|
302 |
+
} else {
|
303 |
+
return (
|
304 |
+
<div>{ parent_post.post_title }</div>
|
305 |
+
)
|
306 |
+
}
|
307 |
+
}
|
308 |
+
},
|
309 |
+
},{
|
310 |
+
Header: __wprm( 'Ratings' ),
|
311 |
+
id: 'rating',
|
312 |
+
accessor: 'rating',
|
313 |
+
width: 200,
|
314 |
+
Filter: ({ filter, onChange }) => (
|
315 |
+
<select
|
316 |
+
onChange={event => onChange(event.target.value)}
|
317 |
+
style={{ width: '100%', fontSize: '1em' }}
|
318 |
+
value={filter ? filter.value : 'all'}
|
319 |
+
>
|
320 |
+
<optgroup label={ __wprm( 'General' ) }>
|
321 |
+
<option value="all">{ __wprm( 'All Ratings' ) }</option>
|
322 |
+
<option value="none">{ __wprm( 'No Ratings' ) }</option>
|
323 |
+
<option value="any">{ __wprm( 'Any Rating' ) }</option>
|
324 |
+
</optgroup>
|
325 |
+
<optgroup label={ __wprm( 'Stars' ) }>
|
326 |
+
<option value="1">{ `1 ${ __wprm( 'star' ) }` }</option>
|
327 |
+
<option value="2">{ `2 ${ __wprm( 'stars' ) }` }</option>
|
328 |
+
<option value="3">{ `3 ${ __wprm( 'stars' ) }` }</option>
|
329 |
+
<option value="4">{ `4 ${ __wprm( 'stars' ) }` }</option>
|
330 |
+
<option value="5">{ `5 ${ __wprm( 'stars' ) }` }</option>
|
331 |
+
</optgroup>
|
332 |
+
</select>
|
333 |
+
),
|
334 |
+
Cell: row => {
|
335 |
+
const ratings = row.value;
|
336 |
+
|
337 |
+
if ( ! ratings.average || "0" === ratings.average ) {
|
338 |
+
return null;
|
339 |
+
}
|
340 |
+
|
341 |
+
return (
|
342 |
+
<div className="wprm-admin-manage-recipes-ratings-container">
|
343 |
+
<div className="wprm-admin-manage-recipes-ratings-average">{ ratings.average }</div>
|
344 |
+
<div className="wprm-admin-manage-recipes-ratings-details">
|
345 |
+
{
|
346 |
+
false === ratings.comment_ratings
|
347 |
+
?
|
348 |
+
<div className="wprm-admin-manage-recipes-ratings-details-none">{ __wprm( 'no comment ratings' ) }</div>
|
349 |
+
:
|
350 |
+
<div>{ `${ ratings.comment_ratings.average } ${ __wprm( 'from' ) } ${ ratings.comment_ratings.count } ${ 1 === ratings.comment_ratings.count ? __wprm( 'comment' ) : __wprm( 'comments' ) }` }</div>
|
351 |
+
}
|
352 |
+
{
|
353 |
+
false === ratings.user_ratings
|
354 |
+
?
|
355 |
+
<div className="wprm-admin-manage-recipes-ratings-details-none">{ __wprm( 'no user ratings' ) }</div>
|
356 |
+
:
|
357 |
+
<div>
|
358 |
+
{ `${ ratings.user_ratings.average } ${ __wprm( 'from' ) } ${ ratings.user_ratings.count } ${ 1 === ratings.user_ratings.count ? __wprm( 'vote' ) : __wprm( 'votes' ) }` }
|
359 |
+
<a
|
360 |
+
href="#"
|
361 |
+
onClick={(e) => {
|
362 |
+
e.preventDefault();
|
363 |
+
if( confirm( `${ __wprm( 'Are you sure you want to delete the user ratings for' ) } "${row.original.name}"?` ) ) {
|
364 |
+
ManageApi.deleteUserRatings(row.original.id).then(() => recipes.refreshData());
|
365 |
+
}
|
366 |
+
}}
|
367 |
+
>(reset)</a>
|
368 |
+
</div>
|
369 |
+
}
|
370 |
+
</div>
|
371 |
+
</div>
|
372 |
+
);
|
373 |
+
},
|
374 |
+
}
|
375 |
+
];
|
376 |
+
|
377 |
+
for (let key in wprm_admin_modal.categories) {
|
378 |
+
const taxonomy = wprm_admin_modal.categories[key];
|
379 |
+
taxonomy.terms.sort((a,b) => a.name.localeCompare(b.name));
|
380 |
+
|
381 |
+
columns.push({
|
382 |
+
Header: taxonomy.label,
|
383 |
+
id: key,
|
384 |
+
accessor: d => d.tags[key],
|
385 |
+
width: 300,
|
386 |
+
sortable: false,
|
387 |
+
Filter: ({ filter, onChange }) => (
|
388 |
+
<select
|
389 |
+
onChange={event => onChange(event.target.value)}
|
390 |
+
style={{ width: '100%', fontSize: '1em' }}
|
391 |
+
value={filter ? filter.value : 'all'}
|
392 |
+
>
|
393 |
+
<optgroup label={ __wprm( 'General' ) }>
|
394 |
+
<option value="all">{ `${ __wprm( 'All' ) } ${ taxonomy.label }` }</option>
|
395 |
+
<option value="none">{ `${ __wprm( 'No' ) } ${ taxonomy.label }` }</option>
|
396 |
+
<option value="any">{ `${ __wprm( 'Any' ) } ${ taxonomy.label }` }</option>
|
397 |
+
</optgroup>
|
398 |
+
<optgroup label={ __wprm( 'Terms' ) }>
|
399 |
+
{
|
400 |
+
taxonomy.terms.map((term, index) => (
|
401 |
+
<option value={term.term_id} key={index}>{ he.decode( term.name ) }{ term.count ? ` (${ term.count })` : '' }</option>
|
402 |
+
))
|
403 |
+
}
|
404 |
+
</optgroup>
|
405 |
+
</select>
|
406 |
+
),
|
407 |
+
Cell: row => {
|
408 |
+
const names = row.value.map(t => t.name);
|
409 |
+
return (
|
410 |
+
<div>{ he.decode( names.join(', ') ) }</div>
|
411 |
+
)
|
412 |
+
},
|
413 |
+
});
|
414 |
+
}
|
415 |
+
|
416 |
+
columns.push({
|
417 |
+
Header: __wprm( 'Prep Time' ),
|
418 |
+
id: 'prep_time',
|
419 |
+
accessor: 'prep_time',
|
420 |
+
width: 100,
|
421 |
+
Filter: (props) => (<TextFilter {...props}/>),
|
422 |
+
Cell: row => (<div>{ getFormattedTime( row.value, row.original.prep_time_zero ) }</div>),
|
423 |
+
},{
|
424 |
+
Header: __wprm( 'Cook Time' ),
|
425 |
+
id: 'cook_time',
|
426 |
+
accessor: 'cook_time',
|
427 |
+
width: 100,
|
428 |
+
Filter: (props) => (<TextFilter {...props}/>),
|
429 |
+
Cell: row => (<div>{ getFormattedTime( row.value, row.original.cook_time_zero ) }</div>),
|
430 |
+
},{
|
431 |
+
Header: __wprm( 'Custom Time' ),
|
432 |
+
id: 'custom_time',
|
433 |
+
accessor: 'custom_time',
|
434 |
+
width: 120,
|
435 |
+
Filter: (props) => (<TextFilter {...props}/>),
|
436 |
+
Cell: row => (
|
437 |
+
<div>
|
438 |
+
<div>{ row.original.custom_time_label }</div>
|
439 |
+
<div>{ getFormattedTime( row.value, row.original.custom_time_zero ) }</div>
|
440 |
+
</div>
|
441 |
+
),
|
442 |
+
},{
|
443 |
+
Header: __wprm( 'Total Time' ),
|
444 |
+
id: 'total_time',
|
445 |
+
accessor: 'total_time',
|
446 |
+
width: 100,
|
447 |
+
Filter: (props) => (<TextFilter {...props}/>),
|
448 |
+
Cell: row => (<div>{ getFormattedTime( row.value ) }</div>),
|
449 |
+
},{
|
450 |
+
Header: __wprm( 'Ingredients' ),
|
451 |
+
id: 'ingredient',
|
452 |
+
accessor: 'ingredients',
|
453 |
+
width: 300,
|
454 |
+
sortable: false,
|
455 |
+
Filter: (props) => (<TextFilter {...props}/>),
|
456 |
+
Cell: row => (
|
457 |
+
<div>
|
458 |
+
{
|
459 |
+
row.value
|
460 |
+
?
|
461 |
+
row.value.map( (group, index) => {
|
462 |
+
group.name = group.name.replace( /(<([^>]+)>)/ig, '' ).trim();
|
463 |
+
|
464 |
+
return (
|
465 |
+
<div key={index}>
|
466 |
+
{ group.name && <div style={{ fontWeight: 'bold' }}>{ he.decode( group.name ) }</div> }
|
467 |
+
{
|
468 |
+
group.ingredients.map( (ingredient, ingredient_index) => {
|
469 |
+
let fields = [];
|
470 |
+
|
471 |
+
if ( ingredient.amount ) { fields.push( ingredient.amount ); }
|
472 |
+
if ( ingredient.unit ) { fields.push( ingredient.unit ); }
|
473 |
+
if ( ingredient.name ) { fields.push( ingredient.name ); }
|
474 |
+
if ( ingredient.notes ) { fields.push( ingredient.notes ); }
|
475 |
+
|
476 |
+
if ( fields.length ) {
|
477 |
+
const ingredientString = fields.join( ' ' ).replace( /(<([^>]+)>)/ig, '' ).trim();
|
478 |
+
return (
|
479 |
+
<div key={ingredient_index}>{ he.decode( ingredientString ) }</div>
|
480 |
+
)
|
481 |
+
}
|
482 |
+
})
|
483 |
+
}
|
484 |
+
</div>
|
485 |
+
)
|
486 |
+
})
|
487 |
+
:
|
488 |
+
null
|
489 |
+
}
|
490 |
+
</div>
|
491 |
+
),
|
492 |
+
},{
|
493 |
+
Header: __wprm( 'Converted Ingredients' ),
|
494 |
+
id: 'unit_conversion',
|
495 |
+
accessor: 'unit_conversion',
|
496 |
+
width: 300,
|
497 |
+
sortable: false,
|
498 |
+
filterable: false,
|
499 |
+
Cell: row => {
|
500 |
+
if ( Array.isArray( row.value ) ) {
|
501 |
+
return (
|
502 |
+
<div>
|
503 |
+
{ row.value.map( (line, index) => {
|
504 |
+
line = line.replace( /(<([^>]+)>)/ig, '' ).trim();
|
505 |
+
|
506 |
+
return(
|
507 |
+
<div key={index}>
|
508 |
+
{ he.decode(line) }
|
509 |
+
</div>
|
510 |
+
)
|
511 |
+
}) }
|
512 |
+
</div>
|
513 |
+
);
|
514 |
+
}
|
515 |
+
|
516 |
+
return (
|
517 |
+
<div>{ row.value }</div>
|
518 |
+
)
|
519 |
+
},
|
520 |
+
},{
|
521 |
+
Header: __wprm( 'Nutrition' ),
|
522 |
+
id: 'nutrition',
|
523 |
+
accessor: 'nutrition',
|
524 |
+
width: 250,
|
525 |
+
sortable: false,
|
526 |
+
filterable: false,
|
527 |
+
Cell: row => (
|
528 |
+
<div className="wprm-manage-recipes-nutrition-container">
|
529 |
+
{
|
530 |
+
Object.keys(wprm_admin_modal.nutrition).map((nutrient, index ) => {
|
531 |
+
const options = wprm_admin_modal.nutrition[nutrient];
|
532 |
+
const value = row.value.hasOwnProperty(nutrient) ? row.value[nutrient] : false;
|
533 |
+
|
534 |
+
if ( false === value ) {
|
535 |
+
return null;
|
536 |
+
}
|
537 |
+
|
538 |
+
if ( 'calories' !== nutrient && ! wprm_admin.addons.premium ) {
|
539 |
+
return null;
|
540 |
+
}
|
541 |
+
|
542 |
+
return (
|
543 |
+
<div
|
544 |
+
className="wprm-manage-recipes-nutrition"
|
545 |
+
key={index}
|
546 |
+
>
|
547 |
+
<div className="wprm-manage-recipes-nutrition-label">{ options.label }</div>
|
548 |
+
<div className="wprm-manage-recipes-nutrition-value-unit">
|
549 |
+
<span className="wprm-manage-recipes-nutrition-value">{ value }</span>
|
550 |
+
<span className="wprm-manage-recipes-nutrition-unit">{ options.unit }</span>
|
551 |
+
</div>
|
552 |
+
</div>
|
553 |
+
)
|
554 |
+
})
|
555 |
+
}
|
556 |
+
</div>
|
557 |
+
),
|
558 |
+
}
|
559 |
+
);
|
560 |
+
|
561 |
+
if ( wprm_admin.addons.elite ) {
|
562 |
+
columns.push({
|
563 |
+
Header: __wprm( 'Recipe Submission User' ),
|
564 |
+
id: 'submission_author',
|
565 |
+
accessor: 'submission_author',
|
566 |
+
width: 300,
|
567 |
+
sortable: false,
|
568 |
+
Filter: ({ filter, onChange }) => (
|
569 |
+
<select
|
570 |
+
onChange={event => onChange(event.target.value)}
|
571 |
+
style={{ width: '100%', fontSize: '1em' }}
|
572 |
+
value={filter ? filter.value : 'all'}
|
573 |
+
>
|
574 |
+
<option value="all">{ __wprm( 'Show All' ) }</option>
|
575 |
+
<option value="yes">{ __wprm( 'Was Recipe Submission' ) }</option>
|
576 |
+
<option value="no">{ __wprm( 'Was not a Recipe Submission' ) }</option>
|
577 |
+
</select>
|
578 |
+
),
|
579 |
+
Cell: row => {
|
580 |
+
const user = row.value;
|
581 |
+
if ( ! user ) {
|
582 |
+
return null;
|
583 |
+
}
|
584 |
+
|
585 |
+
const name = user.name ? user.name : ( row.original.submission_author_user_name ? row.original.submission_author_user_name : '' );
|
586 |
+
|
587 |
+
return (
|
588 |
+
<div className="wprm-admin-manage-recipe-submission-user">
|
589 |
+
<div className="wprm-admin-manage-recipe-submission-user-name">
|
590 |
+
{
|
591 |
+
user.id
|
592 |
+
?
|
593 |
+
<a href={ row.original.submission_author_user_link } target="_blank">#{ user.id }</a>
|
594 |
+
:
|
595 |
+
null
|
596 |
+
}
|
597 |
+
{
|
598 |
+
name
|
599 |
+
?
|
600 |
+
<span> - { name }</span>
|
601 |
+
:
|
602 |
+
null
|
603 |
+
}
|
604 |
+
</div>
|
605 |
+
{
|
606 |
+
user.email
|
607 |
+
?
|
608 |
+
<div className="wprm-admin-manage-recipe-submission-user-email">{ user.email }</div>
|
609 |
+
:
|
610 |
+
null
|
611 |
+
}
|
612 |
+
</div>
|
613 |
+
)
|
614 |
+
},
|
615 |
+
});
|
616 |
+
}
|
617 |
+
|
618 |
+
return columns;
|
619 |
+
}
|
620 |
+
};
|
assets/js/admin-manage/recipes/SeoIndicator.js
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import React, { Fragment } from 'react';
|
2 |
+
|
3 |
+
import Tooltip from '../../shared/Tooltip';
|
4 |
+
|
5 |
+
const SeoIndicator = (props) => {
|
6 |
+
if ( ! props.seo ) {
|
7 |
+
return null;
|
8 |
+
}
|
9 |
+
|
10 |
+
return (
|
11 |
+
<Tooltip
|
12 |
+
content={ props.seo.message }
|
13 |
+
>
|
14 |
+
<div
|
15 |
+
className={ `wprm-admin-manage-seo-indicator wprm-admin-manage-seo-indicator-${ props.seo.type.trim() }` }
|
16 |
+
onClick={ props.onClick }
|
17 |
+
>
|
18 |
+
{
|
19 |
+
'other' === props.seo.type
|
20 |
+
?
|
21 |
+
'n/a'
|
22 |
+
:
|
23 |
+
<Fragment>
|
24 |
+
<div className="wprm-admin-manage-seo-indicator-block"></div>
|
25 |
+
<div className="wprm-admin-manage-seo-indicator-block"></div>
|
26 |
+
<div className="wprm-admin-manage-seo-indicator-block"></div>
|
27 |
+
<div className="wprm-admin-manage-seo-indicator-block"></div>
|
28 |
+
</Fragment>
|
29 |
+
}
|
30 |
+
</div>
|
31 |
+
</Tooltip>
|
32 |
+
);
|
33 |
+
}
|
34 |
+
export default SeoIndicator;
|
assets/js/admin-manage/revisions/Columns.js
ADDED
@@ -0,0 +1,89 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import React from 'react';
|
2 |
+
|
3 |
+
import TextFilter from '../general/TextFilter';
|
4 |
+
import RecipeApi from '../../shared/Api';
|
5 |
+
import Icon from '../../shared/Icon';
|
6 |
+
import { __wprm } from '../../shared/Translations';
|
7 |
+
|
8 |
+
export default {
|
9 |
+
getColumns( recipes ) {
|
10 |
+
let columns = [{
|
11 |
+
Header: __wprm( 'Sort:' ),
|
12 |
+
id: 'actions',
|
13 |
+
headerClassName: 'wprm-admin-table-help-text',
|
14 |
+
sortable: false,
|
15 |
+
width: 70,
|
16 |
+
Filter: () => (
|
17 |
+
<div>
|
18 |
+
{ __wprm( 'Filter:' ) }
|
19 |
+
</div>
|
20 |
+
),
|
21 |
+
Cell: row => (
|
22 |
+
<div className="wprm-admin-manage-actions">
|
23 |
+
<Icon
|
24 |
+
type="eye"
|
25 |
+
title={ __wprm( 'View Revision' ) }
|
26 |
+
onClick={() => {
|
27 |
+
WPRM_Modal.open( 'recipe', {
|
28 |
+
recipe: row.original.recipe_data,
|
29 |
+
restoreRevision: true,
|
30 |
+
saveCallback: () => recipes.refreshData(),
|
31 |
+
} );
|
32 |
+
}}
|
33 |
+
/>
|
34 |
+
<Icon
|
35 |
+
type="trash"
|
36 |
+
title={ __wprm( 'Delete Revision' ) }
|
37 |
+
onClick={() => {
|
38 |
+
if( confirm( `${ __wprm( 'Are you sure you want to delete' ) } "${row.original.post_title}"?` ) ) {
|
39 |
+
RecipeApi.deleteRecipeRevision(row.original.post_parent, row.original.ID).then(() => recipes.refreshData());
|
40 |
+
}
|
41 |
+
}}
|
42 |
+
/>
|
43 |
+
</div>
|
44 |
+
),
|
45 |
+
},{
|
46 |
+
Header: __wprm( 'Recipe ID' ),
|
47 |
+
id: 'recipe_id',
|
48 |
+
accessor: 'post_parent',
|
49 |
+
width: 75,
|
50 |
+
Filter: (props) => (<TextFilter {...props}/>),
|
51 |
+
},{
|
52 |
+
Header: __wprm( 'Revision ID' ),
|
53 |
+
id: 'id',
|
54 |
+
accessor: 'ID',
|
55 |
+
width: 75,
|
56 |
+
Filter: (props) => (<TextFilter {...props}/>),
|
57 |
+
},{
|
58 |
+
Header: __wprm( 'Date' ),
|
59 |
+
id: 'date',
|
60 |
+
accessor: 'post_date',
|
61 |
+
width: 150,
|
62 |
+
Filter: (props) => (<TextFilter {...props}/>),
|
63 |
+
},{
|
64 |
+
Header: __wprm( 'Name' ),
|
65 |
+
id: 'name',
|
66 |
+
accessor: 'post_title',
|
67 |
+
Filter: (props) => (<TextFilter {...props}/>),
|
68 |
+
},{
|
69 |
+
Header: __wprm( 'Recipe Data Size' ),
|
70 |
+
id: 'recipe_data',
|
71 |
+
accessor: 'recipe_data',
|
72 |
+
sortable: false,
|
73 |
+
filterable: false,
|
74 |
+
width: 150,
|
75 |
+
Cell: row => {
|
76 |
+
const emptyRecipeLength = JSON.stringify( wprm_admin_modal.recipe ).length;
|
77 |
+
const revisionRecipeLength = JSON.stringify( row.value ).length;
|
78 |
+
|
79 |
+
return (
|
80 |
+
<div>
|
81 |
+
{ Math.max(revisionRecipeLength - emptyRecipeLength, 0 ).toLocaleString() }
|
82 |
+
</div>
|
83 |
+
)
|
84 |
+
},
|
85 |
+
}]
|
86 |
+
|
87 |
+
return columns;
|
88 |
+
}
|
89 |
+
};
|
assets/js/admin-manage/taxonomies/Columns.js
ADDED
@@ -0,0 +1,197 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import React from 'react';
|
2 |
+
import he from 'he';
|
3 |
+
|
4 |
+
import TextFilter from '../general/TextFilter';
|
5 |
+
import bulkEditCheckbox from '../general/bulkEditCheckbox';
|
6 |
+
import Api from '../general/Api';
|
7 |
+
import Icon from '../../shared/Icon';
|
8 |
+
import { __wprm } from '../../shared/Translations';
|
9 |
+
|
10 |
+
import '../../../css/admin/manage/taxonomies.scss';
|
11 |
+
|
12 |
+
export default {
|
13 |
+
getColumns( datatable ) {
|
14 |
+
let columns = [
|
15 |
+
bulkEditCheckbox( datatable, 'term_id' ),
|
16 |
+
{
|
17 |
+
Header: __wprm( 'Sort:' ),
|
18 |
+
id: 'actions',
|
19 |
+
headerClassName: 'wprm-admin-table-help-text',
|
20 |
+
sortable: false,
|
21 |
+
width: 100,
|
22 |
+
Filter: () => (
|
23 |
+
<div>
|
24 |
+
{ __wprm( 'Filter:' ) }
|
25 |
+
</div>
|
26 |
+
),
|
27 |
+
Cell: row => (
|
28 |
+
<div className="wprm-admin-manage-actions">
|
29 |
+
<Icon
|
30 |
+
type="pencil"
|
31 |
+
title={ `${ __wprm( 'Rename' ) } ${ datatable.options.label.singular }` }
|
32 |
+
onClick={() => {
|
33 |
+
let newName = prompt( `${ __wprm( 'What do you want to be the new name for' ) } "${row.original.name}"?`, row.original.name );
|
34 |
+
if( newName && newName.trim() ) {
|
35 |
+
Api.renameTerm(datatable.options.id, row.original.term_id, newName).then(() => datatable.refreshData());
|
36 |
+
}
|
37 |
+
}}
|
38 |
+
/>
|
39 |
+
<Icon
|
40 |
+
type="merge"
|
41 |
+
title={ `${ __wprm( 'Merge into another' ) } ${ datatable.options.label.singular }` }
|
42 |
+
onClick={() => {
|
43 |
+
let newId = prompt( `${ __wprm( 'What is the ID of the term you want the merge' ) } "${row.original.name}" ${ __wprm( 'into' ) }?` );
|
44 |
+
if( newId && newId != row.original.term_id && newId.trim() ) {
|
45 |
+
Api.getTerm(datatable.options.id, newId).then(newTerm => {
|
46 |
+
if ( newTerm ) {
|
47 |
+
if ( confirm( `${ __wprm( 'Are you sure you want to merge' ) } "${row.original.name}" ${ __wprm( 'into' ) } "${newTerm.name}"?` ) ) {
|
48 |
+
Api.mergeTerm(datatable.options.id, row.original.term_id, newId).then(() => datatable.refreshData());
|
49 |
+
}
|
50 |
+
} else {
|
51 |
+
alert( __wprm( 'We could not find a term with that ID.' ) );
|
52 |
+
}
|
53 |
+
});
|
54 |
+
}
|
55 |
+
}}
|
56 |
+
/>
|
57 |
+
<Icon
|
58 |
+
type="trash"
|
59 |
+
title={ `${ __wprm( 'Delete' ) } ${ datatable.options.label.singular }` }
|
60 |
+
onClick={() => {
|
61 |
+
if( confirm( `${ __wprm( 'Are you sure you want to delete' ) } "${row.original.name}"?` ) ) {
|
62 |
+
Api.deleteTerm(datatable.options.id, row.original.term_id).then(() => datatable.refreshData());
|
63 |
+
}
|
64 |
+
}}
|
65 |
+
/>
|
66 |
+
</div>
|
67 |
+
),
|
68 |
+
},{
|
69 |
+
Header: __wprm( 'ID' ),
|
70 |
+
id: 'id',
|
71 |
+
accessor: 'term_id',
|
72 |
+
width: 65,
|
73 |
+
Filter: (props) => (<TextFilter {...props}/>),
|
74 |
+
},{
|
75 |
+
Header: __wprm( 'Name' ),
|
76 |
+
id: 'name',
|
77 |
+
accessor: 'name',
|
78 |
+
Filter: (props) => (<TextFilter {...props}/>),
|
79 |
+
Cell: row => he.decode(row.value),
|
80 |
+
},{
|
81 |
+
Header: __wprm( 'Recipes' ),
|
82 |
+
id: 'count',
|
83 |
+
accessor: 'count',
|
84 |
+
filterable: false,
|
85 |
+
width: 65,
|
86 |
+
}
|
87 |
+
];
|
88 |
+
|
89 |
+
if ( 'ingredient' === datatable.options.id && wprm_admin.addons.premium ) {
|
90 |
+
columns.push({
|
91 |
+
Header: __wprm( 'Shopping List Group' ),
|
92 |
+
id: 'group',
|
93 |
+
accessor: 'group',
|
94 |
+
width: 200,
|
95 |
+
Filter: (props) => (<TextFilter {...props}/>),
|
96 |
+
Cell: row => {
|
97 |
+
return (
|
98 |
+
<div className="wprm-manage-ingredients-group-container">
|
99 |
+
<Icon
|
100 |
+
type="pencil"
|
101 |
+
title={ __wprm( 'Change Group' ) }
|
102 |
+
onClick={() => {
|
103 |
+
const newGroup = prompt( `${ __wprm( 'What do you want to be the new group for' ) } "${row.original.name}"?`, row.value );
|
104 |
+
if( false !== newGroup ) {
|
105 |
+
Api.updateIngredientMeta(row.original.term_id, { group: newGroup }).then(() => datatable.refreshData());
|
106 |
+
}
|
107 |
+
}}
|
108 |
+
/>
|
109 |
+
{
|
110 |
+
row.value
|
111 |
+
?
|
112 |
+
<span>{ row.value }</span>
|
113 |
+
:
|
114 |
+
null
|
115 |
+
}
|
116 |
+
</div>
|
117 |
+
)
|
118 |
+
},
|
119 |
+
},{
|
120 |
+
Header: __wprm( 'Link' ),
|
121 |
+
id: 'link',
|
122 |
+
accessor: 'link',
|
123 |
+
width: 300,
|
124 |
+
Filter: (props) => (<TextFilter {...props}/>),
|
125 |
+
Cell: row => {
|
126 |
+
return (
|
127 |
+
<div className="wprm-manage-ingredients-link-container">
|
128 |
+
<Icon
|
129 |
+
type="pencil"
|
130 |
+
title={ __wprm( 'Change Ingredient Link' ) }
|
131 |
+
onClick={() => {
|
132 |
+
const newLink = prompt( `${ __wprm( 'What do you want to be the new link for' ) } "${row.original.name}"?`, row.value );
|
133 |
+
if( false !== newLink ) {
|
134 |
+
Api.updateIngredientMeta(row.original.term_id, { link: newLink }).then(() => datatable.refreshData());
|
135 |
+
}
|
136 |
+
}}
|
137 |
+
/>
|
138 |
+
{
|
139 |
+
row.value
|
140 |
+
?
|
141 |
+
<a href={ row.value } target="_blank">{ row.value }</a>
|
142 |
+
:
|
143 |
+
null
|
144 |
+
}
|
145 |
+
</div>
|
146 |
+
)
|
147 |
+
},
|
148 |
+
},{
|
149 |
+
Header: __wprm( 'Link Nofollow' ),
|
150 |
+
id: 'link_nofollow',
|
151 |
+
accessor: 'link_nofollow',
|
152 |
+
width: 250,
|
153 |
+
Filter: ({ filter, onChange }) => (
|
154 |
+
<select
|
155 |
+
onChange={event => onChange(event.target.value)}
|
156 |
+
style={{ width: '100%', fontSize: '1em' }}
|
157 |
+
value={filter ? filter.value : 'all'}
|
158 |
+
>
|
159 |
+
<option value="all">{ __wprm( 'Any Nofollow' ) }</option>
|
160 |
+
{
|
161 |
+
wprm_admin_modal.options.ingredient_link_nofollow.map((option, index) => (
|
162 |
+
<option value={option.value} key={index}>{ option.label }</option>
|
163 |
+
))
|
164 |
+
}
|
165 |
+
</select>
|
166 |
+
),
|
167 |
+
Cell: row => {
|
168 |
+
return (
|
169 |
+
<div>
|
170 |
+
{
|
171 |
+
row.original.link
|
172 |
+
?
|
173 |
+
<select
|
174 |
+
onChange={event => {
|
175 |
+
Api.updateIngredientMeta(row.original.term_id, { link_nofollow: event.target.value }).then(() => datatable.refreshData());
|
176 |
+
}}
|
177 |
+
style={{ width: '100%', fontSize: '1em' }}
|
178 |
+
value={row.value}
|
179 |
+
>
|
180 |
+
{
|
181 |
+
wprm_admin_modal.options.ingredient_link_nofollow.map((option, index) => (
|
182 |
+
<option value={option.value} key={index}>{ option.label }</option>
|
183 |
+
))
|
184 |
+
}
|
185 |
+
</select>
|
186 |
+
:
|
187 |
+
null
|
188 |
+
}
|
189 |
+
</div>
|
190 |
+
)
|
191 |
+
},
|
192 |
+
});
|
193 |
+
}
|
194 |
+
|
195 |
+
return columns;
|
196 |
+
}
|
197 |
+
};
|
assets/js/admin-modal.js
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
if (!global._babelPolyfill) { require('babel-polyfill'); }
|
2 |
+
import ReactDOM from 'react-dom';
|
3 |
+
import React from 'react';
|
4 |
+
|
5 |
+
import App from './admin-modal/App';
|
6 |
+
|
7 |
+
let appContainer = document.getElementById( 'wprm-admin-modal' );
|
8 |
+
|
9 |
+
if (appContainer) {
|
10 |
+
ReactDOM.render(
|
11 |
+
<App
|
12 |
+
ref={(app) => {window.WPRM_Modal = app}}
|
13 |
+
/>,
|
14 |
+
appContainer
|
15 |
+
);
|
16 |
+
}
|
assets/js/admin-modal/App.js
ADDED
@@ -0,0 +1,110 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import React, { Component } from 'react';
|
2 |
+
import Modal from 'react-modal';
|
3 |
+
Modal.setAppElement( '#wprm-admin-modal' );
|
4 |
+
|
5 |
+
import '../../css/admin/modal/app.scss';
|
6 |
+
import '../../css/admin/modal/general/fields.scss';
|
7 |
+
|
8 |
+
import ErrorBoundary from '../shared/ErrorBoundary';
|
9 |
+
|
10 |
+
import BulkEdit from './bulk-edit';
|
11 |
+
import Menu from './menu';
|
12 |
+
import Nutrition from './nutrition';
|
13 |
+
import Recipe from './recipe';
|
14 |
+
import Select from './select';
|
15 |
+
import Taxonomy from './taxonomy';
|
16 |
+
import { __wprm } from '../shared/Translations';
|
17 |
+
|
18 |
+
const contentBlocks = {
|
19 |
+
'bulk-edit': BulkEdit,
|
20 |
+
menu: Menu,
|
21 |
+
nutrition: Nutrition,
|
22 |
+
recipe: Recipe,
|
23 |
+
select: Select,
|
24 |
+
taxonomy: Taxonomy,
|
25 |
+
};
|
26 |
+
|
27 |
+
export default class App extends Component {
|
28 |
+
constructor() {
|
29 |
+
super();
|
30 |
+
|
31 |
+
this.state = {
|
32 |
+
modalIsOpen: false,
|
33 |
+
mode: '',
|
34 |
+
args: {},
|
35 |
+
};
|
36 |
+
|
37 |
+
this.content = React.createRef();
|
38 |
+
|
39 |
+
this.close = this.close.bind(this);
|
40 |
+
this.closeIfAllowed = this.closeIfAllowed.bind(this);
|
41 |
+
}
|
42 |
+
|
43 |
+
open( mode, args = {}, forceOpen = false ) {
|
44 |
+
if ( forceOpen || ! this.state.modalIsOpen ) {
|
45 |
+
this.setState({
|
46 |
+
modalIsOpen: true,
|
47 |
+
mode,
|
48 |
+
args,
|
49 |
+
}, () => {
|
50 |
+
window.onbeforeunload = () => __wprm( 'Are you sure you want to leave this page?' );
|
51 |
+
});
|
52 |
+
}
|
53 |
+
}
|
54 |
+
|
55 |
+
close(callback = false) {
|
56 |
+
this.setState({
|
57 |
+
modalIsOpen: false,
|
58 |
+
}, () => {
|
59 |
+
window.onbeforeunload = null;
|
60 |
+
if ( 'function' === typeof callback ) {
|
61 |
+
callback();
|
62 |
+
}
|
63 |
+
});
|
64 |
+
}
|
65 |
+
|
66 |
+
closeIfAllowed(callback = false) {
|
67 |
+
const checkFunction = this.content.current && this.content.current.hasOwnProperty( 'allowCloseModal' ) ? this.content.current.allowCloseModal : false;
|
68 |
+
|
69 |
+
if ( ! checkFunction || checkFunction() ) {
|
70 |
+
this.close(callback);
|
71 |
+
}
|
72 |
+
}
|
73 |
+
|
74 |
+
addTextToEditor( text, editorId ) {
|
75 |
+
if (typeof tinyMCE == 'undefined' || !tinyMCE.get(editorId) || tinyMCE.get(editorId).isHidden()) {
|
76 |
+
var current = jQuery('textarea#' + editorId).val();
|
77 |
+
jQuery('textarea#' + editorId).val(current + text);
|
78 |
+
} else {
|
79 |
+
tinyMCE.get(editorId).focus(true);
|
80 |
+
tinyMCE.activeEditor.selection.collapse(false);
|
81 |
+
tinyMCE.activeEditor.execCommand('mceInsertContent', false, text);
|
82 |
+
}
|
83 |
+
};
|
84 |
+
|
85 |
+
render() {
|
86 |
+
const Content = contentBlocks.hasOwnProperty(this.state.mode) ? contentBlocks[this.state.mode] : false;
|
87 |
+
|
88 |
+
if ( ! Content ) {
|
89 |
+
return null;
|
90 |
+
}
|
91 |
+
|
92 |
+
return (
|
93 |
+
<Modal
|
94 |
+
isOpen={ this.state.modalIsOpen }
|
95 |
+
onRequestClose={ this.closeIfAllowed }
|
96 |
+
overlayClassName="wprm-admin-modal-overlay"
|
97 |
+
className={`wprm-admin-modal wprm-admin-modal-${this.state.mode}`}
|
98 |
+
>
|
99 |
+
<ErrorBoundary module="Modal">
|
100 |
+
<Content
|
101 |
+
ref={ this.content }
|
102 |
+
mode={ this.state.mode }
|
103 |
+
args={ this.state.args }
|
104 |
+
maybeCloseModal={ this.closeIfAllowed }
|
105 |
+
/>
|
106 |
+
</ErrorBoundary>
|
107 |
+
</Modal>
|
108 |
+
);
|
109 |
+
}
|
110 |
+
}
|
assets/js/admin-modal/bulk-edit/ActionsIngredient.js
ADDED
@@ -0,0 +1,103 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import React, { Fragment } from 'react';
|
2 |
+
|
3 |
+
import FieldText from '../fields/FieldText';
|
4 |
+
import FieldRadio from '../fields/FieldRadio';
|
5 |
+
import { __wprm } from '../../shared/Translations';
|
6 |
+
|
7 |
+
const ActionsIngredient = (props) => {
|
8 |
+
const selectedAction = props.action ? props.action.type : false;
|
9 |
+
const actionOptions = [
|
10 |
+
{ value: 'change-group', label: __wprm( 'Change Shopping List Group' ), default: '' },
|
11 |
+
{ value: 'change-link', label: __wprm( 'Change Link' ), default: '' },
|
12 |
+
{ value: 'change-nofollow', label: __wprm( 'Change Link Nofollow' ), default: 'default' },
|
13 |
+
{ value: 'delete', label: __wprm( 'Delete Ingredients' ), default: false },
|
14 |
+
];
|
15 |
+
|
16 |
+
return (
|
17 |
+
<Fragment>
|
18 |
+
<div className="wprm-admin-modal-bulk-edit-label">{ __wprm( 'Select an action to perform:' ) }</div>
|
19 |
+
<div className="wprm-admin-modal-bulk-edit-actions">
|
20 |
+
{
|
21 |
+
actionOptions.map((option) => (
|
22 |
+
<div className="wprm-admin-modal-bulk-edit-action" key={option.value}>
|
23 |
+
<input
|
24 |
+
type="radio"
|
25 |
+
value={option.value}
|
26 |
+
name={`wprm-admin-radio-bulk-edit-action`}
|
27 |
+
id={`wprm-admin-radio-bulk-edit-action-${option.value}`}
|
28 |
+
checked={selectedAction === option.value}
|
29 |
+
onChange={() => {
|
30 |
+
const newAction = {
|
31 |
+
type: option.value,
|
32 |
+
options: option.default,
|
33 |
+
}
|
34 |
+
|
35 |
+
props.onActionChange(newAction);
|
36 |
+
}}
|
37 |
+
/><label htmlFor={`wprm-admin-radio-bulk-edit-action-${option.value}`}>{ option.label }</label>
|
38 |
+
</div>
|
39 |
+
))
|
40 |
+
}
|
41 |
+
</div>
|
42 |
+
{
|
43 |
+
selectedAction && false !== props.action.options
|
44 |
+
&&
|
45 |
+
<Fragment>
|
46 |
+
<div className="wprm-admin-modal-bulk-edit-label">{ __wprm( 'Action options:' ) }</div>
|
47 |
+
<div className="wprm-admin-modal-bulk-edit-options">
|
48 |
+
{
|
49 |
+
'change-group' === selectedAction
|
50 |
+
&&
|
51 |
+
<FieldText
|
52 |
+
value={props.action.options}
|
53 |
+
placeholder={ __wprm( 'Shopping List Group' ) }
|
54 |
+
onChange={(group) => {
|
55 |
+
const newAction = {
|
56 |
+
...props.action,
|
57 |
+
options: group,
|
58 |
+
}
|
59 |
+
|
60 |
+
props.onActionChange(newAction);
|
61 |
+
}}
|
62 |
+
/>
|
63 |
+
}
|
64 |
+
{
|
65 |
+
'change-link' === selectedAction
|
66 |
+
&&
|
67 |
+
<FieldText
|
68 |
+
value={props.action.options}
|
69 |
+
placeholder={ __wprm( 'Ingredient Link' ) }
|
70 |
+
onChange={(group) => {
|
71 |
+
const newAction = {
|
72 |
+
...props.action,
|
73 |
+
options: group,
|
74 |
+
}
|
75 |
+
|
76 |
+
props.onActionChange(newAction);
|
77 |
+
}}
|
78 |
+
/>
|
79 |
+
}
|
80 |
+
{
|
81 |
+
'change-nofollow' === selectedAction
|
82 |
+
&&
|
83 |
+
<FieldRadio
|
84 |
+
id="nofollow"
|
85 |
+
options={wprm_admin_modal.options.ingredient_link_nofollow}
|
86 |
+
value={props.action.options}
|
87 |
+
onChange={(value) => {
|
88 |
+
const newAction = {
|
89 |
+
...props.action,
|
90 |
+
options: value,
|
91 |
+
}
|
92 |
+
|
93 |
+
props.onActionChange(newAction);
|
94 |
+
}}
|
95 |
+
/>
|
96 |
+
}
|
97 |
+
</div>
|
98 |
+
</Fragment>
|
99 |
+
}
|
100 |
+
</Fragment>
|
101 |
+
);
|
102 |
+
}
|
103 |
+
export default ActionsIngredient;
|
assets/js/admin-modal/bulk-edit/ActionsRating.js
ADDED
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import React, { Fragment } from 'react';
|
2 |
+
|
3 |
+
import { __wprm } from '../../shared/Translations';
|
4 |
+
|
5 |
+
const ActionsRating = (props) => {
|
6 |
+
const selectedAction = props.action ? props.action.type : false;
|
7 |
+
const actionOptions = [
|
8 |
+
{ value: 'delete', label: __wprm( 'Delete Ratings' ), default: false },
|
9 |
+
];
|
10 |
+
|
11 |
+
return (
|
12 |
+
<Fragment>
|
13 |
+
<div className="wprm-admin-modal-bulk-edit-label">{ __wprm( 'Select an action to perform:' ) }</div>
|
14 |
+
<div className="wprm-admin-modal-bulk-edit-actions">
|
15 |
+
{
|
16 |
+
actionOptions.map((option) => (
|
17 |
+
<div className="wprm-admin-modal-bulk-edit-action" key={option.value}>
|
18 |
+
<input
|
19 |
+
type="radio"
|
20 |
+
value={option.value}
|
21 |
+
name={`wprm-admin-radio-bulk-edit-action`}
|
22 |
+
id={`wprm-admin-radio-bulk-edit-action-${option.value}`}
|
23 |
+
checked={selectedAction === option.value}
|
24 |
+
onChange={() => {
|
25 |
+
const newAction = {
|
26 |
+
type: option.value,
|
27 |
+
options: option.default,
|
28 |
+
}
|
29 |
+
|
30 |
+
props.onActionChange(newAction);
|
31 |
+
}}
|
32 |
+
/><label htmlFor={`wprm-admin-radio-bulk-edit-action-${option.value}`}>{ option.label }</label>
|
33 |
+
</div>
|
34 |
+
))
|
35 |
+
}
|
36 |
+
</div>
|
37 |
+
</Fragment>
|
38 |
+
);
|
39 |
+
}
|
40 |
+
export default ActionsRating;
|
assets/js/admin-modal/bulk-edit/ActionsRecipe.js
ADDED
@@ -0,0 +1,185 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import React, { Fragment } from 'react';
|
2 |
+
|
3 |
+
import FieldDropdown from '../fields/FieldDropdown';
|
4 |
+
import FieldCategory from '../fields/FieldCategory';
|
5 |
+
import FieldText from '../fields/FieldText';
|
6 |
+
import { __wprm } from '../../shared/Translations';
|
7 |
+
|
8 |
+
const ActionsRecipe = (props) => {
|
9 |
+
const selectedAction = props.action ? props.action.type : false;
|
10 |
+
|
11 |
+
let defaultTaxonomy = false;
|
12 |
+
let taxonomyOptions = [];
|
13 |
+
Object.keys(wprm_admin_manage.taxonomies).map((taxonomy, index) => {
|
14 |
+
const key = taxonomy.substr(5);
|
15 |
+
|
16 |
+
if ( ! defaultTaxonomy ) {
|
17 |
+
defaultTaxonomy = key;
|
18 |
+
}
|
19 |
+
|
20 |
+
taxonomyOptions.push({
|
21 |
+
value: key,
|
22 |
+
label: wprm_admin_manage.taxonomies[ taxonomy ].name,
|
23 |
+
});
|
24 |
+
});
|
25 |
+
|
26 |
+
// Set action options.
|
27 |
+
let actionOptions = [];
|
28 |
+
if ( 0 < taxonomyOptions.length ) {
|
29 |
+
actionOptions.push(
|
30 |
+
{ value: 'add-terms', label: __wprm( 'Add Terms' ), default: { taxonomy: defaultTaxonomy, terms: [] } },
|
31 |
+
{ value: 'remove-terms', label: __wprm( 'Remove Terms' ), default: { taxonomy: defaultTaxonomy, terms: [] } },
|
32 |
+
);
|
33 |
+
}
|
34 |
+
actionOptions.push(
|
35 |
+
{ value: 'change-author', label: __wprm( 'Change Display Author' ), default: { author: 'default', author_name: '', author_link: '' } },
|
36 |
+
{ value: 'delete', label: __wprm( 'Delete Recipes' ), default: false },
|
37 |
+
)
|
38 |
+
|
39 |
+
return (
|
40 |
+
<Fragment>
|
41 |
+
<div className="wprm-admin-modal-bulk-edit-label">{ __wprm( 'Select an action to perform:' ) }</div>
|
42 |
+
<div className="wprm-admin-modal-bulk-edit-actions">
|
43 |
+
{
|
44 |
+
actionOptions.map((option) => (
|
45 |
+
<div className="wprm-admin-modal-bulk-edit-action" key={option.value}>
|
46 |
+
<input
|
47 |
+
type="radio"
|
48 |
+
value={option.value}
|
49 |
+
name={`wprm-admin-radio-bulk-edit-action`}
|
50 |
+
id={`wprm-admin-radio-bulk-edit-action-${option.value}`}
|
51 |
+
checked={selectedAction === option.value}
|
52 |
+
onChange={() => {
|
53 |
+
const newAction = {
|
54 |
+
type: option.value,
|
55 |
+
options: option.default,
|
56 |
+
}
|
57 |
+
|
58 |
+
props.onActionChange(newAction);
|
59 |
+
}}
|
60 |
+
/><label htmlFor={`wprm-admin-radio-bulk-edit-action-${option.value}`}>{ option.label }</label>
|
61 |
+
</div>
|
62 |
+
))
|
63 |
+
}
|
64 |
+
</div>
|
65 |
+
{
|
66 |
+
selectedAction && false !== props.action.options
|
67 |
+
&&
|
68 |
+
<Fragment>
|
69 |
+
<div className="wprm-admin-modal-bulk-edit-label">{ __wprm( 'Action options:' ) }</div>
|
70 |
+
<div className="wprm-admin-modal-bulk-edit-options">
|
71 |
+
{
|
72 |
+
'change-author' === selectedAction
|
73 |
+
&&
|
74 |
+
<Fragment>
|
75 |
+
<FieldDropdown
|
76 |
+
options={ wprm_admin_modal.options.author.filter( ( author ) => 'same' !== author.actual ) }
|
77 |
+
value={ props.action.options.author }
|
78 |
+
onChange={ (author) => {
|
79 |
+
const newAction = {
|
80 |
+
...props.action,
|
81 |
+
options: {
|
82 |
+
author,
|
83 |
+
author_name: '',
|
84 |
+
author_link: '',
|
85 |
+
}
|
86 |
+
}
|
87 |
+
props.onActionChange(newAction);
|
88 |
+
}}
|
89 |
+
width={ 300 }
|
90 |
+
custom={{
|
91 |
+
menuPlacement: 'top',
|
92 |
+
maxMenuHeight: 150,
|
93 |
+
}}
|
94 |
+
/>
|
95 |
+
{
|
96 |
+
'custom' === wprm_admin_modal.options.author.find((option) => option.value === props.action.options.author ).actual
|
97 |
+
&&
|
98 |
+
<Fragment>
|
99 |
+
|
100 |
+
<FieldText
|
101 |
+
placeholder={ __wprm( 'Author Name' ) }
|
102 |
+
value={ props.action.options.author_name }
|
103 |
+
onChange={ (author_name) => {
|
104 |
+
const newAction = {
|
105 |
+
...props.action,
|
106 |
+
options: {
|
107 |
+
...props.action.options,
|
108 |
+
author_name,
|
109 |
+
}
|
110 |
+
}
|
111 |
+
props.onActionChange(newAction);
|
112 |
+
}}
|
113 |
+
/>
|
114 |
+
|
115 |
+
<FieldText
|
116 |
+
placeholder="https://bootstrapped.ventures"
|
117 |
+
type="url"
|
118 |
+
value={ props.action.options.author_link }
|
119 |
+
onChange={ (author_link) => {
|
120 |
+
const newAction = {
|
121 |
+
...props.action,
|
122 |
+
options: {
|
123 |
+
...props.action.options,
|
124 |
+
author_link,
|
125 |
+
}
|
126 |
+
}
|
127 |
+
props.onActionChange(newAction);
|
128 |
+
}}
|
129 |
+
/>
|
130 |
+
</Fragment>
|
131 |
+
}
|
132 |
+
</Fragment>
|
133 |
+
}
|
134 |
+
{
|
135 |
+
( 'add-terms' === selectedAction || 'remove-terms' === selectedAction )
|
136 |
+
&&
|
137 |
+
<Fragment>
|
138 |
+
<FieldDropdown
|
139 |
+
options={ taxonomyOptions }
|
140 |
+
value={ props.action.options.taxonomy }
|
141 |
+
onChange={ (taxonomy) => {
|
142 |
+
const newAction = {
|
143 |
+
...props.action,
|
144 |
+
options: {
|
145 |
+
taxonomy,
|
146 |
+
terms: [],
|
147 |
+
}
|
148 |
+
}
|
149 |
+
props.onActionChange(newAction);
|
150 |
+
}}
|
151 |
+
width={ 200 }
|
152 |
+
custom={{
|
153 |
+
menuPlacement: 'top',
|
154 |
+
maxMenuHeight: 150,
|
155 |
+
}}
|
156 |
+
/>
|
157 |
+
|
158 |
+
<FieldCategory
|
159 |
+
id={ props.action.options.taxonomy }
|
160 |
+
value={ props.action.options.terms }
|
161 |
+
onChange={(terms) => {
|
162 |
+
const newAction = {
|
163 |
+
...props.action,
|
164 |
+
options: {
|
165 |
+
taxonomy: props.action.options.taxonomy,
|
166 |
+
terms,
|
167 |
+
}
|
168 |
+
}
|
169 |
+
|
170 |
+
props.onActionChange(newAction);
|
171 |
+
}}
|
172 |
+
custom={{
|
173 |
+
menuPlacement: 'top',
|
174 |
+
maxMenuHeight: 200,
|
175 |
+
}}
|
176 |
+
/>
|
177 |
+
</Fragment>
|
178 |
+
}
|
179 |
+
</div>
|
180 |
+
</Fragment>
|
181 |
+
}
|
182 |
+
</Fragment>
|
183 |
+
);
|
184 |
+
}
|
185 |
+
export default ActionsRecipe;
|
assets/js/admin-modal/bulk-edit/ActionsTaxonomy.js
ADDED
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import React, { Fragment } from 'react';
|
2 |
+
|
3 |
+
import { __wprm } from '../../shared/Translations';
|
4 |
+
|
5 |
+
const ActionsIngredient = (props) => {
|
6 |
+
const selectedAction = props.action ? props.action.type : false;
|
7 |
+
const actionOptions = [
|
8 |
+
{ value: 'delete', label: __wprm( 'Delete Terms' ), default: false },
|
9 |
+
];
|
10 |
+
|
11 |
+
return (
|
12 |
+
<Fragment>
|
13 |
+
<div className="wprm-admin-modal-bulk-edit-label">{ __wprm( 'Select an action to perform:' ) }</div>
|
14 |
+
<div className="wprm-admin-modal-bulk-edit-actions">
|
15 |
+
{
|
16 |
+
actionOptions.map((option) => (
|
17 |
+
<div className="wprm-admin-modal-bulk-edit-action" key={option.value}>
|
18 |
+
<input
|
19 |
+
type="radio"
|
20 |
+
value={option.value}
|
21 |
+
name={`wprm-admin-radio-bulk-edit-action`}
|
22 |
+
id={`wprm-admin-radio-bulk-edit-action-${option.value}`}
|
23 |
+
checked={selectedAction === option.value}
|
24 |
+
onChange={() => {
|
25 |
+
const newAction = {
|
26 |
+
type: option.value,
|
27 |
+
options: option.default,
|
28 |
+
}
|
29 |
+
|
30 |
+
props.onActionChange(newAction);
|
31 |
+
}}
|
32 |
+
/><label htmlFor={`wprm-admin-radio-bulk-edit-action-${option.value}`}>{ option.label }</label>
|
33 |
+
</div>
|
34 |
+
))
|
35 |
+
}
|
36 |
+
</div>
|
37 |
+
{
|
38 |
+
selectedAction && false !== props.action.options
|
39 |
+
&&
|
40 |
+
<Fragment>
|
41 |
+
<div className="wprm-admin-modal-bulk-edit-label">{ __wprm( 'Action options:' ) }</div>
|
42 |
+
<div className="wprm-admin-modal-bulk-edit-options">
|
43 |
+
</div>
|
44 |
+
</Fragment>
|
45 |
+
}
|
46 |
+
</Fragment>
|
47 |
+
);
|
48 |
+
}
|
49 |
+
export default ActionsIngredient;
|
assets/js/admin-modal/bulk-edit/Api.js
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
const manageEndpoint = wprm_admin.endpoints.manage;
|
2 |
+
|
3 |
+
export default {
|
4 |
+
bulkEdit(route, type, ids, action) {
|
5 |
+
const data = {
|
6 |
+
type,
|
7 |
+
ids,
|
8 |
+
action,
|
9 |
+
};
|
10 |
+
|
11 |
+
return fetch(`${manageEndpoint}/${route}/bulk`, {
|
12 |
+
method: 'POST',
|
13 |
+
headers: {
|
14 |
+
'X-WP-Nonce': wprm_admin.api_nonce,
|
15 |
+
'Accept': 'application/json',
|
16 |
+
'Content-Type': 'application/json',
|
17 |
+
},
|
18 |
+
credentials: 'same-origin',
|
19 |
+
body: JSON.stringify(data),
|
20 |
+
}).then(function (response) {
|
21 |
+
if ( response.ok ) {
|
22 |
+
return response.json();
|
23 |
+
} else {
|
24 |
+
console.log(response);
|
25 |
+
alert( 'Something went wrong. Please contact support.' );
|
26 |
+
return false;
|
27 |
+
}
|
28 |
+
});
|
29 |
+
},
|
30 |
+
};
|
assets/js/admin-modal/bulk-edit/index.js
ADDED
@@ -0,0 +1,128 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import React, { Component, Fragment } from 'react';
|
2 |
+
|
3 |
+
import '../../../css/admin/modal/bulk-edit.scss';
|
4 |
+
|
5 |
+
import Api from './Api';
|
6 |
+
import Header from '../general/Header';
|
7 |
+
import Footer from '../general/Footer';
|
8 |
+
import { __wprm } from '../../shared/Translations';
|
9 |
+
|
10 |
+
import ActionsIngredient from './ActionsIngredient';
|
11 |
+
import ActionsRating from './ActionsRating';
|
12 |
+
import ActionsRecipe from './ActionsRecipe';
|
13 |
+
import ActionsTaxonomy from './ActionsTaxonomy';
|
14 |
+
|
15 |
+
let actions = {
|
16 |
+
'rating': {
|
17 |
+
label: __wprm( 'Ratings' ),
|
18 |
+
elem: ActionsRating,
|
19 |
+
},
|
20 |
+
'recipe': {
|
21 |
+
label: __wprm( 'Recipes' ),
|
22 |
+
elem: ActionsRecipe,
|
23 |
+
},
|
24 |
+
'ingredient': {
|
25 |
+
label: __wprm( 'Ingredients' ),
|
26 |
+
elem: ActionsIngredient,
|
27 |
+
},
|
28 |
+
};
|
29 |
+
|
30 |
+
Object.keys(wprm_admin_modal.categories).map((id) => {
|
31 |
+
const taxonomy = wprm_admin_modal.categories[ id ];
|
32 |
+
|
33 |
+
actions[ id ] = {
|
34 |
+
label: taxonomy.label,
|
35 |
+
elem: ActionsTaxonomy,
|
36 |
+
};
|
37 |
+
});
|
38 |
+
|
39 |
+
export default class BulkEdit extends Component {
|
40 |
+
constructor(props) {
|
41 |
+
super(props);
|
42 |
+
|
43 |
+
this.state = {
|
44 |
+
route: props.args.hasOwnProperty( 'route' ) ? props.args.route : 'recipe',
|
45 |
+
type: props.args.hasOwnProperty( 'type' ) ? props.args.type : 'recipe',
|
46 |
+
ids: props.args.hasOwnProperty( 'ids' ) ? props.args.ids : [],
|
47 |
+
action: false,
|
48 |
+
savingChanges: false,
|
49 |
+
};
|
50 |
+
|
51 |
+
// Bind functions.
|
52 |
+
this.onBulkEdit = this.onBulkEdit.bind(this);
|
53 |
+
this.allowCloseModal = this.allowCloseModal.bind(this);
|
54 |
+
}
|
55 |
+
|
56 |
+
onBulkEdit() {
|
57 |
+
if ( this.state.action ) {
|
58 |
+
this.setState({
|
59 |
+
savingChanges: true,
|
60 |
+
}, () => {
|
61 |
+
Api.bulkEdit(this.state.route, this.state.type, this.state.ids, this.state.action).then(() => {
|
62 |
+
this.setState({
|
63 |
+
savingChanges: false,
|
64 |
+
}, () => {
|
65 |
+
if ( 'function' === typeof this.props.args.saveCallback ) {
|
66 |
+
this.props.args.saveCallback();
|
67 |
+
}
|
68 |
+
this.props.maybeCloseModal();
|
69 |
+
});
|
70 |
+
});
|
71 |
+
});
|
72 |
+
}
|
73 |
+
}
|
74 |
+
|
75 |
+
allowCloseModal() {
|
76 |
+
return ! this.state.savingChanges;
|
77 |
+
}
|
78 |
+
|
79 |
+
changesMade() {
|
80 |
+
if ( ! this.state.action || ! this.state.action.type ) {
|
81 |
+
return false;
|
82 |
+
} else {
|
83 |
+
return Array.isArray( this.state.action.options ) && this.state.action.options.length === 0 ? false : true;
|
84 |
+
}
|
85 |
+
}
|
86 |
+
|
87 |
+
render() {
|
88 |
+
const action = actions.hasOwnProperty( this.state.type ) ? actions[ this.state.type ] : false;
|
89 |
+
|
90 |
+
if ( ! action ) {
|
91 |
+
return null;
|
92 |
+
}
|
93 |
+
|
94 |
+
const Actions = action.elem;
|
95 |
+
const bulkEditLabel = `${ __wprm( 'Bulk Edit' ) } ${ this.state.ids.length } ${ action.label }`;
|
96 |
+
|
97 |
+
return (
|
98 |
+
<Fragment>
|
99 |
+
<Header
|
100 |
+
onCloseModal={ this.props.maybeCloseModal }
|
101 |
+
>
|
102 |
+
{ bulkEditLabel }
|
103 |
+
</Header>
|
104 |
+
<div className="wprm-admin-modal-bulk-edit-container">
|
105 |
+
<Actions
|
106 |
+
action={ this.state.action }
|
107 |
+
onActionChange={ (action) => {
|
108 |
+
this.setState({
|
109 |
+
action,
|
110 |
+
});
|
111 |
+
} }
|
112 |
+
/>
|
113 |
+
</div>
|
114 |
+
<Footer
|
115 |
+
savingChanges={ this.state.savingChanges }
|
116 |
+
>
|
117 |
+
<button
|
118 |
+
className="button button-primary"
|
119 |
+
onClick={ this.onBulkEdit }
|
120 |
+
disabled={ ! this.changesMade() }
|
121 |
+
>
|
122 |
+
{ bulkEditLabel }
|
123 |
+
</button>
|
124 |
+
</Footer>
|
125 |
+
</Fragment>
|
126 |
+
);
|
127 |
+
}
|
128 |
+
}
|
assets/js/admin-modal/fields/FieldCategory.js
ADDED
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import React from 'react';
|
2 |
+
import he from 'he';
|
3 |
+
import CreatableSelect from 'react-select/lib/Creatable';
|
4 |
+
|
5 |
+
import { __wprm } from '../../shared/Translations';
|
6 |
+
|
7 |
+
const FieldCategory = (props) => {
|
8 |
+
const categories = wprm_admin_modal.categories[ props.id ].terms;
|
9 |
+
let categoryOptions = [];
|
10 |
+
let selectedCategories = [];
|
11 |
+
|
12 |
+
for ( let category of categories ) {
|
13 |
+
const categoryOption = {
|
14 |
+
value: category.term_id,
|
15 |
+
label: he.decode( category.name ),
|
16 |
+
};
|
17 |
+
|
18 |
+
categoryOptions.push(categoryOption);
|
19 |
+
|
20 |
+
if ( props.value.find((elem) => elem.term_id === category.term_id || elem.name === category.term_id ) ) {
|
21 |
+
selectedCategories.push(categoryOption);
|
22 |
+
}
|
23 |
+
}
|
24 |
+
|
25 |
+
const customProps = props.custom ? props.custom : {};
|
26 |
+
|
27 |
+
return (
|
28 |
+
<CreatableSelect
|
29 |
+
isMulti
|
30 |
+
options={categoryOptions}
|
31 |
+
value={selectedCategories}
|
32 |
+
placeholder={ __wprm( 'Select from list or type to create...' ) }
|
33 |
+
onChange={(value) => {
|
34 |
+
let newValue = [];
|
35 |
+
|
36 |
+
for ( let category of value ) {
|
37 |
+
if ( category.hasOwnProperty('__isNew__') && category.__isNew__ ) {
|
38 |
+
wprm_admin_modal.categories[ props.id ].terms.push({
|
39 |
+
term_id: category.label,
|
40 |
+
name: category.label,
|
41 |
+
});
|
42 |
+
}
|
43 |
+
|
44 |
+
let selectedCategory = wprm_admin_modal.categories[ props.id ].terms.find((cat) => cat.term_id === category.value);
|
45 |
+
|
46 |
+
if ( selectedCategory ) {
|
47 |
+
newValue.push(selectedCategory);
|
48 |
+
}
|
49 |
+
}
|
50 |
+
|
51 |
+
props.onChange(newValue);
|
52 |
+
}}
|
53 |
+
styles={{
|
54 |
+
placeholder: (provided) => ({
|
55 |
+
...provided,
|
56 |
+
color: '#444',
|
57 |
+
opacity: '0.333',
|
58 |
+
}),
|
59 |
+
control: (provided) => ({
|
60 |
+
...provided,
|
61 |
+
backgroundColor: 'white',
|
62 |
+
}),
|
63 |
+
container: (provided) => ({
|
64 |
+
...provided,
|
65 |
+
width: '100%',
|
66 |
+
maxWidth: props.width ? props.width : '100%',
|
67 |
+
}),
|
68 |
+
}}
|
69 |
+
{ ...customProps }
|
70 |
+
/>
|
71 |
+
);
|
72 |
+
}
|
73 |
+
export default FieldCategory;
|
assets/js/admin-modal/fields/FieldContainer.js
ADDED
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
import React, { Fragment } from 'react';
|
3 |
+
|
4 |
+
import Icon from '../../shared/Icon';
|
5 |
+
|
6 |
+
const FieldContainer = (props) => {
|
7 |
+
let className = 'wprm-admin-modal-field-container';
|
8 |
+
|
9 |
+
if ( props.id ) {
|
10 |
+
className += ` wprm-admin-modal-field-container-${props.id}`;
|
11 |
+
}
|
12 |
+
|
13 |
+
let helpIcon = null;
|
14 |
+
if ( props.help ) {
|
15 |
+
helpIcon = (
|
16 |
+
<Icon
|
17 |
+
type="question"
|
18 |
+
title={ props.help }
|
19 |
+
className="wprm-admin-icon-help"
|
20 |
+
/>
|
21 |
+
);
|
22 |
+
}
|
23 |
+
|
24 |
+
return (
|
25 |
+
<div className={ className }>
|
26 |
+
{
|
27 |
+
props.label
|
28 |
+
?
|
29 |
+
<Fragment>
|
30 |
+
<div className="wprm-admin-modal-field-label">{props.label}{ helpIcon }</div>
|
31 |
+
<div className="wprm-admin-modal-field">{ props.children }</div>
|
32 |
+
</Fragment>
|
33 |
+
:
|
34 |
+
props.children
|
35 |
+
}
|
36 |
+
</div>
|
37 |
+
);
|
38 |
+
}
|
39 |
+
export default FieldContainer;
|
assets/js/admin-modal/fields/FieldDropdown.js
ADDED
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import React from 'react';
|
2 |
+
import Select from 'react-select';
|
3 |
+
|
4 |
+
const FieldDropdown = (props) => {
|
5 |
+
let selectedOption = false;
|
6 |
+
|
7 |
+
if ( props.options ) {
|
8 |
+
const allOptions = props.options.reduce((acc, cur) => {
|
9 |
+
if ( cur.hasOwnProperty('options') ) {
|
10 |
+
acc = acc.concat( cur.options );
|
11 |
+
} else {
|
12 |
+
acc.push(cur);
|
13 |
+
}
|
14 |
+
|
15 |
+
return acc;
|
16 |
+
}, []);
|
17 |
+
|
18 |
+
selectedOption = allOptions.find((option) => option.value === props.value);
|
19 |
+
}
|
20 |
+
|
21 |
+
const customProps = props.custom ? props.custom : {};
|
22 |
+
|
23 |
+
return (
|
24 |
+
<Select
|
25 |
+
isDisabled={ props.isDisabled }
|
26 |
+
options={props.options}
|
27 |
+
value={selectedOption}
|
28 |
+
placeholder={props.placeholder}
|
29 |
+
onChange={(option) => {
|
30 |
+
props.onChange(option.value);
|
31 |
+
}}
|
32 |
+
styles={{
|
33 |
+
control: (provided) => ({
|
34 |
+
...provided,
|
35 |
+
backgroundColor: 'white',
|
36 |
+
}),
|
37 |
+
container: (provided) => ({
|
38 |
+
...provided,
|
39 |
+
width: '100%',
|
40 |
+
maxWidth: props.width ? props.width : '100%',
|
41 |
+
}),
|
42 |
+
}}
|
43 |
+
{ ...customProps }
|
44 |
+
/>
|
45 |
+
);
|
46 |
+
}
|
47 |
+
export default FieldDropdown;
|
assets/js/admin-modal/fields/FieldGroup.js
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
import React from 'react';
|
3 |
+
import { Element } from 'react-scroll';
|
4 |
+
|
5 |
+
const FieldGroup = (props) => {
|
6 |
+
let id = null;
|
7 |
+
|
8 |
+
if ( props.id ) {
|
9 |
+
id = `wprm-admin-modal-fields-group-${props.id}`;
|
10 |
+
}
|
11 |
+
|
12 |
+
return (
|
13 |
+
<Element className="wprm-admin-modal-fields-group" id={ id } name={ id } >
|
14 |
+
{
|
15 |
+
props.header
|
16 |
+
?
|
17 |
+
<div className="wprm-admin-modal-fields-group-header">{ props.header }</div>
|
18 |
+
:
|
19 |
+
null
|
20 |
+
}
|
21 |
+
<div className="wprm-admin-modal-fields">
|
22 |
+
{ props.children }
|
23 |
+
</div>
|
24 |
+
</Element>
|
25 |
+
);
|
26 |
+
}
|
27 |
+
export default FieldGroup;
|
assets/js/admin-modal/fields/FieldImage.js
ADDED
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import React from 'react';
|
2 |
+
|
3 |
+
import Media from '../general/Media';
|
4 |
+
import Button from '../../shared/Button';
|
5 |
+
import { __wprm } from '../../shared/Translations';
|
6 |
+
|
7 |
+
const FieldImage = (props) => {
|
8 |
+
const hasImage = props.id > 0;
|
9 |
+
|
10 |
+
const selectImage = () => {
|
11 |
+
Media.selectImage((attachment) => {
|
12 |
+
props.onChange( attachment.id, attachment.url );
|
13 |
+
});
|
14 |
+
}
|
15 |
+
|
16 |
+
return (
|
17 |
+
<div className="wprm-admin-modal-field-image">
|
18 |
+
{
|
19 |
+
hasImage
|
20 |
+
?
|
21 |
+
<div className="wprm-admin-modal-field-image-preview">
|
22 |
+
<img
|
23 |
+
onClick={ selectImage }
|
24 |
+
src={ props.url }
|
25 |
+
/>
|
26 |
+
<a
|
27 |
+
href="#"
|
28 |
+
tabIndex={ props.disableTab ? '-1' : null }
|
29 |
+
onClick={ (e) => {
|
30 |
+
e.preventDefault();
|
31 |
+
props.onChange( 0, '' );
|
32 |
+
} }
|
33 |
+
>{ __wprm( 'Remove Image' ) }</a>
|
34 |
+
</div>
|
35 |
+
:
|
36 |
+
<Button
|
37 |
+
required={ props.required }
|
38 |
+
disableTab={ props.disableTab }
|
39 |
+
onClick={ selectImage }
|
40 |
+
|
41 |
+
>{ __wprm( 'Select Image' ) }</Button>
|
42 |
+
}
|
43 |
+
</div>
|
44 |
+
);
|
45 |
+
}
|
46 |
+
export default FieldImage;
|
assets/js/admin-modal/fields/FieldIngredient.js
ADDED
@@ -0,0 +1,140 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import React, { Component } from 'react';
|
2 |
+
import { Draggable } from 'react-beautiful-dnd';
|
3 |
+
import { isKeyHotkey } from 'is-hotkey';
|
4 |
+
|
5 |
+
const isTabHotkey = isKeyHotkey('tab');
|
6 |
+
|
7 |
+
import Icon from '../../shared/Icon';
|
8 |
+
import { __wprm } from '../../shared/Translations';
|
9 |
+
|
10 |
+
import FieldRichText from './FieldRichText';
|
11 |
+
|
12 |
+
const handle = (provided) => (
|
13 |
+
<div
|
14 |
+
className="wprm-admin-modal-field-ingredient-handle"
|
15 |
+
{...provided.dragHandleProps}
|
16 |
+
tabIndex="-1"
|
17 |
+
><Icon type="drag" /></div>
|
18 |
+
);
|
19 |
+
|
20 |
+
const group = (props, provided) => (
|
21 |
+
<div
|
22 |
+
className="wprm-admin-modal-field-ingredient-group"
|
23 |
+
ref={provided.innerRef}
|
24 |
+
{...provided.draggableProps}
|
25 |
+
>
|
26 |
+
{ handle(provided) }
|
27 |
+
<div className="wprm-admin-modal-field-ingredient-group-name-container">
|
28 |
+
<FieldRichText
|
29 |
+
singleLine
|
30 |
+
className="wprm-admin-modal-field-ingredient-group-name"
|
31 |
+
toolbar="no-styling"
|
32 |
+
value={ props.name }
|
33 |
+
placeholder={ __wprm( 'Ingredient Group Header' ) }
|
34 |
+
onChange={(value) => props.onChangeName(value)}
|
35 |
+
onKeyDown={(event) => {
|
36 |
+
if ( isTabHotkey(event) ) {
|
37 |
+
props.onTab();
|
38 |
+
event.preventDefault();
|
39 |
+
}
|
40 |
+
}}
|
41 |
+
/>
|
42 |
+
</div>
|
43 |
+
<div className="wprm-admin-modal-field-ingredient-after-container">
|
44 |
+
<Icon
|
45 |
+
type="trash"
|
46 |
+
onClick={ props.onDelete }
|
47 |
+
/>
|
48 |
+
</div>
|
49 |
+
</div>
|
50 |
+
);
|
51 |
+
|
52 |
+
const ingredient = (props, provided) => {
|
53 |
+
let amount = props.amount;
|
54 |
+
let unit = props.unit;
|
55 |
+
|
56 |
+
return (
|
57 |
+
<div
|
58 |
+
className="wprm-admin-modal-field-ingredient"
|
59 |
+
ref={provided.innerRef}
|
60 |
+
{...provided.draggableProps}
|
61 |
+
>
|
62 |
+
{ handle(provided) }
|
63 |
+
<div className="wprm-admin-modal-field-ingredient-text-container">
|
64 |
+
<FieldRichText
|
65 |
+
singleLine
|
66 |
+
toolbar={ wprm_admin.addons.premium ? 'all' : 'no-link' }
|
67 |
+
className="wprm-admin-modal-field-ingredient-amount"
|
68 |
+
value={ amount }
|
69 |
+
placeholder="1"
|
70 |
+
onChange={(amount) => {
|
71 |
+
props.onChangeIngredient({amount});
|
72 |
+
}}
|
73 |
+
/>
|
74 |
+
<FieldRichText
|
75 |
+
singleLine
|
76 |
+
toolbar={ wprm_admin.addons.premium ? 'all' : 'no-link' }
|
77 |
+
value={ unit }
|
78 |
+
placeholder={ __wprm( 'tbsp' ) }
|
79 |
+
onChange={(unit) => {
|
80 |
+
props.onChangeIngredient({unit});
|
81 |
+
}}
|
82 |
+
/>
|
83 |
+
<FieldRichText
|
84 |
+
singleLine
|
85 |
+
toolbar="ingredient"
|
86 |
+
value={ props.name }
|
87 |
+
placeholder={ __wprm( 'olive oil' ) }
|
88 |
+
onChange={(name) => {
|
89 |
+
props.onChangeIngredient({
|
90 |
+
name,
|
91 |
+
globalLink: false, // Changing names will lead to a different global link.
|
92 |
+
})
|
93 |
+
}}
|
94 |
+
/>
|
95 |
+
<FieldRichText
|
96 |
+
singleLine
|
97 |
+
toolbar={ wprm_admin.addons.premium ? 'all' : 'no-link' }
|
98 |
+
value={ props.notes }
|
99 |
+
placeholder={ __wprm( 'extra virgin' ) }
|
100 |
+
onChange={(notes) => props.onChangeIngredient({notes})}
|
101 |
+
onKeyDown={(event) => {
|
102 |
+
if ( isTabHotkey(event) ) {
|
103 |
+
props.onTab();
|
104 |
+
event.preventDefault();
|
105 |
+
}
|
106 |
+
}}
|
107 |
+
/>
|
108 |
+
</div>
|
109 |
+
<div className="wprm-admin-modal-field-ingredient-after-container">
|
110 |
+
<Icon
|
111 |
+
type="trash"
|
112 |
+
onClick={ props.onDelete }
|
113 |
+
/>
|
114 |
+
</div>
|
115 |
+
</div>
|
116 |
+
);
|
117 |
+
};
|
118 |
+
|
119 |
+
export default class FieldIngredient extends Component {
|
120 |
+
shouldComponentUpdate(nextProps) {
|
121 |
+
return JSON.stringify(this.props) !== JSON.stringify(nextProps);
|
122 |
+
}
|
123 |
+
|
124 |
+
render() {
|
125 |
+
return (
|
126 |
+
<Draggable
|
127 |
+
draggableId={ `ingredient-${this.props.uid}` }
|
128 |
+
index={ this.props.index }
|
129 |
+
>
|
130 |
+
{(provided, snapshot) => {
|
131 |
+
if ( 'group' === this.props.type ) {
|
132 |
+
return group(this.props, provided);
|
133 |
+
} else {
|
134 |
+
return ingredient(this.props, provided);
|
135 |
+
}
|
136 |
+
}}
|
137 |
+
</Draggable>
|
138 |
+
);
|
139 |
+
}
|
140 |
+
}
|
assets/js/admin-modal/fields/FieldInstruction.js
ADDED
@@ -0,0 +1,112 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import React, { Component } from 'react';
|
2 |
+
import { Draggable } from 'react-beautiful-dnd';
|
3 |
+
import { isKeyHotkey } from 'is-hotkey';
|
4 |
+
|
5 |
+
const isTabHotkey = isKeyHotkey('tab');
|
6 |
+
|
7 |
+
import Icon from '../../shared/Icon';
|
8 |
+
import { __wprm } from '../../shared/Translations';
|
9 |
+
|
10 |
+
import FieldRichText from './FieldRichText';
|
11 |
+
import FieldImage from './FieldImage';
|
12 |
+
|
13 |
+
const handle = (provided) => (
|
14 |
+
<div
|
15 |
+
className="wprm-admin-modal-field-instruction-handle"
|
16 |
+
{...provided.dragHandleProps}
|
17 |
+
tabIndex="-1"
|
18 |
+
><Icon type="drag" /></div>
|
19 |
+
);
|
20 |
+
|
21 |
+
const group = (props, provided) => (
|
22 |
+
<div
|
23 |
+
className="wprm-admin-modal-field-instruction-group"
|
24 |
+
ref={provided.innerRef}
|
25 |
+
{...provided.draggableProps}
|
26 |
+
>
|
27 |
+
<div className="wprm-admin-modal-field-instruction-main-container">
|
28 |
+
{ handle(provided) }
|
29 |
+
<div className="wprm-admin-modal-field-instruction-group-name-container">
|
30 |
+
<FieldRichText
|
31 |
+
singleLine
|
32 |
+
toolbar="no-styling"
|
33 |
+
value={ props.name }
|
34 |
+
placeholder={ __wprm( 'Instruction Group Header' ) }
|
35 |
+
onChange={(value) => props.onChangeText(value)}
|
36 |
+
onKeyDown={(event) => {
|
37 |
+
if ( isTabHotkey(event) ) {
|
38 |
+
props.onTab();
|
39 |
+
event.preventDefault();
|
40 |
+
}
|
41 |
+
}}
|
42 |
+
/>
|
43 |
+
</div>
|
44 |
+
</div>
|
45 |
+
<div className="wprm-admin-modal-field-instruction-after-container">
|
46 |
+
<Icon
|
47 |
+
type="trash"
|
48 |
+
onClick={ props.onDelete }
|
49 |
+
/>
|
50 |
+
</div>
|
51 |
+
</div>
|
52 |
+
);
|
53 |
+
|
54 |
+
const instruction = (props, provided) => (
|
55 |
+
<div
|
56 |
+
className="wprm-admin-modal-field-instruction"
|
57 |
+
ref={provided.innerRef}
|
58 |
+
{...provided.draggableProps}
|
59 |
+
>
|
60 |
+
<div className="wprm-admin-modal-field-instruction-main-container">
|
61 |
+
{ handle(provided) }
|
62 |
+
<div className="wprm-admin-modal-field-instruction-text-container">
|
63 |
+
<FieldRichText
|
64 |
+
value={ props.text }
|
65 |
+
placeholder={ __wprm( 'This is one instruction step.' ) }
|
66 |
+
onChange={(value) => props.onChangeText(value)}
|
67 |
+
onKeyDown={(event) => {
|
68 |
+
if ( isTabHotkey(event) ) {
|
69 |
+
props.onTab();
|
70 |
+
event.preventDefault();
|
71 |
+
}
|
72 |
+
}}
|
73 |
+
/>
|
74 |
+
</div>
|
75 |
+
</div>
|
76 |
+
<div className="wprm-admin-modal-field-instruction-after-container">
|
77 |
+
<Icon
|
78 |
+
type="trash"
|
79 |
+
onClick={ props.onDelete }
|
80 |
+
/>
|
81 |
+
<FieldImage
|
82 |
+
id={ props.image }
|
83 |
+
url={ props.image_url }
|
84 |
+
onChange={(id, url) => props.onChangeImage(id, url)}
|
85 |
+
disableTab={ true }
|
86 |
+
/>
|
87 |
+
</div>
|
88 |
+
</div>
|
89 |
+
);
|
90 |
+
|
91 |
+
export default class FieldInstruction extends Component {
|
92 |
+
shouldComponentUpdate(nextProps) {
|
93 |
+
return JSON.stringify(this.props) !== JSON.stringify(nextProps);
|
94 |
+
}
|
95 |
+
|
96 |
+
render() {
|
97 |
+
return (
|
98 |
+
<Draggable
|
99 |
+
draggableId={ `instruction-${this.props.uid}` }
|
100 |
+
index={ this.props.index }
|
101 |
+
>
|
102 |
+
{(provided, snapshot) => {
|
103 |
+
if ( 'group' === this.props.type ) {
|
104 |
+
return group(this.props, provided);
|
105 |
+
} else {
|
106 |
+
return instruction(this.props, provided);
|
107 |
+
}
|
108 |
+
}}
|
109 |
+
</Draggable>
|
110 |
+
);
|
111 |
+
}
|
112 |
+
}
|
assets/js/admin-modal/fields/FieldRadio.js
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import React, { Fragment } from 'react';
|
2 |
+
|
3 |
+
const FieldRadio = (props) => {
|
4 |
+
return (
|
5 |
+
<Fragment>
|
6 |
+
{
|
7 |
+
props.options.map((option) => (
|
8 |
+
<div className="wprm-admin-modal-field-radio-option" key={option.value}>
|
9 |
+
<input
|
10 |
+
type="radio"
|
11 |
+
value={option.value}
|
12 |
+
name={`wprm-admin-radio-${props.id}`}
|
13 |
+
id={`wprm-admin-radio-${props.id}-${option.value}`}
|
14 |
+
checked={props.value == option.value}
|
15 |
+
onChange={(e) => {
|
16 |
+
props.onChange(e.target.value);
|
17 |
+
}}
|
18 |
+
/><label htmlFor={`wprm-admin-radio-${props.id}-${option.value}`}>{ option.label }</label>
|
19 |
+
</div>
|
20 |
+
))
|
21 |
+
}
|
22 |
+
</Fragment>
|
23 |
+
);
|
24 |
+
}
|
25 |
+
export default FieldRadio;
|
assets/js/admin-modal/fields/FieldRichText/Toolbar/ButtonAction.js
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import React from 'react';
|
2 |
+
|
3 |
+
import Icon from '../../../../shared/Icon';
|
4 |
+
|
5 |
+
const ButtonAction = (props) => {
|
6 |
+
return (
|
7 |
+
<span
|
8 |
+
className="wprm-admin-modal-toolbar-button"
|
9 |
+
onMouseDown={ (event) => {
|
10 |
+
event.preventDefault();
|
11 |
+
props.action();
|
12 |
+
}}
|
13 |
+
>
|
14 |
+
<Icon
|
15 |
+
type={ props.type }
|
16 |
+
title={ props.title }
|
17 |
+
/>
|
18 |
+
</span>
|
19 |
+
);
|
20 |
+
}
|
21 |
+
export default ButtonAction;
|
assets/js/admin-modal/fields/FieldRichText/Toolbar/ButtonCharacter.js
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import React from 'react';
|
2 |
+
|
3 |
+
import Tooltip from '../../../../shared/Tooltip';
|
4 |
+
|
5 |
+
const ButtonCharacter = (props) => {
|
6 |
+
return (
|
7 |
+
<span
|
8 |
+
className="wprm-admin-modal-toolbar-button"
|
9 |
+
onMouseDown={ (event) => {
|
10 |
+
event.preventDefault();
|
11 |
+
props.richText.editor.insertText( props.character );
|
12 |
+
}}
|
13 |
+
>
|
14 |
+
<Tooltip
|
15 |
+
content={ props.title }
|
16 |
+
>
|
17 |
+
<span className="wprm-admin-modal-toolbar-button-character">{ props.character }</span>
|
18 |
+
</Tooltip>
|
19 |
+
</span>
|
20 |
+
);
|
21 |
+
}
|
22 |
+
export default ButtonCharacter;
|
assets/js/admin-modal/fields/FieldRichText/Toolbar/ButtonLink.js
ADDED
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import React, { Fragment } from 'react';
|
2 |
+
|
3 |
+
import Icon from '../../../../shared/Icon';
|
4 |
+
import { __wprm } from '../../../../shared/Translations';
|
5 |
+
|
6 |
+
const ButtonLink = (props) => {
|
7 |
+
const isActive = props.richText.hasInline('link');
|
8 |
+
const { editor } = props.richText;
|
9 |
+
|
10 |
+
return (
|
11 |
+
<Fragment>
|
12 |
+
{
|
13 |
+
isActive
|
14 |
+
?
|
15 |
+
<span
|
16 |
+
className="wprm-admin-modal-toolbar-button wprm-admin-modal-toolbar-button-active"
|
17 |
+
onMouseDown={ (event) => {
|
18 |
+
event.preventDefault();
|
19 |
+
editor.unwrapInline('link');
|
20 |
+
}}
|
21 |
+
>
|
22 |
+
<Icon
|
23 |
+
type="unlink"
|
24 |
+
title={ __wprm( 'Remove Link' ) }
|
25 |
+
/>
|
26 |
+
</span>
|
27 |
+
:
|
28 |
+
<span
|
29 |
+
className="wprm-admin-modal-toolbar-button"
|
30 |
+
onMouseDown={ (event) => {
|
31 |
+
event.preventDefault();
|
32 |
+
|
33 |
+
const href = window.prompt( __wprm( 'Enter the URL of the link:' ) );
|
34 |
+
if ( href ) {
|
35 |
+
if ( ! editor.value.selection.isExpanded ) {
|
36 |
+
editor
|
37 |
+
.insertText(href)
|
38 |
+
.moveFocusBackward(href.length);
|
39 |
+
}
|
40 |
+
|
41 |
+
editor.wrapInline({
|
42 |
+
type: 'link',
|
43 |
+
data: {
|
44 |
+
href,
|
45 |
+
},
|
46 |
+
});
|
47 |
+
editor.moveToEnd();
|
48 |
+
}
|
49 |
+
}}
|
50 |
+
>
|
51 |
+
<Icon
|
52 |
+
type="link"
|
53 |
+
title={ isActive ? __wprm( 'Edit Link' ) : __wprm( 'Add Link' ) }
|
54 |
+
/>
|
55 |
+
</span>
|
56 |
+
}
|
57 |
+
</Fragment>
|
58 |
+
);
|
59 |
+
}
|
60 |
+
export default ButtonLink;
|
assets/js/admin-modal/fields/FieldRichText/Toolbar/ButtonMark.js
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import React from 'react';
|
2 |
+
|
3 |
+
import Icon from '../../../../shared/Icon';
|
4 |
+
|
5 |
+
const ButtonMark = (props) => {
|
6 |
+
const isActive = props.richText.hasMark( props.type );
|
7 |
+
|
8 |
+
return (
|
9 |
+
<span
|
10 |
+
className={ `wprm-admin-modal-toolbar-button${isActive ? ' wprm-admin-modal-toolbar-button-active' : ''}` }
|
11 |
+
onMouseDown={ (event) => {
|
12 |
+
event.preventDefault();
|
13 |
+
props.richText.editor.toggleMark( props.type );
|
14 |
+
}}
|
15 |
+
>
|
16 |
+
<Icon
|
17 |
+
type={ props.type }
|
18 |
+
title={ props.title }
|
19 |
+
/>
|
20 |
+
</span>
|
21 |
+
);
|
22 |
+
}
|
23 |
+
export default ButtonMark;
|
assets/js/admin-modal/fields/FieldRichText/Toolbar/Spacer.js
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import React from 'react';
|
2 |
+
|
3 |
+
const Spacer = (props) => {
|
4 |
+
return (
|
5 |
+
<span className="wprm-admin-modal-toolbar-spacer"></span>
|
6 |
+
);
|
7 |
+
}
|
8 |
+
export default Spacer;
|
assets/js/admin-modal/fields/FieldRichText/Toolbar/ToolbarLink.js
ADDED
@@ -0,0 +1,81 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import React from 'react';
|
2 |
+
|
3 |
+
import { __wprm } from '../../../../shared/Translations';
|
4 |
+
import Icon from '../../../../shared/Icon';
|
5 |
+
import Spacer from './Spacer';
|
6 |
+
|
7 |
+
const getLinkData = (inline) => {
|
8 |
+
return {
|
9 |
+
href: inline.data.get('href'),
|
10 |
+
newTab: inline.data.get('newTab'),
|
11 |
+
noFollow: inline.data.get('noFollow'),
|
12 |
+
}
|
13 |
+
}
|
14 |
+
|
15 |
+
const editHref = (editor, inline) => {
|
16 |
+
let linkData = getLinkData( inline );
|
17 |
+
const href = window.prompt( __wprm( 'Enter the URL of the link:' ), linkData.href );
|
18 |
+
if ( href ) {
|
19 |
+
linkData['href'] = href;
|
20 |
+
editor.setNodeByKey(inline.key, {
|
21 |
+
data: linkData
|
22 |
+
});
|
23 |
+
} else if ( '' === href ) {
|
24 |
+
editor.unwrapInline('link');
|
25 |
+
}
|
26 |
+
}
|
27 |
+
|
28 |
+
const toggleCheckbox = (editor, inline, option) => {
|
29 |
+
let linkData = getLinkData( inline );
|
30 |
+
|
31 |
+
linkData[ option ] = ! linkData[ option ];
|
32 |
+
editor.setNodeByKey(inline.key, {
|
33 |
+
data: linkData
|
34 |
+
});
|
35 |
+
}
|
36 |
+
|
37 |
+
const ToolbarLink = (props) => {
|
38 |
+
const { editor } = props.richText;
|
39 |
+
const value = props.richText.state.value;
|
40 |
+
const inline = value.inlines.find(inline => inline.type === 'link');
|
41 |
+
|
42 |
+
if ( ! inline ) {
|
43 |
+
return null;
|
44 |
+
}
|
45 |
+
|
46 |
+
const link = getLinkData( inline );
|
47 |
+
|
48 |
+
return (
|
49 |
+
<div className="wprm-admin-modal-toolbar-link">
|
50 |
+
<Icon
|
51 |
+
type="link"
|
52 |
+
onClick={() => editHref( editor, inline ) }
|
53 |
+
/>
|
54 |
+
<span
|
55 |
+
className="wprm-admin-modal-toolbar-link-value"
|
56 |
+
onMouseDown={ () => editHref( editor, inline ) }
|
57 |
+
>
|
58 |
+
{ link.href }
|
59 |
+
</span>
|
60 |
+
<Spacer />
|
61 |
+
<Icon
|
62 |
+
type={ link.newTab ? 'checkbox-checked' : 'checkbox-empty' }
|
63 |
+
onClick={() => toggleCheckbox( editor, inline, 'newTab' ) }
|
64 |
+
/>
|
65 |
+
<span
|
66 |
+
className="wprm-admin-modal-toolbar-link-value"
|
67 |
+
onMouseDown={ () => toggleCheckbox( editor, inline, 'newTab' ) }
|
68 |
+
>{ __wprm( 'Open in new tab' ) }</span>
|
69 |
+
<Spacer />
|
70 |
+
<Icon
|
71 |
+
type={ link.noFollow ? 'checkbox-checked' : 'checkbox-empty' }
|
72 |
+
onClick={() => toggleCheckbox( editor, inline, 'noFollow' ) }
|
73 |
+
/>
|
74 |
+
<span
|
75 |
+
className="wprm-admin-modal-toolbar-link-value"
|
76 |
+
onMouseDown={ () => toggleCheckbox( editor, inline, 'noFollow' ) }
|
77 |
+
>{ __wprm( 'Use nofollow' ) }</span>
|
78 |
+
</div>
|
79 |
+
);
|
80 |
+
}
|
81 |
+
export default ToolbarLink;
|
assets/js/admin-modal/fields/FieldRichText/Toolbar/ToolbarSuggest.js
ADDED
@@ -0,0 +1,88 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import React, { Component, Fragment } from 'react';
|
2 |
+
|
3 |
+
import Api from '../../../general/Api';
|
4 |
+
import Loader from '../../../../shared/Loader';
|
5 |
+
import { __wprm } from '../../../../shared/Translations';
|
6 |
+
|
7 |
+
export default class ToolbarSuggest extends Component {
|
8 |
+
constructor(props) {
|
9 |
+
super(props);
|
10 |
+
|
11 |
+
this.state = {
|
12 |
+
suggestions: [],
|
13 |
+
loading: false,
|
14 |
+
}
|
15 |
+
}
|
16 |
+
|
17 |
+
componentDidMount() {
|
18 |
+
const search = this.props.richText.getHtmlFromValue( this.props.value );
|
19 |
+
|
20 |
+
this.updateSuggestions( search );
|
21 |
+
}
|
22 |
+
|
23 |
+
componentDidUpdate(prevProps) {
|
24 |
+
const search = this.props.richText.getHtmlFromValue( this.props.value );
|
25 |
+
const prevSearch = this.props.richText.getHtmlFromValue( prevProps.value );
|
26 |
+
|
27 |
+
if ( search !== prevSearch ) {
|
28 |
+
this.updateSuggestions( search );
|
29 |
+
}
|
30 |
+
}
|
31 |
+
|
32 |
+
updateSuggestions( search ) {
|
33 |
+
this.setState({
|
34 |
+
loading: true,
|
35 |
+
});
|
36 |
+
|
37 |
+
Api.getSuggestions({ search }).then(data => {
|
38 |
+
if ( data ) {
|
39 |
+
this.state.suggestions = data.suggestions;
|
40 |
+
this.setState({
|
41 |
+
suggestions: data.suggestions,
|
42 |
+
loading: false,
|
43 |
+
});
|
44 |
+
}
|
45 |
+
});
|
46 |
+
}
|
47 |
+
|
48 |
+
render() {
|
49 |
+
return (
|
50 |
+
<div className="wprm-admin-modal-toolbar-suggest">
|
51 |
+
{
|
52 |
+
! this.state.loading
|
53 |
+
&& 0 === this.state.suggestions.length
|
54 |
+
?
|
55 |
+
<strong>{ __wprm( 'No suggestions found.' ) }</strong>
|
56 |
+
:
|
57 |
+
<Fragment>
|
58 |
+
<strong>{ __wprm( 'Suggestions:' ) }</strong>
|
59 |
+
{
|
60 |
+
this.state.loading
|
61 |
+
?
|
62 |
+
<Loader/>
|
63 |
+
:
|
64 |
+
<Fragment>
|
65 |
+
{
|
66 |
+
this.state.suggestions.map((suggestion, index) => (
|
67 |
+
<span
|
68 |
+
className="wprm-admin-modal-toolbar-suggestion"
|
69 |
+
onMouseDown={ (event) => {
|
70 |
+
event.preventDefault();
|
71 |
+
|
72 |
+
const newValue = this.props.richText.getValueFromHtml( suggestion.name );
|
73 |
+
this.props.richText.onChange( { value: newValue } );
|
74 |
+
} }
|
75 |
+
key={ index }
|
76 |
+
>
|
77 |
+
<span className="wprm-admin-modal-toolbar-suggestion-text">{ suggestion.name } ({ suggestion.count})</span>
|
78 |
+
</span>
|
79 |
+
))
|
80 |
+
}
|
81 |
+
</Fragment>
|
82 |
+
}
|
83 |
+
</Fragment>
|
84 |
+
}
|
85 |
+
</div>
|
86 |
+
);
|
87 |
+
}
|
88 |
+
}
|
assets/js/admin-modal/fields/FieldRichText/Toolbar/index.js
ADDED
@@ -0,0 +1,97 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import React from 'react';
|
2 |
+
|
3 |
+
import { __wprm } from '../../../../shared/Translations';
|
4 |
+
|
5 |
+
import ModalToolbar from '../../../general/toolbar';
|
6 |
+
import ButtonAction from './ButtonAction';
|
7 |
+
import ButtonCharacter from './ButtonCharacter';
|
8 |
+
import ButtonLink from './ButtonLink';
|
9 |
+
import ButtonMark from './ButtonMark';
|
10 |
+
import Spacer from './Spacer';
|
11 |
+
import ToolbarLink from './ToolbarLink';
|
12 |
+
import ToolbarSuggest from './ToolbarSuggest';
|
13 |
+
|
14 |
+
const Toolbar = (props) => {
|
15 |
+
const hidden = {
|
16 |
+
visibility: 'hidden'
|
17 |
+
};
|
18 |
+
|
19 |
+
let hideStyling = false;
|
20 |
+
let hideLink = false;
|
21 |
+
|
22 |
+
switch( props.type ) {
|
23 |
+
case 'no-styling':
|
24 |
+
hideStyling = true;
|
25 |
+
break;
|
26 |
+
case 'no-link':
|
27 |
+
hideLink = true;
|
28 |
+
break;
|
29 |
+
case 'ingredient':
|
30 |
+
hideLink = true;
|
31 |
+
break;
|
32 |
+
}
|
33 |
+
|
34 |
+
return (
|
35 |
+
<ModalToolbar>
|
36 |
+
{
|
37 |
+
props.richText.hasInline('link')
|
38 |
+
&&
|
39 |
+
<ToolbarLink
|
40 |
+
richText={ props.richText }
|
41 |
+
/>
|
42 |
+
}
|
43 |
+
{
|
44 |
+
'ingredient' === props.type
|
45 |
+
&&
|
46 |
+
<ToolbarSuggest
|
47 |
+
richText={ props.richText }
|
48 |
+
value={ props.value }
|
49 |
+
/>
|
50 |
+
}
|
51 |
+
<div className="wprm-admin-modal-toolbar-buttons">
|
52 |
+
<span
|
53 |
+
style={ hideStyling ? hidden : null }
|
54 |
+
>
|
55 |
+
<ButtonMark richText={ props.richText } type="bold" title={ __wprm( 'Bold' ) } />
|
56 |
+
<ButtonMark richText={ props.richText } type="italic" title={ __wprm( 'Italic' ) } />
|
57 |
+
<ButtonMark richText={ props.richText } type="underline" title={ __wprm( 'Underline' ) } />
|
58 |
+
<Spacer />
|
59 |
+
<ButtonMark richText={ props.richText } type="subscript" title={ __wprm( 'Subscript' ) } />
|
60 |
+
<ButtonMark richText={ props.richText } type="superscript" title={ __wprm( 'Superscript' ) } />
|
61 |
+
</span>
|
62 |
+
<Spacer />
|
63 |
+
<span
|
64 |
+
style={ hideLink ? hidden : null }
|
65 |
+
>
|
66 |
+
<ButtonLink richText={ props.richText } />
|
67 |
+
</span>
|
68 |
+
<Spacer />
|
69 |
+
<ButtonAction
|
70 |
+
type="adjustable"
|
71 |
+
title={ __wprm( 'Adjustable Shortcode' ) }
|
72 |
+
action={() => {
|
73 |
+
props.richText.editor.wrapText( '[adjustable]', '[/adjustable]' );
|
74 |
+
props.richText.editor.moveToEnd();
|
75 |
+
}}
|
76 |
+
/>
|
77 |
+
<ButtonAction
|
78 |
+
type="clock"
|
79 |
+
title={ __wprm( 'Timer Shortcode' ) }
|
80 |
+
action={() => {
|
81 |
+
props.richText.editor.wrapText( '[timer minutes=0]', '[/timer]' );
|
82 |
+
props.richText.editor.moveToEnd();
|
83 |
+
}}
|
84 |
+
/>
|
85 |
+
<Spacer />
|
86 |
+
<ButtonCharacter richText={ props.richText } character="½" />
|
87 |
+
<ButtonCharacter richText={ props.richText } character="⅓" />
|
88 |
+
<ButtonCharacter richText={ props.richText } character="⅔" />
|
89 |
+
<ButtonCharacter richText={ props.richText } character="¼" />
|
90 |
+
<ButtonCharacter richText={ props.richText } character="¾" />
|
91 |
+
<Spacer />
|
92 |
+
<ButtonCharacter richText={ props.richText } character="°" />
|
93 |
+
</div>
|
94 |
+
</ModalToolbar>
|
95 |
+
);
|
96 |
+
}
|
97 |
+
export default Toolbar;
|
assets/js/admin-modal/fields/FieldRichText/index.js
ADDED
@@ -0,0 +1,212 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import React, { Component, Fragment } from 'react';
|
2 |
+
|
3 |
+
import { Editor, getEventTransfer } from 'slate-react';
|
4 |
+
import Html from 'slate-html-serializer';
|
5 |
+
|
6 |
+
import { isKeyHotkey } from 'is-hotkey';
|
7 |
+
|
8 |
+
const isEnterKey = isKeyHotkey('enter');
|
9 |
+
const isTabKey = isKeyHotkey('tab');
|
10 |
+
const isBoldHotkey = isKeyHotkey('mod+b');
|
11 |
+
const isItalicHotkey = isKeyHotkey('mod+i');
|
12 |
+
const isUnderlinedHotkey = isKeyHotkey('mod+u');
|
13 |
+
|
14 |
+
import '../../../../css/admin/modal/general/rich-text.scss';
|
15 |
+
|
16 |
+
import Toolbar from './Toolbar';
|
17 |
+
import rules from './rules';
|
18 |
+
const html = new Html({ rules })
|
19 |
+
|
20 |
+
export default class FieldRichText extends Component {
|
21 |
+
constructor(props) {
|
22 |
+
super(props);
|
23 |
+
|
24 |
+
this.state = {
|
25 |
+
value: this.getValueFromHtml( props.value ),
|
26 |
+
};
|
27 |
+
|
28 |
+
if ( props.singleLine ) {
|
29 |
+
this.schema = {
|
30 |
+
document: {
|
31 |
+
nodes: [
|
32 |
+
{
|
33 |
+
match: { type: 'paragraph' },
|
34 |
+
min: 1,
|
35 |
+
max: 1,
|
36 |
+
},
|
37 |
+
],
|
38 |
+
},
|
39 |
+
}
|
40 |
+
} else {
|
41 |
+
this.schema = null;
|
42 |
+
}
|
43 |
+
|
44 |
+
this.getValueFromHtml = this.getValueFromHtml.bind(this);
|
45 |
+
this.onChange = this.onChange.bind(this);
|
46 |
+
this.onPaste = this.onPaste.bind(this);
|
47 |
+
this.onKeyDown = this.onKeyDown.bind(this);
|
48 |
+
this.renderNode = this.renderNode.bind(this);
|
49 |
+
this.renderMark = this.renderMark.bind(this);
|
50 |
+
this.hasMark = this.hasMark.bind(this);
|
51 |
+
this.hasInline = this.hasInline.bind(this);
|
52 |
+
}
|
53 |
+
|
54 |
+
getValueFromHtml( htmlString ) {
|
55 |
+
return html.deserialize( htmlString );
|
56 |
+
}
|
57 |
+
|
58 |
+
getHtmlFromValue( value ) {
|
59 |
+
let htmlString = html.serialize( value );
|
60 |
+
|
61 |
+
if ( this.props.singleLine ) {
|
62 |
+
// Strip surrounding paragraph tags if present.
|
63 |
+
htmlString = htmlString.replace(/^<p>(.*)<\/p>$/gm, '$1');
|
64 |
+
}
|
65 |
+
|
66 |
+
return htmlString;
|
67 |
+
}
|
68 |
+
|
69 |
+
onChange( { value } ) {
|
70 |
+
const oldHtmlString = this.getHtmlFromValue( this.state.value );
|
71 |
+
const newHtmlString = this.getHtmlFromValue( value );
|
72 |
+
|
73 |
+
if ( oldHtmlString !== newHtmlString ) {
|
74 |
+
this.props.onChange(newHtmlString);
|
75 |
+
}
|
76 |
+
|
77 |
+
this.setState({ value })
|
78 |
+
}
|
79 |
+
|
80 |
+
onPaste( event, editor, next ) {
|
81 |
+
const transfer = getEventTransfer(event);
|
82 |
+
if (transfer.type !== 'html') return next();
|
83 |
+
const { document } = html.deserialize(transfer.html);
|
84 |
+
editor.insertFragment(document);
|
85 |
+
}
|
86 |
+
|
87 |
+
onKeyDown(event, editor, next) {
|
88 |
+
// Pass along key down.
|
89 |
+
if ( this.props.onKeyDown ) {
|
90 |
+
this.props.onKeyDown(event);
|
91 |
+
}
|
92 |
+
|
93 |
+
// Force editor to blur when we press the TAB key to prevent double toolbar issues.
|
94 |
+
if ( isTabKey(event) ) {
|
95 |
+
editor.blur();
|
96 |
+
}
|
97 |
+
|
98 |
+
// Prevent ENTER key in singleLine mode.
|
99 |
+
if ( this.props.singleLine && isEnterKey(event) ) {
|
100 |
+
event.preventDefault();
|
101 |
+
return;
|
102 |
+
}
|
103 |
+
|
104 |
+
// Check for mark shortcuts.
|
105 |
+
let mark;
|
106 |
+
|
107 |
+
if (isBoldHotkey(event)) {
|
108 |
+
mark = 'bold';
|
109 |
+
} else if (isItalicHotkey(event)) {
|
110 |
+
mark = 'italic';
|
111 |
+
} else if (isUnderlinedHotkey(event)) {
|
112 |
+
mark = 'underline';
|
113 |
+
} else {
|
114 |
+
return next();
|
115 |
+
}
|
116 |
+
|
117 |
+
event.preventDefault();
|
118 |
+
editor.toggleMark(mark);
|
119 |
+
}
|
120 |
+
|
121 |
+
render() {
|
122 |
+
const toolbarType = this.props.toolbar ? this.props.toolbar : 'all';
|
123 |
+
|
124 |
+
return (
|
125 |
+
<Fragment>
|
126 |
+
{
|
127 |
+
this.state.value.selection.isFocused
|
128 |
+
&&
|
129 |
+
<Toolbar
|
130 |
+
richText={ this }
|
131 |
+
value={ this.state.value }
|
132 |
+
type={ toolbarType }
|
133 |
+
/>
|
134 |
+
}
|
135 |
+
<Editor
|
136 |
+
spellCheck
|
137 |
+
className={ `wprm-admin-modal-field-richtext${ this.props.className ? ` ${ this.props.className }` : ''}`}
|
138 |
+
value={this.state.value}
|
139 |
+
placeholder={this.props.placeholder}
|
140 |
+
onChange={this.onChange}
|
141 |
+
onPaste={this.onPaste}
|
142 |
+
renderNode={this.renderNode}
|
143 |
+
renderMark={this.renderMark}
|
144 |
+
onKeyDown={this.onKeyDown}
|
145 |
+
tabIndex={ 0 }
|
146 |
+
ref={ (editor) => this.editor = editor }
|
147 |
+
schema={this.schema}
|
148 |
+
/>
|
149 |
+
</Fragment>
|
150 |
+
);
|
151 |
+
}
|
152 |
+
|
153 |
+
renderNode(props, editor, next) {
|
154 |
+
switch (props.node.type) {
|
155 |
+
case 'paragraph':
|
156 |
+
if ( this.props.singleLine ) {
|
157 |
+
return (
|
158 |
+
<div className="wprm-admin-modal-field-richtext-singleline">
|
159 |
+
{ props.children }
|
160 |
+
</div>
|
161 |
+
);
|
162 |
+
}
|
163 |
+
|
164 |
+
return (
|
165 |
+
<p {...props.attributes} className={props.node.data.get('className')}>
|
166 |
+
{props.children}
|
167 |
+
</p>
|
168 |
+
)
|
169 |
+
case 'link':
|
170 |
+
return (
|
171 |
+
<a
|
172 |
+
{...props.attributes}
|
173 |
+
href={ props.node.data.get('href') }
|
174 |
+
target={ props.node.data.get('newTab') ? '_blank' : null }
|
175 |
+
rel={ props.node.data.get('noFollow') ? 'nofollow' : null }
|
176 |
+
>
|
177 |
+
{props.children}
|
178 |
+
</a>
|
179 |
+
)
|
180 |
+
default:
|
181 |
+
return next()
|
182 |
+
}
|
183 |
+
}
|
184 |
+
|
185 |
+
renderMark(props, editor, next) {
|
186 |
+
const { mark, attributes } = props;
|
187 |
+
switch (mark.type) {
|
188 |
+
case 'bold':
|
189 |
+
return <strong {...attributes}>{props.children}</strong>
|
190 |
+
case 'italic':
|
191 |
+
return <em {...attributes}>{props.children}</em>
|
192 |
+
case 'underline':
|
193 |
+
return <u {...attributes}>{props.children}</u>
|
194 |
+
case 'subscript':
|
195 |
+
return <sub {...attributes}>{props.children}</sub>
|
196 |
+
case 'superscript':
|
197 |
+
return <sup {...attributes}>{props.children}</sup>
|
198 |
+
default:
|
199 |
+
return next()
|
200 |
+
}
|
201 |
+
}
|
202 |
+
|
203 |
+
hasMark(type) {
|
204 |
+
const { value } = this.state;
|
205 |
+
return value.activeMarks.some(mark => mark.type === type);
|
206 |
+
}
|
207 |
+
|
208 |
+
hasInline(type) {
|
209 |
+
const { value } = this.state;
|
210 |
+
return value.inlines.some(inline => inline.type === type)
|
211 |
+
}
|
212 |
+
}
|
assets/js/admin-modal/fields/FieldRichText/rules.js
ADDED
@@ -0,0 +1,107 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import React from 'react';
|
2 |
+
|
3 |
+
const BLOCK_TAGS = {
|
4 |
+
p: 'paragraph',
|
5 |
+
}
|
6 |
+
|
7 |
+
const INLINE_TAGS = {
|
8 |
+
a: 'link',
|
9 |
+
}
|
10 |
+
|
11 |
+
const MARK_TAGS = {
|
12 |
+
em: 'italic',
|
13 |
+
i: 'italic',
|
14 |
+
strong: 'bold',
|
15 |
+
b: 'bold',
|
16 |
+
u: 'underline',
|
17 |
+
sub: 'subscript',
|
18 |
+
sup: 'superscript',
|
19 |
+
}
|
20 |
+
|
21 |
+
const rules = [
|
22 |
+
{
|
23 |
+
deserialize(el, next) {
|
24 |
+
const type = BLOCK_TAGS[el.tagName.toLowerCase()]
|
25 |
+
if (type) {
|
26 |
+
return {
|
27 |
+
object: 'block',
|
28 |
+
type: type,
|
29 |
+
data: {
|
30 |
+
className: el.getAttribute('class'),
|
31 |
+
},
|
32 |
+
nodes: next(el.childNodes),
|
33 |
+
}
|
34 |
+
}
|
35 |
+
},
|
36 |
+
serialize(obj, children) {
|
37 |
+
if (obj.object == 'block') {
|
38 |
+
switch (obj.type) {
|
39 |
+
case 'paragraph':
|
40 |
+
return <p className={obj.data.get('className')}>{children}</p>
|
41 |
+
}
|
42 |
+
}
|
43 |
+
},
|
44 |
+
},
|
45 |
+
{
|
46 |
+
deserialize(el, next) {
|
47 |
+
const type = INLINE_TAGS[el.tagName.toLowerCase()]
|
48 |
+
if (type) {
|
49 |
+
return {
|
50 |
+
object: 'inline',
|
51 |
+
type: type,
|
52 |
+
data: {
|
53 |
+
className: el.getAttribute('class'),
|
54 |
+
href: el.getAttribute('href'),
|
55 |
+
newTab: '_blank' === el.getAttribute('target') ? true : false,
|
56 |
+
noFollow: el.getAttribute('rel') && el.getAttribute('rel').includes('nofollow') ? true : false,
|
57 |
+
},
|
58 |
+
nodes: next(el.childNodes),
|
59 |
+
}
|
60 |
+
}
|
61 |
+
},
|
62 |
+
serialize(obj, children) {
|
63 |
+
if (obj.object == 'inline') {
|
64 |
+
switch (obj.type) {
|
65 |
+
case 'link':
|
66 |
+
return (
|
67 |
+
<a
|
68 |
+
className={ obj.data.get('className') }
|
69 |
+
href={ obj.data.get('href') }
|
70 |
+
target={ obj.data.get('newTab') ? '_blank' : null }
|
71 |
+
rel={ obj.data.get('noFollow') ? 'nofollow' : null }
|
72 |
+
>{children}</a>
|
73 |
+
)
|
74 |
+
}
|
75 |
+
}
|
76 |
+
},
|
77 |
+
},
|
78 |
+
{
|
79 |
+
deserialize(el, next) {
|
80 |
+
const type = MARK_TAGS[el.tagName.toLowerCase()]
|
81 |
+
if (type) {
|
82 |
+
return {
|
83 |
+
object: 'mark',
|
84 |
+
type: type,
|
85 |
+
nodes: next(el.childNodes),
|
86 |
+
}
|
87 |
+
}
|
88 |
+
},
|
89 |
+
serialize(obj, children) {
|
90 |
+
if (obj.object == 'mark') {
|
91 |
+
switch (obj.type) {
|
92 |
+
case 'bold':
|
93 |
+
return <strong>{children}</strong>
|
94 |
+
case 'italic':
|
95 |
+
return <em>{children}</em>
|
96 |
+
case 'underline':
|
97 |
+
return <u>{children}</u>
|
98 |
+
case 'subscript':
|
99 |
+
return <sub>{children}</sub>
|
100 |
+
case 'superscript':
|
101 |
+
return <sup>{children}</sup>
|
102 |
+
}
|
103 |
+
}
|
104 |
+
},
|
105 |
+
},
|
106 |
+
];
|
107 |
+
export default rules;
|
assets/js/admin-modal/fields/FieldText.js
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import React from 'react';
|
2 |
+
|
3 |
+
const FieldText = (props) => {
|
4 |
+
const type = props.type ? props.type : 'text';
|
5 |
+
|
6 |
+
return (
|
7 |
+
<input
|
8 |
+
type={ type }
|
9 |
+
value={props.value}
|
10 |
+
placeholder={props.placeholder}
|
11 |
+
onChange={(e) => {
|
12 |
+
props.onChange( e.target.value );
|
13 |
+
}}
|
14 |
+
onKeyDown={(e) => {
|
15 |
+
if ( props.onKeyDown ) {
|
16 |
+
props.onKeyDown(e);
|
17 |
+
}
|
18 |
+
}}
|
19 |
+
/>
|
20 |
+
);
|
21 |
+
}
|
22 |
+
export default FieldText;
|
assets/js/admin-modal/fields/FieldTextArea.js
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import React from 'react';
|
2 |
+
|
3 |
+
const FieldTextarea = (props) => {
|
4 |
+
return (
|
5 |
+
<textarea
|
6 |
+
value={props.value}
|
7 |
+
placeholder={props.placeholder}
|
8 |
+
onChange={(e) => {
|
9 |
+
props.onChange(e.target.value);
|
10 |
+
}}
|
11 |
+
/>
|
12 |
+
);
|
13 |
+
}
|
14 |
+
export default FieldTextarea;
|
assets/js/admin-modal/fields/FieldTime.js
ADDED
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import React from 'react';
|
2 |
+
|
3 |
+
import { __wprm } from '../../shared/Translations';
|
4 |
+
|
5 |
+
const FieldTime = (props) => {
|
6 |
+
const time = parseInt( props.value.time );
|
7 |
+
|
8 |
+
let days = 0,
|
9 |
+
hours = 0,
|
10 |
+
minutes = 0;
|
11 |
+
|
12 |
+
if ( time > 0 ) {
|
13 |
+
days = Math.floor( time / 24 / 60 );
|
14 |
+
hours = Math.floor( time / 60 % 24 );
|
15 |
+
minutes = Math.floor( time % 60 );
|
16 |
+
}
|
17 |
+
|
18 |
+
return (
|
19 |
+
<div className="wprm-admin-modal-field-time">
|
20 |
+
<div className="wprm-admin-modal-field-time-parts">
|
21 |
+
<input
|
22 |
+
type="number"
|
23 |
+
value={ 0 < days ? '' + days : '' }
|
24 |
+
onChange={ (e) => {
|
25 |
+
let newDays = parseInt( e.target.value );
|
26 |
+
newDays = isNaN( newDays ) ? 0 : newDays;
|
27 |
+
|
28 |
+
const newTime = 24 * 60 * Math.max( 0, newDays ) + 60 * hours + minutes;
|
29 |
+
props.onChange( newTime );
|
30 |
+
}}
|
31 |
+
/> { __wprm( 'days' ) }
|
32 |
+
<input
|
33 |
+
type="number"
|
34 |
+
value={ 0 < hours ? '' + hours : '' }
|
35 |
+
onChange={ (e) => {
|
36 |
+
let newHours = parseInt( e.target.value );
|
37 |
+
newHours = isNaN( newHours ) ? 0 : newHours;
|
38 |
+
|
39 |
+
const newTime = 24 * 60 * days + 60 * Math.max( 0, newHours ) + minutes;
|
40 |
+
props.onChange( newTime );
|
41 |
+
}}
|
42 |
+
/> { __wprm( 'hours' ) }
|
43 |
+
<input
|
44 |
+
type="number"
|
45 |
+
value={ 0 < minutes ? '' + minutes : ( props.value.zero ? '0' : '' ) }
|
46 |
+
onChange={ (e) => {
|
47 |
+
let newMinutes = parseInt( e.target.value );
|
48 |
+
newMinutes = isNaN( newMinutes ) ? 0 : newMinutes;
|
49 |
+
|
50 |
+
const newTime = 24 * 60 * days + 60 * hours + Math.max( 0, newMinutes );
|
51 |
+
props.onChange( newTime );
|
52 |
+
}}
|
53 |
+
/> { __wprm( 'minutes' ) }
|
54 |
+
</div>
|
55 |
+
{
|
56 |
+
0 === time
|
57 |
+
&& props.hasOwnProperty( 'onChangeZero' )
|
58 |
+
&&
|
59 |
+
<div className="wprm-admin-modal-field-time-none">
|
60 |
+
<input
|
61 |
+
id={ `wprm-admin-modal-field-time-none-${props.id}` }
|
62 |
+
type="checkbox"
|
63 |
+
checked={ props.value.zero }
|
64 |
+
onChange={(e) => {
|
65 |
+
props.onChangeZero( e.target.checked );
|
66 |
+
}}
|
67 |
+
/> <label htmlFor={ `wprm-admin-modal-field-time-none-${props.id}` }>{ __wprm( 'Show "0" in template' ) }</label>
|
68 |
+
</div>
|
69 |
+
}
|
70 |
+
</div>
|
71 |
+
);
|
72 |
+
}
|
73 |
+
export default FieldTime;
|
assets/js/admin-modal/fields/FieldTinymce.js
ADDED
@@ -0,0 +1,118 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import React, { Component } from 'react';
|
2 |
+
|
3 |
+
import Loader from '../../shared/Loader';
|
4 |
+
|
5 |
+
export default class FieldTinymce extends Component {
|
6 |
+
constructor(props) {
|
7 |
+
super(props);
|
8 |
+
|
9 |
+
// Make sure each render gets a unique UID.
|
10 |
+
const uid = parseInt( wprm_admin_modal.editor_uid );
|
11 |
+
wprm_admin_modal.editor_uid = uid + 1;
|
12 |
+
|
13 |
+
this.state = {
|
14 |
+
editorHtml: false,
|
15 |
+
addedListeners: false,
|
16 |
+
editorId: `wprm-admin-modal-notes-editor-${uid}`,
|
17 |
+
}
|
18 |
+
|
19 |
+
this.initEditor = this.initEditor.bind(this);
|
20 |
+
this.initTinyMCE = this.initTinyMCE.bind(this);
|
21 |
+
}
|
22 |
+
|
23 |
+
componentDidMount() {
|
24 |
+
const editor = document.getElementById( 'wprm-admin-modal-notes-placeholder' );
|
25 |
+
let editorHtml = editor.innerHTML;
|
26 |
+
editorHtml = editorHtml.replace( /wprm-admin-modal-notes-editor/g, this.state.editorId );
|
27 |
+
|
28 |
+
this.setState({
|
29 |
+
editorHtml,
|
30 |
+
});
|
31 |
+
}
|
32 |
+
|
33 |
+
componentDidUpdate( prevProps, prevState ) {
|
34 |
+
if ( this.state.editorHtml && ! prevState.editorHtml ) {
|
35 |
+
this.initEditor();
|
36 |
+
}
|
37 |
+
}
|
38 |
+
|
39 |
+
initEditor() {
|
40 |
+
if ( typeof window.tinymce !== 'undefined' ) {
|
41 |
+
this.initTinyMCE();
|
42 |
+
} else {
|
43 |
+
this.initTextarea();
|
44 |
+
}
|
45 |
+
}
|
46 |
+
|
47 |
+
initTextarea() {
|
48 |
+
const textarea = document.getElementById( this.state.editorId );
|
49 |
+
|
50 |
+
if ( typeof window.quicktags !== 'undefined' ) {
|
51 |
+
window.quicktags( { id: this.state.editorId } );
|
52 |
+
}
|
53 |
+
|
54 |
+
if ( textarea ) {
|
55 |
+
textarea.value = this.props.value;
|
56 |
+
|
57 |
+
['input', 'blur'].forEach((event) => {
|
58 |
+
textarea.addEventListener(event, () => {
|
59 |
+
this.props.onChange( textarea.value );
|
60 |
+
});
|
61 |
+
});
|
62 |
+
}
|
63 |
+
}
|
64 |
+
|
65 |
+
initTinyMCE() {
|
66 |
+
// Clean up first.
|
67 |
+
const container = document.getElementById( `wp-${this.state.editorId}-editor-container` );
|
68 |
+
container.outerHTML = `<textarea id="${this.state.editorId}"></textarea>`;
|
69 |
+
|
70 |
+
const $wrap = tinymce.$( `#wp-${this.state.editorId}-wrap` );
|
71 |
+
|
72 |
+
// Force to text mode and init.
|
73 |
+
$wrap.removeClass( 'tmce-active' ).addClass( 'html-active' );
|
74 |
+
this.initTextarea();
|
75 |
+
|
76 |
+
// Force to visual mode and init.
|
77 |
+
$wrap.removeClass( 'html-active' ).addClass( 'tmce-active' );
|
78 |
+
|
79 |
+
let args = {};
|
80 |
+
if ( typeof window.tinyMCEPreInit !== 'undefined' && tinyMCEPreInit.hasOwnProperty('mceInit') && tinyMCEPreInit.mceInit.hasOwnProperty('wprm-admin-modal-notes-editor') ) {
|
81 |
+
args = tinyMCEPreInit.mceInit['wprm-admin-modal-notes-editor'];
|
82 |
+
}
|
83 |
+
if ( args.hasOwnProperty('body_class') ) {
|
84 |
+
args.body_class = args.body_class.replace( /wprm-admin-modal-notes-editor/g, this.state.editorId );
|
85 |
+
}
|
86 |
+
args.selector = `#${this.state.editorId}`;
|
87 |
+
|
88 |
+
window.tinymce.init( args );
|
89 |
+
|
90 |
+
// Attach listener.
|
91 |
+
const editor = window.tinymce.get(this.state.editorId);
|
92 |
+
|
93 |
+
if ( editor ) {
|
94 |
+
editor.on('change', () => {
|
95 |
+
this.props.onChange( editor.getContent() );
|
96 |
+
});
|
97 |
+
}
|
98 |
+
}
|
99 |
+
|
100 |
+
componentWillUnmount() {
|
101 |
+
if ( typeof window.tinyMCE !== 'undefined' ) {
|
102 |
+
window.tinyMCE.remove(`#${this.state.editorId}`);
|
103 |
+
}
|
104 |
+
}
|
105 |
+
|
106 |
+
render() {
|
107 |
+
if ( ! this.state.editorHtml ) {
|
108 |
+
return <Loader/>;
|
109 |
+
}
|
110 |
+
|
111 |
+
return (
|
112 |
+
<div
|
113 |
+
id="wprm-admin-modal-field-tinymce-container"
|
114 |
+
dangerouslySetInnerHTML={ { __html: this.state.editorHtml } }
|
115 |
+
/>
|
116 |
+
);
|
117 |
+
}
|
118 |
+
}
|
assets/js/admin-modal/fields/FieldVideo.js
ADDED
@@ -0,0 +1,77 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import React, { Fragment } from 'react';
|
2 |
+
|
3 |
+
import Media from '../general/Media';
|
4 |
+
import FieldTextarea from './FieldTextarea';
|
5 |
+
|
6 |
+
import { __wprm } from '../../shared/Translations';
|
7 |
+
|
8 |
+
const FieldVideo = (props) => {
|
9 |
+
const hasUpload = props.id > 0;
|
10 |
+
const hasEmbed = ! hasUpload && ( -1 == props.id || props.embed );
|
11 |
+
const hasVideo = hasUpload || hasEmbed;
|
12 |
+
|
13 |
+
const selectVideo = () => {
|
14 |
+
Media.selectVideo((attachment) => {
|
15 |
+
props.onChange( attachment.attributes.id, attachment.attributes.thumb.src );
|
16 |
+
});
|
17 |
+
}
|
18 |
+
|
19 |
+
return (
|
20 |
+
<div className="wprm-admin-modal-field-video">
|
21 |
+
{
|
22 |
+
hasVideo
|
23 |
+
?
|
24 |
+
<Fragment>
|
25 |
+
{
|
26 |
+
hasUpload
|
27 |
+
?
|
28 |
+
<div className="wprm-admin-modal-field-video-preview">
|
29 |
+
<img
|
30 |
+
onClick={ selectVideo }
|
31 |
+
src={ props.thumb }
|
32 |
+
/>
|
33 |
+
<a
|
34 |
+
href="#"
|
35 |
+
onClick={ (e) => {
|
36 |
+
e.preventDefault();
|
37 |
+
props.onChange( 0, '' );
|
38 |
+
} }
|
39 |
+
>{ __wprm( 'Remove Video' ) }</a>
|
40 |
+
</div>
|
41 |
+
:
|
42 |
+
<Fragment>
|
43 |
+
<FieldTextarea
|
44 |
+
value={ props.embed }
|
45 |
+
onChange={(embed) => {
|
46 |
+
props.onChange( -1, '', embed );
|
47 |
+
}}
|
48 |
+
placeholder={ __wprm( 'Use URL to the video (e.g. https://www.youtube.com/watch?v=dQw4w9WgXcQ) or the full embed code.' ) }
|
49 |
+
/>
|
50 |
+
<a
|
51 |
+
href="#"
|
52 |
+
onClick={ (e) => {
|
53 |
+
e.preventDefault();
|
54 |
+
props.onChange( 0, '', '' );
|
55 |
+
} }
|
56 |
+
>{ __wprm( 'Remove Video' ) }</a>
|
57 |
+
</Fragment>
|
58 |
+
}
|
59 |
+
</Fragment>
|
60 |
+
:
|
61 |
+
<Fragment>
|
62 |
+
<button
|
63 |
+
className="button"
|
64 |
+
onClick={ selectVideo }
|
65 |
+
>{ __wprm( 'Upload Video' ) }</button>
|
66 |
+
<button
|
67 |
+
className="button"
|
68 |
+
onClick={ () => {
|
69 |
+
props.onChange( -1, '' );
|
70 |
+
} }
|
71 |
+
>{ __wprm( 'Embed Video' ) }</button>
|
72 |
+
</Fragment>
|
73 |
+
}
|
74 |
+
</div>
|
75 |
+
);
|
76 |
+
}
|
77 |
+
export default FieldVideo;
|
assets/js/admin-modal/general/Api.js
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
const modalEndpoint = wprm_admin.endpoints.modal;
|
2 |
+
|
3 |
+
let gettingSuggestions = false;
|
4 |
+
let gettingSuggestionsNextArgs = false;
|
5 |
+
|
6 |
+
export default {
|
7 |
+
getSuggestions(args) {
|
8 |
+
if ( ! gettingSuggestions ) {
|
9 |
+
return this.getSuggestionsDebounced(args);
|
10 |
+
} else {
|
11 |
+
gettingSuggestionsNextArgs = args;
|
12 |
+
return new Promise(r => r(false));
|
13 |
+
}
|
14 |
+
},
|
15 |
+
getSuggestionsDebounced(args) {
|
16 |
+
gettingSuggestions = true;
|
17 |
+
|
18 |
+
return fetch(`${modalEndpoint}/ingredient/suggest`, {
|
19 |
+
method: 'POST',
|
20 |
+
headers: {
|
21 |
+
'X-WP-Nonce': wprm_admin.api_nonce,
|
22 |
+
'Accept': 'application/json',
|
23 |
+
'Content-Type': 'application/json',
|
24 |
+
},
|
25 |
+
credentials: 'same-origin',
|
26 |
+
body: JSON.stringify(args),
|
27 |
+
}).then(response => {
|
28 |
+
return response.json().then(json => {
|
29 |
+
// Check if another request is queued.
|
30 |
+
if ( gettingSuggestionsNextArgs ) {
|
31 |
+
const newArgs = gettingSuggestionsNextArgs;
|
32 |
+
gettingSuggestionsNextArgs = false;
|
33 |
+
|
34 |
+
return this.getSuggestionsDebounced(newArgs);
|
35 |
+
} else {
|
36 |
+
// Return this request.
|
37 |
+
gettingSuggestions = false;
|
38 |
+
return response.ok ? json : false;
|
39 |
+
}
|
40 |
+
});
|
41 |
+
});
|
42 |
+
},
|
43 |
+
};
|
assets/js/admin-modal/general/EditMode.js
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import React from 'react';
|
2 |
+
|
3 |
+
import '../../../css/admin/modal/general/edit-mode.scss';
|
4 |
+
|
5 |
+
const EditMode = (props) => {
|
6 |
+
if ( ! props.modes ) {
|
7 |
+
return null;
|
8 |
+
}
|
9 |
+
|
10 |
+
return (
|
11 |
+
<div
|
12 |
+
className="wprm-admin-modal-field-edit-mode-container"
|
13 |
+
>
|
14 |
+
{
|
15 |
+
props.modes.map((mode, index) => (
|
16 |
+
<a
|
17 |
+
href="#"
|
18 |
+
className={ `wprm-admin-modal-field-edit-mode${ mode.id === props.mode ? ' wprm-admin-modal-field-edit-mode-selected' : '' }` }
|
19 |
+
onClick={(e) => {
|
20 |
+
e.preventDefault();
|
21 |
+
props.onModeChange( mode.id );
|
22 |
+
}}
|
23 |
+
key={index}
|
24 |
+
>
|
25 |
+
{ mode.label }
|
26 |
+
</a>
|
27 |
+
))
|
28 |
+
}
|
29 |
+
</div>
|
30 |
+
);
|
31 |
+
}
|
32 |
+
export default EditMode;
|
assets/js/admin-modal/general/Footer.js
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import React, { Fragment } from 'react';
|
2 |
+
|
3 |
+
import Loader from '../../shared/Loader';
|
4 |
+
|
5 |
+
const Footer = (props) => {
|
6 |
+
return (
|
7 |
+
<div className="wprm-admin-modal-footer">
|
8 |
+
{
|
9 |
+
props.savingChanges
|
10 |
+
?
|
11 |
+
<Loader/>
|
12 |
+
:
|
13 |
+
<Fragment>
|
14 |
+
{ props.children }
|
15 |
+
</Fragment>
|
16 |
+
}
|
17 |
+
</div>
|
18 |
+
);
|
19 |
+
}
|
20 |
+
export default Footer;
|
assets/js/admin-modal/general/Header.js
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import React from 'react';
|
2 |
+
|
3 |
+
import { __wprm } from '../../shared/Translations';
|
4 |
+
import Icon from '../../shared/Icon';
|
5 |
+
|
6 |
+
const Header = (props) => {
|
7 |
+
return (
|
8 |
+
<div className="wprm-admin-modal-header">
|
9 |
+
<h2>{ props.children }</h2>
|
10 |
+
<div
|
11 |
+
className="wprm-admin-modal-close"
|
12 |
+
onClick={props.onCloseModal}
|
13 |
+
>
|
14 |
+
<Icon
|
15 |
+
type="close"
|
16 |
+
title={ __wprm( 'Close' ) }
|
17 |
+
/>
|
18 |
+
</div>
|
19 |
+
</div>
|
20 |
+
);
|
21 |
+
}
|
22 |
+
export default Header;
|
assets/js/admin-modal/general/Media.js
ADDED
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { __wprm } from '../../shared/Translations';
|
2 |
+
|
3 |
+
const Media = {
|
4 |
+
selectImage( callback ) {
|
5 |
+
this.select( 'image', callback );
|
6 |
+
},
|
7 |
+
selectVideo( callback ) {
|
8 |
+
this.select( 'video', callback );
|
9 |
+
},
|
10 |
+
select( type, callback ) {
|
11 |
+
let media_arguments = {
|
12 |
+
title: __wprm( 'Select Media' ),
|
13 |
+
button: {
|
14 |
+
text: __wprm( 'Select' ),
|
15 |
+
},
|
16 |
+
multiple: false,
|
17 |
+
};
|
18 |
+
|
19 |
+
// Check what media type we're getting.
|
20 |
+
if ( 'video' === type ) {
|
21 |
+
media_arguments.frame = 'video';
|
22 |
+
media_arguments.state = 'video-details';
|
23 |
+
} else {
|
24 |
+
// Default to image.
|
25 |
+
media_arguments.library = {
|
26 |
+
type: 'image',
|
27 |
+
};
|
28 |
+
}
|
29 |
+
|
30 |
+
// Create a new media frame (don't reuse because we have multiple different inputs)
|
31 |
+
let frame = wp.media(media_arguments);
|
32 |
+
|
33 |
+
// Handle image selection
|
34 |
+
frame.on('select', function() {
|
35 |
+
var attachment = frame.state().get('selection').first().toJSON();
|
36 |
+
callback( attachment );
|
37 |
+
});
|
38 |
+
|
39 |
+
// Handle video selection
|
40 |
+
frame.on('update', function() {
|
41 |
+
let attachment = frame.state().media.attachment;
|
42 |
+
|
43 |
+
if ( attachment ) {
|
44 |
+
callback( attachment );
|
45 |
+
}
|
46 |
+
});
|
47 |
+
|
48 |
+
// Finally, open the modal on click
|
49 |
+
frame.open();
|
50 |
+
}
|
51 |
+
}
|
52 |
+
export default Media;
|
assets/js/admin-modal/general/Toolbar.js
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import React from 'react';
|
2 |
+
import ReactDOM from 'react-dom';
|
3 |
+
|
4 |
+
const Toolbar = (props) => {
|
5 |
+
const toolbarContainer = document.getElementById( 'wprm-admin-modal-toolbar-container' );
|
6 |
+
|
7 |
+
if ( ! toolbarContainer ) {
|
8 |
+
return null;
|
9 |
+
} else {
|
10 |
+
return ReactDOM.createPortal(
|
11 |
+
<div
|
12 |
+
className="wprm-admin-modal-toolbar"
|
13 |
+
onMouseDown={ (event) => {
|
14 |
+
event.preventDefault();
|
15 |
+
}}
|
16 |
+
>
|
17 |
+
{ props.children }
|
18 |
+
</div>,
|
19 |
+
toolbarContainer,
|
20 |
+
);
|
21 |
+
}
|
22 |
+
}
|
23 |
+
export default Toolbar;
|
assets/js/admin-modal/menu/index.js
ADDED
@@ -0,0 +1,237 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import React, { Component, Fragment } from 'react';
|
2 |
+
|
3 |
+
import '../../../css/admin/modal/menu.scss';
|
4 |
+
|
5 |
+
import Header from '../general/Header';
|
6 |
+
import Button from '../../shared/Button';
|
7 |
+
import { __wprm } from '../../shared/Translations';
|
8 |
+
|
9 |
+
export default class Menu extends Component {
|
10 |
+
render() {
|
11 |
+
return (
|
12 |
+
<Fragment>
|
13 |
+
<Header
|
14 |
+
onCloseModal={ this.props.maybeCloseModal }
|
15 |
+
>
|
16 |
+
WP Recipe Maker
|
17 |
+
</Header>
|
18 |
+
<div className="wprm-admin-modal-menu-container">
|
19 |
+
<h2>{ __wprm( 'Recipes' ) }</h2>
|
20 |
+
<div className="wprm-admin-modal-menu-buttons">
|
21 |
+
<Button
|
22 |
+
isPrimary
|
23 |
+
onClick={ () => {
|
24 |
+
WPRM_Modal.open( 'recipe', this.props.args, true );
|
25 |
+
} }
|
26 |
+
>{ __wprm( 'Create new Recipe' ) }</Button>
|
27 |
+
<Button
|
28 |
+
onClick={ () => {
|
29 |
+
WPRM_Modal.open( 'select', {
|
30 |
+
title: __wprm( 'Insert existing Recipe' ),
|
31 |
+
button: __wprm( 'Insert' ),
|
32 |
+
fields: {
|
33 |
+
recipe: {},
|
34 |
+
},
|
35 |
+
insertCallback: ( fields ) => {
|
36 |
+
if ( 'function' === typeof this.props.args.insertCallback ) {
|
37 |
+
this.props.args.insertCallback( `[wprm-recipe id="${ fields.recipe.id }"]` );
|
38 |
+
}
|
39 |
+
},
|
40 |
+
}, true );
|
41 |
+
} }
|
42 |
+
>{ __wprm( 'Insert existing Recipe' ) }</Button>
|
43 |
+
<Button
|
44 |
+
required="premium"
|
45 |
+
onClick={ () => {
|
46 |
+
WPRM_Modal.open( 'select', {
|
47 |
+
title: __wprm( 'Create new from existing Recipe' ),
|
48 |
+
button: __wprm( 'Clone Recipe' ),
|
49 |
+
fields: {
|
50 |
+
recipe: {},
|
51 |
+
},
|
52 |
+
nextStepCallback: ( fields ) => {
|
53 |
+
WPRM_Modal.open( 'recipe', {
|
54 |
+
...this.props.args,
|
55 |
+
recipeId: fields.recipe.id,
|
56 |
+
cloneRecipe: true,
|
57 |
+
}, true );
|
58 |
+
},
|
59 |
+
}, true );
|
60 |
+
} }
|
61 |
+
>{ __wprm( 'Create new from existing Recipe' ) }</Button>
|
62 |
+
</div>
|
63 |
+
<h2>{ __wprm( 'Recipe Snippets' ) }</h2>
|
64 |
+
<div className="wprm-admin-modal-menu-buttons">
|
65 |
+
<Button
|
66 |
+
help={ __wprm( 'Displays default snippet template as set in the WPRM Settings' ) }
|
67 |
+
onClick={ () => {
|
68 |
+
WPRM_Modal.open( 'select', {
|
69 |
+
title: __wprm( 'Full Snippet Template' ),
|
70 |
+
button: __wprm( 'Insert' ),
|
71 |
+
fields: {
|
72 |
+
recipe: { showFirst: true },
|
73 |
+
},
|
74 |
+
insertCallback: ( fields ) => {
|
75 |
+
if ( 'function' === typeof this.props.args.insertCallback ) {
|
76 |
+
let shortcode = '[wprm-recipe-snippet';
|
77 |
+
shortcode += fields.recipe && fields.recipe.id ? ` id="${ fields.recipe.id }"]` : ']';
|
78 |
+
|
79 |
+
this.props.args.insertCallback( shortcode );
|
80 |
+
}
|
81 |
+
},
|
82 |
+
}, true );
|
83 |
+
} }
|
84 |
+
>{ __wprm( 'Full Snippet Template' ) }</Button>
|
85 |
+
<Button
|
86 |
+
onClick={ () => {
|
87 |
+
WPRM_Modal.open( 'select', {
|
88 |
+
title: __wprm( 'Jump to Recipe' ),
|
89 |
+
button: __wprm( 'Insert' ),
|
90 |
+
fields: {
|
91 |
+
recipe: { showFirst: true },
|
92 |
+
},
|
93 |
+
insertCallback: ( fields ) => {
|
94 |
+
if ( 'function' === typeof this.props.args.insertCallback ) {
|
95 |
+
let shortcode = '[wprm-recipe-jump';
|
96 |
+
shortcode += fields.recipe && fields.recipe.id ? ` id="${ fields.recipe.id }"]` : ']';
|
97 |
+
|
98 |
+
this.props.args.insertCallback( shortcode );
|
99 |
+
}
|
100 |
+
},
|
101 |
+
}, true );
|
102 |
+
} }
|
103 |
+
>{ __wprm( 'Jump to Recipe' ) }</Button>
|
104 |
+
<Button
|
105 |
+
onClick={ () => {
|
106 |
+
WPRM_Modal.open( 'select', {
|
107 |
+
title: __wprm( 'Jump to Video' ),
|
108 |
+
button: __wprm( 'Insert' ),
|
109 |
+
fields: {
|
110 |
+
recipe: { showFirst: true },
|
111 |
+
},
|
112 |
+
insertCallback: ( fields ) => {
|
113 |
+
if ( 'function' === typeof this.props.args.insertCallback ) {
|
114 |
+
let shortcode = '[wprm-recipe-jump-video';
|
115 |
+
shortcode += fields.recipe && fields.recipe.id ? ` id="${ fields.recipe.id }"]` : ']';
|
116 |
+
|
117 |
+
this.props.args.insertCallback( shortcode );
|
118 |
+
}
|
119 |
+
},
|
120 |
+
}, true );
|
121 |
+
} }
|
122 |
+
>{ __wprm( 'Jump to Video' ) }</Button>
|
123 |
+
<Button
|
124 |
+
onClick={ () => {
|
125 |
+
WPRM_Modal.open( 'select', {
|
126 |
+
title: __wprm( 'Print Recipe' ),
|
127 |
+
button: __wprm( 'Insert' ),
|
128 |
+
fields: {
|
129 |
+
recipe: { showFirst: true },
|
130 |
+
},
|
131 |
+
insertCallback: ( fields ) => {
|
132 |
+
if ( 'function' === typeof this.props.args.insertCallback ) {
|
133 |
+
let shortcode = '[wprm-recipe-print';
|
134 |
+
shortcode += fields.recipe && fields.recipe.id ? ` id="${ fields.recipe.id }"]` : ']';
|
135 |
+
|
136 |
+
this.props.args.insertCallback( shortcode );
|
137 |
+
}
|
138 |
+
},
|
139 |
+
}, true );
|
140 |
+
} }
|
141 |
+
>{ __wprm( 'Print Recipe' ) }</Button>
|
142 |
+
</div>
|
143 |
+
<h2>{ __wprm( 'Recipe Parts' ) }</h2>
|
144 |
+
<div className="wprm-admin-modal-menu-buttons">
|
145 |
+
<Button
|
146 |
+
required="premium"
|
147 |
+
onClick={ () => {
|
148 |
+
WPRM_Modal.open( 'select', {
|
149 |
+
title: __wprm( 'Nutrition Label' ),
|
150 |
+
button: __wprm( 'Insert' ),
|
151 |
+
fields: {
|
152 |
+
recipe: { showFirst: true },
|
153 |
+
},
|
154 |
+
insertCallback: ( fields ) => {
|
155 |
+
if ( 'function' === typeof this.props.args.insertCallback ) {
|
156 |
+
let shortcode = '[wprm-nutrition-label';
|
157 |
+
shortcode += fields.recipe && fields.recipe.id ? ` id="${ fields.recipe.id }"]` : ']';
|
158 |
+
|
159 |
+
this.props.args.insertCallback( shortcode );
|
160 |
+
}
|
161 |
+
},
|
162 |
+
}, true );
|
163 |
+
} }
|
164 |
+
>{ __wprm( 'Nutrition Label' ) }</Button>
|
165 |
+
<Button
|
166 |
+
onClick={ () => {
|
167 |
+
WPRM_Modal.open( 'select', {
|
168 |
+
title: __wprm( 'Recipe Video' ),
|
169 |
+
button: __wprm( 'Insert' ),
|
170 |
+
fields: {
|
171 |
+
recipe: { showFirst: true },
|
172 |
+
},
|
173 |
+
insertCallback: ( fields ) => {
|
174 |
+
if ( 'function' === typeof this.props.args.insertCallback ) {
|
175 |
+
let shortcode = '[wprm-recipe-video';
|
176 |
+
shortcode += fields.recipe && fields.recipe.id ? ` id="${ fields.recipe.id }"]` : ']';
|
177 |
+
|
178 |
+
this.props.args.insertCallback( shortcode );
|
179 |
+
}
|
180 |
+
},
|
181 |
+
}, true );
|
182 |
+
} }
|
183 |
+
>{ __wprm( 'Recipe Video' ) }</Button>
|
184 |
+
</div>
|
185 |
+
<h2>{ __wprm( 'Other Features' ) }</h2>
|
186 |
+
<div className="wprm-admin-modal-menu-buttons">
|
187 |
+
<Button
|
188 |
+
help={ __wprm( 'Use for a list of existing recipes on your website' ) }
|
189 |
+
onClick={ () => {
|
190 |
+
WPRM_Modal.open( 'select', {
|
191 |
+
title: __wprm( 'Recipe Roundup Item' ),
|
192 |
+
button: __wprm( 'Insert' ),
|
193 |
+
fields: {
|
194 |
+
recipe: {},
|
195 |
+
},
|
196 |
+
insertCallback: ( fields ) => {
|
197 |
+
if ( 'function' === typeof this.props.args.insertCallback ) {
|
198 |
+
this.props.args.insertCallback( `[wprm-recipe-roundup-item id="${ fields.recipe.id }"]` );
|
199 |
+
}
|
200 |
+
},
|
201 |
+
}, true );
|
202 |
+
} }
|
203 |
+
>{ __wprm( 'Recipe Roundup Item' ) }</Button>
|
204 |
+
<Button
|
205 |
+
required="elite"
|
206 |
+
onClick={ () => {
|
207 |
+
if ( 'function' === typeof this.props.args.insertCallback ) {
|
208 |
+
this.props.args.insertCallback( '[wprm-recipe-submission]' );
|
209 |
+
}
|
210 |
+
this.props.maybeCloseModal();
|
211 |
+
} }
|
212 |
+
>{ __wprm( 'Recipe Submission Form' ) }</Button>
|
213 |
+
<Button
|
214 |
+
required="elite"
|
215 |
+
onClick={ () => {
|
216 |
+
if ( 'function' === typeof this.props.args.insertCallback ) {
|
217 |
+
this.props.args.insertCallback( '[wprm-recipe-collections]' );
|
218 |
+
}
|
219 |
+
this.props.maybeCloseModal();
|
220 |
+
} }
|
221 |
+
>{ __wprm( 'Recipe Collections' ) }</Button>
|
222 |
+
<Button
|
223 |
+
required="elite"
|
224 |
+
help={ __wprm( 'Find the saved collection ID on the WP Recipe Maker > Manage > Saved Collections page' ) }
|
225 |
+
onClick={ () => {
|
226 |
+
if ( 'function' === typeof this.props.args.insertCallback ) {
|
227 |
+
this.props.args.insertCallback( '[wprm-saved-collection id=""]' );
|
228 |
+
}
|
229 |
+
this.props.maybeCloseModal();
|
230 |
+
} }
|
231 |
+
>{ __wprm( 'Saved Recipe Collection' ) }</Button>
|
232 |
+
</div>
|
233 |
+
</div>
|
234 |
+
</Fragment>
|
235 |
+
);
|
236 |
+
}
|
237 |
+
}
|
assets/js/admin-modal/nutrition/index.js
ADDED
@@ -0,0 +1,196 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import React, { Component, Fragment } from 'react';
|
2 |
+
|
3 |
+
import '../../../css/admin/modal/nutrition.scss';
|
4 |
+
|
5 |
+
import { __wprm } from '../../shared/Translations';
|
6 |
+
import Loader from '../../shared/Loader';
|
7 |
+
import Header from '../general/Header';
|
8 |
+
import Footer from '../general/Footer';
|
9 |
+
|
10 |
+
import FieldText from '../fields/FieldText';
|
11 |
+
import Api from '../recipe/nutrition-calculation/Api';
|
12 |
+
import Nutrients from '../recipe/nutrition-calculation/Nutrients';
|
13 |
+
|
14 |
+
export default class Menu extends Component {
|
15 |
+
constructor(props) {
|
16 |
+
super(props);
|
17 |
+
|
18 |
+
let ingredient = {
|
19 |
+
id: 0,
|
20 |
+
amount: '',
|
21 |
+
unit: '',
|
22 |
+
name: '',
|
23 |
+
facts: {},
|
24 |
+
}
|
25 |
+
let loadingIngredient = false;
|
26 |
+
|
27 |
+
if ( props.args.hasOwnProperty( 'ingredient' ) ) {
|
28 |
+
ingredient = JSON.parse( JSON.stringify( props.args.ingredient ) );
|
29 |
+
} else if ( props.args.hasOwnProperty( 'ingredientId' ) ) {
|
30 |
+
loadingIngredient = true;
|
31 |
+
Api.getCustomIngredient(props.args.ingredientId).then((data) => {
|
32 |
+
if ( data ) {
|
33 |
+
const savedIngredient = JSON.parse( JSON.stringify( data.ingredient ) );
|
34 |
+
|
35 |
+
if ( savedIngredient ) {
|
36 |
+
const ingredient = {
|
37 |
+
id: savedIngredient.id,
|
38 |
+
amount: savedIngredient.nutrition.amount,
|
39 |
+
unit: savedIngredient.nutrition.unit,
|
40 |
+
name: savedIngredient.name,
|
41 |
+
facts: savedIngredient.nutrition.nutrients,
|
42 |
+
}
|
43 |
+
|
44 |
+
this.setState({
|
45 |
+
ingredient,
|
46 |
+
originalIngredient: JSON.parse( JSON.stringify( ingredient ) ),
|
47 |
+
loadingIngredient: false,
|
48 |
+
});
|
49 |
+
}
|
50 |
+
}
|
51 |
+
});
|
52 |
+
}
|
53 |
+
|
54 |
+
this.state = {
|
55 |
+
ingredient,
|
56 |
+
originalIngredient: JSON.parse( JSON.stringify( ingredient ) ),
|
57 |
+
loadingIngredient,
|
58 |
+
savingChanges: false,
|
59 |
+
};
|
60 |
+
|
61 |
+
this.changesMade = this.changesMade.bind(this);
|
62 |
+
this.saveChanges = this.saveChanges.bind(this);
|
63 |
+
}
|
64 |
+
|
65 |
+
saveChanges() {
|
66 |
+
if ( '' === this.state.ingredient.name.trim() ) {
|
67 |
+
alert( __wprm( 'A name is required for this saved nutrition ingredient.' ) );
|
68 |
+
} else {
|
69 |
+
this.setState({
|
70 |
+
savingChanges: true,
|
71 |
+
}, () => {
|
72 |
+
Api.saveCustomIngredient(this.state.ingredient.id, this.state.ingredient.amount, this.state.ingredient.unit, this.state.ingredient.name, this.state.ingredient.facts ).then(() => {
|
73 |
+
this.setState({
|
74 |
+
originalIngredient: JSON.parse( JSON.stringify( this.state.ingredient ) ),
|
75 |
+
savingChanges: false,
|
76 |
+
},() => {
|
77 |
+
if ( 'function' === typeof this.props.args.saveCallback ) {
|
78 |
+
this.props.args.saveCallback( this.state.ingredient );
|
79 |
+
}
|
80 |
+
this.props.maybeCloseModal();
|
81 |
+
});
|
82 |
+
});
|
83 |
+
})
|
84 |
+
}
|
85 |
+
}
|
86 |
+
|
87 |
+
allowCloseModal() {
|
88 |
+
return ! this.state.savingChanges && ( ! this.changesMade() || confirm( __wprm( 'Are you sure you want to close without saving changes?' ) ) );
|
89 |
+
}
|
90 |
+
|
91 |
+
changesMade() {
|
92 |
+
return JSON.stringify( this.state.ingredient ) !== JSON.stringify( this.state.originalIngredient );
|
93 |
+
}
|
94 |
+
|
95 |
+
render() {
|
96 |
+
return (
|
97 |
+
<Fragment>
|
98 |
+
<Header
|
99 |
+
onCloseModal={ this.props.maybeCloseModal }
|
100 |
+
>
|
101 |
+
{
|
102 |
+
this.state.loadingIngredient
|
103 |
+
?
|
104 |
+
__wprm( 'Loading Ingredient...' )
|
105 |
+
:
|
106 |
+
<Fragment>
|
107 |
+
{
|
108 |
+
this.state.ingredient.id
|
109 |
+
?
|
110 |
+
|
111 |
+
`${ __wprm( 'Editing Nutrition Ingredient' ) } #${this.state.ingredient.id}${this.state.ingredient.name ? ` - ${this.state.ingredient.name}` : ''}`
|
112 |
+
:
|
113 |
+
`${ __wprm( 'Creating new Nutrition Ingredient' ) }${this.state.ingredient.name ? ` - ${this.state.ingredient.name}` : ''}`
|
114 |
+
}
|
115 |
+
</Fragment>
|
116 |
+
}
|
117 |
+
</Header>
|
118 |
+
<div className="wprm-admin-modal-nutrition-container">
|
119 |
+
{
|
120 |
+
this.state.loadingIngredient
|
121 |
+
?
|
122 |
+
<Loader />
|
123 |
+
:
|
124 |
+
<Fragment>
|
125 |
+
<div className="wprm-admin-modal-nutrition-custom-ingredient">
|
126 |
+
<FieldText
|
127 |
+
type="number"
|
128 |
+
placeholder={ __wprm( 'Amount' ) }
|
129 |
+
value={ this.state.ingredient.amount }
|
130 |
+
onChange={ (amount) => {
|
131 |
+
this.setState({
|
132 |
+
ingredient: {
|
133 |
+
...this.state.ingredient,
|
134 |
+
amount,
|
135 |
+
}
|
136 |
+
});
|
137 |
+
}}
|
138 |
+
/>
|
139 |
+
<FieldText
|
140 |
+
placeholder={ __wprm( 'Unit' ) }
|
141 |
+
value={ this.state.ingredient.unit }
|
142 |
+
onChange={ (unit) => {
|
143 |
+
this.setState({
|
144 |
+
ingredient: {
|
145 |
+
...this.state.ingredient,
|
146 |
+
unit,
|
147 |
+
}
|
148 |
+
});
|
149 |
+
}}
|
150 |
+
/>
|
151 |
+
<FieldText
|
152 |
+
placeholder={ __wprm( 'Name (required)' ) }
|
153 |
+
value={ this.state.ingredient.name }
|
154 |
+
onChange={ (name) => {
|
155 |
+
this.setState({
|
156 |
+
ingredient: {
|
157 |
+
...this.state.ingredient,
|
158 |
+
name,
|
159 |
+
}
|
160 |
+
});
|
161 |
+
}}
|
162 |
+
/>
|
163 |
+
</div>
|
164 |
+
<Nutrients
|
165 |
+
id="modal"
|
166 |
+
facts={ this.state.ingredient.facts }
|
167 |
+
onChange={ (nutrient, value) => {
|
168 |
+
let facts = { ...this.state.ingredient.facts };
|
169 |
+
facts[ nutrient ] = value;
|
170 |
+
|
171 |
+
this.setState({
|
172 |
+
ingredient: {
|
173 |
+
...this.state.ingredient,
|
174 |
+
facts,
|
175 |
+
}
|
176 |
+
});
|
177 |
+
}}
|
178 |
+
/>
|
179 |
+
</Fragment>
|
180 |
+
}
|
181 |
+
</div>
|
182 |
+
<Footer
|
183 |
+
savingChanges={ this.state.savingChanges }
|
184 |
+
>
|
185 |
+
<button
|
186 |
+
className="button button-primary"
|
187 |
+
onClick={ this.saveChanges }
|
188 |
+
disabled={ ! this.changesMade() }
|
189 |
+
>
|
190 |
+
{ __wprm( 'Save' ) }
|
191 |
+
</button>
|
192 |
+
</Footer>
|
193 |
+
</Fragment>
|
194 |
+
);
|
195 |
+
}
|
196 |
+
}
|
assets/js/admin-modal/recipe/edit-ingredient-links/index.js
ADDED
@@ -0,0 +1,109 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import React, { Component, Fragment } from 'react';
|
2 |
+
|
3 |
+
import '../../../../css/admin/modal/recipe/ingredient-links.scss';
|
4 |
+
|
5 |
+
import Header from '../../general/Header';
|
6 |
+
import Footer from '../../general/Footer';
|
7 |
+
import { __wprm } from '../../../shared/Translations';
|
8 |
+
|
9 |
+
import Api from '../edit/RecipeIngredients/IngredientLinks/Api';
|
10 |
+
import IngredientLink from '../edit/RecipeIngredients/IngredientLinks/IngredientLink';
|
11 |
+
|
12 |
+
export default class EditIngredientLinks extends Component {
|
13 |
+
constructor(props) {
|
14 |
+
super(props);
|
15 |
+
|
16 |
+
this.state = {
|
17 |
+
isSaving: false,
|
18 |
+
ingredients: JSON.parse( JSON.stringify( this.props.ingredients ) ),
|
19 |
+
};
|
20 |
+
|
21 |
+
this.saveLinks = this.saveLinks.bind(this);
|
22 |
+
}
|
23 |
+
|
24 |
+
saveLinks() {
|
25 |
+
const ingredientsToSave = this.state.ingredients.filter( (ingredient, index) => false !== ingredient.globalLink && JSON.stringify( ingredient ) !== JSON.stringify( this.props.ingredients[ index ] ) );
|
26 |
+
const linksToSave = ingredientsToSave.map((ingredient) => ({
|
27 |
+
name: ingredient.name,
|
28 |
+
url: ingredient.globalLink.url,
|
29 |
+
nofollow: ingredient.globalLink.nofollow,
|
30 |
+
}));
|
31 |
+
|
32 |
+
this.setState({
|
33 |
+
isSaving: true,
|
34 |
+
}, () => {
|
35 |
+
Api.saveGlobalLinks( linksToSave ).then((data) => {
|
36 |
+
if ( data ) {
|
37 |
+
// Update ingredient and state.
|
38 |
+
this.props.onIngredientsChange(this.state.ingredients);
|
39 |
+
} else {
|
40 |
+
this.setState({
|
41 |
+
isSaving: false,
|
42 |
+
});
|
43 |
+
}
|
44 |
+
});
|
45 |
+
});
|
46 |
+
}
|
47 |
+
|
48 |
+
render() {
|
49 |
+
const changesMade = JSON.stringify( this.props.ingredients ) !== JSON.stringify( this.state.ingredients );
|
50 |
+
|
51 |
+
return (
|
52 |
+
<Fragment>
|
53 |
+
<Header
|
54 |
+
onCloseModal={ this.props.onCloseModal }
|
55 |
+
>
|
56 |
+
{ __wprm( 'Editing Global Ingredient Links' ) }
|
57 |
+
</Header>
|
58 |
+
<div className="wprm-admin-modal-field-ingredient-links-container wprm-admin-modal-field-ingredient-links-edit-container">
|
59 |
+
<div className="wprm-admin-modal-field-ingredient-links">
|
60 |
+
{
|
61 |
+
this.state.ingredients.map((field, index) => {
|
62 |
+
if ( 'group' === field.type || ! field.name ) {
|
63 |
+
return null;
|
64 |
+
}
|
65 |
+
|
66 |
+
return (
|
67 |
+
<IngredientLink
|
68 |
+
ingredient={ field }
|
69 |
+
onLinkChange={(link) => {
|
70 |
+
let newIngredients = JSON.parse( JSON.stringify( this.state.ingredients ) );
|
71 |
+
newIngredients[ index ].globalLink = link;
|
72 |
+
|
73 |
+
this.setState({
|
74 |
+
ingredients: newIngredients,
|
75 |
+
});
|
76 |
+
}}
|
77 |
+
type={ 'edit-global' }
|
78 |
+
hasChanged={
|
79 |
+
JSON.stringify( field ) !== JSON.stringify( this.props.ingredients[ index ] )
|
80 |
+
}
|
81 |
+
isUpdating={ false }
|
82 |
+
key={ index }
|
83 |
+
/>
|
84 |
+
)
|
85 |
+
})
|
86 |
+
}
|
87 |
+
</div>
|
88 |
+
</div>
|
89 |
+
<Footer
|
90 |
+
savingChanges={ this.state.isSaving }
|
91 |
+
>
|
92 |
+
<button
|
93 |
+
className="button"
|
94 |
+
onClick={ this.props.onCancel }
|
95 |
+
>
|
96 |
+
{ __wprm( 'Cancel' ) }
|
97 |
+
</button>
|
98 |
+
<button
|
99 |
+
className="button button-primary"
|
100 |
+
onClick={ this.saveLinks }
|
101 |
+
disabled={ ! changesMade }
|
102 |
+
>
|
103 |
+
{ __wprm( 'Save Changes' ) }
|
104 |
+
</button>
|
105 |
+
</Footer>
|
106 |
+
</Fragment>
|
107 |
+
);
|
108 |
+
}
|
109 |
+
}
|
assets/js/admin-modal/recipe/edit/RecipeCategories.js
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import React, { Fragment } from 'react';
|
2 |
+
|
3 |
+
import FieldContainer from '../../fields/FieldContainer';
|
4 |
+
import FieldCategory from '../../fields/FieldCategory';
|
5 |
+
|
6 |
+
const RecipeCategories = (props) => {
|
7 |
+
const categories = Object.keys( wprm_admin_modal.categories );
|
8 |
+
|
9 |
+
return (
|
10 |
+
<Fragment>
|
11 |
+
{
|
12 |
+
categories.map((category, index) => {
|
13 |
+
const options = wprm_admin_modal.categories[ category ];
|
14 |
+
const value = props.tags.hasOwnProperty( category ) ? props.tags[ category ] : [];
|
15 |
+
|
16 |
+
return (
|
17 |
+
<FieldContainer
|
18 |
+
id={ category }
|
19 |
+
label={ options.label }
|
20 |
+
help={ options.hasOwnProperty( 'help' ) ? options.help : null }
|
21 |
+
key={ index }
|
22 |
+
>
|
23 |
+
<FieldCategory
|
24 |
+
id={ category }
|
25 |
+
value={ value }
|
26 |
+
onChange={ (value) => {
|
27 |
+
const tags = {
|
28 |
+
...props.tags,
|
29 |
+
};
|
30 |
+
|
31 |
+
tags[ category ] = value;
|
32 |
+
|
33 |
+
props.onRecipeChange( { tags } );
|
34 |
+
}}
|
35 |
+
width="450px"
|
36 |
+
/>
|
37 |
+
</FieldContainer>
|
38 |
+
)
|
39 |
+
})
|
40 |
+
}
|
41 |
+
</Fragment>
|
42 |
+
);
|
43 |
+
}
|
44 |
+
export default RecipeCategories;
|
assets/js/admin-modal/recipe/edit/RecipeGeneral.js
ADDED
@@ -0,0 +1,109 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import React, { Fragment } from 'react';
|
2 |
+
|
3 |
+
import '../../../../css/admin/modal/recipe/fields/general.scss';
|
4 |
+
|
5 |
+
import { __wprm } from '../../../shared/Translations';
|
6 |
+
import FieldContainer from '../../fields/FieldContainer';
|
7 |
+
import FieldDropdown from '../../fields/FieldDropdown';
|
8 |
+
import FieldText from '../../fields/FieldText';
|
9 |
+
import FieldRadio from '../../fields/FieldRadio';
|
10 |
+
import FieldRichText from '../../fields/FieldRichText';
|
11 |
+
|
12 |
+
const RecipeGeneral = (props) => {
|
13 |
+
const author = wprm_admin_modal.options.author.find((option) => option.value === props.author.display );
|
14 |
+
|
15 |
+
return (
|
16 |
+
<Fragment>
|
17 |
+
<FieldContainer id="type" label={ __wprm( 'Recipe Type' ) } help={ __wprm( `You're only allowed to add recipe metadata for food recipes. Use "Other" for crafts and DIY instructions.` ) }>
|
18 |
+
<FieldRadio
|
19 |
+
id="type"
|
20 |
+
options={[
|
21 |
+
{ value: 'food', label: __wprm( 'Food Recipe' ) },
|
22 |
+
{ value: 'other', label: __wprm( 'Other (no metadata)' ) },
|
23 |
+
]}
|
24 |
+
value={ props.type }
|
25 |
+
onChange={ (type) => {
|
26 |
+
props.onRecipeChange( { type } );
|
27 |
+
}}
|
28 |
+
/>
|
29 |
+
</FieldContainer>
|
30 |
+
<FieldContainer id="name" label={ __wprm( 'Name' ) }>
|
31 |
+
<FieldText
|
32 |
+
placeholder={ __wprm( 'Recipe Name' ) }
|
33 |
+
value={ props.name }
|
34 |
+
onChange={ (name) => {
|
35 |
+
props.onRecipeChange( { name } );
|
36 |
+
}}
|
37 |
+
/>
|
38 |
+
</FieldContainer>
|
39 |
+
<FieldContainer id="summary" label={ __wprm( 'Summary' ) }>
|
40 |
+
<FieldRichText
|
41 |
+
placeholder={ __wprm( 'Short description of this recipe...' ) }
|
42 |
+
value={ props.summary }
|
43 |
+
onChange={ (summary) => {
|
44 |
+
props.onRecipeChange( { summary } );
|
45 |
+
}}
|
46 |
+
/>
|
47 |
+
</FieldContainer>
|
48 |
+
{
|
49 |
+
author && 'same' === author.actual
|
50 |
+
?
|
51 |
+
null // Don't display when set to "Same author for every recipe".
|
52 |
+
:
|
53 |
+
<FieldContainer id="author" label={ __wprm( 'Author' ) }>
|
54 |
+
<FieldDropdown
|
55 |
+
options={ wprm_admin_modal.options.author.filter( ( author ) => 'same' !== author.actual ) }
|
56 |
+
value={ props.author.display }
|
57 |
+
onChange={ (author_display) => {
|
58 |
+
props.onRecipeChange( { author_display } );
|
59 |
+
}}
|
60 |
+
width={ 300 }
|
61 |
+
/>
|
62 |
+
</FieldContainer>
|
63 |
+
}
|
64 |
+
{
|
65 |
+
author && 'custom' === author.actual
|
66 |
+
&&
|
67 |
+
<Fragment>
|
68 |
+
<FieldContainer id="author-name" label={ __wprm( 'Name' ) }>
|
69 |
+
<FieldText
|
70 |
+
placeholder={ __wprm( 'Author Name' ) }
|
71 |
+
value={ props.author.name }
|
72 |
+
onChange={ (author_name) => {
|
73 |
+
props.onRecipeChange( { author_name } );
|
74 |
+
}}
|
75 |
+
/>
|
76 |
+
</FieldContainer>
|
77 |
+
<FieldContainer id="author-link" label={ __wprm( 'Link' ) }>
|
78 |
+
<FieldText
|
79 |
+
placeholder="https://bootstrapped.ventures"
|
80 |
+
type="url"
|
81 |
+
value={ props.author.link }
|
82 |
+
onChange={ (author_link) => {
|
83 |
+
props.onRecipeChange( { author_link } );
|
84 |
+
}}
|
85 |
+
/>
|
86 |
+
</FieldContainer>
|
87 |
+
</Fragment>
|
88 |
+
}
|
89 |
+
<FieldContainer id="servings" label={ __wprm( 'Servings' ) }>
|
90 |
+
<FieldText
|
91 |
+
placeholder="4"
|
92 |
+
type="number"
|
93 |
+
value={ 0 != props.servings.amount ? props.servings.amount : '' }
|
94 |
+
onChange={ (servings) => {
|
95 |
+
props.onRecipeChange( { servings } );
|
96 |
+
}}
|
97 |
+
/>
|
98 |
+
<FieldText
|
99 |
+
placeholder={ __wprm( 'people' ) }
|
100 |
+
value={ props.servings.unit }
|
101 |
+
onChange={ (servings_unit) => {
|
102 |
+
props.onRecipeChange( { servings_unit } );
|
103 |
+
}}
|
104 |
+
/>
|
105 |
+
</FieldContainer>
|
106 |
+
</Fragment>
|
107 |
+
);
|
108 |
+
}
|
109 |
+
export default RecipeGeneral;
|
assets/js/admin-modal/recipe/edit/RecipeImport.js
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import React, { Fragment } from 'react';
|
2 |
+
|
3 |
+
import '../../../../css/admin/modal/recipe/fields/import.scss';
|
4 |
+
|
5 |
+
import { __wprm } from '../../../shared/Translations';
|
6 |
+
import FieldContainer from '../../fields/FieldContainer';
|
7 |
+
import FieldTextarea from '../../fields/FieldTextarea';
|
8 |
+
|
9 |
+
const RecipeImport = (props) => {
|
10 |
+
return (
|
11 |
+
<Fragment>
|
12 |
+
<FieldContainer label={ __wprm( 'Import from Text' ) }>
|
13 |
+
<FieldTextarea
|
14 |
+
placeholder={ __wprm( 'Paste or type recipe to start...' ) }
|
15 |
+
value={''}
|
16 |
+
onChange={ (value) => {
|
17 |
+
if ( value ) {
|
18 |
+
props.onModeChange( 'text-import', value );
|
19 |
+
}
|
20 |
+
}}
|
21 |
+
/>
|
22 |
+
</FieldContainer>
|
23 |
+
<FieldContainer label={ __wprm( 'Import from JSON' ) }>
|
24 |
+
<FieldTextarea
|
25 |
+
placeholder={ __wprm( 'Paste the recipe JSON data to import' ) }
|
26 |
+
value={''}
|
27 |
+
onChange={ (value) => {
|
28 |
+
if ( value ) {
|
29 |
+
try {
|
30 |
+
const importedRecipe = JSON.parse(value);
|
31 |
+
props.onRecipeChange( importedRecipe );
|
32 |
+
alert( __wprm( 'The recipe has been imported.' ) );
|
33 |
+
} catch (e) {
|
34 |
+
alert( __wprm( 'No valid recipe found.' ) );
|
35 |
+
}
|
36 |
+
}
|
37 |
+
}}
|
38 |
+
/>
|
39 |
+
</FieldContainer>
|
40 |
+
</Fragment>
|
41 |
+
);
|
42 |
+
}
|
43 |
+
export default RecipeImport;
|
assets/js/admin-modal/recipe/edit/RecipeIngredients/IngredientLinks/Api.js
ADDED
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
const ingredientLinksEndpoint = wprm_admin.endpoints.ingredient_links;
|
2 |
+
|
3 |
+
export default {
|
4 |
+
getGlobalLinks(ingredients) {
|
5 |
+
const data = {
|
6 |
+
ingredients,
|
7 |
+
};
|
8 |
+
|
9 |
+
return fetch(`${ingredientLinksEndpoint}`, {
|
10 |
+
method: 'POST',
|
11 |
+
headers: {
|
12 |
+
'X-WP-Nonce': wprm_admin.api_nonce,
|
13 |
+
'Accept': 'application/json',
|
14 |
+
'Content-Type': 'application/json',
|
15 |
+
},
|
16 |
+
credentials: 'same-origin',
|
17 |
+
body: JSON.stringify(data),
|
18 |
+
}).then(function (response) {
|
19 |
+
if ( response.ok ) {
|
20 |
+
return response.json();
|
21 |
+
} else {
|
22 |
+
console.log(response);
|
23 |
+
alert( 'Something went wrong. Please contact support.' );
|
24 |
+
return false;
|
25 |
+
}
|
26 |
+
});
|
27 |
+
},
|
28 |
+
saveGlobalLinks(links) {
|
29 |
+
const data = {
|
30 |
+
links,
|
31 |
+
};
|
32 |
+
|
33 |
+
return fetch(`${ingredientLinksEndpoint}`, {
|
34 |
+
method: 'PUT',
|
35 |
+
headers: {
|
36 |
+
'X-WP-Nonce': wprm_admin.api_nonce,
|
37 |
+
'Accept': 'application/json',
|
38 |
+
'Content-Type': 'application/json',
|
39 |
+
},
|
40 |
+
credentials: 'same-origin',
|
41 |
+
body: JSON.stringify(data),
|
42 |
+
}).then(function (response) {
|
43 |
+
if ( response.ok ) {
|
44 |
+
return response.json();
|
45 |
+
} else {
|
46 |
+
console.log(response);
|
47 |
+
alert( 'Something went wrong. Please contact support.' );
|
48 |
+
return false;
|
49 |
+
}
|
50 |
+
});
|
51 |
+
},
|
52 |
+
};
|
assets/js/admin-modal/recipe/edit/RecipeIngredients/IngredientLinks/IngredientLink.js
ADDED
@@ -0,0 +1,100 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import React, { Fragment } from 'react';
|
2 |
+
|
3 |
+
import striptags from 'striptags';
|
4 |
+
|
5 |
+
import Loader from '../../../../../shared/Loader';
|
6 |
+
import { __wprm } from '../../../../../shared/Translations';
|
7 |
+
import FieldDropdown from '../../../../fields/FieldDropdown';
|
8 |
+
import FieldText from '../../../../fields/FieldText';
|
9 |
+
|
10 |
+
const IngredientLink = (props) => {
|
11 |
+
const { ingredient } = props;
|
12 |
+
|
13 |
+
let link = {
|
14 |
+
url: '',
|
15 |
+
nofollow: 'default',
|
16 |
+
};
|
17 |
+
let nofollowLabel = '';
|
18 |
+
|
19 |
+
if ( 'global' === props.type || 'edit-global' === props.type ) {
|
20 |
+
if ( ingredient.hasOwnProperty('globalLink') && false !== ingredient.globalLink ) {
|
21 |
+
link = ingredient.globalLink;
|
22 |
+
|
23 |
+
const nofollowOption = wprm_admin_modal.options.ingredient_link_nofollow.find((option) => option.value === link.nofollow );
|
24 |
+
if ( nofollowOption ) {
|
25 |
+
nofollowLabel = nofollowOption.label;
|
26 |
+
}
|
27 |
+
}
|
28 |
+
} else {
|
29 |
+
if ( ingredient.hasOwnProperty('link') ) {
|
30 |
+
link = ingredient.link;
|
31 |
+
}
|
32 |
+
}
|
33 |
+
|
34 |
+
const hasLink = link && link.url;
|
35 |
+
|
36 |
+
return (
|
37 |
+
<div className="wprm-admin-modal-field-ingredient-links-link-container">
|
38 |
+
<div className="wprm-admin-modal-field-ingredient-links-link-ingredient">
|
39 |
+
{ striptags( ingredient.name ) }
|
40 |
+
{
|
41 |
+
'edit-global' === props.type
|
42 |
+
&& props.hasChanged
|
43 |
+
&&
|
44 |
+
<div className="wprm-admin-modal-field-ingredient-links-link-ingredient-count">
|
45 |
+
{
|
46 |
+
0 < link.count - 1
|
47 |
+
?
|
48 |
+
`${link.count - 1} ${ __wprm( 'other recipe(s) affected' ) }`
|
49 |
+
:
|
50 |
+
__wprm( 'This can affect other recipes' )
|
51 |
+
}
|
52 |
+
</div>
|
53 |
+
}
|
54 |
+
</div>
|
55 |
+
{
|
56 |
+
'global' === props.type
|
57 |
+
?
|
58 |
+
<Fragment>
|
59 |
+
{
|
60 |
+
props.isUpdating
|
61 |
+
?
|
62 |
+
<Loader />
|
63 |
+
:
|
64 |
+
<Fragment>
|
65 |
+
<div
|
66 |
+
className={ `wprm-admin-modal-field-ingredient-links-link-url${ hasLink ? '' : ' wprm-admin-modal-field-ingredient-links-link-url-none'}` }
|
67 |
+
>{ hasLink ? link.url : __wprm( 'No link set' ) }</div>
|
68 |
+
<div className="wprm-admin-modal-field-ingredient-links-link-nofollow">{ hasLink ? nofollowLabel : '' }</div>
|
69 |
+
</Fragment>
|
70 |
+
}
|
71 |
+
</Fragment>
|
72 |
+
:
|
73 |
+
<Fragment>
|
74 |
+
<FieldText
|
75 |
+
type="url"
|
76 |
+
value={ link.url }
|
77 |
+
onChange={ (url) => {
|
78 |
+
props.onLinkChange( {
|
79 |
+
...link,
|
80 |
+
url,
|
81 |
+
} );
|
82 |
+
}}
|
83 |
+
/>
|
84 |
+
<FieldDropdown
|
85 |
+
options={ wprm_admin_modal.options.ingredient_link_nofollow }
|
86 |
+
value={ link.nofollow }
|
87 |
+
onChange={ (nofollow) => {
|
88 |
+
props.onLinkChange( {
|
89 |
+
...link,
|
90 |
+
nofollow,
|
91 |
+
} );
|
92 |
+
}}
|
93 |
+
width={ 200 }
|
94 |
+
/>
|
95 |
+
</Fragment>
|
96 |
+
}
|
97 |
+
</div>
|
98 |
+
);
|
99 |
+
}
|
100 |
+
export default IngredientLink;
|
assets/js/admin-modal/recipe/edit/RecipeIngredients/IngredientLinks/index.js
ADDED
@@ -0,0 +1,140 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import React, { Component } from 'react';
|
2 |
+
|
3 |
+
import '../../../../../../css/admin/modal/recipe/ingredient-links.scss';
|
4 |
+
|
5 |
+
import FieldContainer from '../../../../fields/FieldContainer';
|
6 |
+
import FieldRadio from '../../../../fields/FieldRadio';
|
7 |
+
import { __wprm } from '../../../../../shared/Translations';
|
8 |
+
|
9 |
+
import Api from './Api';
|
10 |
+
import IngredientLink from './IngredientLink';
|
11 |
+
|
12 |
+
export default class IngredientLinks extends Component {
|
13 |
+
constructor(props) {
|
14 |
+
super(props);
|
15 |
+
|
16 |
+
this.state = {
|
17 |
+
isUpdating: false,
|
18 |
+
}
|
19 |
+
}
|
20 |
+
|
21 |
+
componentDidMount() {
|
22 |
+
this.updateGlobalLinks()
|
23 |
+
}
|
24 |
+
|
25 |
+
updateGlobalLinks() {
|
26 |
+
let getGlobalLinksFor = {};
|
27 |
+
|
28 |
+
for ( let i = 0; i < this.props.ingredients.length; i++ ) {
|
29 |
+
const ingredient = this.props.ingredients[ i ];
|
30 |
+
|
31 |
+
if ( 'ingredient' === ingredient.type && ingredient.name && ( ! ingredient.hasOwnProperty( 'globalLink' ) || false === ingredient.globalLink ) ) {
|
32 |
+
getGlobalLinksFor[ i ] = {
|
33 |
+
name: ingredient.name,
|
34 |
+
}
|
35 |
+
}
|
36 |
+
}
|
37 |
+
|
38 |
+
if ( 0 < Object.keys( getGlobalLinksFor ).length ) {
|
39 |
+
const updatingIndexes = Object.keys( getGlobalLinksFor ).map( (index) => parseInt( index ) );
|
40 |
+
|
41 |
+
this.setState({
|
42 |
+
isUpdating: updatingIndexes,
|
43 |
+
}, () => {
|
44 |
+
Api.getGlobalLinks( getGlobalLinksFor ).then((data) => {
|
45 |
+
if ( data && data.links ) {
|
46 |
+
let newIngredients = JSON.parse( JSON.stringify( this.props.ingredients ) );
|
47 |
+
|
48 |
+
for ( let index in data.links ) {
|
49 |
+
newIngredients[ parseInt( index ) ].globalLink = data.links[ index ];
|
50 |
+
}
|
51 |
+
|
52 |
+
// Update ingredient and state.
|
53 |
+
this.props.onIngredientsChange(newIngredients);
|
54 |
+
}
|
55 |
+
|
56 |
+
this.setState({
|
57 |
+
isUpdating: false,
|
58 |
+
});
|
59 |
+
});
|
60 |
+
});
|
61 |
+
}
|
62 |
+
}
|
63 |
+
|
64 |
+
render() {
|
65 |
+
if ( ! wprm_admin.addons.premium ) {
|
66 |
+
return (
|
67 |
+
<p>{ __wprm( 'This feature is only available in' ) } <a href="https://bootstrapped.ventures/wp-recipe-maker/get-the-plugin/" target="_blank">WP Recipe Maker Premium</a>.</p>
|
68 |
+
);
|
69 |
+
}
|
70 |
+
|
71 |
+
const ingredients = this.props.ingredients.filter((field) => 'ingredient' === field.type && field.name );
|
72 |
+
if ( ! ingredients.length ) {
|
73 |
+
return (
|
74 |
+
<p>{ __wprm( 'No ingredients set for this recipe.' ) }</p>
|
75 |
+
);
|
76 |
+
}
|
77 |
+
|
78 |
+
return (
|
79 |
+
<div className="wprm-admin-modal-field-ingredient-links-container">
|
80 |
+
<FieldContainer
|
81 |
+
id="link-type"
|
82 |
+
label={ __wprm( 'Ingredient Link Type' ) }
|
83 |
+
help={
|
84 |
+
'global' === this.props.type
|
85 |
+
?
|
86 |
+
__wprm( 'Global: the same link will be used for every recipe with this ingredient' )
|
87 |
+
:
|
88 |
+
__wprm( 'Custom: these links will only affect the recipe below' )
|
89 |
+
}
|
90 |
+
>
|
91 |
+
<FieldRadio
|
92 |
+
id="link-type"
|
93 |
+
options={[
|
94 |
+
{ value: 'global', label: __wprm( 'Use Global Links' ) },
|
95 |
+
{ value: 'custom', label: __wprm( 'Custom Links for this Recipe only' ) },
|
96 |
+
]}
|
97 |
+
value={ this.props.type }
|
98 |
+
onChange={this.props.onTypeChange}
|
99 |
+
/>
|
100 |
+
</FieldContainer>
|
101 |
+
<div className="wprm-admin-modal-field-ingredient-links">
|
102 |
+
{
|
103 |
+
this.props.ingredients.map((field, index) => {
|
104 |
+
if ( 'group' === field.type || ! field.name ) {
|
105 |
+
return null;
|
106 |
+
}
|
107 |
+
|
108 |
+
return (
|
109 |
+
<IngredientLink
|
110 |
+
ingredient={ field }
|
111 |
+
onLinkChange={(link) => {
|
112 |
+
// Only custom links can be changed here.
|
113 |
+
let newIngredients = JSON.parse( JSON.stringify( this.props.ingredients ) );
|
114 |
+
newIngredients[ index ].link = link;
|
115 |
+
|
116 |
+
this.props.onIngredientsChange(newIngredients);
|
117 |
+
}}
|
118 |
+
type={ this.props.type }
|
119 |
+
isUpdating={ this.state.isUpdating && this.state.isUpdating.includes( index ) }
|
120 |
+
key={ index }
|
121 |
+
/>
|
122 |
+
)
|
123 |
+
})
|
124 |
+
}
|
125 |
+
</div>
|
126 |
+
{
|
127 |
+
'global' === this.props.type
|
128 |
+
&&
|
129 |
+
<button
|
130 |
+
className="button button-primary"
|
131 |
+
onClick={() => {
|
132 |
+
this.props.onModeChange('ingredient-links');
|
133 |
+
}}
|
134 |
+
disabled={ false !== this.state.isUpdating }
|
135 |
+
>{ __wprm( 'Edit Global Links' ) }</button>
|
136 |
+
}
|
137 |
+
</div>
|
138 |
+
);
|
139 |
+
}
|
140 |
+
}
|
assets/js/admin-modal/recipe/edit/RecipeIngredients/IngredientsEdit.js
ADDED
@@ -0,0 +1,161 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import React, { Component } from 'react';
|
2 |
+
import { DragDropContext, Droppable } from 'react-beautiful-dnd';
|
3 |
+
|
4 |
+
import { __wprm } from '../../../../shared/Translations';
|
5 |
+
import FieldIngredient from '../../../fields/FieldIngredient';
|
6 |
+
|
7 |
+
export default class IngredientsEdit extends Component {
|
8 |
+
constructor(props) {
|
9 |
+
super(props);
|
10 |
+
|
11 |
+
this.container = React.createRef();
|
12 |
+
}
|
13 |
+
|
14 |
+
componentDidUpdate( prevProps ) {
|
15 |
+
if ( this.props.ingredients.length > prevProps.ingredients.length ) {
|
16 |
+
const inputs = this.container.current.querySelectorAll('.wprm-admin-modal-field-ingredient-group-name, .wprm-admin-modal-field-ingredient-amount');
|
17 |
+
|
18 |
+
if ( inputs.length ) {
|
19 |
+
inputs[ inputs.length - 1 ].focus();
|
20 |
+
}
|
21 |
+
}
|
22 |
+
}
|
23 |
+
|
24 |
+
onDragEnd(result) {
|
25 |
+
if ( result.destination ) {
|
26 |
+
let newFields = JSON.parse( JSON.stringify( this.props.ingredients ) );
|
27 |
+
const sourceIndex = result.source.index;
|
28 |
+
const destinationIndex = result.destination.index;
|
29 |
+
|
30 |
+
const field = newFields.splice(sourceIndex, 1)[0];
|
31 |
+
newFields.splice(destinationIndex, 0, field);
|
32 |
+
|
33 |
+
this.props.onRecipeChange({
|
34 |
+
ingredients_flat: newFields,
|
35 |
+
});
|
36 |
+
}
|
37 |
+
}
|
38 |
+
|
39 |
+
addField(type) {
|
40 |
+
let newFields = JSON.parse( JSON.stringify( this.props.ingredients ) );
|
41 |
+
let newField;
|
42 |
+
|
43 |
+
if ( 'group' === type ) {
|
44 |
+
newField = {
|
45 |
+
type: 'group',
|
46 |
+
name: '',
|
47 |
+
};
|
48 |
+
} else {
|
49 |
+
newField = {
|
50 |
+
type: 'ingredient',
|
51 |
+
amount: '',
|
52 |
+
unit: '',
|
53 |
+
name: '',
|
54 |
+
notes: '',
|
55 |
+
}
|
56 |
+
}
|
57 |
+
|
58 |
+
// Give unique UID.
|
59 |
+
let maxUid = Math.max.apply( Math, newFields.map( function(field) { return field.uid; } ) );
|
60 |
+
maxUid = maxUid < 0 ? -1 : maxUid;
|
61 |
+
newField.uid = maxUid + 1;
|
62 |
+
|
63 |
+
newFields.push(newField);
|
64 |
+
|
65 |
+
this.props.onRecipeChange({
|
66 |
+
ingredients_flat: newFields,
|
67 |
+
});
|
68 |
+
}
|
69 |
+
|
70 |
+
render() {
|
71 |
+
return (
|
72 |
+
<div
|
73 |
+
className="wprm-admin-modal-field-ingredient-edit-container"
|
74 |
+
ref={ this.container }
|
75 |
+
>
|
76 |
+
<DragDropContext
|
77 |
+
onDragEnd={ this.onDragEnd.bind(this) }
|
78 |
+
>
|
79 |
+
<Droppable
|
80 |
+
droppableId="wprm-ingredients"
|
81 |
+
>
|
82 |
+
{(provided, snapshot) => (
|
83 |
+
<div
|
84 |
+
className={`${ snapshot.isDraggingOver ? ' wprm-admin-modal-field-ingredient-container-draggingover' : ''}`}
|
85 |
+
ref={provided.innerRef}
|
86 |
+
{...provided.droppableProps}
|
87 |
+
>
|
88 |
+
<div className="wprm-admin-modal-field-ingredient-header-container">
|
89 |
+
<div className="wprm-admin-modal-field-ingredient-header">{ __wprm( 'Amount' ) }</div>
|
90 |
+
<div className="wprm-admin-modal-field-ingredient-header">{ __wprm( 'Unit' ) }</div>
|
91 |
+
<div className="wprm-admin-modal-field-ingredient-header">{ __wprm( 'Name' ) } <span className="wprm-admin-modal-field-ingredient-header-required">({ __wprm( 'required' ) })</span></div>
|
92 |
+
<div className="wprm-admin-modal-field-ingredient-header">{ __wprm( 'Notes' ) }</div>
|
93 |
+
</div>
|
94 |
+
{
|
95 |
+
this.props.ingredients.map((field, index) => (
|
96 |
+
<FieldIngredient
|
97 |
+
{ ...field }
|
98 |
+
index={ index }
|
99 |
+
key={ index }
|
100 |
+
onTab={() => {
|
101 |
+
// Create new ingredient if we're tabbing in the last one.
|
102 |
+
if ( index === this.props.ingredients.length - 1) {
|
103 |
+
// Use timeout to fix focus problem (because of preventDefault?).
|
104 |
+
setTimeout(() => {
|
105 |
+
this.addField( 'ingredient' );
|
106 |
+
});
|
107 |
+
}
|
108 |
+
}}
|
109 |
+
onChangeName={ ( name ) => {
|
110 |
+
let newFields = JSON.parse( JSON.stringify( this.props.ingredients ) );
|
111 |
+
newFields[index].name = name;
|
112 |
+
|
113 |
+
this.props.onRecipeChange({
|
114 |
+
ingredients_flat: newFields,
|
115 |
+
});
|
116 |
+
}}
|
117 |
+
onChangeIngredient={ ( ingredient ) => {
|
118 |
+
let newFields = JSON.parse( JSON.stringify( this.props.ingredients ) );
|
119 |
+
|
120 |
+
newFields[index] = {
|
121 |
+
...newFields[index],
|
122 |
+
...ingredient,
|
123 |
+
}
|
124 |
+
|
125 |
+
this.props.onRecipeChange({
|
126 |
+
ingredients_flat: newFields,
|
127 |
+
});
|
128 |
+
}}
|
129 |
+
onDelete={() => {
|
130 |
+
let newFields = JSON.parse( JSON.stringify( this.props.ingredients ) );
|
131 |
+
newFields.splice(index, 1);
|
132 |
+
|
133 |
+
this.props.onRecipeChange({
|
134 |
+
ingredients_flat: newFields,
|
135 |
+
});
|
136 |
+
}}
|
137 |
+
/>
|
138 |
+
))
|
139 |
+
}
|
140 |
+
{provided.placeholder}
|
141 |
+
</div>
|
142 |
+
)}
|
143 |
+
</Droppable>
|
144 |
+
</DragDropContext>
|
145 |
+
<div
|
146 |
+
className="wprm-admin-modal-field-ingredient-actions"
|
147 |
+
>
|
148 |
+
<button
|
149 |
+
className="button"
|
150 |
+
onClick={() => { this.addField( 'ingredient' ) } }
|
151 |
+
>{ __wprm( 'Add Ingredient' ) }</button>
|
152 |
+
<button
|
153 |
+
className="button"
|
154 |
+
onClick={() => { this.addField( 'group' ) } }
|
155 |
+
>{ __wprm( 'Add Ingredient Group' ) }</button>
|
156 |
+
<p>{ __wprm( 'Tip: use the TAB key to move from field to field and easily add ingredients.' ) }</p>
|
157 |
+
</div>
|
158 |
+
</div>
|
159 |
+
);
|
160 |
+
}
|
161 |
+
}
|
assets/js/admin-modal/recipe/edit/RecipeIngredients/IngredientsPreview.js
ADDED
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import React from 'react';
|
2 |
+
|
3 |
+
const IngredientsPreview = (props) => {
|
4 |
+
const { ingredients } = props;
|
5 |
+
|
6 |
+
return (
|
7 |
+
<div className="wprm-admin-modal-field-ingredient-preview">
|
8 |
+
{
|
9 |
+
ingredients.map((field, index) => {
|
10 |
+
if ( 'group' === field.type ) {
|
11 |
+
if ( field.name ) {
|
12 |
+
return (
|
13 |
+
<h3 key={index}>{ field.name }</h3>
|
14 |
+
);
|
15 |
+
}
|
16 |
+
} else {
|
17 |
+
if ( field.amount || field.unit || field.name || field.notes ) {
|
18 |
+
let ingredient = '';
|
19 |
+
|
20 |
+
if ( field.amount ) {
|
21 |
+
ingredient += `<span className="wprm-admin-modal-field-ingredient-preview-ingredient-amount">${ field.amount }</span>`;
|
22 |
+
}
|
23 |
+
if ( field.unit ) {
|
24 |
+
ingredient += `<span className="wprm-admin-modal-field-ingredient-preview-ingredient-unit">${ field.unit }</span>`;
|
25 |
+
}
|
26 |
+
if ( field.name ) {
|
27 |
+
ingredient += `<span className="wprm-admin-modal-field-ingredient-preview-ingredient-name">${ field.name }</span>`;
|
28 |
+
}
|
29 |
+
if ( field.notes ) {
|
30 |
+
ingredient += `<span className="wprm-admin-modal-field-ingredient-preview-ingredient-notes">${ field.notes }</span>`;
|
31 |
+
}
|
32 |
+
|
33 |
+
if ( ingredient ) {
|
34 |
+
return (
|
35 |
+
<div
|
36 |
+
className="wprm-admin-modal-field-ingredient-preview-ingredient"
|
37 |
+
dangerouslySetInnerHTML={ { __html: ingredient } }
|
38 |
+
key={index}/
|
39 |
+
>
|
40 |
+
);
|
41 |
+
}
|
42 |
+
}
|
43 |
+
}
|
44 |
+
|
45 |
+
return null;
|
46 |
+
})
|
47 |
+
}
|
48 |
+
</div>
|
49 |
+
);
|
50 |
+
}
|
51 |
+
export default IngredientsPreview;
|
assets/js/admin-modal/recipe/edit/RecipeIngredients/UnitConversion/Api.js
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
const conversionEndpoint = wprm_admin.endpoints.unit_conversion;
|
2 |
+
|
3 |
+
export default {
|
4 |
+
getConversions(ingredients) {
|
5 |
+
const data = {
|
6 |
+
ingredients,
|
7 |
+
};
|
8 |
+
|
9 |
+
return fetch(`${conversionEndpoint}`, {
|
10 |
+
method: 'POST',
|
11 |
+
headers: {
|
12 |
+
'X-WP-Nonce': wprm_admin.api_nonce,
|
13 |
+
'Accept': 'application/json',
|
14 |
+
'Content-Type': 'application/json',
|
15 |
+
},
|
16 |
+
credentials: 'same-origin',
|
17 |
+
body: JSON.stringify(data),
|
18 |
+
}).then(function (response) {
|
19 |
+
if ( response.ok ) {
|
20 |
+
return response.json();
|
21 |
+
} else {
|
22 |
+
console.log(response);
|
23 |
+
alert( 'Something went wrong. Please contact support.' );
|
24 |
+
return false;
|
25 |
+
}
|
26 |
+
});
|
27 |
+
},
|
28 |
+
};
|
assets/js/admin-modal/recipe/edit/RecipeIngredients/UnitConversion/UnitConversionIngredient.js
ADDED
@@ -0,0 +1,120 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import React from 'react';
|
2 |
+
|
3 |
+
import striptags from 'striptags';
|
4 |
+
|
5 |
+
import { __wprm } from '../../../../../shared/Translations';
|
6 |
+
import Loader from '../../../../../shared/Loader';
|
7 |
+
import FieldDropdown from '../../../../fields/FieldDropdown';
|
8 |
+
import FieldRichText from '../../../../fields/FieldRichText';
|
9 |
+
|
10 |
+
const unitConversionOptions = () => {
|
11 |
+
let options = [
|
12 |
+
{
|
13 |
+
label: __wprm( 'Convert' ),
|
14 |
+
options: [
|
15 |
+
{
|
16 |
+
value: 'none',
|
17 |
+
label: __wprm( 'Keep Unit' ),
|
18 |
+
},
|
19 |
+
{
|
20 |
+
value: 'automatic',
|
21 |
+
label: __wprm( 'Automatically' ),
|
22 |
+
}
|
23 |
+
],
|
24 |
+
}
|
25 |
+
];
|
26 |
+
|
27 |
+
let weightOptions = [];
|
28 |
+
wprm_admin_modal.unit_conversion.units.weight.map( (unit) => {
|
29 |
+
weightOptions.push({
|
30 |
+
value: unit,
|
31 |
+
label: wprm_admin_modal.unit_conversion.units.data[ unit ].label,
|
32 |
+
})
|
33 |
+
});
|
34 |
+
|
35 |
+
if ( 0 < weightOptions.length ) {
|
36 |
+
options.push({
|
37 |
+
label: __wprm( 'Weight Units' ),
|
38 |
+
options: weightOptions,
|
39 |
+
})
|
40 |
+
}
|
41 |
+
|
42 |
+
let volumeOptions = [];
|
43 |
+
wprm_admin_modal.unit_conversion.units.volume.map( (unit) => {
|
44 |
+
volumeOptions.push({
|
45 |
+
value: unit,
|
46 |
+
label: wprm_admin_modal.unit_conversion.units.data[ unit ].label,
|
47 |
+
})
|
48 |
+
});
|
49 |
+
|
50 |
+
if ( 0 < volumeOptions.length ) {
|
51 |
+
options.push({
|
52 |
+
label: __wprm( 'Volume Units' ),
|
53 |
+
options: volumeOptions,
|
54 |
+
})
|
55 |
+
}
|
56 |
+
|
57 |
+
return options;
|
58 |
+
}
|
59 |
+
|
60 |
+
const UnitConversionIngredient = (props) => {
|
61 |
+
const { ingredient, isConverting, method } = props;
|
62 |
+
const converted = ingredient.converted ? ingredient.converted : { 2: { amount: '', unit: '' } };
|
63 |
+
const methodOptions = unitConversionOptions();
|
64 |
+
|
65 |
+
let originalIngredient = `${ingredient.amount} ${ingredient.unit}`.trim();
|
66 |
+
originalIngredient = `${originalIngredient} ${ingredient.name}`.trim();
|
67 |
+
|
68 |
+
if ( ingredient.notes ) {
|
69 |
+
originalIngredient += ` (${ingredient.notes})`;
|
70 |
+
}
|
71 |
+
|
72 |
+
return (
|
73 |
+
<tr>
|
74 |
+
<td>
|
75 |
+
<FieldDropdown
|
76 |
+
isDisabled={ isConverting }
|
77 |
+
options={ methodOptions }
|
78 |
+
placeholder={ __wprm( 'Convert...' ) }
|
79 |
+
value={ method }
|
80 |
+
onChange={ (method) => {
|
81 |
+
props.onMethodChange( method );
|
82 |
+
}}
|
83 |
+
width={ 150 }
|
84 |
+
/>
|
85 |
+
</td>
|
86 |
+
<td
|
87 |
+
style={ 'failed' === method ? { color: 'darkred' } : null }
|
88 |
+
>
|
89 |
+
{
|
90 |
+
isConverting
|
91 |
+
?
|
92 |
+
<Loader />
|
93 |
+
:
|
94 |
+
<div className="wprm-admin-modal-field-ingredient-unit-conversion-fields">
|
95 |
+
<FieldRichText
|
96 |
+
singleLine
|
97 |
+
value={ converted[2].amount }
|
98 |
+
onChange={(amount) => {
|
99 |
+
let newConverted = converted;
|
100 |
+
newConverted[2].amount = amount;
|
101 |
+
props.onConvertedChange(newConverted);
|
102 |
+
}}
|
103 |
+
/>
|
104 |
+
<FieldRichText
|
105 |
+
singleLine
|
106 |
+
value={ converted[2].unit }
|
107 |
+
onChange={(unit) => {
|
108 |
+
let newConverted = converted;
|
109 |
+
newConverted[2].unit = unit;
|
110 |
+
props.onConvertedChange(newConverted);
|
111 |
+
}}
|
112 |
+
/>
|
113 |
+
</div>
|
114 |
+
}
|
115 |
+
</td>
|
116 |
+
<td>{ striptags( originalIngredient ) }</td>
|
117 |
+
</tr>
|
118 |
+
);
|
119 |
+
}
|
120 |
+
export default UnitConversionIngredient;
|
assets/js/admin-modal/recipe/edit/RecipeIngredients/UnitConversion/index.js
ADDED
@@ -0,0 +1,198 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import React, { Component } from 'react';
|
2 |
+
|
3 |
+
import '../../../../../../css/admin/modal/recipe/unit-conversion.scss';
|
4 |
+
|
5 |
+
import Api from './Api';
|
6 |
+
import { __wprm } from '../../../../../shared/Translations';
|
7 |
+
import { parseQuantity, formatQuantity } from '../../../../../../../../wp-recipe-maker-premium/assets/js/shared/quantities';
|
8 |
+
|
9 |
+
import UnitConversionIngredient from './UnitConversionIngredient';
|
10 |
+
|
11 |
+
export default class UnitConversion extends Component {
|
12 |
+
constructor(props) {
|
13 |
+
super(props);
|
14 |
+
|
15 |
+
this.state = {
|
16 |
+
isConverting: {},
|
17 |
+
methods: {},
|
18 |
+
}
|
19 |
+
|
20 |
+
this.convert = this.convert.bind(this);
|
21 |
+
this.convertAll = this.convertAll.bind(this);
|
22 |
+
}
|
23 |
+
|
24 |
+
convertAll( method ) {
|
25 |
+
let indexesToConvert = [];
|
26 |
+
|
27 |
+
for ( let i = 0; i < this.props.ingredients.length; i++ ) {
|
28 |
+
const ingredient = this.props.ingredients[ i ];
|
29 |
+
|
30 |
+
if ( 'ingredient' === ingredient.type ) {
|
31 |
+
indexesToConvert.push( i );
|
32 |
+
}
|
33 |
+
}
|
34 |
+
|
35 |
+
if ( indexesToConvert ) {
|
36 |
+
this.convert( indexesToConvert, method );
|
37 |
+
}
|
38 |
+
}
|
39 |
+
|
40 |
+
convert( indexes, method ) {
|
41 |
+
let isConverting = this.state.isConverting;
|
42 |
+
let methods = this.state.methods;
|
43 |
+
|
44 |
+
if ( 'none' === method ) {
|
45 |
+
let newIngredients = JSON.parse( JSON.stringify( this.props.ingredients ) );
|
46 |
+
|
47 |
+
for ( let index of indexes ) {
|
48 |
+
const ingredient = this.props.ingredients[ index ];
|
49 |
+
|
50 |
+
if ( ! ingredient.hasOwnProperty('converted') ) {
|
51 |
+
newIngredients[ index ].converted = { 2: {} };
|
52 |
+
}
|
53 |
+
|
54 |
+
newIngredients[ index ].converted[2].amount = ingredient.amount;
|
55 |
+
newIngredients[ index ].converted[2].unit = ingredient.unit;
|
56 |
+
|
57 |
+
isConverting[ index ] = false;
|
58 |
+
methods[ index ] = method;
|
59 |
+
}
|
60 |
+
|
61 |
+
this.props.onIngredientsChange(newIngredients);
|
62 |
+
} else {
|
63 |
+
let ingredientsToConvert = {};
|
64 |
+
|
65 |
+
for ( let index of indexes ) {
|
66 |
+
const ingredient = this.props.ingredients[ index ];
|
67 |
+
|
68 |
+
ingredientsToConvert[ index ] = {
|
69 |
+
index,
|
70 |
+
amount: parseQuantity( ingredient.amount ),
|
71 |
+
unit: ingredient.unit,
|
72 |
+
name: ingredient.name,
|
73 |
+
};
|
74 |
+
|
75 |
+
// Force conversion to specific unit.
|
76 |
+
if ( 'automatic' !== method ) {
|
77 |
+
ingredientsToConvert[ index ].units_to = [ method ];
|
78 |
+
}
|
79 |
+
|
80 |
+
isConverting[ index ] = true;
|
81 |
+
methods[ index ] = method;
|
82 |
+
}
|
83 |
+
|
84 |
+
Api.getConversions( ingredientsToConvert ).then((data) => {
|
85 |
+
if ( data && data.conversions ) {
|
86 |
+
let newIngredients = JSON.parse( JSON.stringify( this.props.ingredients ) );
|
87 |
+
let isConverting = this.state.isConverting;
|
88 |
+
let methods = this.state.methods;
|
89 |
+
|
90 |
+
for ( let index in data.conversions ) {
|
91 |
+
const ingredient = this.props.ingredients[ parseInt( index ) ];
|
92 |
+
const conversion = data.conversions[ index ];
|
93 |
+
|
94 |
+
if ( ! ingredient.hasOwnProperty('converted') ) {
|
95 |
+
newIngredients[ index ].converted = { 2: {} };
|
96 |
+
}
|
97 |
+
|
98 |
+
if ( 'none' === conversion.type || 'failed' === conversion.type ) {
|
99 |
+
newIngredients[ index ].converted[2].amount = ingredient.amount;
|
100 |
+
newIngredients[ index ].converted[2].unit = ingredient.unit;
|
101 |
+
methods[ index ] = conversion.type;
|
102 |
+
} else {
|
103 |
+
newIngredients[ index ].converted[2].amount = formatQuantity( conversion.amount, wprmp_admin.settings.unit_conversion_round_to_decimals );
|
104 |
+
newIngredients[ index ].converted[2].unit = conversion.alias;
|
105 |
+
methods[ index ] = method;
|
106 |
+
}
|
107 |
+
|
108 |
+
isConverting[ index ] = false;
|
109 |
+
}
|
110 |
+
|
111 |
+
// Update ingredient and state.
|
112 |
+
this.props.onIngredientsChange(newIngredients);
|
113 |
+
this.setState({
|
114 |
+
isConverting,
|
115 |
+
methods,
|
116 |
+
});
|
117 |
+
}
|
118 |
+
});
|
119 |
+
}
|
120 |
+
|
121 |
+
this.setState({
|
122 |
+
isConverting,
|
123 |
+
methods,
|
124 |
+
});
|
125 |
+
}
|
126 |
+
|
127 |
+
render() {
|
128 |
+
if ( ! wprm_admin.addons.pro ) {
|
129 |
+
return (
|
130 |
+
<p>{ __wprm( 'This feature is only available in' ) } <a href="https://bootstrapped.ventures/wp-recipe-maker/get-the-plugin/" target="_blank">WP Recipe Maker Pro Bundle</a>.</p>
|
131 |
+
);
|
132 |
+
}
|
133 |
+
|
134 |
+
if ( ! wprm_admin_modal.unit_conversion ) {
|
135 |
+
return (
|
136 |
+
<p>{ __wprm( 'You need to set up this feature on the WP Recipe Maker > Settings > Unit Conversion page first.' ) }</p>
|
137 |
+
);
|
138 |
+
}
|
139 |
+
|
140 |
+
const ingredients = this.props.ingredients.filter((field) => 'ingredient' === field.type && field.name );
|
141 |
+
if ( ! ingredients.length ) {
|
142 |
+
return (
|
143 |
+
<p>{ __wprm( 'No ingredients set for this recipe.' ) }</p>
|
144 |
+
);
|
145 |
+
}
|
146 |
+
|
147 |
+
return (
|
148 |
+
<div
|
149 |
+
className="wprm-admin-modal-field-ingredient-unit-conversion-container"
|
150 |
+
>
|
151 |
+
<table
|
152 |
+
className="wprm-admin-modal-field-ingredient-unit-conversion"
|
153 |
+
>
|
154 |
+
<thead>
|
155 |
+
<tr>
|
156 |
+
<th>{ __wprm( 'Conversion' ) }</th>
|
157 |
+
<th>{ __wprm( 'Converted' ) } ({ wprm_admin_modal.unit_conversion.systems[2] })</th>
|
158 |
+
<th>{ __wprm( 'Default' ) } ({ wprm_admin_modal.unit_conversion.systems[1] })</th>
|
159 |
+
</tr>
|
160 |
+
</thead>
|
161 |
+
<tbody>
|
162 |
+
{
|
163 |
+
this.props.ingredients.map((field, index) => {
|
164 |
+
if ( 'group' === field.type || ! field.name ) {
|
165 |
+
return null;
|
166 |
+
}
|
167 |
+
|
168 |
+
return (
|
169 |
+
<UnitConversionIngredient
|
170 |
+
ingredient={ field }
|
171 |
+
isConverting={ this.state.isConverting[ index ] }
|
172 |
+
method={ this.state.methods[ index ] }
|
173 |
+
onMethodChange={(method) => {
|
174 |
+
if ( ! this.state.isConverting[ index ] ) {
|
175 |
+
this.convert( [ index ], method );
|
176 |
+
}
|
177 |
+
}}
|
178 |
+
onConvertedChange={(converted) => {
|
179 |
+
let newIngredients = JSON.parse( JSON.stringify( this.props.ingredients ) );
|
180 |
+
newIngredients[ index ].converted = converted;
|
181 |
+
|
182 |
+
this.props.onIngredientsChange(newIngredients);
|
183 |
+
}}
|
184 |
+
key={ index }
|
185 |
+
/>
|
186 |
+
)
|
187 |
+
})
|
188 |
+
}
|
189 |
+
</tbody>
|
190 |
+
</table>
|
191 |
+
<button
|
192 |
+
className="button button-primary"
|
193 |
+
onClick={() => { this.convertAll( 'automatic' ) } }
|
194 |
+
>{ __wprm( 'Convert All Automatically' ) }</button>
|
195 |
+
</div>
|
196 |
+
);
|
197 |
+
}
|
198 |
+
}
|
assets/js/admin-modal/recipe/edit/RecipeIngredients/index.js
ADDED
@@ -0,0 +1,109 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import React, { Component } from 'react';
|
2 |
+
|
3 |
+
import '../../../../../css/admin/modal/recipe/fields/ingredients.scss';
|
4 |
+
|
5 |
+
import EditMode from '../../../general/EditMode';
|
6 |
+
import { __wprm } from '../../../../shared/Translations';
|
7 |
+
|
8 |
+
import IngredientsEdit from './IngredientsEdit';
|
9 |
+
import IngredientsPreview from './IngredientsPreview';
|
10 |
+
|
11 |
+
import IngredientLinks from './IngredientLinks';
|
12 |
+
import UnitConversion from './UnitConversion';
|
13 |
+
|
14 |
+
export default class RecipeIngredients extends Component {
|
15 |
+
constructor(props) {
|
16 |
+
super(props);
|
17 |
+
|
18 |
+
this.state = {
|
19 |
+
mode: 'edit',
|
20 |
+
}
|
21 |
+
}
|
22 |
+
|
23 |
+
shouldComponentUpdate(nextProps, nextState) {
|
24 |
+
return this.state.mode !== nextState.mode
|
25 |
+
|| this.props.linkType !== nextProps.linkType
|
26 |
+
|| JSON.stringify( this.props.ingredients ) !== JSON.stringify( nextProps.ingredients );
|
27 |
+
}
|
28 |
+
|
29 |
+
render() {
|
30 |
+
let modes = [
|
31 |
+
{
|
32 |
+
id: 'edit',
|
33 |
+
label: __wprm( 'Edit Ingredients' ),
|
34 |
+
},
|
35 |
+
{
|
36 |
+
id: 'ingredient-links',
|
37 |
+
label: __wprm( 'Ingredient Links' ),
|
38 |
+
},
|
39 |
+
{
|
40 |
+
id: 'unit-conversion',
|
41 |
+
label: __wprm( 'Unit Conversion' ),
|
42 |
+
},
|
43 |
+
];
|
44 |
+
|
45 |
+
let mode = null;
|
46 |
+
switch ( this.state.mode ) {
|
47 |
+
case 'unit-conversion':
|
48 |
+
mode = (
|
49 |
+
<UnitConversion
|
50 |
+
ingredients={ this.props.ingredients }
|
51 |
+
onIngredientsChange={ ( ingredients_flat ) => {
|
52 |
+
this.props.onRecipeChange({
|
53 |
+
ingredients_flat,
|
54 |
+
});
|
55 |
+
}}
|
56 |
+
/>
|
57 |
+
);
|
58 |
+
break;
|
59 |
+
case 'ingredient-links':
|
60 |
+
mode = (
|
61 |
+
<IngredientLinks
|
62 |
+
ingredients={ this.props.ingredients }
|
63 |
+
onIngredientsChange={ ( ingredients_flat ) => {
|
64 |
+
this.props.onRecipeChange({
|
65 |
+
ingredients_flat,
|
66 |
+
});
|
67 |
+
}}
|
68 |
+
type={ this.props.linkType }
|
69 |
+
onTypeChange={ ( ingredient_links_type ) => {
|
70 |
+
this.props.onRecipeChange({
|
71 |
+
ingredient_links_type,
|
72 |
+
});
|
73 |
+
} }
|
74 |
+
onModeChange={ this.props.onModeChange }
|
75 |
+
/>
|
76 |
+
);
|
77 |
+
break;
|
78 |
+
case 'preview':
|
79 |
+
mode = (
|
80 |
+
<IngredientsPreview
|
81 |
+
ingredients={ this.props.ingredients }
|
82 |
+
/>
|
83 |
+
);
|
84 |
+
break;
|
85 |
+
default:
|
86 |
+
mode = (
|
87 |
+
<IngredientsEdit
|
88 |
+
ingredients={ this.props.ingredients }
|
89 |
+
onRecipeChange={ this.props.onRecipeChange }
|
90 |
+
/>
|
91 |
+
);
|
92 |
+
}
|
93 |
+
|
94 |
+
return (
|
95 |
+
<div className="wprm-admin-modal-field-ingredient-container">
|
96 |
+
<EditMode
|
97 |
+
modes={ modes }
|
98 |
+
mode={ this.state.mode }
|
99 |
+
onModeChange={(mode) => {
|
100 |
+
this.setState({
|
101 |
+
mode,
|
102 |
+
})
|
103 |
+
}}
|
104 |
+
/>
|
105 |
+
{ mode }
|
106 |
+
</div>
|
107 |
+
);
|
108 |
+
}
|
109 |
+
}
|
assets/js/admin-modal/recipe/edit/RecipeInstructions.js
ADDED
@@ -0,0 +1,163 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import React, { Component } from 'react';
|
2 |
+
import { DragDropContext, Droppable } from 'react-beautiful-dnd';
|
3 |
+
|
4 |
+
import '../../../../css/admin/modal/recipe/fields/instructions.scss';
|
5 |
+
|
6 |
+
import { __wprm } from '../../../shared/Translations';
|
7 |
+
import FieldInstruction from '../../fields/FieldInstruction';
|
8 |
+
|
9 |
+
export default class RecipeInstructions extends Component {
|
10 |
+
constructor(props) {
|
11 |
+
super(props);
|
12 |
+
|
13 |
+
this.container = React.createRef();
|
14 |
+
}
|
15 |
+
|
16 |
+
shouldComponentUpdate(nextProps) {
|
17 |
+
return JSON.stringify( this.props.instructions ) !== JSON.stringify( nextProps.instructions );
|
18 |
+
}
|
19 |
+
|
20 |
+
componentDidUpdate( prevProps ) {
|
21 |
+
if ( this.props.instructions.length > prevProps.instructions.length ) {
|
22 |
+
const inputs = this.container.current.querySelectorAll('.wprm-admin-modal-field-richtext');
|
23 |
+
|
24 |
+
if ( inputs.length ) {
|
25 |
+
inputs[ inputs.length - 1 ].focus();
|
26 |
+
}
|
27 |
+
}
|
28 |
+
}
|
29 |
+
|
30 |
+
onDragEnd(result) {
|
31 |
+
if ( result.destination ) {
|
32 |
+
let newFields = JSON.parse( JSON.stringify( this.props.instructions ) );
|
33 |
+
const sourceIndex = result.source.index;
|
34 |
+
const destinationIndex = result.destination.index;
|
35 |
+
|
36 |
+
const field = newFields.splice(sourceIndex, 1)[0];
|
37 |
+
newFields.splice(destinationIndex, 0, field);
|
38 |
+
|
39 |
+
this.props.onRecipeChange({
|
40 |
+
instructions_flat: newFields,
|
41 |
+
});
|
42 |
+
}
|
43 |
+
}
|
44 |
+
|
45 |
+
addField(type) {
|
46 |
+
let newFields = JSON.parse( JSON.stringify( this.props.instructions ) );
|
47 |
+
let newField;
|
48 |
+
|
49 |
+
if ( 'group' === type ) {
|
50 |
+
newField = {
|
51 |
+
type: 'group',
|
52 |
+
name: '',
|
53 |
+
};
|
54 |
+
} else {
|
55 |
+
newField = {
|
56 |
+
type: 'instruction',
|
57 |
+
text: '',
|
58 |
+
image: 0,
|
59 |
+
image_url: '',
|
60 |
+
}
|
61 |
+
}
|
62 |
+
|
63 |
+
// Give unique UID.
|
64 |
+
let maxUid = Math.max.apply( Math, newFields.map( function(field) { return field.uid; } ) );
|
65 |
+
maxUid = maxUid < 0 ? -1 : maxUid;
|
66 |
+
newField.uid = maxUid + 1;
|
67 |
+
|
68 |
+
newFields.push(newField);
|
69 |
+
|
70 |
+
this.props.onRecipeChange({
|
71 |
+
instructions_flat: newFields,
|
72 |
+
});
|
73 |
+
}
|
74 |
+
|
75 |
+
render() {
|
76 |
+
return (
|
77 |
+
<div
|
78 |
+
className="wprm-admin-modal-field-instruction-container"
|
79 |
+
ref={ this.container }
|
80 |
+
>
|
81 |
+
<DragDropContext
|
82 |
+
onDragEnd={this.onDragEnd.bind(this)}
|
83 |
+
>
|
84 |
+
<Droppable
|
85 |
+
droppableId="wprm-instructions"
|
86 |
+
>
|
87 |
+
{(provided, snapshot) => (
|
88 |
+
<div
|
89 |
+
className={`${ snapshot.isDraggingOver ? ' wprm-admin-modal-field-instruction-container-draggingover' : ''}`}
|
90 |
+
ref={provided.innerRef}
|
91 |
+
{...provided.droppableProps}
|
92 |
+
>
|
93 |
+
{
|
94 |
+
this.props.instructions.map((field, index) => (
|
95 |
+
<FieldInstruction
|
96 |
+
{ ...field }
|
97 |
+
index={ index }
|
98 |
+
key={ index }
|
99 |
+
onTab={() => {
|
100 |
+
// Create new instruction if we're tabbing in the last one.
|
101 |
+
if ( index === this.props.instructions.length - 1) {
|
102 |
+
// Use timeout to fix focus problem (because of preventDefault?).
|
103 |
+
setTimeout(() => {
|
104 |
+
this.addField( 'instruction' );
|
105 |
+
});
|
106 |
+
}
|
107 |
+
}}
|
108 |
+
onChangeText={ ( text ) => {
|
109 |
+
let newFields = JSON.parse( JSON.stringify( this.props.instructions ) );
|
110 |
+
|
111 |
+
if ( 'group' === field.type ) {
|
112 |
+
newFields[index].name = text;
|
113 |
+
} else {
|
114 |
+
newFields[index].text = text;
|
115 |
+
}
|
116 |
+
|
117 |
+
this.props.onRecipeChange({
|
118 |
+
instructions_flat: newFields,
|
119 |
+
});
|
120 |
+
}}
|
121 |
+
onChangeImage={ ( image, url ) => {
|
122 |
+
let newFields = JSON.parse( JSON.stringify( this.props.instructions ) );
|
123 |
+
|
124 |
+
newFields[index].image = image;
|
125 |
+
newFields[index].image_url = url;
|
126 |
+
|
127 |
+
this.props.onRecipeChange({
|
128 |
+
instructions_flat: newFields,
|
129 |
+
});
|
130 |
+
}}
|
131 |
+
onDelete={() => {
|
132 |
+
let newFields = JSON.parse( JSON.stringify( this.props.instructions ) );
|
133 |
+
newFields.splice(index, 1);
|
134 |
+
|
135 |
+
this.props.onRecipeChange({
|
136 |
+
instructions_flat: newFields,
|
137 |
+
});
|
138 |
+
}}
|
139 |
+
/>
|
140 |
+
))
|
141 |
+
}
|
142 |
+
{provided.placeholder}
|
143 |
+
</div>
|
144 |
+
)}
|
145 |
+
</Droppable>
|
146 |
+
</DragDropContext>
|
147 |
+
<div
|
148 |
+
className="wprm-admin-modal-field-instruction-actions"
|
149 |
+
>
|
150 |
+
<button
|
151 |
+
className="button"
|
152 |
+
onClick={() => { this.addField( 'instruction' ) } }
|
153 |
+
>{ __wprm( 'Add Instruction' ) }</button>
|
154 |
+
<button
|
155 |
+
className="button"
|
156 |
+
onClick={() => { this.addField( 'group' ) } }
|
157 |
+
>{ __wprm( 'Add Instruction Group' ) }</button>
|
158 |
+
<p>{ __wprm( 'Tip: use the TAB key to move from field to field and easily add instructions.' ) }</p>
|
159 |
+
</div>
|
160 |
+
</div>
|
161 |
+
);
|
162 |
+
}
|
163 |
+
}
|
assets/js/admin-modal/recipe/edit/RecipeMedia.js
ADDED
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import React, { Fragment } from 'react';
|
2 |
+
|
3 |
+
import '../../../../css/admin/modal/recipe/fields/media.scss';
|
4 |
+
|
5 |
+
import { __wprm } from '../../../shared/Translations';
|
6 |
+
import FieldContainer from '../../fields/FieldContainer';
|
7 |
+
import FieldImage from '../../fields/FieldImage';
|
8 |
+
import FieldVideo from '../../fields/FieldVideo';
|
9 |
+
|
10 |
+
const RecipeMedia = (props) => {
|
11 |
+
return (
|
12 |
+
<Fragment>
|
13 |
+
<FieldContainer label={ __wprm( 'Image' ) } help={ __wprm( 'Used in the recipe metadata. Should be an image of the completed dish.' ) }>
|
14 |
+
<FieldImage
|
15 |
+
id={ props.image.id }
|
16 |
+
url={ props.image.url }
|
17 |
+
onChange={ ( image_id, image_url ) => {
|
18 |
+
props.onRecipeChange( {
|
19 |
+
image_id,
|
20 |
+
image_url,
|
21 |
+
} );
|
22 |
+
}}
|
23 |
+
/>
|
24 |
+
</FieldContainer>
|
25 |
+
{
|
26 |
+
'recipe_image' !== wprm_admin.settings.pinterest_use_for_image
|
27 |
+
?
|
28 |
+
<FieldContainer label={ __wprm( 'Pin Image' ) } help={ __wprm( 'Optionally set a different image to use for the "Pin Recipe" button.' ) }>
|
29 |
+
<FieldImage
|
30 |
+
required="premium"
|
31 |
+
id={ props.pinImage.id }
|
32 |
+
url={ props.pinImage.url }
|
33 |
+
onChange={ ( pin_image_id, pin_image_url ) => {
|
34 |
+
props.onRecipeChange( {
|
35 |
+
pin_image_id,
|
36 |
+
pin_image_url,
|
37 |
+
} );
|
38 |
+
}}
|
39 |
+
/>
|
40 |
+
</FieldContainer>
|
41 |
+
:
|
42 |
+
null
|
43 |
+
}
|
44 |
+
<FieldContainer label={ __wprm( 'Video' ) } help={ __wprm( 'Used in the recipe metadata. Can be displayed elsewhere on the page using the [wprm-recipe-video] shortcode.' ) }>
|
45 |
+
<FieldVideo
|
46 |
+
id={ props.video.id }
|
47 |
+
thumb={ props.video.thumb }
|
48 |
+
embed={ props.video.embed }
|
49 |
+
onChange={ ( video_id, video_thumb_url, video_embed = false ) => {
|
50 |
+
let video = {
|
51 |
+
video_id,
|
52 |
+
video_thumb_url,
|
53 |
+
}
|
54 |
+
|
55 |
+
if ( video_embed !== false ) {
|
56 |
+
video.video_embed = video_embed;
|
57 |
+
}
|
58 |
+
|
59 |
+
props.onRecipeChange( video );
|
60 |
+
}}
|
61 |
+
/>
|
62 |
+
</FieldContainer>
|
63 |
+
</Fragment>
|
64 |
+
);
|
65 |
+
}
|
66 |
+
export default RecipeMedia;
|
assets/js/admin-modal/recipe/edit/RecipeNotes.js
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import React from 'react';
|
2 |
+
|
3 |
+
import '../../../../css/admin/modal/recipe/fields/notes.scss';
|
4 |
+
|
5 |
+
import { __wprm } from '../../../shared/Translations';
|
6 |
+
import FieldContainer from '../../fields/FieldContainer';
|
7 |
+
import FieldTinymce from '../../fields/FieldTinymce';
|
8 |
+
|
9 |
+
const RecipeNotes = (props) => {
|
10 |
+
return (
|
11 |
+
<FieldContainer label={ __wprm( 'Recipe Notes' ) }>
|
12 |
+
<FieldTinymce
|
13 |
+
id="recipe-notes"
|
14 |
+
value={ props.notes }
|
15 |
+
onChange={ ( notes ) => {
|
16 |
+
props.onRecipeChange( { notes } );
|
17 |
+
}}
|
18 |
+
/>
|
19 |
+
</FieldContainer>
|
20 |
+
);
|
21 |
+
}
|
22 |
+
export default RecipeNotes;
|
assets/js/admin-modal/recipe/edit/RecipeNutrition.js
ADDED
@@ -0,0 +1,108 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import React, { Fragment } from 'react';
|
2 |
+
|
3 |
+
import FieldContainer from '../../fields/FieldContainer';
|
4 |
+
import FieldText from '../../fields/FieldText';
|
5 |
+
import Button from '../../../shared/Button';
|
6 |
+
import { __wprm } from '../../../shared/Translations';
|
7 |
+
|
8 |
+
import '../../../../css/admin/modal/recipe/fields/nutrition.scss';
|
9 |
+
|
10 |
+
const RecipeNutrition = (props) => {
|
11 |
+
const serving_size = props.nutrition.hasOwnProperty('serving_size') && props.nutrition['serving_size'] ? props.nutrition['serving_size'] : '';
|
12 |
+
const serving_unit = props.nutrition.hasOwnProperty('serving_unit') && props.nutrition['serving_unit'] ? props.nutrition['serving_unit'] : '';
|
13 |
+
|
14 |
+
return (
|
15 |
+
<Fragment>
|
16 |
+
<p>
|
17 |
+
{ __wprm( 'These should be the nutrition facts for 1 serving of your recipe.' ) }<br/>
|
18 |
+
{
|
19 |
+
props.servings.amount
|
20 |
+
?
|
21 |
+
<Fragment>{ __wprm( 'Total servings for this recipe:' ) } { `${props.servings.amount} ${props.servings.unit}`}</Fragment>
|
22 |
+
:
|
23 |
+
<Fragment>{ __wprm( `You don't have the servings field set for your recipe under "General".` ) }</Fragment>
|
24 |
+
}
|
25 |
+
</p>
|
26 |
+
<div className="wprm-admin-modal-field-nutrition-container">
|
27 |
+
{
|
28 |
+
wprm_admin.addons.premium
|
29 |
+
?
|
30 |
+
<FieldContainer id="nutrition_serving_size" label={ __wprm( 'Serving Size' ) } help={ __wprm( 'The weight of 1 serving. Does not affect the calculation.' ) }>
|
31 |
+
<FieldText
|
32 |
+
type="number"
|
33 |
+
value={ serving_size }
|
34 |
+
onChange={ (serving_size) => {
|
35 |
+
const nutrition = {
|
36 |
+
...props.nutrition,
|
37 |
+
serving_size,
|
38 |
+
};
|
39 |
+
|
40 |
+
props.onRecipeChange( { nutrition } );
|
41 |
+
}}
|
42 |
+
/>
|
43 |
+
<FieldText
|
44 |
+
placeholder={ __wprm( 'g' ) }
|
45 |
+
value={ serving_unit }
|
46 |
+
onChange={ (serving_unit) => {
|
47 |
+
const nutrition = {
|
48 |
+
...props.nutrition,
|
49 |
+
serving_unit,
|
50 |
+
};
|
51 |
+
|
52 |
+
props.onRecipeChange( { nutrition } );
|
53 |
+
}}
|
54 |
+
/>
|
55 |
+
</FieldContainer>
|
56 |
+
:
|
57 |
+
null
|
58 |
+
}
|
59 |
+
{
|
60 |
+
Object.keys(wprm_admin_modal.nutrition).map((nutrient, index ) => {
|
61 |
+
const options = wprm_admin_modal.nutrition[nutrient];
|
62 |
+
const value = props.nutrition.hasOwnProperty(nutrient) ? props.nutrition[nutrient] : '';
|
63 |
+
|
64 |
+
if ( 'serving_size' === nutrient ) {
|
65 |
+
return null;
|
66 |
+
}
|
67 |
+
|
68 |
+
if ( 'calories' !== nutrient && ! wprm_admin.addons.premium ) {
|
69 |
+
return null;
|
70 |
+
}
|
71 |
+
|
72 |
+
return (
|
73 |
+
<FieldContainer id={ `nutrition_${nutrient}` } label={ options.label } key={ index }>
|
74 |
+
<FieldText
|
75 |
+
type="number"
|
76 |
+
value={ value }
|
77 |
+
onChange={ (value) => {
|
78 |
+
const nutrition = {
|
79 |
+
...props.nutrition,
|
80 |
+
[nutrient]: value,
|
81 |
+
};
|
82 |
+
|
83 |
+
props.onRecipeChange( { nutrition } );
|
84 |
+
}}
|
85 |
+
/><span className="wprm-admin-modal-field-nutrition-unit">{ options.unit }</span>
|
86 |
+
</FieldContainer>
|
87 |
+
)
|
88 |
+
})
|
89 |
+
}
|
90 |
+
</div>
|
91 |
+
{
|
92 |
+
wprm_admin.addons.premium
|
93 |
+
?
|
94 |
+
null
|
95 |
+
:
|
96 |
+
<p>{ __wprm( 'More nutrients are available in' ) } <a href="https://bootstrapped.ventures/wp-recipe-maker/get-the-plugin/" target="_blank">WP Recipe Maker Premium</a>.</p>
|
97 |
+
}
|
98 |
+
<Button
|
99 |
+
isPrimary
|
100 |
+
required="pro"
|
101 |
+
onClick={() => {
|
102 |
+
props.onModeChange('nutrition-calculation');
|
103 |
+
}}
|
104 |
+
>{ __wprm( 'Calculate Nutrition Facts' ) }</Button>
|
105 |
+
</Fragment>
|
106 |
+
);
|
107 |
+
}
|
108 |
+
export default RecipeNutrition;
|
assets/js/admin-modal/recipe/edit/RecipeTimes.js
ADDED
@@ -0,0 +1,87 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import React, { Fragment } from 'react';
|
2 |
+
|
3 |
+
import '../../../../css/admin/modal/recipe/fields/times.scss';
|
4 |
+
|
5 |
+
import { __wprm } from '../../../shared/Translations';
|
6 |
+
import FieldContainer from '../../fields/FieldContainer';
|
7 |
+
import FieldText from '../../fields/FieldText';
|
8 |
+
import FieldTime from '../../fields/FieldTime';
|
9 |
+
|
10 |
+
const RecipeTimes = (props) => {
|
11 |
+
const calculatedTotal = Math.max( 0, parseInt( props.prep.time ) ) + Math.max( 0, parseInt( props.cook.time ) ) + Math.max( 0, parseInt( props.custom.time ) );
|
12 |
+
|
13 |
+
return (
|
14 |
+
<Fragment>
|
15 |
+
<FieldContainer id="prep-time" label={ __wprm( 'Prep Time' ) }>
|
16 |
+
<FieldTime
|
17 |
+
id="prep"
|
18 |
+
value={ props.prep }
|
19 |
+
onChange={ (prep_time) => {
|
20 |
+
props.onRecipeChange( { prep_time } );
|
21 |
+
}}
|
22 |
+
onChangeZero={ (prep_time_zero) => {
|
23 |
+
props.onRecipeChange( { prep_time_zero } );
|
24 |
+
}}
|
25 |
+
/>
|
26 |
+
</FieldContainer>
|
27 |
+
<FieldContainer id="cook-time" label={ __wprm( 'Cook Time' ) }>
|
28 |
+
<FieldTime
|
29 |
+
id="cook"
|
30 |
+
value={ props.cook }
|
31 |
+
onChange={ (cook_time) => {
|
32 |
+
props.onRecipeChange( { cook_time } );
|
33 |
+
}}
|
34 |
+
onChangeZero={ (cook_time_zero) => {
|
35 |
+
props.onRecipeChange( { cook_time_zero } );
|
36 |
+
}}
|
37 |
+
/>
|
38 |
+
</FieldContainer>
|
39 |
+
<FieldContainer id="custom-time-label" label={ __wprm( 'Custom Time Label' ) } help={ __wprm( 'Optional extra time field that you can label yourself. Examples: Resting Time, Baking Time' ) }>
|
40 |
+
<FieldText
|
41 |
+
placeholder={ __wprm( 'Resting Time' ) }
|
42 |
+
value={ props.customLabel }
|
43 |
+
onChange={ (custom_time_label) => {
|
44 |
+
props.onRecipeChange( { custom_time_label } );
|
45 |
+
}}
|
46 |
+
/>
|
47 |
+
</FieldContainer>
|
48 |
+
<FieldContainer id="custom-time" label={ __wprm( 'Custom Time' ) }>
|
49 |
+
<FieldTime
|
50 |
+
id="custom"
|
51 |
+
value={ props.custom }
|
52 |
+
onChange={ (custom_time) => {
|
53 |
+
props.onRecipeChange( { custom_time } );
|
54 |
+
}}
|
55 |
+
onChangeZero={ (custom_time_zero) => {
|
56 |
+
props.onRecipeChange( { custom_time_zero } );
|
57 |
+
}}
|
58 |
+
/>
|
59 |
+
</FieldContainer>
|
60 |
+
<FieldContainer id="total-time" label={ __wprm( 'Total Time' ) }>
|
61 |
+
<FieldTime
|
62 |
+
id="total"
|
63 |
+
value={ props.total }
|
64 |
+
onChange={ (total_time) => {
|
65 |
+
props.onRecipeChange( { total_time } );
|
66 |
+
}}
|
67 |
+
/>
|
68 |
+
{
|
69 |
+
calculatedTotal !== parseInt( props.total.time )
|
70 |
+
&&
|
71 |
+
<div>
|
72 |
+
<a
|
73 |
+
href="#"
|
74 |
+
onClick={(e) => {
|
75 |
+
e.preventDefault();
|
76 |
+
props.onRecipeChange({
|
77 |
+
total_time: calculatedTotal,
|
78 |
+
});
|
79 |
+
}}
|
80 |
+
>{ __wprm( 'Recalculate Total Time' ) }</a>
|
81 |
+
</div>
|
82 |
+
}
|
83 |
+
</FieldContainer>
|
84 |
+
</Fragment>
|
85 |
+
);
|
86 |
+
}
|
87 |
+
export default RecipeTimes;
|
assets/js/admin-modal/recipe/edit/index.js
ADDED
@@ -0,0 +1,258 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import React, { Fragment } from 'react';
|
2 |
+
import { Element, Link } from 'react-scroll';
|
3 |
+
import CopyToClipboard from 'react-copy-to-clipboard';
|
4 |
+
|
5 |
+
import Header from '../../general/Header';
|
6 |
+
import Footer from '../../general/Footer';
|
7 |
+
|
8 |
+
import Loader from '../../../shared/Loader';
|
9 |
+
import { __wprm } from '../../../shared/Translations';
|
10 |
+
|
11 |
+
import FieldGroup from '../../fields/FieldGroup';
|
12 |
+
|
13 |
+
import RecipeImport from './RecipeImport';
|
14 |
+
import RecipeMedia from './RecipeMedia';
|
15 |
+
import RecipeGeneral from './RecipeGeneral';
|
16 |
+
import RecipeTimes from './RecipeTimes';
|
17 |
+
import RecipeCategories from './RecipeCategories';
|
18 |
+
import RecipeIngredients from './RecipeIngredients';
|
19 |
+
import RecipeInstructions from './RecipeInstructions';
|
20 |
+
import RecipeNutrition from './RecipeNutrition';
|
21 |
+
import RecipeNotes from './RecipeNotes';
|
22 |
+
|
23 |
+
const EditRecipe = (props) => {
|
24 |
+
const structure = [
|
25 |
+
{
|
26 |
+
id: 'import', name: __wprm( 'Import' ),
|
27 |
+
elem: (
|
28 |
+
<RecipeImport
|
29 |
+
onModeChange={ props.onModeChange }
|
30 |
+
onRecipeChange={ props.onRecipeChange }
|
31 |
+
/>
|
32 |
+
)
|
33 |
+
},
|
34 |
+
{
|
35 |
+
id: 'media', name: __wprm( 'Media' ),
|
36 |
+
elem: (
|
37 |
+
<RecipeMedia
|
38 |
+
image={{
|
39 |
+
id: props.recipe.image_id,
|
40 |
+
url: props.recipe.image_url,
|
41 |
+
}}
|
42 |
+
pinImage={{
|
43 |
+
id: props.recipe.pin_image_id,
|
44 |
+
url: props.recipe.pin_image_url,
|
45 |
+
}}
|
46 |
+
video={{
|
47 |
+
id: props.recipe.video_id,
|
48 |
+
thumb: props.recipe.video_thumb_url,
|
49 |
+
embed: props.recipe.video_embed,
|
50 |
+
}}
|
51 |
+
onRecipeChange={ props.onRecipeChange }
|
52 |
+
/>
|
53 |
+
)
|
54 |
+
},
|
55 |
+
{
|
56 |
+
id: 'general', name: __wprm( 'General' ),
|
57 |
+
elem: (
|
58 |
+
<RecipeGeneral
|
59 |
+
type={ props.recipe.type }
|
60 |
+
name={ props.recipe.name }
|
61 |
+
summary={ props.recipe.summary }
|
62 |
+
author={{
|
63 |
+
display: props.recipe.author_display,
|
64 |
+
name: props.recipe.author_name,
|
65 |
+
link: props.recipe.author_link,
|
66 |
+
}}
|
67 |
+
servings={{
|
68 |
+
amount: props.recipe.servings,
|
69 |
+
unit: props.recipe.servings_unit,
|
70 |
+
}}
|
71 |
+
onRecipeChange={ props.onRecipeChange }
|
72 |
+
/>
|
73 |
+
)
|
74 |
+
},
|
75 |
+
{
|
76 |
+
id: 'times', name: __wprm( 'Times' ),
|
77 |
+
elem: (
|
78 |
+
<RecipeTimes
|
79 |
+
prep={ {
|
80 |
+
time: props.recipe.prep_time,
|
81 |
+
zero: props.recipe.prep_time_zero,
|
82 |
+
} }
|
83 |
+
cook={ {
|
84 |
+
time: props.recipe.cook_time,
|
85 |
+
zero: props.recipe.cook_time_zero,
|
86 |
+
} }
|
87 |
+
custom={ {
|
88 |
+
time: props.recipe.custom_time,
|
89 |
+
zero: props.recipe.custom_time_zero,
|
90 |
+
} }
|
91 |
+
customLabel={ props.recipe.custom_time_label }
|
92 |
+
total={ {
|
93 |
+
time: props.recipe.total_time,
|
94 |
+
zero: false,
|
95 |
+
} }
|
96 |
+
onRecipeChange={ props.onRecipeChange }
|
97 |
+
/>
|
98 |
+
)
|
99 |
+
},
|
100 |
+
{
|
101 |
+
id: 'categories', name: __wprm( 'Categories' ),
|
102 |
+
elem: (
|
103 |
+
<RecipeCategories
|
104 |
+
tags={ props.recipe.tags }
|
105 |
+
onRecipeChange={ props.onRecipeChange }
|
106 |
+
/>
|
107 |
+
)
|
108 |
+
},
|
109 |
+
{
|
110 |
+
id: 'ingredients', name: __wprm( 'Ingredients' ),
|
111 |
+
elem: (
|
112 |
+
<RecipeIngredients
|
113 |
+
ingredients={ props.recipe.ingredients_flat }
|
114 |
+
linkType={ props.recipe.ingredient_links_type }
|
115 |
+
onRecipeChange={ props.onRecipeChange }
|
116 |
+
onModeChange={ props.onModeChange }
|
117 |
+
/>
|
118 |
+
)
|
119 |
+
},
|
120 |
+
{
|
121 |
+
id: 'instructions', name: __wprm( 'Instructions' ),
|
122 |
+
elem: (
|
123 |
+
<RecipeInstructions
|
124 |
+
instructions={ props.recipe.instructions_flat }
|
125 |
+
onRecipeChange={ props.onRecipeChange }
|
126 |
+
/>
|
127 |
+
)
|
128 |
+
},
|
129 |
+
{
|
130 |
+
id: 'nutrition', name: __wprm( 'Nutrition' ),
|
131 |
+
elem: (
|
132 |
+
<RecipeNutrition
|
133 |
+
nutrition={ props.recipe.nutrition }
|
134 |
+
servings={{
|
135 |
+
amount: props.recipe.servings,
|
136 |
+
unit: props.recipe.servings_unit,
|
137 |
+
}}
|
138 |
+
onRecipeChange={ props.onRecipeChange }
|
139 |
+
onModeChange={ props.onModeChange }
|
140 |
+
/>
|
141 |
+
)
|
142 |
+
},
|
143 |
+
{
|
144 |
+
id: 'notes', name: __wprm( 'Notes' ),
|
145 |
+
elem: (
|
146 |
+
<RecipeNotes
|
147 |
+
notes={ props.recipe.notes }
|
148 |
+
onRecipeChange={ props.onRecipeChange }
|
149 |
+
/>
|
150 |
+
)
|
151 |
+
},
|
152 |
+
];
|
153 |
+
|
154 |
+
return (
|
155 |
+
<Fragment>
|
156 |
+
<Header
|
157 |
+
onCloseModal={ props.onCloseModal }
|
158 |
+
>
|
159 |
+
{
|
160 |
+
props.loadingRecipe
|
161 |
+
?
|
162 |
+
__wprm( 'Loading Recipe...' )
|
163 |
+
:
|
164 |
+
<Fragment>
|
165 |
+
{
|
166 |
+
props.recipe.id
|
167 |
+
?
|
168 |
+
|
169 |
+
`${ __wprm( 'Editing Recipe' ) } #${props.recipe.id}${props.recipe.name ? ` - ${props.recipe.name}` : ''}`
|
170 |
+
:
|
171 |
+
`${ __wprm( 'Creating new Recipe' ) }${props.recipe.name ? ` - ${props.recipe.name}` : ''}`
|
172 |
+
}
|
173 |
+
</Fragment>
|
174 |
+
}
|
175 |
+
</Header>
|
176 |
+
<div className="wprm-admin-modal-recipe-quicklinks">
|
177 |
+
{
|
178 |
+
structure.map((group, index) => (
|
179 |
+
<Link
|
180 |
+
to={ `wprm-admin-modal-fields-group-${ group.id }` }
|
181 |
+
containerId="wprm-admin-modal-recipe-content"
|
182 |
+
className="wprm-admin-modal-recipe-quicklink"
|
183 |
+
activeClass="active"
|
184 |
+
spy={true}
|
185 |
+
offset={-10}
|
186 |
+
smooth={true}
|
187 |
+
duration={400}
|
188 |
+
key={index}
|
189 |
+
>
|
190 |
+
{ group.name }
|
191 |
+
</Link>
|
192 |
+
))
|
193 |
+
}
|
194 |
+
</div>
|
195 |
+
<Element className="wprm-admin-modal-content" id="wprm-admin-modal-recipe-content">
|
196 |
+
{
|
197 |
+
props.loadingRecipe
|
198 |
+
?
|
199 |
+
<Loader/>
|
200 |
+
:
|
201 |
+
<div className="wprm-admin-modal-recipe-fields">
|
202 |
+
{
|
203 |
+
structure.map((group, index) => (
|
204 |
+
<FieldGroup
|
205 |
+
header={ group.name }
|
206 |
+
id={ group.id }
|
207 |
+
key={ 100 * props.forceRerender + index }
|
208 |
+
>
|
209 |
+
{ group.elem }
|
210 |
+
</FieldGroup>
|
211 |
+
))
|
212 |
+
}
|
213 |
+
</div>
|
214 |
+
}
|
215 |
+
</Element>
|
216 |
+
<div id="wprm-admin-modal-toolbar-container"></div>
|
217 |
+
<Footer
|
218 |
+
savingChanges={ props.savingChanges }
|
219 |
+
>
|
220 |
+
{
|
221 |
+
props.savingFailed
|
222 |
+
?
|
223 |
+
<CopyToClipboard
|
224 |
+
text={JSON.stringify( props.recipe )}
|
225 |
+
onCopy={(text, result) => {
|
226 |
+
if ( result ) {
|
227 |
+
alert( __wprm( 'The recipe has been copied and can be used in the "Import from JSON" feature.' ) );
|
228 |
+
} else {
|
229 |
+
alert( __wprm( 'Something went wrong. Please contact support.' ) );
|
230 |
+
}
|
231 |
+
}}
|
232 |
+
>
|
233 |
+
<a href="#" onClick={ (e) => { e.preventDefault(); } }>
|
234 |
+
{ __wprm( 'Copy JSON to Clipboard' ) }
|
235 |
+
</a>
|
236 |
+
</CopyToClipboard>
|
237 |
+
:
|
238 |
+
null
|
239 |
+
}
|
240 |
+
<button
|
241 |
+
className="button button-primary"
|
242 |
+
onClick={ () => { props.saveRecipe( false ) } }
|
243 |
+
disabled={ ! props.changesMade }
|
244 |
+
>
|
245 |
+
{ __wprm( 'Save' ) }
|
246 |
+
</button>
|
247 |
+
<button
|
248 |
+
className="button button-primary"
|
249 |
+
onClick={ () => { props.saveRecipe( true ) } }
|
250 |
+
disabled={ ! props.changesMade }
|
251 |
+
>
|
252 |
+
{ __wprm( 'Save & Close' ) }
|
253 |
+
</button>
|
254 |
+
</Footer>
|
255 |
+
</Fragment>
|
256 |
+
);
|
257 |
+
}
|
258 |
+
export default EditRecipe;
|
assets/js/admin-modal/recipe/index.js
ADDED
@@ -0,0 +1,245 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import React, { Component } from 'react';
|
2 |
+
import { scroller } from 'react-scroll';
|
3 |
+
|
4 |
+
import '../../../css/admin/modal/recipe.scss';
|
5 |
+
|
6 |
+
import Api from '../../shared/Api';
|
7 |
+
import { __wprm } from '../../shared/Translations';
|
8 |
+
|
9 |
+
import EditRecipe from './edit';
|
10 |
+
import EditIngredientLinks from './edit-ingredient-links';
|
11 |
+
import NutritionCalculation from './nutrition-calculation';
|
12 |
+
import TextImport from './text-import';
|
13 |
+
|
14 |
+
export default class Recipe extends Component {
|
15 |
+
constructor(props) {
|
16 |
+
super(props);
|
17 |
+
|
18 |
+
let recipe = JSON.parse( JSON.stringify( wprm_admin_modal.recipe ) );
|
19 |
+
let loadingRecipe = false;
|
20 |
+
|
21 |
+
if ( props.args.hasOwnProperty( 'recipe' ) ) {
|
22 |
+
recipe = JSON.parse( JSON.stringify( props.args.recipe ) );
|
23 |
+
} else if ( props.args.hasOwnProperty( 'recipeId' ) ) {
|
24 |
+
loadingRecipe = true;
|
25 |
+
Api.getRecipe(props.args.recipeId).then((data) => {
|
26 |
+
if ( data ) {
|
27 |
+
const recipe = JSON.parse( JSON.stringify( data.recipe ) );
|
28 |
+
|
29 |
+
if ( props.args.cloneRecipe ) {
|
30 |
+
delete recipe.id;
|
31 |
+
}
|
32 |
+
|
33 |
+
this.setState({
|
34 |
+
recipe,
|
35 |
+
originalRecipe: props.args.cloneRecipe || props.args.restoreRevision ? {} : JSON.parse( JSON.stringify( recipe ) ),
|
36 |
+
loadingRecipe: false,
|
37 |
+
mode: 'recipe',
|
38 |
+
});
|
39 |
+
|
40 |
+
this.scrollToGroup();
|
41 |
+
} else {
|
42 |
+
// Loading recipe failed.
|
43 |
+
this.setState({
|
44 |
+
loadingRecipe: false,
|
45 |
+
});
|
46 |
+
}
|
47 |
+
});
|
48 |
+
}
|
49 |
+
|
50 |
+
this.state = {
|
51 |
+
recipe,
|
52 |
+
originalRecipe: props.args.cloneRecipe || props.args.restoreRevision ? {} : JSON.parse( JSON.stringify( recipe ) ),
|
53 |
+
savingChanges: false,
|
54 |
+
savingFailed: false,
|
55 |
+
loadingRecipe,
|
56 |
+
forceRerender: 0,
|
57 |
+
mode: 'recipe',
|
58 |
+
};
|
59 |
+
|
60 |
+
// Bind functions.
|
61 |
+
this.scrollToGroup = this.scrollToGroup.bind(this);
|
62 |
+
this.onModeChange = this.onModeChange.bind(this);
|
63 |
+
this.onRecipeChange = this.onRecipeChange.bind(this);
|
64 |
+
this.saveRecipe = this.saveRecipe.bind(this);
|
65 |
+
this.allowCloseModal = this.allowCloseModal.bind(this);
|
66 |
+
this.changesMade = this.changesMade.bind(this);
|
67 |
+
}
|
68 |
+
|
69 |
+
componentDidMount() {
|
70 |
+
if ( 'recipe' === this.state.mode && ! this.state.loadingRecipe ) {
|
71 |
+
this.scrollToGroup();
|
72 |
+
}
|
73 |
+
}
|
74 |
+
|
75 |
+
onModeChange( mode, args = false ) {
|
76 |
+
let newState = {
|
77 |
+
mode,
|
78 |
+
};
|
79 |
+
|
80 |
+
if ( 'text-import' === mode ) {
|
81 |
+
newState['textImportText'] = args;
|
82 |
+
}
|
83 |
+
|
84 |
+
this.setState(newState, () => {
|
85 |
+
if ( 'recipe' === mode ) {
|
86 |
+
args = args ? args : 'media';
|
87 |
+
this.scrollToGroup( args );
|
88 |
+
}
|
89 |
+
});
|
90 |
+
}
|
91 |
+
|
92 |
+
scrollToGroup( group = 'media' ) {
|
93 |
+
scroller.scrollTo( `wprm-admin-modal-fields-group-${ group }`, {
|
94 |
+
containerId: 'wprm-admin-modal-recipe-content',
|
95 |
+
offset: -10,
|
96 |
+
} );
|
97 |
+
}
|
98 |
+
|
99 |
+
onRecipeChange(fields) {
|
100 |
+
this.setState((prevState) => ({
|
101 |
+
recipe: {
|
102 |
+
...prevState.recipe,
|
103 |
+
...fields,
|
104 |
+
}
|
105 |
+
}));
|
106 |
+
}
|
107 |
+
|
108 |
+
saveRecipe( closeAfter = false ) {
|
109 |
+
if ( ! this.state.savingChanges ) {
|
110 |
+
this.setState({
|
111 |
+
savingChanges: true,
|
112 |
+
savingFailed: false,
|
113 |
+
}, () => {
|
114 |
+
Api.saveRecipe(this.state.recipe).then((data) => {
|
115 |
+
if ( data && data.recipe ) {
|
116 |
+
const recipe = JSON.parse( JSON.stringify( data.recipe ) );
|
117 |
+
this.setState((prevState) => ({
|
118 |
+
recipe,
|
119 |
+
originalRecipe: JSON.parse( JSON.stringify( recipe ) ),
|
120 |
+
savingChanges: false,
|
121 |
+
forceRerender: prevState.forceRerender + 1,
|
122 |
+
}), () => {
|
123 |
+
if ( 'function' === typeof this.props.args.saveCallback ) {
|
124 |
+
this.props.args.saveCallback( recipe );
|
125 |
+
}
|
126 |
+
if ( closeAfter ) {
|
127 |
+
if ( 'function' === typeof this.props.args.saveCloseCallback ) {
|
128 |
+
this.props.args.saveCloseCallback( recipe );
|
129 |
+
}
|
130 |
+
this.props.maybeCloseModal();
|
131 |
+
}
|
132 |
+
});
|
133 |
+
} else {
|
134 |
+
this.setState({
|
135 |
+
savingChanges: false,
|
136 |
+
savingFailed: true,
|
137 |
+
});
|
138 |
+
}
|
139 |
+
});
|
140 |
+
});
|
141 |
+
}
|
142 |
+
}
|
143 |
+
|
144 |
+
allowCloseModal() {
|
145 |
+
switch ( this.state.mode ) {
|
146 |
+
case 'nutrition-calculation':
|
147 |
+
if ( confirm( __wprm( 'Are you sure you want to stop calculating the nutrition facts?' ) ) ) {
|
148 |
+
this.onModeChange( 'recipe', 'nutrition' );
|
149 |
+
}
|
150 |
+
return false;
|
151 |
+
case 'ingredient-links':
|
152 |
+
this.onModeChange( 'recipe', 'ingredients' );
|
153 |
+
return false;
|
154 |
+
case 'text-import':
|
155 |
+
this.onModeChange( 'recipe' );
|
156 |
+
return false;
|
157 |
+
}
|
158 |
+
|
159 |
+
// Closing recipe itself.
|
160 |
+
return ! this.state.savingChanges && ( ! this.changesMade() || confirm( __wprm( 'Are you sure you want to close without saving changes?' ) ) );
|
161 |
+
}
|
162 |
+
|
163 |
+
changesMade() {
|
164 |
+
return JSON.stringify( this.state.recipe ) !== JSON.stringify( this.state.originalRecipe );
|
165 |
+
}
|
166 |
+
|
167 |
+
render() {
|
168 |
+
switch ( this.state.mode ) {
|
169 |
+
case 'nutrition-calculation':
|
170 |
+
return (
|
171 |
+
<NutritionCalculation
|
172 |
+
onCloseModal={ this.props.maybeCloseModal }
|
173 |
+
name={ this.state.recipe.name }
|
174 |
+
servings={ this.state.recipe.servings }
|
175 |
+
ingredients={ this.state.recipe.ingredients_flat }
|
176 |
+
onCancel={() => {
|
177 |
+
this.onModeChange( 'recipe', 'nutrition' );
|
178 |
+
}}
|
179 |
+
onNutritionChange={ (calculated) => {
|
180 |
+
let nutrition = {};
|
181 |
+
|
182 |
+
Object.keys(wprm_admin_modal.nutrition).map((nutrient, index ) => {
|
183 |
+
if ( calculated.hasOwnProperty( nutrient ) ) {
|
184 |
+
nutrition[ nutrient ] = calculated[ nutrient ];
|
185 |
+
} else {
|
186 |
+
nutrition[ nutrient ] = false;
|
187 |
+
}
|
188 |
+
});
|
189 |
+
|
190 |
+
this.onRecipeChange({
|
191 |
+
nutrition,
|
192 |
+
});
|
193 |
+
this.onModeChange( 'recipe', 'nutrition' );
|
194 |
+
}}
|
195 |
+
/>
|
196 |
+
);
|
197 |
+
case 'ingredient-links':
|
198 |
+
return (
|
199 |
+
<EditIngredientLinks
|
200 |
+
onCloseModal={ this.props.maybeCloseModal }
|
201 |
+
onCancel={() => {
|
202 |
+
this.onModeChange( 'recipe', 'ingredients' );
|
203 |
+
}}
|
204 |
+
ingredients={ this.state.recipe.ingredients_flat }
|
205 |
+
onIngredientsChange={ (ingredients_flat) => {
|
206 |
+
this.onRecipeChange({
|
207 |
+
ingredients_flat,
|
208 |
+
});
|
209 |
+
this.onModeChange( 'recipe', 'ingredients' );
|
210 |
+
}}
|
211 |
+
/>
|
212 |
+
);
|
213 |
+
case 'text-import':
|
214 |
+
return (
|
215 |
+
<TextImport
|
216 |
+
onCloseModal={ this.props.maybeCloseModal }
|
217 |
+
onCancel={() => {
|
218 |
+
this.onModeChange( 'recipe' );
|
219 |
+
}}
|
220 |
+
text={ this.state.textImportText }
|
221 |
+
recipe={ this.state.recipe }
|
222 |
+
onImportValues={ ( newRecipe ) => {
|
223 |
+
this.onRecipeChange( newRecipe );
|
224 |
+
this.onModeChange( 'recipe' );
|
225 |
+
} }
|
226 |
+
/>
|
227 |
+
);
|
228 |
+
default:
|
229 |
+
return (
|
230 |
+
<EditRecipe
|
231 |
+
onCloseModal={ this.props.maybeCloseModal }
|
232 |
+
changesMade={ this.changesMade() }
|
233 |
+
savingChanges={ this.state.savingChanges }
|
234 |
+
savingFailed={ this.state.savingFailed }
|
235 |
+
loadingRecipe={ this.state.loadingRecipe }
|
236 |
+
recipe={ this.state.recipe }
|
237 |
+
onRecipeChange={ this.onRecipeChange }
|
238 |
+
saveRecipe={ this.saveRecipe }
|
239 |
+
forceRerender={ this.state.forceRerender }
|
240 |
+
onModeChange={this.onModeChange}
|
241 |
+
/>
|
242 |
+
);
|
243 |
+
}
|
244 |
+
}
|
245 |
+
}
|
assets/js/admin-modal/recipe/nutrition-calculation/Api.js
ADDED
@@ -0,0 +1,150 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
const nutritionEndpoint = wprm_admin.endpoints.nutrition;
|
2 |
+
|
3 |
+
export default {
|
4 |
+
getMatches(ingredients) {
|
5 |
+
const data = {
|
6 |
+
ingredients,
|
7 |
+
};
|
8 |
+
|
9 |
+
return fetch(`${nutritionEndpoint}/matches`, {
|
10 |
+
method: 'POST',
|
11 |
+
headers: {
|
12 |
+
'X-WP-Nonce': wprm_admin.api_nonce,
|
13 |
+
'Accept': 'application/json',
|
14 |
+
'Content-Type': 'application/json',
|
15 |
+
},
|
16 |
+
credentials: 'same-origin',
|
17 |
+
body: JSON.stringify(data),
|
18 |
+
}).then(function (response) {
|
19 |
+
if ( response.ok ) {
|
20 |
+
return response.json();
|
21 |
+
} else {
|
22 |
+
console.log(response);
|
23 |
+
alert( 'Something went wrong. Please contact support.' );
|
24 |
+
return false;
|
25 |
+
}
|
26 |
+
});
|
27 |
+
},
|
28 |
+
getApiOptions(search) {
|
29 |
+
const data = {
|
30 |
+
search,
|
31 |
+
};
|
32 |
+
|
33 |
+
return fetch(`${nutritionEndpoint}/api/options`, {
|
34 |
+
method: 'POST',
|
35 |
+
headers: {
|
36 |
+
'X-WP-Nonce': wprm_admin.api_nonce,
|
37 |
+
'Accept': 'application/json',
|
38 |
+
'Content-Type': 'application/json',
|
39 |
+
},
|
40 |
+
credentials: 'same-origin',
|
41 |
+
body: JSON.stringify(data),
|
42 |
+
}).then(function (response) {
|
43 |
+
if ( response.ok ) {
|
44 |
+
return response.json();
|
45 |
+
} else {
|
46 |
+
console.log(response);
|
47 |
+
alert( 'Something went wrong. Please contact support.' );
|
48 |
+
return false;
|
49 |
+
}
|
50 |
+
});
|
51 |
+
},
|
52 |
+
getApiFacts(ingredients) {
|
53 |
+
const data = {
|
54 |
+
ingredients,
|
55 |
+
};
|
56 |
+
|
57 |
+
return fetch(`${nutritionEndpoint}/api/facts`, {
|
58 |
+
method: 'POST',
|
59 |
+
headers: {
|
60 |
+
'X-WP-Nonce': wprm_admin.api_nonce,
|
61 |
+
'Accept': 'application/json',
|
62 |
+
'Content-Type': 'application/json',
|
63 |
+
},
|
64 |
+
credentials: 'same-origin',
|
65 |
+
body: JSON.stringify(data),
|
66 |
+
}).then(function (response) {
|
67 |
+
if ( response.ok ) {
|
68 |
+
return response.json();
|
69 |
+
} else {
|
70 |
+
console.log(response);
|
71 |
+
alert( 'Something went wrong. Please contact support.' );
|
72 |
+
return false;
|
73 |
+
}
|
74 |
+
});
|
75 |
+
},
|
76 |
+
saveCustomIngredient( id, amount, unit, name, nutrients ) {
|
77 |
+
const data = {
|
78 |
+
amount,
|
79 |
+
unit,
|
80 |
+
name,
|
81 |
+
nutrients,
|
82 |
+
};
|
83 |
+
|
84 |
+
id = parseInt( id );
|
85 |
+
const endpoint = id ? `${nutritionEndpoint}/custom/${id}` : `${nutritionEndpoint}/custom`;
|
86 |
+
const method = id ? 'PUT' : 'POST';
|
87 |
+
|
88 |
+
return fetch(endpoint, {
|
89 |
+
method,
|
90 |
+
headers: {
|
91 |
+
'X-WP-Nonce': wprm_admin.api_nonce,
|
92 |
+
'Accept': 'application/json',
|
93 |
+
'Content-Type': 'application/json',
|
94 |
+
},
|
95 |
+
credentials: 'same-origin',
|
96 |
+
body: JSON.stringify(data),
|
97 |
+
}).then(function (response) {
|
98 |
+
if ( response.ok ) {
|
99 |
+
return response.json();
|
100 |
+
} else {
|
101 |
+
console.log(response);
|
102 |
+
alert( 'Something went wrong. Please contact support.' );
|
103 |
+
return false;
|
104 |
+
}
|
105 |
+
});
|
106 |
+
},
|
107 |
+
getCustomIngredient( id ) {
|
108 |
+
return fetch(`${nutritionEndpoint}/custom/${id}`, {
|
109 |
+
method: 'GET',
|
110 |
+
headers: {
|
111 |
+
'X-WP-Nonce': wprm_admin.api_nonce,
|
112 |
+
'Accept': 'application/json',
|
113 |
+
'Content-Type': 'application/json',
|
114 |
+
},
|
115 |
+
credentials: 'same-origin',
|
116 |
+
}).then(function (response) {
|
117 |
+
if ( response.ok ) {
|
118 |
+
return response.json();
|
119 |
+
} else {
|
120 |
+
console.log(response);
|
121 |
+
alert( 'Something went wrong. Please contact support.' );
|
122 |
+
return false;
|
123 |
+
}
|
124 |
+
});
|
125 |
+
},
|
126 |
+
getCustomIngredients( search ) {
|
127 |
+
const data = {
|
128 |
+
search,
|
129 |
+
};
|
130 |
+
|
131 |
+
return fetch(`${nutritionEndpoint}/custom/search`, {
|
132 |
+
method: 'POST',
|
133 |
+
headers: {
|
134 |
+
'X-WP-Nonce': wprm_admin.api_nonce,
|
135 |
+
'Accept': 'application/json',
|
136 |
+
'Content-Type': 'application/json',
|
137 |
+
},
|
138 |
+
credentials: 'same-origin',
|
139 |
+
body: JSON.stringify(data),
|
140 |
+
}).then(function (response) {
|
141 |
+
if ( response.ok ) {
|
142 |
+
return response.json();
|
143 |
+
} else {
|
144 |
+
console.log(response);
|
145 |
+
alert( 'Something went wrong. Please contact support.' );
|
146 |
+
return false;
|
147 |
+
}
|
148 |
+
});
|
149 |
+
},
|
150 |
+
};
|
assets/js/admin-modal/recipe/nutrition-calculation/Nutrients.js
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import React from 'react';
|
2 |
+
|
3 |
+
const Nutrients = (props) => {
|
4 |
+
const facts = props.facts ? props.facts : {};
|
5 |
+
|
6 |
+
let nutrients = JSON.parse( JSON.stringify( wprm_admin_modal.nutrition ) );
|
7 |
+
delete nutrients.serving_size;
|
8 |
+
|
9 |
+
return (
|
10 |
+
<div className="wprm-admin-modal-recipe-nutrition-calculation-nutrients" id={ `wprm-admin-modal-recipe-nutrition-calculation-nutrients-${props.id}` }>
|
11 |
+
{
|
12 |
+
Object.keys(nutrients).map((nutrient, index) => {
|
13 |
+
const options = nutrients[ nutrient ];
|
14 |
+
|
15 |
+
let value = false;
|
16 |
+
|
17 |
+
if ( facts.hasOwnProperty( nutrient ) ) {
|
18 |
+
value = facts[ nutrient ];
|
19 |
+
}
|
20 |
+
|
21 |
+
return (
|
22 |
+
<div className="wprm-admin-modal-recipe-nutrition-calculation-nutrient" key={index}>
|
23 |
+
<input
|
24 |
+
type="text"
|
25 |
+
id={ `wprm-admin-modal-recipe-nutrition-calculation-nutrient-${props.id}-${index}` }
|
26 |
+
value={ value ? value : "" }
|
27 |
+
onChange={ (e) => {
|
28 |
+
const newValue = e.target.value;
|
29 |
+
props.onChange( nutrient, newValue );
|
30 |
+
}}
|
31 |
+
disabled={ ! props.hasOwnProperty( 'onChange' ) }
|
32 |
+
/>
|
33 |
+
<label
|
34 |
+
htmlFor={ `wprm-admin-modal-recipe-nutrition-calculation-nutrient-${props.id}-${index}` }
|
35 |
+
>{ options.unit } { options.label }</label>
|
36 |
+
</div>
|
37 |
+
);
|
38 |
+
})
|
39 |
+
}
|
40 |
+
</div>
|
41 |
+
);
|
42 |
+
}
|
43 |
+
export default Nutrients;
|
assets/js/admin-modal/recipe/nutrition-calculation/StepCustom.js
ADDED
@@ -0,0 +1,224 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import React, { Component, Fragment } from 'react';
|
2 |
+
|
3 |
+
import FieldText from '../../fields/FieldText';
|
4 |
+
import { formatQuantity } from '../../../../../../wp-recipe-maker-premium/assets/js/shared/quantities';
|
5 |
+
import { __wprm } from '../../../shared/Translations';
|
6 |
+
|
7 |
+
import Api from './Api';
|
8 |
+
import Nutrients from './Nutrients';
|
9 |
+
import StepCustomIngredient from './StepCustomIngredient';
|
10 |
+
|
11 |
+
export default class StepCustom extends Component {
|
12 |
+
constructor(props) {
|
13 |
+
super(props);
|
14 |
+
|
15 |
+
this.state = {
|
16 |
+
amount: '',
|
17 |
+
unit: '',
|
18 |
+
name: '',
|
19 |
+
facts: {},
|
20 |
+
savedIngredient: false,
|
21 |
+
savedAmount: false,
|
22 |
+
}
|
23 |
+
|
24 |
+
// Bind functions.
|
25 |
+
this.initCustomIngredient = this.initCustomIngredient.bind(this);
|
26 |
+
this.getSavedFacts = this.getSavedFacts.bind(this);
|
27 |
+
this.useCustomFacts = this.useCustomFacts.bind(this);
|
28 |
+
this.useSavedFacts = this.useSavedFacts.bind(this);
|
29 |
+
this.useFacts = this.useFacts.bind(this);
|
30 |
+
}
|
31 |
+
|
32 |
+
componentDidMount() {
|
33 |
+
this.initCustomIngredient();
|
34 |
+
}
|
35 |
+
|
36 |
+
componentDidUpdate( prevProps ) {
|
37 |
+
if ( this.props.index !== prevProps.index ) {
|
38 |
+
this.initCustomIngredient();
|
39 |
+
}
|
40 |
+
}
|
41 |
+
|
42 |
+
initCustomIngredient() {
|
43 |
+
const { ingredient } = this.props;
|
44 |
+
const amount = ingredient && ingredient.nutrition ? ingredient.nutrition.amount : '';
|
45 |
+
const unit = ingredient && ingredient.nutrition ? ingredient.nutrition.unit : '';
|
46 |
+
const name = ingredient ? ingredient.name : '';
|
47 |
+
|
48 |
+
this.setState({
|
49 |
+
amount,
|
50 |
+
unit,
|
51 |
+
name,
|
52 |
+
facts: {},
|
53 |
+
savedIngredient: false,
|
54 |
+
savedAmount: false,
|
55 |
+
});
|
56 |
+
}
|
57 |
+
|
58 |
+
getSavedFacts() {
|
59 |
+
let facts = {};
|
60 |
+
|
61 |
+
if ( this.state.savedIngredient && this.state.savedIngredient.nutrition ) {
|
62 |
+
// Get modifier.
|
63 |
+
let modifier = 1.0;
|
64 |
+
|
65 |
+
if ( this.state.savedAmount && parseFloat( this.state.savedAmount ) ) {
|
66 |
+
const originalAmount = this.state.savedIngredient.nutrition.amount ? parseFloat( this.state.savedIngredient.nutrition.amount ) : 1.0;
|
67 |
+
modifier = parseFloat( this.state.savedAmount ) / originalAmount;
|
68 |
+
}
|
69 |
+
|
70 |
+
// Loop over nutrients.
|
71 |
+
Object.keys( this.state.savedIngredient.nutrition.nutrients ).map((nutrient, index) => {
|
72 |
+
const value = this.state.savedIngredient.nutrition.nutrients[ nutrient ];
|
73 |
+
|
74 |
+
if ( value ) {
|
75 |
+
facts[ nutrient ] = formatQuantity( modifier * value, 1 );
|
76 |
+
}
|
77 |
+
});
|
78 |
+
}
|
79 |
+
|
80 |
+
return facts;
|
81 |
+
}
|
82 |
+
|
83 |
+
useCustomFacts( save = false ) {
|
84 |
+
if ( save ) {
|
85 |
+
if ( '' === this.state.name.trim() ) {
|
86 |
+
alert( __wprm( 'A name is required for this saved nutrition ingredient.' ) );
|
87 |
+
} else {
|
88 |
+
Api.createCustomIngredient(0, this.state.amount, this.state.unit, this.state.name, this.state.facts );
|
89 |
+
this.useFacts( this.state.facts );
|
90 |
+
}
|
91 |
+
} else {
|
92 |
+
this.useFacts( this.state.facts );
|
93 |
+
}
|
94 |
+
}
|
95 |
+
|
96 |
+
useSavedFacts() {
|
97 |
+
this.useFacts( this.getSavedFacts() );
|
98 |
+
}
|
99 |
+
|
100 |
+
useFacts(facts) {
|
101 |
+
this.props.onFactsChange( facts );
|
102 |
+
}
|
103 |
+
|
104 |
+
render() {
|
105 |
+
const { ingredient } = this.props;
|
106 |
+
|
107 |
+
if ( ! ingredient ) {
|
108 |
+
return null;
|
109 |
+
}
|
110 |
+
|
111 |
+
let ingredientName = ingredient.nutrition && ingredient.nutrition.amount ? `${ingredient.nutrition.amount} ` : '';
|
112 |
+
ingredientName += ingredient.nutrition && ingredient.nutrition.unit ? `${ingredient.nutrition.unit} ` : '';
|
113 |
+
ingredientName += ingredient.name ? ingredient.name : '';
|
114 |
+
|
115 |
+
return (
|
116 |
+
<div className="wprm-admin-modal-recipe-nutrition-calculation-custom">
|
117 |
+
<h2>{ __wprm( 'Save a new Custom Ingredient' ) }</h2>
|
118 |
+
<div className="wprm-admin-modal-recipe-nutrition-calculation-custom-ingredient">
|
119 |
+
<FieldText
|
120 |
+
type="number"
|
121 |
+
placeholder={ __wprm( 'Amount' ) }
|
122 |
+
value={ this.state.amount }
|
123 |
+
onChange={ (amount) => {
|
124 |
+
this.setState({
|
125 |
+
amount,
|
126 |
+
});
|
127 |
+
}}
|
128 |
+
/>
|
129 |
+
<FieldText
|
130 |
+
placeholder={ __wprm( 'Unit' ) }
|
131 |
+
value={ this.state.unit }
|
132 |
+
onChange={ (unit) => {
|
133 |
+
this.setState({
|
134 |
+
unit,
|
135 |
+
});
|
136 |
+
}}
|
137 |
+
/>
|
138 |
+
<FieldText
|
139 |
+
placeholder={ __wprm( 'Name (required)' ) }
|
140 |
+
value={ this.state.name }
|
141 |
+
onChange={ (name) => {
|
142 |
+
this.setState({
|
143 |
+
name
|
144 |
+
});
|
145 |
+
}}
|
146 |
+
/>
|
147 |
+
</div>
|
148 |
+
<Nutrients
|
149 |
+
id="custom-ingredient"
|
150 |
+
facts={ this.state.facts }
|
151 |
+
onChange={ (nutrient, value) => {
|
152 |
+
let facts = { ...this.state.facts };
|
153 |
+
facts[ nutrient ] = value;
|
154 |
+
|
155 |
+
this.setState({
|
156 |
+
facts,
|
157 |
+
});
|
158 |
+
}}
|
159 |
+
/>
|
160 |
+
<button
|
161 |
+
className="button button-primary"
|
162 |
+
onClick={() => {
|
163 |
+
this.useCustomFacts( true );
|
164 |
+
}}
|
165 |
+
>{ __wprm( 'Save for Later & Use' ) }</button>
|
166 |
+
<button
|
167 |
+
className="button button-primary"
|
168 |
+
onClick={() => {
|
169 |
+
this.useCustomFacts( false );
|
170 |
+
}}
|
171 |
+
>{ __wprm( 'Use' ) }</button>
|
172 |
+
<h2>{ __wprm( 'Select a saved ingredient' ) }</h2>
|
173 |
+
<StepCustomIngredient
|
174 |
+
value={false}
|
175 |
+
onValueChange={(savedIngredient) => {
|
176 |
+
// Change saved amount if same unit.
|
177 |
+
let savedAmount = savedIngredient.nutrition.amount;
|
178 |
+
|
179 |
+
if ( savedIngredient.nutrition && ingredient.nutrition && savedIngredient.nutrition.unit === ingredient.nutrition.unit ) {
|
180 |
+
savedAmount = ingredient.nutrition.amount;
|
181 |
+
}
|
182 |
+
|
183 |
+
this.setState({
|
184 |
+
savedIngredient,
|
185 |
+
savedAmount,
|
186 |
+
});
|
187 |
+
}}
|
188 |
+
defaultSearch={ this.props.ingredient.name }
|
189 |
+
/>
|
190 |
+
{
|
191 |
+
this.state.savedIngredient
|
192 |
+
?
|
193 |
+
<Fragment>
|
194 |
+
<div className="wprm-admin-modal-recipe-nutrition-calculation-custom-saved-ingredient">
|
195 |
+
<strong>{ __wprm( 'Match this equation to get the correct amounts:' ) }</strong>
|
196 |
+
<div className="wprm-admin-modal-recipe-nutrition-calculation-custom-saved-ingredient-match">
|
197 |
+
{ ingredientName } = <FieldText
|
198 |
+
type="number"
|
199 |
+
value={ this.state.savedAmount }
|
200 |
+
onChange={ (savedAmount) => {
|
201 |
+
this.setState({
|
202 |
+
savedAmount,
|
203 |
+
});
|
204 |
+
}}
|
205 |
+
/> { this.state.savedIngredient.nutrition.unit } { this.state.savedIngredient.text }
|
206 |
+
</div>
|
207 |
+
</div>
|
208 |
+
<Nutrients
|
209 |
+
id="saved-ingredient"
|
210 |
+
facts={ this.getSavedFacts() }
|
211 |
+
/>
|
212 |
+
</Fragment>
|
213 |
+
:
|
214 |
+
null
|
215 |
+
}
|
216 |
+
<button
|
217 |
+
className="button button-primary"
|
218 |
+
onClick={this.useSavedFacts}
|
219 |
+
disabled={ ! this.state.savedIngredient }
|
220 |
+
>{ __wprm( 'Use' ) }</button>
|
221 |
+
</div>
|
222 |
+
)
|
223 |
+
}
|
224 |
+
}
|
assets/js/admin-modal/recipe/nutrition-calculation/StepCustomIngredient.js
ADDED
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import React, { Component } from 'react';
|
2 |
+
import AsyncSelect from 'react-select/lib/Async';
|
3 |
+
|
4 |
+
import { __wprm } from '../../../shared/Translations';
|
5 |
+
import Api from './Api';
|
6 |
+
|
7 |
+
export default class StepCustomIngredient extends Component {
|
8 |
+
getOptions(input) {
|
9 |
+
input = input ? input : this.props.defaultSearch;
|
10 |
+
|
11 |
+
if ( ! input ) {
|
12 |
+
return Promise.resolve([]);
|
13 |
+
}
|
14 |
+
|
15 |
+
return Api.getCustomIngredients(input).then((data) => {
|
16 |
+
if ( data ) {
|
17 |
+
return data.ingredients;
|
18 |
+
} else {
|
19 |
+
return [];
|
20 |
+
}
|
21 |
+
});
|
22 |
+
}
|
23 |
+
|
24 |
+
render() {
|
25 |
+
return (
|
26 |
+
<AsyncSelect
|
27 |
+
placeholder={ __wprm( 'Select or search for a saved ingredient' ) }
|
28 |
+
value={this.props.value}
|
29 |
+
onChange={this.props.onValueChange}
|
30 |
+
getOptionValue={({id}) => id}
|
31 |
+
getOptionLabel={({text}) => text}
|
32 |
+
loadOptions={this.getOptions.bind(this)}
|
33 |
+
defaultOptions={true}
|
34 |
+
clearable={false}
|
35 |
+
menuPlacement="top"
|
36 |
+
styles={{
|
37 |
+
control: (provided) => ({
|
38 |
+
...provided,
|
39 |
+
backgroundColor: 'white',
|
40 |
+
}),
|
41 |
+
container: (provided) => ({
|
42 |
+
...provided,
|
43 |
+
width: '100%',
|
44 |
+
maxWidth: '440px',
|
45 |
+
marginBottom: '10px',
|
46 |
+
}),
|
47 |
+
}}
|
48 |
+
/>
|
49 |
+
);
|
50 |
+
}
|
51 |
+
}
|
assets/js/admin-modal/recipe/nutrition-calculation/StepMatch.js
ADDED
@@ -0,0 +1,159 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import React, { Component, Fragment } from 'react';
|
2 |
+
|
3 |
+
import Api from './Api';
|
4 |
+
import Loader from '../../../shared/Loader';
|
5 |
+
import { __wprm } from '../../../shared/Translations';
|
6 |
+
|
7 |
+
export default class StepMatch extends Component {
|
8 |
+
constructor(props) {
|
9 |
+
super(props);
|
10 |
+
|
11 |
+
this.searchInput = React.createRef();
|
12 |
+
|
13 |
+
let search = props.ingredient.nutrition.matchSearch;
|
14 |
+
let options = props.ingredient.nutrition.matchOptions;
|
15 |
+
let isSearching = false;
|
16 |
+
|
17 |
+
if ( false === options ) {
|
18 |
+
search = props.ingredient.name;
|
19 |
+
isSearching = true;
|
20 |
+
this.searchApi( search );
|
21 |
+
}
|
22 |
+
|
23 |
+
this.state = {
|
24 |
+
search,
|
25 |
+
prevSearch: search,
|
26 |
+
options,
|
27 |
+
isSearching,
|
28 |
+
}
|
29 |
+
|
30 |
+
this.onSearch = this.onSearch.bind(this);
|
31 |
+
this.searchApi = this.searchApi.bind(this);
|
32 |
+
}
|
33 |
+
|
34 |
+
componentDidMount() {
|
35 |
+
this.searchInput.current.focus();
|
36 |
+
}
|
37 |
+
|
38 |
+
onSearch() {
|
39 |
+
if ( ! this.state.isSearching && '' !== this.state.search ) {
|
40 |
+
this.setState({
|
41 |
+
isSearching: true,
|
42 |
+
}, () => {
|
43 |
+
this.searchApi( this.state.search );
|
44 |
+
});
|
45 |
+
}
|
46 |
+
}
|
47 |
+
|
48 |
+
searchApi(search) {
|
49 |
+
Api.getApiOptions(search).then((data) => {
|
50 |
+
if ( data ) {
|
51 |
+
this.setState({
|
52 |
+
options: data.matchOptions,
|
53 |
+
prevSearch: search,
|
54 |
+
isSearching: false,
|
55 |
+
});
|
56 |
+
}
|
57 |
+
});
|
58 |
+
}
|
59 |
+
|
60 |
+
render() {
|
61 |
+
const { ingredient } = this.props;
|
62 |
+
|
63 |
+
let fullIngredientText = `${ingredient.amount} ${ingredient.unit} ${ingredient.name}`;
|
64 |
+
|
65 |
+
if ( ingredient.notes ) {
|
66 |
+
fullIngredientText += ` (${ingredient.notes})`;
|
67 |
+
}
|
68 |
+
|
69 |
+
return (
|
70 |
+
<div className="wprm-admin-modal-recipe-nutrition-calculation-match">
|
71 |
+
<p><strong>{ __wprm( 'Find a match for:' ) }</strong> { fullIngredientText }</p>
|
72 |
+
<div className="wprm-admin-modal-recipe-nutrition-calculation-match-search">
|
73 |
+
<input
|
74 |
+
ref={ this.searchInput }
|
75 |
+
type="text"
|
76 |
+
value={ this.state.search }
|
77 |
+
onChange={(e) => {
|
78 |
+
this.setState({
|
79 |
+
search: e.target.value,
|
80 |
+
});
|
81 |
+
}}
|
82 |
+
onKeyDown={(e) => {
|
83 |
+
if (e.which === 13 || e.keyCode === 13) {
|
84 |
+
this.onSearch();
|
85 |
+
}
|
86 |
+
}}
|
87 |
+
disabled={ this.state.isSearching }
|
88 |
+
/>
|
89 |
+
<button
|
90 |
+
className="button button-primary"
|
91 |
+
onClick={this.onSearch}
|
92 |
+
disabled={ this.state.isSearching || '' === this.state.search || this.state.prevSearch === this.state.search }
|
93 |
+
>{ __wprm( 'Search' ) }</button>
|
94 |
+
</div>
|
95 |
+
{
|
96 |
+
this.state.isSearching
|
97 |
+
?
|
98 |
+
<Loader />
|
99 |
+
:
|
100 |
+
<Fragment>
|
101 |
+
{
|
102 |
+
! this.state.options
|
103 |
+
|| 0 === this.state.options.length
|
104 |
+
?
|
105 |
+
<Fragment>
|
106 |
+
{
|
107 |
+
this.state.prevSearch
|
108 |
+
?
|
109 |
+
<p>{ __wprm( 'No ingredients found for' ) } "{ this.state.prevSearch }".</p>
|
110 |
+
:
|
111 |
+
<p>{ __wprm( 'No ingredients found.' ) }</p>
|
112 |
+
}
|
113 |
+
</Fragment>
|
114 |
+
:
|
115 |
+
<Fragment>
|
116 |
+
{
|
117 |
+
false !== this.state.prevSearch
|
118 |
+
&&
|
119 |
+
<p>{ __wprm( 'Results for' ) } "{ this.state.prevSearch }":</p>
|
120 |
+
}
|
121 |
+
<div className="wprm-admin-modal-recipe-nutrition-calculation-matches">
|
122 |
+
{
|
123 |
+
this.state.options.map((match, index) => (
|
124 |
+
<div
|
125 |
+
className="wprm-admin-modal-recipe-nutrition-calculation-matches-option"
|
126 |
+
onClick={() => {
|
127 |
+
this.props.onMatchChange({
|
128 |
+
match,
|
129 |
+
matchSearch: this.state.search,
|
130 |
+
matchOptions: this.state.options,
|
131 |
+
});
|
132 |
+
}}
|
133 |
+
key={index}
|
134 |
+
>
|
135 |
+
{
|
136 |
+
match.image
|
137 |
+
?
|
138 |
+
<img
|
139 |
+
className="wprm-admin-modal-recipe-nutrition-calculation-matches-option-image"
|
140 |
+
src={ `https://spoonacular.com/cdn/ingredients_100x100/${match.image}` }
|
141 |
+
/>
|
142 |
+
:
|
143 |
+
null
|
144 |
+
}
|
145 |
+
<div
|
146 |
+
className="wprm-admin-modal-recipe-nutrition-calculation-matches-option-name"
|
147 |
+
>{ match.name }{ match.aisle ? ` (${ match.aisle.toLowerCase() })` : ''}</div>
|
148 |
+
</div>
|
149 |
+
))
|
150 |
+
}
|
151 |
+
</div>
|
152 |
+
</Fragment>
|
153 |
+
}
|
154 |
+
</Fragment>
|
155 |
+
}
|
156 |
+
</div>
|
157 |
+
);
|
158 |
+
}
|
159 |
+
}
|
assets/js/admin-modal/recipe/nutrition-calculation/StepSource.js
ADDED
@@ -0,0 +1,104 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import React from 'react';
|
2 |
+
|
3 |
+
import { __wprm } from '../../../shared/Translations';
|
4 |
+
import FieldText from '../../fields/FieldText';
|
5 |
+
import FieldDropdown from '../../fields/FieldDropdown';
|
6 |
+
|
7 |
+
const StepSource = (props) => {
|
8 |
+
if ( ! props.ingredients.length ) {
|
9 |
+
return (
|
10 |
+
<p>{ __wprm( 'No ingredients set for this recipe.' ) }</p>
|
11 |
+
);
|
12 |
+
}
|
13 |
+
|
14 |
+
return (
|
15 |
+
<table className="wprm-admin-modal-recipe-nutrition-calculation-source">
|
16 |
+
<thead>
|
17 |
+
<tr>
|
18 |
+
<th>{ __wprm( 'Used in Recipe' ) }</th>
|
19 |
+
<th>{ __wprm( 'Used for Calculation' ) }</th>
|
20 |
+
<th>{ __wprm( 'Nutrition Source' ) }</th>
|
21 |
+
<th>{ __wprm( 'API Match' ) }</th>
|
22 |
+
</tr>
|
23 |
+
</thead>
|
24 |
+
<tbody>
|
25 |
+
{
|
26 |
+
props.ingredients.map( ( ingredient, index ) => {
|
27 |
+
let apiMatchFound = false;
|
28 |
+
|
29 |
+
if ( ingredient.nutrition.match && 'api' === ingredient.nutrition.source && ingredient.nutrition.match.id && 'custom' !== ingredient.nutrition.match.source ) {
|
30 |
+
apiMatchFound = true;
|
31 |
+
}
|
32 |
+
|
33 |
+
return (
|
34 |
+
<tr key={ index }>
|
35 |
+
<td>{ `${ ingredient.amount} ${ ingredient.unit }` }</td>
|
36 |
+
<td>
|
37 |
+
<FieldText
|
38 |
+
type="number"
|
39 |
+
value={ ingredient.nutrition.amount }
|
40 |
+
onChange={ (amount) => {
|
41 |
+
props.onIngredientChange( index, { amount } );
|
42 |
+
}}
|
43 |
+
/>
|
44 |
+
<FieldText
|
45 |
+
value={ ingredient.nutrition.unit }
|
46 |
+
onChange={ (unit) => {
|
47 |
+
props.onIngredientChange( index, { unit } );
|
48 |
+
}}
|
49 |
+
/>
|
50 |
+
{ ingredient.name } { ingredient.notes ? ` (${ingredient.notes})` : '' }
|
51 |
+
</td>
|
52 |
+
<td>
|
53 |
+
<FieldDropdown
|
54 |
+
options={[
|
55 |
+
{
|
56 |
+
value: 'api',
|
57 |
+
label: __wprm( 'API' ),
|
58 |
+
},
|
59 |
+
{
|
60 |
+
value: 'custom',
|
61 |
+
label: __wprm( 'Saved/Custom' ),
|
62 |
+
}
|
63 |
+
]}
|
64 |
+
value={ ingredient.nutrition.source }
|
65 |
+
onChange={ (source) => {
|
66 |
+
props.onIngredientChange( index, { source } );
|
67 |
+
}}
|
68 |
+
width={ 150 }
|
69 |
+
/>
|
70 |
+
</td>
|
71 |
+
<td>
|
72 |
+
{
|
73 |
+
'api' === ingredient.nutrition.source
|
74 |
+
&&
|
75 |
+
<a
|
76 |
+
href="#"
|
77 |
+
onClick={(e) => {
|
78 |
+
e.preventDefault();
|
79 |
+
|
80 |
+
props.onStepChange( 'match', {
|
81 |
+
index,
|
82 |
+
} );
|
83 |
+
}}
|
84 |
+
className={ apiMatchFound ? '' : 'wprm-admin-modal-recipe-nutrition-calculation-source-no-match' }
|
85 |
+
>
|
86 |
+
{
|
87 |
+
apiMatchFound
|
88 |
+
?
|
89 |
+
`${ingredient.nutrition.match.name}${ ingredient.nutrition.match.aisle ? ` (${ ingredient.nutrition.match.aisle.toLowerCase() })` : ''}`
|
90 |
+
:
|
91 |
+
__wprm( 'no match found' )
|
92 |
+
}
|
93 |
+
</a>
|
94 |
+
}
|
95 |
+
</td>
|
96 |
+
</tr>
|
97 |
+
)
|
98 |
+
})
|
99 |
+
}
|
100 |
+
</tbody>
|
101 |
+
</table>
|
102 |
+
);
|
103 |
+
}
|
104 |
+
export default StepSource;
|
assets/js/admin-modal/recipe/nutrition-calculation/StepSummary.js
ADDED
@@ -0,0 +1,146 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import React, { Component, Fragment } from 'react';
|
2 |
+
|
3 |
+
import { formatQuantity } from '../../../../../../wp-recipe-maker-premium/assets/js/shared/quantities';
|
4 |
+
import { __wprm } from '../../../shared/Translations';
|
5 |
+
|
6 |
+
import Nutrients from './Nutrients';
|
7 |
+
|
8 |
+
class IngredientList extends Component {
|
9 |
+
constructor(props) {
|
10 |
+
super(props);
|
11 |
+
|
12 |
+
this.state = {
|
13 |
+
editingIndex: false,
|
14 |
+
}
|
15 |
+
}
|
16 |
+
|
17 |
+
render() {
|
18 |
+
return (
|
19 |
+
<div className="wprm-admin-modal-recipe-nutrition-calculation-summary-ingredients">
|
20 |
+
{ this.props.ingredients.map( (ingredient, index) => {
|
21 |
+
let ingredientName = ingredient.amount ? `${ingredient.amount} ` : '';
|
22 |
+
ingredientName += ingredient.unit ? `${ingredient.unit} ` : '';
|
23 |
+
ingredientName += ingredient.name ? ingredient.name : '';
|
24 |
+
|
25 |
+
const hasMatch = ! ! ingredient.nutrition.match;
|
26 |
+
|
27 |
+
// Get name of match with nutrition summary.
|
28 |
+
let matchName = hasMatch && ingredient.nutrition.match.name ? ingredient.nutrition.match.name : __wprm( 'n/a' );
|
29 |
+
|
30 |
+
let nutritionSummary = [];
|
31 |
+
if ( ingredient.nutrition.facts ) {
|
32 |
+
const summaryNutrients = ['calories', 'carbohydrates', 'fat', 'protein'];
|
33 |
+
|
34 |
+
for ( let nutrient of summaryNutrients ) {
|
35 |
+
if ( ingredient.nutrition.facts[ nutrient ] ) {
|
36 |
+
const value = formatQuantity( ingredient.nutrition.facts[ nutrient ], 0 );
|
37 |
+
nutritionSummary.push( `${ wprm_admin_modal.nutrition[ nutrient ].label }: ${ value }${ wprm_admin_modal.nutrition[ nutrient ].unit }` );
|
38 |
+
}
|
39 |
+
}
|
40 |
+
}
|
41 |
+
|
42 |
+
if ( 0 < nutritionSummary.length ) {
|
43 |
+
matchName += ` - ${ nutritionSummary.join(' | ') }`;
|
44 |
+
}
|
45 |
+
|
46 |
+
return (
|
47 |
+
<div className="wprm-admin-modal-recipe-nutrition-calculation-summary-ingredient-container" key={index}>
|
48 |
+
<div className={`wprm-admin-modal-recipe-nutrition-calculation-summary-ingredient${ ingredient.nutrition.factsUsed ? '' : ' wprm-admin-modal-recipe-nutrition-calculation-summary-ingredient-not-used' }`}>
|
49 |
+
<div className="wprm-admin-modal-recipe-nutrition-calculation-summary-ingredient-select">
|
50 |
+
<input
|
51 |
+
id={ `wprm-admin-modal-recipe-nutrition-calculation-summary-ingredient-${index}` }
|
52 |
+
type="checkbox"
|
53 |
+
checked={ ingredient.nutrition.factsUsed }
|
54 |
+
onChange={(e) => {
|
55 |
+
this.props.onChangeNutrition( index, {
|
56 |
+
factsUsed: e.target.checked,
|
57 |
+
})
|
58 |
+
}}
|
59 |
+
/>
|
60 |
+
<label
|
61 |
+
htmlFor={ `wprm-admin-modal-recipe-nutrition-calculation-summary-ingredient-${index}` }
|
62 |
+
>
|
63 |
+
{ ingredientName }
|
64 |
+
</label>
|
65 |
+
</div>
|
66 |
+
<a
|
67 |
+
href="#"
|
68 |
+
onClick={(e) => {
|
69 |
+
e.preventDefault();
|
70 |
+
|
71 |
+
this.setState({
|
72 |
+
editingIndex: index === this.state.editingIndex ? false : index,
|
73 |
+
});
|
74 |
+
}}
|
75 |
+
className={ hasMatch ? 'wprm-admin-modal-recipe-nutrition-calculation-summary-ingredient-match' : 'wprm-admin-modal-recipe-nutrition-calculation-summary-ingredient-no-match' }
|
76 |
+
style={ index === this.state.editingIndex ? { fontWeight: 'bold' } : null }
|
77 |
+
>
|
78 |
+
{ matchName }
|
79 |
+
</a>
|
80 |
+
</div>
|
81 |
+
{
|
82 |
+
index === this.state.editingIndex
|
83 |
+
&&
|
84 |
+
<Nutrients
|
85 |
+
id={ `${this.props.id}-ingredients` }
|
86 |
+
facts={ ingredient.nutrition.facts }
|
87 |
+
onChange={ (nutrient, value) => {
|
88 |
+
let facts = { ...ingredient.nutrition.facts };
|
89 |
+
facts[ nutrient ] = value;
|
90 |
+
|
91 |
+
this.props.onChangeNutrition( index, { facts } );
|
92 |
+
}}
|
93 |
+
/>
|
94 |
+
}
|
95 |
+
</div>
|
96 |
+
)
|
97 |
+
} ) }
|
98 |
+
</div>
|
99 |
+
);
|
100 |
+
}
|
101 |
+
}
|
102 |
+
|
103 |
+
const StepSummary = (props) => {
|
104 |
+
return (
|
105 |
+
<div className="wprm-admin-modal-recipe-nutrition-calculation-summary">
|
106 |
+
{
|
107 |
+
props.servings
|
108 |
+
?
|
109 |
+
<p>{ __wprm( 'Values of all the checked ingredients will be added together and' ) } <strong>{ __wprm( 'divided by' ) } { props.servings }</strong>, { __wprm( 'the number of servings for this recipe.' ) }</p>
|
110 |
+
:
|
111 |
+
<p>{__wprm( 'Values of all the checked ingredients will be added together.' ) }</p>
|
112 |
+
}
|
113 |
+
{
|
114 |
+
0 < props.apiIngredients.length
|
115 |
+
&&
|
116 |
+
<Fragment>
|
117 |
+
<h2>{ __wprm( 'API Ingredients' ) }</h2>
|
118 |
+
<IngredientList
|
119 |
+
id="api"
|
120 |
+
ingredients={ props.apiIngredients }
|
121 |
+
onChangeNutrition={props.onApiIngredientsChange}
|
122 |
+
/>
|
123 |
+
</Fragment>
|
124 |
+
}
|
125 |
+
{
|
126 |
+
0 < props.customIngredients.length
|
127 |
+
&&
|
128 |
+
<Fragment>
|
129 |
+
<h2>{ __wprm( 'Custom Ingredients' ) }</h2>
|
130 |
+
<IngredientList
|
131 |
+
id="custom"
|
132 |
+
ingredients={ props.customIngredients }
|
133 |
+
onChangeNutrition={props.onCustomIngredientsChange}
|
134 |
+
/>
|
135 |
+
</Fragment>
|
136 |
+
}
|
137 |
+
<h2>{ __wprm( 'Recipe Nutrition Facts Preview' ) }</h2>
|
138 |
+
<p>{ __wprm( 'Changes to these values can be made after confirming with the blue button.' ) }</p>
|
139 |
+
<Nutrients
|
140 |
+
id="summary-preview"
|
141 |
+
facts={ props.recipeFactsPreview }
|
142 |
+
/>
|
143 |
+
</div>
|
144 |
+
);
|
145 |
+
}
|
146 |
+
export default StepSummary;
|
assets/js/admin-modal/recipe/nutrition-calculation/index.js
ADDED
@@ -0,0 +1,347 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import React, { Component, Fragment } from 'react';
|
2 |
+
|
3 |
+
import '../../../../css/admin/modal/recipe/nutrition-calculation.scss';
|
4 |
+
|
5 |
+
import Header from '../../general/Header';
|
6 |
+
import Footer from '../../general/Footer';
|
7 |
+
|
8 |
+
import Api from './Api';
|
9 |
+
import StepSource from './StepSource';
|
10 |
+
import StepMatch from './StepMatch';
|
11 |
+
import StepCustom from './StepCustom';
|
12 |
+
import StepSummary from './StepSummary';
|
13 |
+
|
14 |
+
import { parseQuantity, formatQuantity } from '../../../../../../wp-recipe-maker-premium/assets/js/shared/quantities';
|
15 |
+
import { __wprm } from '../../../shared/Translations';
|
16 |
+
import Loader from '../../../shared/Loader';
|
17 |
+
|
18 |
+
export default class NutritionCalculation extends Component {
|
19 |
+
constructor(props) {
|
20 |
+
super(props);
|
21 |
+
|
22 |
+
// Remove ingredient groups and ingredients without a name
|
23 |
+
let ingredients = props.ingredients.filter( ( ingredient ) => ingredient.type === 'ingredient' && ingredient.name );
|
24 |
+
|
25 |
+
// Parse quantities.
|
26 |
+
ingredients = ingredients.map( ( ingredient ) => {
|
27 |
+
// Strip HTML and shortcodes from unit.
|
28 |
+
let unit = ingredient.unit;
|
29 |
+
unit = unit.replace( /(<([^>]+)>)/ig, '' );
|
30 |
+
unit = unit.replace( /(\[([^\]]+)\])/ig, '' );
|
31 |
+
|
32 |
+
ingredient.nutrition = {
|
33 |
+
amount: parseQuantity( ingredient.amount ),
|
34 |
+
unit,
|
35 |
+
}
|
36 |
+
|
37 |
+
return ingredient;
|
38 |
+
});
|
39 |
+
|
40 |
+
Api.getMatches(ingredients).then((data) => {
|
41 |
+
if ( data ) {
|
42 |
+
this.setState({
|
43 |
+
ingredients: data.ingredients,
|
44 |
+
calculating: false,
|
45 |
+
});
|
46 |
+
} else {
|
47 |
+
this.setState({
|
48 |
+
calculating: false,
|
49 |
+
});
|
50 |
+
}
|
51 |
+
});
|
52 |
+
|
53 |
+
this.state = {
|
54 |
+
step: 'source',
|
55 |
+
stepArgs: {},
|
56 |
+
ingredients: [],
|
57 |
+
apiIngredients: [],
|
58 |
+
customIngredients: [],
|
59 |
+
calculating: true,
|
60 |
+
};
|
61 |
+
|
62 |
+
// Bind functions.
|
63 |
+
this.onStepChange = this.onStepChange.bind(this);
|
64 |
+
this.onIngredientChange = this.onIngredientChange.bind(this);
|
65 |
+
}
|
66 |
+
|
67 |
+
componentDidUpdate( prevProps, prevState ) {
|
68 |
+
// Get facts for the API ingredients and check if there are any custom ingredients to do.
|
69 |
+
if ( 'source' === prevState.step && 'summary' === this.state.step ) {
|
70 |
+
const apiIngredients = this.state.ingredients.filter( (ingredient) => 'api' === ingredient.nutrition.source );
|
71 |
+
const customIngredients = this.state.ingredients.filter( (ingredient) => 'custom' === ingredient.nutrition.source );
|
72 |
+
|
73 |
+
let calculating = false;
|
74 |
+
let step = 'summary';
|
75 |
+
|
76 |
+
if ( 0 < apiIngredients.length ) {
|
77 |
+
calculating = true;
|
78 |
+
|
79 |
+
Api.getApiFacts(apiIngredients).then((data) => {
|
80 |
+
if ( data ) {
|
81 |
+
this.setState({
|
82 |
+
calculating: false,
|
83 |
+
apiIngredients: data.ingredients,
|
84 |
+
});
|
85 |
+
} else {
|
86 |
+
this.setState({
|
87 |
+
calculating: false,
|
88 |
+
});
|
89 |
+
}
|
90 |
+
});
|
91 |
+
}
|
92 |
+
|
93 |
+
if ( 0 < customIngredients.length ) {
|
94 |
+
step = 'custom';
|
95 |
+
}
|
96 |
+
|
97 |
+
this.setState({
|
98 |
+
calculating,
|
99 |
+
customIngredients,
|
100 |
+
step,
|
101 |
+
});
|
102 |
+
}
|
103 |
+
|
104 |
+
// Check if there are any custom ingredients left to do.
|
105 |
+
if ( 'custom' === this.state.step ) {
|
106 |
+
const customIngredientsTodo = this.state.customIngredients.filter( (ingredient) => ! ingredient.nutrition.hasOwnProperty('facts') );
|
107 |
+
|
108 |
+
// No more custom ingredients left, go to summary.
|
109 |
+
if ( 0 === customIngredientsTodo.length ) {
|
110 |
+
this.setState({
|
111 |
+
step: 'summary',
|
112 |
+
});
|
113 |
+
}
|
114 |
+
}
|
115 |
+
}
|
116 |
+
|
117 |
+
onStepChange(step, stepArgs = {} ) {
|
118 |
+
this.setState({
|
119 |
+
step,
|
120 |
+
stepArgs,
|
121 |
+
});
|
122 |
+
}
|
123 |
+
|
124 |
+
onIngredientChange(index, nutrition) {
|
125 |
+
let ingredients = JSON.parse( JSON.stringify( this.state.ingredients ) );
|
126 |
+
|
127 |
+
ingredients[index].nutrition = {
|
128 |
+
...ingredients[index].nutrition,
|
129 |
+
...nutrition,
|
130 |
+
}
|
131 |
+
|
132 |
+
this.setState({
|
133 |
+
ingredients,
|
134 |
+
});
|
135 |
+
}
|
136 |
+
|
137 |
+
getRecipeFacts() {
|
138 |
+
let nutrients = JSON.parse( JSON.stringify( wprm_admin_modal.nutrition ) );
|
139 |
+
delete nutrients.serving_size;
|
140 |
+
|
141 |
+
let facts = {};
|
142 |
+
|
143 |
+
const servings = this.props.servings && parseInt( this.props.servings ) > 0 ? parseInt( this.props.servings ) : 1;
|
144 |
+
|
145 |
+
for ( let field in nutrients ) {
|
146 |
+
let value = false;
|
147 |
+
|
148 |
+
for ( let ingredient of this.state.apiIngredients.concat( this.state.customIngredients ) ) {
|
149 |
+
if ( ingredient.nutrition.factsUsed && ingredient.nutrition.facts && ingredient.nutrition.facts[ field ] ) {
|
150 |
+
if ( value ) {
|
151 |
+
value += parseFloat( ingredient.nutrition.facts[ field ] );
|
152 |
+
} else {
|
153 |
+
value = parseFloat( ingredient.nutrition.facts[ field ] );
|
154 |
+
}
|
155 |
+
}
|
156 |
+
}
|
157 |
+
|
158 |
+
if ( value ) {
|
159 |
+
value = value / servings;
|
160 |
+
|
161 |
+
// TODO setting to change default rounding?
|
162 |
+
if ( '%' === nutrients[ field ].unit ) {
|
163 |
+
value = formatQuantity( value, 1 );
|
164 |
+
} else {
|
165 |
+
value = formatQuantity( value, 0 );
|
166 |
+
}
|
167 |
+
}
|
168 |
+
|
169 |
+
facts[ field ] = value;
|
170 |
+
}
|
171 |
+
|
172 |
+
return facts;
|
173 |
+
}
|
174 |
+
|
175 |
+
render() {
|
176 |
+
let step = null;
|
177 |
+
switch ( this.state.step ) {
|
178 |
+
case 'source':
|
179 |
+
step = (
|
180 |
+
<StepSource
|
181 |
+
ingredients={ this.state.ingredients }
|
182 |
+
onIngredientChange={ this.onIngredientChange }
|
183 |
+
onStepChange={ this.onStepChange }
|
184 |
+
/>
|
185 |
+
);
|
186 |
+
break;
|
187 |
+
case 'match':
|
188 |
+
const ingredientIndex = this.state.stepArgs.index;
|
189 |
+
|
190 |
+
step = (
|
191 |
+
<StepMatch
|
192 |
+
ingredient={ this.state.ingredients[ ingredientIndex ] }
|
193 |
+
onMatchChange={ (match) => {
|
194 |
+
this.onIngredientChange( ingredientIndex, {
|
195 |
+
...match,
|
196 |
+
});
|
197 |
+
this.onStepChange('source');
|
198 |
+
}}
|
199 |
+
/>
|
200 |
+
);
|
201 |
+
break;
|
202 |
+
case 'custom':
|
203 |
+
// Get the first one that doesn't have nutrition facts.
|
204 |
+
const todoIndex = this.state.customIngredients.findIndex( (ingredient) => ! ingredient.nutrition.hasOwnProperty('facts') );
|
205 |
+
|
206 |
+
step = (
|
207 |
+
<StepCustom
|
208 |
+
index={ todoIndex }
|
209 |
+
ingredient={ this.state.customIngredients[ todoIndex ] }
|
210 |
+
onFactsChange={ (facts) => {
|
211 |
+
let customIngredients = JSON.parse( JSON.stringify( this.state.customIngredients ) );
|
212 |
+
customIngredients[ todoIndex ].nutrition.facts = facts;
|
213 |
+
|
214 |
+
this.setState({
|
215 |
+
customIngredients,
|
216 |
+
});
|
217 |
+
}}
|
218 |
+
/>
|
219 |
+
);
|
220 |
+
break;
|
221 |
+
case 'summary':
|
222 |
+
step = (
|
223 |
+
<StepSummary
|
224 |
+
servings={ this.props.servings }
|
225 |
+
recipeFactsPreview={ this.getRecipeFacts() }
|
226 |
+
apiIngredients={ this.state.apiIngredients }
|
227 |
+
customIngredients={ this.state.customIngredients }
|
228 |
+
onApiIngredientsChange={ (index, nutrition) => {
|
229 |
+
let ingredients = JSON.parse( JSON.stringify( this.state.apiIngredients ) );
|
230 |
+
|
231 |
+
ingredients[index].nutrition = {
|
232 |
+
...ingredients[index].nutrition,
|
233 |
+
...nutrition,
|
234 |
+
}
|
235 |
+
|
236 |
+
this.setState({
|
237 |
+
apiIngredients: ingredients,
|
238 |
+
});
|
239 |
+
}}
|
240 |
+
onCustomIngredientsChange={ (index, nutrition) => {
|
241 |
+
let ingredients = JSON.parse( JSON.stringify( this.state.customIngredients ) );
|
242 |
+
|
243 |
+
ingredients[index].nutrition = {
|
244 |
+
...ingredients[index].nutrition,
|
245 |
+
...nutrition,
|
246 |
+
}
|
247 |
+
|
248 |
+
this.setState({
|
249 |
+
customIngredients: ingredients,
|
250 |
+
});
|
251 |
+
}}
|
252 |
+
/>
|
253 |
+
);
|
254 |
+
break;
|
255 |
+
}
|
256 |
+
|
257 |
+
let buttons = null;
|
258 |
+
|
259 |
+
const backButton = (
|
260 |
+
<button
|
261 |
+
className="button"
|
262 |
+
onClick={() => {
|
263 |
+
this.onStepChange( 'source' );
|
264 |
+
}}
|
265 |
+
>
|
266 |
+
{ __wprm( 'Go Back' ) }
|
267 |
+
</button>
|
268 |
+
);
|
269 |
+
|
270 |
+
switch ( this.state.step ) {
|
271 |
+
case 'source':
|
272 |
+
buttons = (
|
273 |
+
<Fragment>
|
274 |
+
<button
|
275 |
+
className="button"
|
276 |
+
onClick={ this.props.onCancel }
|
277 |
+
>
|
278 |
+
{ __wprm( 'Cancel Calculation' ) }
|
279 |
+
</button>
|
280 |
+
<button
|
281 |
+
className="button button-primary"
|
282 |
+
onClick={() => {
|
283 |
+
this.onStepChange( 'summary' );
|
284 |
+
}}
|
285 |
+
>
|
286 |
+
{ __wprm( 'Go to Next Step' ) }
|
287 |
+
</button>
|
288 |
+
</Fragment>
|
289 |
+
);
|
290 |
+
break;
|
291 |
+
case 'match':
|
292 |
+
buttons = (
|
293 |
+
<Fragment>
|
294 |
+
{ backButton }
|
295 |
+
</Fragment>
|
296 |
+
);
|
297 |
+
break;
|
298 |
+
case 'summary':
|
299 |
+
buttons = (
|
300 |
+
<Fragment>
|
301 |
+
{ backButton }
|
302 |
+
<button
|
303 |
+
className="button button-primary"
|
304 |
+
onClick={() => {
|
305 |
+
const calculated = this.getRecipeFacts();
|
306 |
+
this.props.onNutritionChange( calculated );
|
307 |
+
}}
|
308 |
+
>
|
309 |
+
{ __wprm( 'Use These Values' ) }
|
310 |
+
</button>
|
311 |
+
</Fragment>
|
312 |
+
);
|
313 |
+
break;
|
314 |
+
}
|
315 |
+
|
316 |
+
return (
|
317 |
+
<Fragment>
|
318 |
+
<Header
|
319 |
+
onCloseModal={ this.props.onCloseModal }
|
320 |
+
>
|
321 |
+
{
|
322 |
+
this.props.name
|
323 |
+
?
|
324 |
+
`${this.props.name} - ${ __wprm( 'Nutrition Calculation' ) }`
|
325 |
+
:
|
326 |
+
`${ __wprm( 'Recipe' ) } - ${ __wprm( 'Nutrition Calculation' ) }`
|
327 |
+
}
|
328 |
+
</Header>
|
329 |
+
<div className="wprm-admin-modal-recipe-nutrition-calculation">
|
330 |
+
{
|
331 |
+
this.state.calculating
|
332 |
+
&& 'custom' !== this.state.step
|
333 |
+
?
|
334 |
+
<Loader />
|
335 |
+
:
|
336 |
+
step
|
337 |
+
}
|
338 |
+
</div>
|
339 |
+
<Footer
|
340 |
+
savingChanges={ this.state.calculating && 'custom' !== this.state.step }
|
341 |
+
>
|
342 |
+
{ buttons }
|
343 |
+
</Footer>
|
344 |
+
</Fragment>
|
345 |
+
);
|
346 |
+
}
|
347 |
+
}
|
assets/js/admin-modal/recipe/text-import/Api.js
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
const modalEndpoint = wprm_admin.endpoints.modal;
|
2 |
+
|
3 |
+
export default {
|
4 |
+
parseIngredients(ingredients) {
|
5 |
+
const data = {
|
6 |
+
ingredients,
|
7 |
+
};
|
8 |
+
|
9 |
+
return fetch(`${modalEndpoint}/ingredient/parse`, {
|
10 |
+
method: 'POST',
|
11 |
+
headers: {
|
12 |
+
'X-WP-Nonce': wprm_admin.api_nonce,
|
13 |
+
'Accept': 'application/json',
|
14 |
+
'Content-Type': 'application/json',
|
15 |
+
},
|
16 |
+
credentials: 'same-origin',
|
17 |
+
body: JSON.stringify(data),
|
18 |
+
}).then(function (response) {
|
19 |
+
if ( response.ok ) {
|
20 |
+
return response.json();
|
21 |
+
} else {
|
22 |
+
console.log(response);
|
23 |
+
alert( 'Something went wrong. Please contact support.' );
|
24 |
+
return false;
|
25 |
+
}
|
26 |
+
});
|
27 |
+
},
|
28 |
+
};
|
assets/js/admin-modal/recipe/text-import/SelectGroups.js
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import React from 'react';
|
2 |
+
|
3 |
+
const SelectGroups = (props) => {
|
4 |
+
return (
|
5 |
+
<div className="wprm-admin-modal-field-text-import-groups">
|
6 |
+
{
|
7 |
+
props.value.map((field, index) => (
|
8 |
+
<div className="wprm-admin-modal-field-text-import-groups-field" key={index}>
|
9 |
+
<input
|
10 |
+
type="checkbox"
|
11 |
+
checked={ field.group }
|
12 |
+
onChange={(e) => {
|
13 |
+
let newFields = JSON.parse( JSON.stringify( props.value ) );
|
14 |
+
newFields[ index ].group = e.target.checked;
|
15 |
+
props.onChange(newFields);
|
16 |
+
} }
|
17 |
+
/>
|
18 |
+
<input
|
19 |
+
type="text"
|
20 |
+
value={ field.text }
|
21 |
+
style={ field.group ? { fontWeight: 'bold' } : null }
|
22 |
+
onChange={(e) => {
|
23 |
+
let newFields = JSON.parse( JSON.stringify( props.value ) );
|
24 |
+
newFields[ index ].text = e.target.value;
|
25 |
+
props.onChange(newFields);
|
26 |
+
} }
|
27 |
+
/>
|
28 |
+
</div>
|
29 |
+
))
|
30 |
+
}
|
31 |
+
</div>
|
32 |
+
);
|
33 |
+
}
|
34 |
+
export default SelectGroups;
|
assets/js/admin-modal/recipe/text-import/index.js
ADDED
@@ -0,0 +1,326 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import React, { Component, Fragment } from 'react';
|
2 |
+
|
3 |
+
import '../../../../css/admin/modal/text-import.scss';
|
4 |
+
|
5 |
+
import Header from '../../general/Header';
|
6 |
+
import Footer from '../../general/Footer';
|
7 |
+
import { __wprm } from '../../../shared/Translations';
|
8 |
+
|
9 |
+
import FieldContainer from '../../fields/FieldContainer';
|
10 |
+
import FieldText from '../../fields/FieldText';
|
11 |
+
import FieldTextarea from '../../fields/FieldTextarea';
|
12 |
+
|
13 |
+
import Api from './Api';
|
14 |
+
import SelectGroups from './SelectGroups';
|
15 |
+
|
16 |
+
export default class TextImport extends Component {
|
17 |
+
constructor(props) {
|
18 |
+
super(props);
|
19 |
+
|
20 |
+
this.textInput = React.createRef();
|
21 |
+
|
22 |
+
this.state = {
|
23 |
+
text: props.text ? props.text : '',
|
24 |
+
name: false,
|
25 |
+
summary: false,
|
26 |
+
ingredients: false,
|
27 |
+
instructions: false,
|
28 |
+
notes: false,
|
29 |
+
isParsing: false,
|
30 |
+
};
|
31 |
+
|
32 |
+
this.setSelection = this.setSelection.bind(this);
|
33 |
+
this.useValues = this.useValues.bind(this);
|
34 |
+
}
|
35 |
+
|
36 |
+
componentDidMount() {
|
37 |
+
this.textInput.current.focus();
|
38 |
+
}
|
39 |
+
|
40 |
+
setSelection( field ) {
|
41 |
+
const textArea = this.textInput.current;
|
42 |
+
let selection = textArea.value.substring( textArea.selectionStart, textArea.selectionEnd );
|
43 |
+
|
44 |
+
selection = selection ? selection : false;
|
45 |
+
|
46 |
+
if ( 'ingredients' === field || 'instructions' === field ) {
|
47 |
+
selection = this.getSeperateFields( selection );
|
48 |
+
}
|
49 |
+
|
50 |
+
if ( selection !== this.state[ field ] ) {
|
51 |
+
let newState = {};
|
52 |
+
newState[ field ] = selection;
|
53 |
+
this.setState(newState);
|
54 |
+
}
|
55 |
+
}
|
56 |
+
|
57 |
+
getSeperateFields( content ) {
|
58 |
+
if ( false === content ) {
|
59 |
+
return false;
|
60 |
+
}
|
61 |
+
|
62 |
+
let fields = [];
|
63 |
+
let lines = content.split(/[\r\n]+/);
|
64 |
+
|
65 |
+
// Loop over all lines in selection.
|
66 |
+
for ( let line of lines ) {
|
67 |
+
// Trim and remove bullet points.
|
68 |
+
line = line.trim();
|
69 |
+
line = line.replace(/\d\.\s+|[a-z]\)\s+|•\s+|[A-Z]\.\s+|[IVX]+\.\s+/g, '');
|
70 |
+
|
71 |
+
if ( line ) {
|
72 |
+
fields.push({
|
73 |
+
group: false,
|
74 |
+
text: line,
|
75 |
+
});
|
76 |
+
}
|
77 |
+
}
|
78 |
+
|
79 |
+
// Return false if there weren't any non-empty lines.
|
80 |
+
if ( ! fields.length ) {
|
81 |
+
return false;
|
82 |
+
}
|
83 |
+
|
84 |
+
return fields;
|
85 |
+
}
|
86 |
+
|
87 |
+
useValues() {
|
88 |
+
let newRecipe = {};
|
89 |
+
|
90 |
+
// Simple matching.
|
91 |
+
if ( false !== this.state.name ) { newRecipe.name = this.state.name }
|
92 |
+
if ( false !== this.state.summary ) { newRecipe.summary = this.state.summary }
|
93 |
+
if ( false !== this.state.notes ) { newRecipe.notes = this.state.notes }
|
94 |
+
|
95 |
+
// Instructions.
|
96 |
+
if ( false !== this.state.instructions ) {
|
97 |
+
let instructions_flat = [];
|
98 |
+
|
99 |
+
this.state.instructions.map( ( instruction, index ) => {
|
100 |
+
if ( instruction.group ) {
|
101 |
+
instructions_flat.push({
|
102 |
+
uid: index,
|
103 |
+
type: 'group',
|
104 |
+
name: instruction.text,
|
105 |
+
});
|
106 |
+
} else {
|
107 |
+
instructions_flat.push({
|
108 |
+
uid: index,
|
109 |
+
type: 'instruction',
|
110 |
+
text: instruction.text,
|
111 |
+
image: 0,
|
112 |
+
image_url: '',
|
113 |
+
});
|
114 |
+
}
|
115 |
+
});
|
116 |
+
|
117 |
+
newRecipe.instructions_flat = instructions_flat;
|
118 |
+
}
|
119 |
+
|
120 |
+
// Ingredients.
|
121 |
+
let ingredients_flat = [];
|
122 |
+
let ingredientsToParse = {};
|
123 |
+
|
124 |
+
if ( false !== this.state.ingredients ) {
|
125 |
+
this.state.ingredients.map((ingredient, index) => {
|
126 |
+
if ( ingredient.group ) {
|
127 |
+
ingredients_flat.push({
|
128 |
+
uid: index,
|
129 |
+
type: 'group',
|
130 |
+
name: ingredient.text,
|
131 |
+
});
|
132 |
+
} else {
|
133 |
+
ingredients_flat.push({
|
134 |
+
uid: index,
|
135 |
+
type: 'ingredient',
|
136 |
+
amount: '',
|
137 |
+
unit: '',
|
138 |
+
name: '',
|
139 |
+
notes: '',
|
140 |
+
});
|
141 |
+
|
142 |
+
ingredientsToParse[ index ] = ingredient.text;
|
143 |
+
}
|
144 |
+
})
|
145 |
+
|
146 |
+
newRecipe.ingredients_flat = ingredients_flat;
|
147 |
+
}
|
148 |
+
|
149 |
+
// Parse ingredients?
|
150 |
+
if ( 0 < Object.keys( ingredientsToParse ).length ) {
|
151 |
+
this.setState({
|
152 |
+
isParsing: true,
|
153 |
+
}, () => {
|
154 |
+
Api.parseIngredients(ingredientsToParse).then((data) => {
|
155 |
+
if (data) {
|
156 |
+
for ( let index in data.parsed ) {
|
157 |
+
const parsedIngredient = data.parsed[ index ];
|
158 |
+
|
159 |
+
newRecipe.ingredients_flat[ index ] = {
|
160 |
+
...newRecipe.ingredients_flat[ index ],
|
161 |
+
...parsedIngredient,
|
162 |
+
}
|
163 |
+
}
|
164 |
+
|
165 |
+
this.props.onImportValues( newRecipe );
|
166 |
+
} else {
|
167 |
+
this.setState({
|
168 |
+
isParsing: false,
|
169 |
+
});
|
170 |
+
}
|
171 |
+
});
|
172 |
+
});
|
173 |
+
} else {
|
174 |
+
this.props.onImportValues( newRecipe );
|
175 |
+
}
|
176 |
+
}
|
177 |
+
|
178 |
+
render() {
|
179 |
+
const changesMade = false !== this.state.name
|
180 |
+
|| false !== this.state.summary
|
181 |
+
|| false !== this.state.ingredients
|
182 |
+
|| false !== this.state.instructions
|
183 |
+
|| false !== this.state.notes;
|
184 |
+
|
185 |
+
return (
|
186 |
+
<Fragment>
|
187 |
+
<Header
|
188 |
+
onCloseModal={ this.props.onCloseModal }
|
189 |
+
>
|
190 |
+
{
|
191 |
+
this.props.recipe.name
|
192 |
+
?
|
193 |
+
`${this.props.recipe.name} - ${ __wprm( 'Import from Text' ) }`
|
194 |
+
:
|
195 |
+
`${ __wprm( 'Recipe' ) } - ${ __wprm( 'Import from Text' ) }`
|
196 |
+
}
|
197 |
+
</Header>
|
198 |
+
<div className="wprm-admin-modal-field-text-import-container">
|
199 |
+
<h2>{ __wprm( '1. Highlight text and click the corresponding button' ) }</h2>
|
200 |
+
<div className="wprm-admin-modal-field-text-import-selection">
|
201 |
+
<div className="wprm-admin-modal-field-text-import-buttons">
|
202 |
+
<button
|
203 |
+
className={ false !== this.state.name ? 'button wprm-selection-made' : 'button' }
|
204 |
+
onClick={() => this.setSelection( 'name' ) }
|
205 |
+
>{ __wprm( 'Name' ) }</button>
|
206 |
+
<button
|
207 |
+
className={ false !== this.state.summary ? 'button wprm-selection-made' : 'button' }
|
208 |
+
onClick={() => this.setSelection( 'summary' ) }
|
209 |
+
>{ __wprm( 'Summary' ) }</button>
|
210 |
+
<button
|
211 |
+
className={ false !== this.state.ingredients ? 'button wprm-selection-made' : 'button' }
|
212 |
+
onClick={() => this.setSelection( 'ingredients' ) }
|
213 |
+
>{ __wprm( 'Ingredients' ) }</button>
|
214 |
+
<button
|
215 |
+
className={ false !== this.state.instructions ? 'button wprm-selection-made' : 'button' }
|
216 |
+
onClick={() => this.setSelection( 'instructions' ) }
|
217 |
+
>{ __wprm( 'Instructions' ) }</button>
|
218 |
+
<button
|
219 |
+
className={ false !== this.state.notes ? 'button wprm-selection-made' : 'button' }
|
220 |
+
onClick={() => this.setSelection( 'notes' ) }
|
221 |
+
>{ __wprm( 'Notes' ) }</button>
|
222 |
+
</div>
|
223 |
+
<textarea
|
224 |
+
ref={this.textInput}
|
225 |
+
value={this.state.text}
|
226 |
+
placeholder={ __wprm( 'Paste or type recipe' ) }
|
227 |
+
onChange={(e) => {
|
228 |
+
this.setState({
|
229 |
+
text: e.target.value,
|
230 |
+
});
|
231 |
+
}}
|
232 |
+
/>
|
233 |
+
</div>
|
234 |
+
<h2>{ __wprm( '2. Fine-tune selections' ) }</h2>
|
235 |
+
<div className="wprm-admin-modal-field-text-import-finetune">
|
236 |
+
{
|
237 |
+
! changesMade
|
238 |
+
?
|
239 |
+
<p>{ __wprm( 'Make a selection using the buttons above first.' ) }</p>
|
240 |
+
:
|
241 |
+
<Fragment>
|
242 |
+
{
|
243 |
+
false !== this.state.name
|
244 |
+
&&
|
245 |
+
<FieldContainer label={ __wprm( 'Name' ) }>
|
246 |
+
<FieldText
|
247 |
+
value={ this.state.name }
|
248 |
+
onChange={ (name) => {
|
249 |
+
this.setState({ name });
|
250 |
+
}}
|
251 |
+
/>
|
252 |
+
</FieldContainer>
|
253 |
+
}
|
254 |
+
{
|
255 |
+
false !== this.state.summary
|
256 |
+
&&
|
257 |
+
<FieldContainer label={ __wprm( 'Summary' ) }>
|
258 |
+
<FieldTextarea
|
259 |
+
value={ this.state.summary }
|
260 |
+
onChange={ (summary) => {
|
261 |
+
this.setState({ summary });
|
262 |
+
}}
|
263 |
+
/>
|
264 |
+
</FieldContainer>
|
265 |
+
}
|
266 |
+
{
|
267 |
+
false !== this.state.ingredients
|
268 |
+
&&
|
269 |
+
<FieldContainer label={ __wprm( 'Ingredients' ) } help={ __wprm( 'Use the checkboxes to indicate group headers (like Frosting and Cake)' ) }>
|
270 |
+
<SelectGroups
|
271 |
+
value={ this.state.ingredients }
|
272 |
+
onChange={ (ingredients) => {
|
273 |
+
this.setState({ ingredients });
|
274 |
+
}}
|
275 |
+
/>
|
276 |
+
</FieldContainer>
|
277 |
+
}
|
278 |
+
{
|
279 |
+
false !== this.state.instructions
|
280 |
+
&&
|
281 |
+
<FieldContainer label={ __wprm( 'Instructions' ) } help={__wprm( 'Use the checkboxes to indicate group headers (like Frosting and Cake)' ) }>
|
282 |
+
<SelectGroups
|
283 |
+
value={ this.state.instructions }
|
284 |
+
onChange={ (instructions) => {
|
285 |
+
this.setState({ instructions });
|
286 |
+
}}
|
287 |
+
/>
|
288 |
+
</FieldContainer>
|
289 |
+
}
|
290 |
+
{
|
291 |
+
false !== this.state.notes
|
292 |
+
&&
|
293 |
+
<FieldContainer label={ __wprm( 'Notes' ) }>
|
294 |
+
<FieldTextarea
|
295 |
+
value={ this.state.notes }
|
296 |
+
onChange={ (notes) => {
|
297 |
+
this.setState({ notes });
|
298 |
+
}}
|
299 |
+
/>
|
300 |
+
</FieldContainer>
|
301 |
+
}
|
302 |
+
</Fragment>
|
303 |
+
}
|
304 |
+
</div>
|
305 |
+
</div>
|
306 |
+
<Footer
|
307 |
+
savingChanges={ this.state.isParsing }
|
308 |
+
>
|
309 |
+
<button
|
310 |
+
className="button"
|
311 |
+
onClick={ this.props.onCancel }
|
312 |
+
>
|
313 |
+
{ __wprm( 'Cancel' ) }
|
314 |
+
</button>
|
315 |
+
<button
|
316 |
+
className="button button-primary"
|
317 |
+
onClick={ this.useValues }
|
318 |
+
disabled={ ! changesMade }
|
319 |
+
>
|
320 |
+
{ __wprm( 'Use these Values' ) }
|
321 |
+
</button>
|
322 |
+
</Footer>
|
323 |
+
</Fragment>
|
324 |
+
);
|
325 |
+
}
|
326 |
+
}
|
assets/js/admin-modal/select/SelectRecipe.js
ADDED
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import React, { Component } from 'react';
|
2 |
+
import AsyncSelect from 'react-select/lib/Async';
|
3 |
+
|
4 |
+
import { __wprm } from '../../shared/Translations';
|
5 |
+
|
6 |
+
export default class SelectRecipe extends Component {
|
7 |
+
getOptions(input) {
|
8 |
+
if (!input) {
|
9 |
+
return Promise.resolve({ options: [] });
|
10 |
+
}
|
11 |
+
|
12 |
+
return fetch(wprm_admin.ajax_url, {
|
13 |
+
method: 'POST',
|
14 |
+
credentials: 'same-origin',
|
15 |
+
body: 'action=wprm_search_recipes&security=' + wprm_admin.nonce + '&search=' + encodeURIComponent( input ),
|
16 |
+
headers: {
|
17 |
+
'Accept': 'application/json, text/plain, */*',
|
18 |
+
'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8',
|
19 |
+
},
|
20 |
+
})
|
21 |
+
.then((response) => response.json())
|
22 |
+
.then((json) => {
|
23 |
+
return json.data.recipes_with_id;
|
24 |
+
});
|
25 |
+
}
|
26 |
+
|
27 |
+
render() {
|
28 |
+
return (
|
29 |
+
<AsyncSelect
|
30 |
+
placeholder={ __wprm( 'Select or search a recipe' ) }
|
31 |
+
value={this.props.value}
|
32 |
+
onChange={this.props.onValueChange}
|
33 |
+
getOptionValue={({id}) => id}
|
34 |
+
getOptionLabel={({text}) => text}
|
35 |
+
defaultOptions={this.props.options.concat(wprm_admin.latest_recipes)}
|
36 |
+
loadOptions={this.getOptions.bind(this)}
|
37 |
+
noOptionsMessage={() => __wprm( 'No recipes found' ) }
|
38 |
+
clearable={false}
|
39 |
+
/>
|
40 |
+
);
|
41 |
+
}
|
42 |
+
}
|
assets/js/admin-modal/select/index.js
ADDED
@@ -0,0 +1,98 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import React, { Component, Fragment } from 'react';
|
2 |
+
|
3 |
+
import '../../../css/admin/modal/select.scss';
|
4 |
+
|
5 |
+
import { __wprm } from '../../shared/Translations';
|
6 |
+
import Header from '../general/Header';
|
7 |
+
import Footer from '../general/Footer';
|
8 |
+
|
9 |
+
import SelectRecipe from './SelectRecipe';
|
10 |
+
|
11 |
+
const firstRecipeOnPage = {
|
12 |
+
id: 0,
|
13 |
+
text: __wprm( 'First recipe on page' ),
|
14 |
+
};
|
15 |
+
|
16 |
+
export default class Menu extends Component {
|
17 |
+
constructor(props) {
|
18 |
+
super(props);
|
19 |
+
|
20 |
+
let recipe = false;
|
21 |
+
if ( props.args.fields.recipe.showFirst ) {
|
22 |
+
recipe = firstRecipeOnPage;
|
23 |
+
}
|
24 |
+
|
25 |
+
this.state = {
|
26 |
+
recipe,
|
27 |
+
};
|
28 |
+
}
|
29 |
+
|
30 |
+
selectionsMade() {
|
31 |
+
return false !== this.state.recipe;
|
32 |
+
}
|
33 |
+
|
34 |
+
render() {
|
35 |
+
return (
|
36 |
+
<Fragment>
|
37 |
+
<Header
|
38 |
+
onCloseModal={ this.props.maybeCloseModal }
|
39 |
+
>
|
40 |
+
{
|
41 |
+
this.props.args.title
|
42 |
+
?
|
43 |
+
this.props.args.title
|
44 |
+
:
|
45 |
+
'WP Recipe Maker'
|
46 |
+
}
|
47 |
+
</Header>
|
48 |
+
<div className="wprm-admin-modal-select-container">
|
49 |
+
{
|
50 |
+
this.props.args.fields.recipe
|
51 |
+
?
|
52 |
+
<SelectRecipe
|
53 |
+
options={
|
54 |
+
this.props.args.fields.recipe.showFirst
|
55 |
+
?
|
56 |
+
[firstRecipeOnPage]
|
57 |
+
:
|
58 |
+
[]
|
59 |
+
}
|
60 |
+
value={ this.state.recipe }
|
61 |
+
onValueChange={(recipe) => {
|
62 |
+
this.setState({ recipe });
|
63 |
+
}}
|
64 |
+
/>
|
65 |
+
:
|
66 |
+
null
|
67 |
+
}
|
68 |
+
</div>
|
69 |
+
<Footer
|
70 |
+
savingChanges={ false }
|
71 |
+
>
|
72 |
+
<button
|
73 |
+
className="button button-primary"
|
74 |
+
onClick={ () => {
|
75 |
+
if ( 'function' === typeof this.props.args.nextStepCallback ) {
|
76 |
+
this.props.args.nextStepCallback( this.state );
|
77 |
+
} else {
|
78 |
+
if ( 'function' === typeof this.props.args.insertCallback ) {
|
79 |
+
this.props.args.insertCallback( this.state );
|
80 |
+
}
|
81 |
+
this.props.maybeCloseModal();
|
82 |
+
}
|
83 |
+
} }
|
84 |
+
disabled={ ! this.selectionsMade() }
|
85 |
+
>
|
86 |
+
{
|
87 |
+
this.props.args.button
|
88 |
+
?
|
89 |
+
this.props.args.button
|
90 |
+
:
|
91 |
+
__wprm( 'Select' )
|
92 |
+
}
|
93 |
+
</button>
|
94 |
+
</Footer>
|
95 |
+
</Fragment>
|
96 |
+
);
|
97 |
+
}
|
98 |
+
}
|
assets/js/admin-modal/taxonomy/Api.js
ADDED
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
const customTaxonomiesEndpoint = wprm_admin.endpoints.custom_taxonomies;
|
2 |
+
|
3 |
+
export default {
|
4 |
+
saveCustomTaxonomy( editing, taxonomy ) {
|
5 |
+
const data = {
|
6 |
+
...taxonomy,
|
7 |
+
};
|
8 |
+
|
9 |
+
const method = editing ? 'PUT' : 'POST';
|
10 |
+
|
11 |
+
return fetch(`${customTaxonomiesEndpoint}`, {
|
12 |
+
method,
|
13 |
+
headers: {
|
14 |
+
'X-WP-Nonce': wprm_admin.api_nonce,
|
15 |
+
'Accept': 'application/json',
|
16 |
+
'Content-Type': 'application/json',
|
17 |
+
},
|
18 |
+
credentials: 'same-origin',
|
19 |
+
body: JSON.stringify(data),
|
20 |
+
}).then(function (response) {
|
21 |
+
if ( response.ok ) {
|
22 |
+
return response.json();
|
23 |
+
} else {
|
24 |
+
console.log(response);
|
25 |
+
alert( 'Something went wrong. Please contact support.' );
|
26 |
+
return false;
|
27 |
+
}
|
28 |
+
});
|
29 |
+
},
|
30 |
+
deleteCustomTaxonomy( key ) {
|
31 |
+
const data = {
|
32 |
+
key,
|
33 |
+
};
|
34 |
+
|
35 |
+
return fetch(`${customTaxonomiesEndpoint}`, {
|
36 |
+
method: 'DELETE',
|
37 |
+
headers: {
|
38 |
+
'X-WP-Nonce': wprm_admin.api_nonce,
|
39 |
+
'Accept': 'application/json',
|
40 |
+
'Content-Type': 'application/json',
|
41 |
+
},
|
42 |
+
credentials: 'same-origin',
|
43 |
+
body: JSON.stringify(data),
|
44 |
+
}).then(function (response) {
|
45 |
+
if ( response.ok ) {
|
46 |
+
return response.json();
|
47 |
+
} else {
|
48 |
+
console.log(response);
|
49 |
+
alert( 'Something went wrong. Please contact support.' );
|
50 |
+
return false;
|
51 |
+
}
|
52 |
+
});
|
53 |
+
},
|
54 |
+
};
|
assets/js/admin-modal/taxonomy/index.js
ADDED
@@ -0,0 +1,180 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import React, { Component, Fragment } from 'react';
|
2 |
+
|
3 |
+
import '../../../css/admin/modal/taxonomy.scss';
|
4 |
+
|
5 |
+
import { __wprm } from '../../shared/Translations';
|
6 |
+
import Header from '../general/Header';
|
7 |
+
import Footer from '../general/Footer';
|
8 |
+
|
9 |
+
import FieldContainer from '../fields/FieldContainer';
|
10 |
+
import FieldText from '../fields/FieldText';
|
11 |
+
import Api from './Api';
|
12 |
+
|
13 |
+
export default class Menu extends Component {
|
14 |
+
constructor(props) {
|
15 |
+
super(props);
|
16 |
+
|
17 |
+
let taxonomy = {
|
18 |
+
key: '',
|
19 |
+
singular_name: '',
|
20 |
+
name: '',
|
21 |
+
}
|
22 |
+
|
23 |
+
let editing = false;
|
24 |
+
if ( props.args.hasOwnProperty( 'taxonomy' ) ) {
|
25 |
+
editing = true;
|
26 |
+
taxonomy = JSON.parse( JSON.stringify( props.args.taxonomy ) );
|
27 |
+
}
|
28 |
+
|
29 |
+
this.state = {
|
30 |
+
editing,
|
31 |
+
taxonomy,
|
32 |
+
originalTaxonomy: JSON.parse( JSON.stringify( taxonomy ) ),
|
33 |
+
savingChanges: false,
|
34 |
+
};
|
35 |
+
|
36 |
+
this.changesMade = this.changesMade.bind(this);
|
37 |
+
this.saveChanges = this.saveChanges.bind(this);
|
38 |
+
}
|
39 |
+
|
40 |
+
sanitizeSlug(text) {
|
41 |
+
text = text.trim();
|
42 |
+
text = text.toLowerCase();
|
43 |
+
|
44 |
+
const from = "àáäâèéëêìíïîòóöôùúüûñçěščřžýúůďťň·/-,:;";
|
45 |
+
const to = "aaaaeeeeiiiioooouuuuncescrzyuudtn______";
|
46 |
+
|
47 |
+
for ( let i=0, l=from.length ; i<l ; i++ )
|
48 |
+
{
|
49 |
+
text = text.replace(new RegExp(from.charAt(i), 'g'), to.charAt(i));
|
50 |
+
}
|
51 |
+
|
52 |
+
text = text.replace('.', '-')
|
53 |
+
.replace(/[^a-z0-9\s_]/g, '')
|
54 |
+
.replace(/\s+/g, '_')
|
55 |
+
.replace(/_+/g, '_');
|
56 |
+
|
57 |
+
return text;
|
58 |
+
}
|
59 |
+
|
60 |
+
saveChanges() {
|
61 |
+
if ( ! this.state.taxonomy.key.trim() || ! this.state.taxonomy.singular_name.trim() || ! this.state.taxonomy.name.trim() ) {
|
62 |
+
alert( __wprm( 'All fields are required.' ) );
|
63 |
+
} else {
|
64 |
+
this.setState({
|
65 |
+
savingChanges: true,
|
66 |
+
}, () => {
|
67 |
+
Api.saveCustomTaxonomy( this.state.editing, this.state.taxonomy ).then((taxonomy) => {
|
68 |
+
if ( taxonomy ) {
|
69 |
+
this.setState({
|
70 |
+
originalTaxonomy: JSON.parse( JSON.stringify( this.state.taxonomy ) ),
|
71 |
+
savingChanges: false,
|
72 |
+
},() => {
|
73 |
+
if ( 'function' === typeof this.props.args.saveCallback ) {
|
74 |
+
this.props.args.saveCallback( this.state.taxonomy );
|
75 |
+
}
|
76 |
+
this.props.maybeCloseModal();
|
77 |
+
});
|
78 |
+
} else {
|
79 |
+
if ( ! this.state.editing && false === taxonomy ) {
|
80 |
+
alert( __wprm( 'Something went wrong. Make sure this key does not exist yet.' ) );
|
81 |
+
}
|
82 |
+
this.setState({
|
83 |
+
savingChanges: false,
|
84 |
+
});
|
85 |
+
}
|
86 |
+
});
|
87 |
+
})
|
88 |
+
}
|
89 |
+
}
|
90 |
+
|
91 |
+
allowCloseModal() {
|
92 |
+
return ! this.state.savingChanges && ( ! this.changesMade() || confirm( __wprm( 'Are you sure you want to close without saving changes?' ) ) );
|
93 |
+
}
|
94 |
+
|
95 |
+
changesMade() {
|
96 |
+
return JSON.stringify( this.state.taxonomy ) !== JSON.stringify( this.state.originalTaxonomy );
|
97 |
+
}
|
98 |
+
|
99 |
+
render() {
|
100 |
+
return (
|
101 |
+
<Fragment>
|
102 |
+
<Header
|
103 |
+
onCloseModal={ this.props.maybeCloseModal }
|
104 |
+
>
|
105 |
+
{
|
106 |
+
this.state.editing
|
107 |
+
?
|
108 |
+
|
109 |
+
`${ __wprm( 'Editing Custom Taxonomy' ) }${this.state.taxonomy.key ? ` - wprm_${this.state.taxonomy.key}` : ''}`
|
110 |
+
:
|
111 |
+
`${ __wprm( 'Creating new Custom Taxonomy' ) }${this.state.taxonomy.key ? ` - wprm_${this.state.taxonomy.key}` : ''}`
|
112 |
+
}
|
113 |
+
</Header>
|
114 |
+
<div className="wprm-admin-modal-taxonomy-container">
|
115 |
+
{
|
116 |
+
false === this.state.editing
|
117 |
+
&&
|
118 |
+
<FieldContainer id="key" label={ __wprm( 'Key' ) }>
|
119 |
+
<FieldText
|
120 |
+
placeholder={ __wprm( 'course' ) }
|
121 |
+
value={ `wprm_${this.state.taxonomy.key}` }
|
122 |
+
onChange={ (key) => {
|
123 |
+
let sanitizedKey = key.substr(5);
|
124 |
+
sanitizedKey = this.sanitizeSlug( sanitizedKey );
|
125 |
+
|
126 |
+
this.setState({
|
127 |
+
taxonomy: {
|
128 |
+
...this.state.taxonomy,
|
129 |
+
key: sanitizedKey,
|
130 |
+
}
|
131 |
+
});
|
132 |
+
}}
|
133 |
+
disabled={ this.state.editing }
|
134 |
+
/>
|
135 |
+
</FieldContainer>
|
136 |
+
}
|
137 |
+
<FieldContainer id="singular_name" label={ __wprm( 'Singular Name' ) }>
|
138 |
+
<FieldText
|
139 |
+
placeholder={ __wprm( 'Course' ) }
|
140 |
+
value={ this.state.taxonomy.singular_name }
|
141 |
+
onChange={ (singular_name) => {
|
142 |
+
this.setState({
|
143 |
+
taxonomy: {
|
144 |
+
...this.state.taxonomy,
|
145 |
+
singular_name,
|
146 |
+
}
|
147 |
+
});
|
148 |
+
}}
|
149 |
+
/>
|
150 |
+
</FieldContainer>
|
151 |
+
<FieldContainer id="name" label={ __wprm( 'Plural Name' ) }>
|
152 |
+
<FieldText
|
153 |
+
placeholder={ __wprm( 'Courses' ) }
|
154 |
+
value={ this.state.taxonomy.name }
|
155 |
+
onChange={ (name) => {
|
156 |
+
this.setState({
|
157 |
+
taxonomy: {
|
158 |
+
...this.state.taxonomy,
|
159 |
+
name,
|
160 |
+
}
|
161 |
+
});
|
162 |
+
}}
|
163 |
+
/>
|
164 |
+
</FieldContainer>
|
165 |
+
</div>
|
166 |
+
<Footer
|
167 |
+
savingChanges={ this.state.savingChanges }
|
168 |
+
>
|
169 |
+
<button
|
170 |
+
className="button button-primary"
|
171 |
+
onClick={ this.saveChanges }
|
172 |
+
disabled={ ! this.changesMade() }
|
173 |
+
>
|
174 |
+
{ __wprm( 'Save' ) }
|
175 |
+
</button>
|
176 |
+
</Footer>
|
177 |
+
</Fragment>
|
178 |
+
);
|
179 |
+
}
|
180 |
+
}
|
assets/js/admin-template/general/Helpers.js
CHANGED
@@ -39,8 +39,9 @@ export default {
|
|
39 |
if ( shortcode.attributes.hasOwnProperty(attribute) ) {
|
40 |
let value = shortcode.attributes[attribute];
|
41 |
|
42 |
-
// Replace " with HTML entity to prevent breaking shortcode.
|
43 |
value = value.replace(/"/gm, '"');
|
|
|
44 |
fullShortcode += ' ' + attribute + '="' + value + '"';
|
45 |
}
|
46 |
}
|
39 |
if ( shortcode.attributes.hasOwnProperty(attribute) ) {
|
40 |
let value = shortcode.attributes[attribute];
|
41 |
|
42 |
+
// Replace " and ] with HTML entity to prevent breaking shortcode.
|
43 |
value = value.replace(/"/gm, '"');
|
44 |
+
value = value.replace(/\]/gm, ']');
|
45 |
fullShortcode += ' ' + attribute + '="' + value + '"';
|
46 |
}
|
47 |
}
|
assets/js/admin-template/main/preview-template/Block.js
CHANGED
@@ -72,6 +72,7 @@ export default class Block extends Component {
|
|
72 |
|
73 |
// Revert HTML entity change.
|
74 |
value = value.replace(/"/gm, '"');
|
|
|
75 |
|
76 |
properties[id] = {
|
77 |
...options,
|
72 |
|
73 |
// Revert HTML entity change.
|
74 |
value = value.replace(/"/gm, '"');
|
75 |
+
value = value.replace(/]/gm, ']');
|
76 |
|
77 |
properties[id] = {
|
78 |
...options,
|
assets/js/admin-template/main/preview-template/index.js
CHANGED
@@ -299,7 +299,7 @@ export default class PreviewTemplate extends Component {
|
|
299 |
<div className={`wprm-recipe wprm-recipe-roundup-item wprm-recipe-template-${this.props.template.slug}`}>{ this.state.parsedHtml }</div>
|
300 |
<h2>Our second recipe</h2>
|
301 |
<p>A roundup would have multiple recipes, so here is another one with some more demo text. Lorem ipsum dolor sit amet, consectetur adipiscing elit. In eleifend vitae nisl et pharetra. Sed euismod nisi convallis arcu lobortis commodo.</p>
|
302 |
-
<
|
303 |
</Fragment>
|
304 |
}
|
305 |
</Fragment>
|
299 |
<div className={`wprm-recipe wprm-recipe-roundup-item wprm-recipe-template-${this.props.template.slug}`}>{ this.state.parsedHtml }</div>
|
300 |
<h2>Our second recipe</h2>
|
301 |
<p>A roundup would have multiple recipes, so here is another one with some more demo text. Lorem ipsum dolor sit amet, consectetur adipiscing elit. In eleifend vitae nisl et pharetra. Sed euismod nisi convallis arcu lobortis commodo.</p>
|
302 |
+
<p>...</p>
|
303 |
</Fragment>
|
304 |
}
|
305 |
</Fragment>
|
assets/js/admin.js
CHANGED
@@ -2,8 +2,6 @@ if (!global._babelPolyfill) { require('babel-polyfill'); }
|
|
2 |
import './admin/editor';
|
3 |
import './admin/feedback';
|
4 |
import './admin/import';
|
5 |
-
import './admin/manage';
|
6 |
-
import './admin/modal';
|
7 |
import './admin/settings';
|
8 |
import './admin/tools';
|
9 |
|
@@ -11,9 +9,4 @@ import '../css/admin/addons.scss';
|
|
11 |
import '../css/admin/comments.scss';
|
12 |
import '../css/admin/faq.scss';
|
13 |
|
14 |
-
import './public/comment-rating';
|
15 |
-
|
16 |
-
import Modal from './admin/modal/Modal';
|
17 |
-
import Recipe from './admin/modal/Recipe';
|
18 |
-
import * as utils from './admin/modal/utils';
|
19 |
-
export { Modal, Recipe, utils };
|
2 |
import './admin/editor';
|
3 |
import './admin/feedback';
|
4 |
import './admin/import';
|
|
|
|
|
5 |
import './admin/settings';
|
6 |
import './admin/tools';
|
7 |
|
9 |
import '../css/admin/comments.scss';
|
10 |
import '../css/admin/faq.scss';
|
11 |
|
12 |
+
import './public/comment-rating';
|
|
|
|
|
|
|
|
|
|
assets/js/admin/editor.js
CHANGED
@@ -1,19 +1,61 @@
|
|
1 |
-
import Modal from './modal/Modal';
|
2 |
-
|
3 |
// Opening Modal
|
4 |
jQuery(document).ready(function($) {
|
5 |
-
jQuery(document).on('click', '.wprm-modal-button', function() {
|
6 |
-
|
7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
});
|
9 |
|
10 |
// Edit Recipe button
|
11 |
jQuery(document).on('click', '.wprm-modal-edit-button', function() {
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
});
|
19 |
});
|
|
|
|
|
1 |
// Opening Modal
|
2 |
jQuery(document).ready(function($) {
|
3 |
+
jQuery(document).on('click', '.wprm-modal-menu-button', function() {
|
4 |
+
WPRM_Modal.open( 'menu', {
|
5 |
+
insertCallback: ( shortcode ) => {
|
6 |
+
const editorId = jQuery(this).data('editor');
|
7 |
+
|
8 |
+
if ( editorId ) {
|
9 |
+
WPRM_Modal.addTextToEditor( shortcode, editorId );
|
10 |
+
}
|
11 |
+
},
|
12 |
+
saveCloseCallback: ( recipe ) => {
|
13 |
+
const editorId = jQuery(this).data('editor');
|
14 |
+
|
15 |
+
if ( editorId ) {
|
16 |
+
WPRM_Modal.addTextToEditor( '[wprm-recipe id="' + recipe.id + '"]', editorId );
|
17 |
+
}
|
18 |
+
},
|
19 |
+
} );
|
20 |
+
});
|
21 |
+
|
22 |
+
jQuery(document).on('click', '.wprm-modal-create-button', function() {
|
23 |
+
WPRM_Modal.open( 'recipe', {
|
24 |
+
saveCloseCallback: ( recipe ) => {
|
25 |
+
const editorId = jQuery(this).data('editor');
|
26 |
+
|
27 |
+
if ( editorId ) {
|
28 |
+
WPRM_Modal.addTextToEditor( '[wprm-recipe id="' + recipe.id + '"]', editorId );
|
29 |
+
}
|
30 |
+
|
31 |
+
if( jQuery('.wprm-manage-datatable').length > 0 ) {
|
32 |
+
jQuery('.wprm-manage-datatable').DataTable().ajax.reload(null, false);
|
33 |
+
}
|
34 |
+
},
|
35 |
+
} );
|
36 |
});
|
37 |
|
38 |
// Edit Recipe button
|
39 |
jQuery(document).on('click', '.wprm-modal-edit-button', function() {
|
40 |
+
const recipeId = jQuery(this).data('recipe');
|
41 |
+
|
42 |
+
WPRM_Modal.open( 'recipe', {
|
43 |
+
recipeId,
|
44 |
+
saveCallback: ( recipe ) => {
|
45 |
+
const editorId = jQuery(this).data('editor');
|
46 |
+
|
47 |
+
if ( editorId ) {
|
48 |
+
// Refresh content in editor to reload recipe preview.
|
49 |
+
if ( typeof tinyMCE !== 'undefined' && tinyMCE.get(editorId) && !tinyMCE.get(editorId).isHidden() ) {
|
50 |
+
tinyMCE.get(editorId).focus(true);
|
51 |
+
tinyMCE.activeEditor.setContent(tinyMCE.activeEditor.getContent());
|
52 |
+
}
|
53 |
+
}
|
54 |
+
|
55 |
+
if( jQuery('.wprm-manage-datatable').length > 0 ) {
|
56 |
+
jQuery('.wprm-manage-datatable').DataTable().ajax.reload(null, false);
|
57 |
+
}
|
58 |
+
},
|
59 |
+
} );
|
60 |
});
|
61 |
});
|
assets/js/admin/import/after_import.js
CHANGED
@@ -1,14 +1,11 @@
|
|
1 |
-
import Modal from '../modal/Modal';
|
2 |
-
|
3 |
jQuery(document).ready(function($) {
|
4 |
// Edit imported recipe
|
5 |
jQuery(document).on('click', '.wprm-import-recipes-actions-edit', function(e) {
|
6 |
e.preventDefault();
|
7 |
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
});
|
13 |
});
|
14 |
});
|
|
|
|
|
1 |
jQuery(document).ready(function($) {
|
2 |
// Edit imported recipe
|
3 |
jQuery(document).on('click', '.wprm-import-recipes-actions-edit', function(e) {
|
4 |
e.preventDefault();
|
5 |
|
6 |
+
const recipeId = jQuery(this).data('id');
|
7 |
+
WPRM_Modal.open( 'recipe', {
|
8 |
+
recipeId,
|
9 |
+
} );
|
|
|
10 |
});
|
11 |
});
|
assets/js/admin/manage.js
DELETED
@@ -1,10 +0,0 @@
|
|
1 |
-
import initDatatable from './manage/datatable';
|
2 |
-
import initDatatableInteractions from './manage/interactions';
|
3 |
-
import '../../css/admin/manage.scss';
|
4 |
-
|
5 |
-
jQuery(document).ready(function($) {
|
6 |
-
if(jQuery('.wprm-manage-datatable').length > 0) {
|
7 |
-
initDatatable();
|
8 |
-
initDatatableInteractions();
|
9 |
-
}
|
10 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/admin/manage/api.js
DELETED
@@ -1,66 +0,0 @@
|
|
1 |
-
export function rename_term(term_id, taxonomy, new_name) {
|
2 |
-
var data = {
|
3 |
-
action: 'wprm_rename_term',
|
4 |
-
security: wprm_admin.nonce,
|
5 |
-
term_id: term_id,
|
6 |
-
taxonomy: taxonomy,
|
7 |
-
new_name: new_name
|
8 |
-
};
|
9 |
-
|
10 |
-
jQuery.post(wprm_admin.ajax_url, data, function() {
|
11 |
-
jQuery('.wprm-manage-datatable').DataTable().ajax.reload(null, false);
|
12 |
-
});
|
13 |
-
};
|
14 |
-
|
15 |
-
export function update_term_metadata(term_id, field, value) {
|
16 |
-
var data = {
|
17 |
-
action: 'wprm_update_term_metadata',
|
18 |
-
security: wprm_admin.nonce,
|
19 |
-
term_id: term_id,
|
20 |
-
field: field,
|
21 |
-
value: value
|
22 |
-
};
|
23 |
-
|
24 |
-
jQuery.post(wprm_admin.ajax_url, data, function() {
|
25 |
-
jQuery('.wprm-manage-datatable').DataTable().ajax.reload(null, false);
|
26 |
-
});
|
27 |
-
};
|
28 |
-
|
29 |
-
export function delete_or_merge_term(term_id, taxonomy, new_term_id) {
|
30 |
-
var data = {
|
31 |
-
action: 'wprm_delete_or_merge_term',
|
32 |
-
security: wprm_admin.nonce,
|
33 |
-
term_id: term_id,
|
34 |
-
taxonomy: taxonomy,
|
35 |
-
new_term_id: new_term_id
|
36 |
-
};
|
37 |
-
|
38 |
-
jQuery.post(wprm_admin.ajax_url, data, function() {
|
39 |
-
jQuery('.wprm-manage-datatable').DataTable().ajax.reload(null, false);
|
40 |
-
});
|
41 |
-
};
|
42 |
-
|
43 |
-
export function delete_terms(term_ids, taxonomy) {
|
44 |
-
var data = {
|
45 |
-
action: 'wprm_delete_terms',
|
46 |
-
security: wprm_admin.nonce,
|
47 |
-
term_ids: term_ids,
|
48 |
-
taxonomy: taxonomy
|
49 |
-
};
|
50 |
-
|
51 |
-
jQuery.post(wprm_admin.ajax_url, data, function() {
|
52 |
-
jQuery('.wprm-manage-datatable').DataTable().ajax.reload(null, false);
|
53 |
-
});
|
54 |
-
};
|
55 |
-
|
56 |
-
export function delete_recipe(recipe_id) {
|
57 |
-
var data = {
|
58 |
-
action: 'wprm_delete_recipe',
|
59 |
-
security: wprm_admin.nonce,
|
60 |
-
recipe_id: recipe_id,
|
61 |
-
};
|
62 |
-
|
63 |
-
jQuery.post(wprm_admin.ajax_url, data, function() {
|
64 |
-
jQuery('.wprm-manage-datatable').DataTable().ajax.reload(null, false);
|
65 |
-
});
|
66 |
-
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/admin/manage/datatable.js
DELETED
@@ -1,199 +0,0 @@
|
|
1 |
-
import '../../../../vendor/select2/js/select2.min.js';
|
2 |
-
import '../../../../vendor/select2/css/select2.min.css';
|
3 |
-
// import 'datatables.net';
|
4 |
-
// import 'datatables.net-dt/css/jquery.dataTables.css';
|
5 |
-
import 'tooltipster';
|
6 |
-
import 'tooltipster/dist/css/tooltipster.bundle.css';
|
7 |
-
|
8 |
-
// Source: http://stackoverflow.com/questions/647259/javascript-query-string
|
9 |
-
function get_query_args() {
|
10 |
-
var result = {}, queryString = location.search.slice(1),
|
11 |
-
re = /([^&=]+)=([^&]*)/g, m;
|
12 |
-
|
13 |
-
while (m = re.exec(queryString)) {
|
14 |
-
result[decodeURIComponent(m[1])] = decodeURIComponent(m[2]);
|
15 |
-
}
|
16 |
-
|
17 |
-
return result;
|
18 |
-
}
|
19 |
-
|
20 |
-
function initDatatableFilters(datable) {
|
21 |
-
var args = get_query_args();
|
22 |
-
jQuery('.wprm-manage-recipes-filter').on('change', function() {
|
23 |
-
datable.search('').draw();
|
24 |
-
}).each(function() {
|
25 |
-
var taxonomy = jQuery(this).data('taxonomy');
|
26 |
-
|
27 |
-
if(args.hasOwnProperty(taxonomy) && jQuery(this).find("option[value='" + args[taxonomy] + "']").length > 0) {
|
28 |
-
jQuery(this).val(args[taxonomy]);
|
29 |
-
}
|
30 |
-
}).select2_wprm().trigger('change');
|
31 |
-
}
|
32 |
-
|
33 |
-
export default function initDatatable() {
|
34 |
-
// Get ID of datatable that's active on this page
|
35 |
-
var wprm_active_datatable = '';
|
36 |
-
jQuery('.wprm-manage-datatable').each(function() {
|
37 |
-
wprm_active_datatable = jQuery(this).attr('id');
|
38 |
-
});
|
39 |
-
|
40 |
-
// Init datatable
|
41 |
-
$.fn.dataTable.ext.errMode = 'throw';
|
42 |
-
|
43 |
-
var datatable = jQuery('.wprm-manage-datatable').DataTable( {
|
44 |
-
pageLength: 10,
|
45 |
-
order: [ 0, 'desc' ],
|
46 |
-
serverSide: true,
|
47 |
-
ajax: {
|
48 |
-
url: wprm_admin.ajax_url,
|
49 |
-
type: 'POST',
|
50 |
-
data: function ( d ) {
|
51 |
-
d.action = 'wprm_manage_datatable';
|
52 |
-
d.security = wprm_admin.nonce;
|
53 |
-
d.table = wprm_active_datatable;
|
54 |
-
|
55 |
-
// Check for advanced search filters.
|
56 |
-
var search_filters = jQuery('.wprm-manage-recipes-filter');
|
57 |
-
|
58 |
-
if(search_filters.length > 0) {
|
59 |
-
var search = jQuery('#wprm-manage-recipes_wrapper').find('input[type="search"]').val();
|
60 |
-
|
61 |
-
search_filters.each(function() {
|
62 |
-
var taxonomy = jQuery(this).data('taxonomy');
|
63 |
-
var value = jQuery(this).val();
|
64 |
-
|
65 |
-
value = 'none' === value ? 'none' : parseInt(value);
|
66 |
-
|
67 |
-
if('none' === value || value > 0) {
|
68 |
-
search += '{{' + taxonomy + '=' + value +'}}';
|
69 |
-
}
|
70 |
-
});
|
71 |
-
|
72 |
-
d.search.value = search;
|
73 |
-
}
|
74 |
-
}
|
75 |
-
},
|
76 |
-
drawCallback: function() {
|
77 |
-
// Select2.
|
78 |
-
jQuery('.wprm-manage-datatable').find('select').select2_wprm();
|
79 |
-
|
80 |
-
// Add tooltips.
|
81 |
-
jQuery('.wprm-manage-ingredients-actions').tooltipster({
|
82 |
-
content: '<div class="wprm-manage-ingredients-actions-tooltip">' + wprm_admin.manage.tooltip.ingredients + '</div>',
|
83 |
-
contentAsHTML: true,
|
84 |
-
functionBefore: function() {
|
85 |
-
var instances = jQuery.tooltipster.instances();
|
86 |
-
jQuery.each(instances, function(i, instance){
|
87 |
-
instance.close();
|
88 |
-
});
|
89 |
-
},
|
90 |
-
functionReady: function(instance, helper) {
|
91 |
-
var id = parseInt(jQuery(helper.origin).data('id')),
|
92 |
-
count = parseInt(jQuery(helper.origin).data('count')),
|
93 |
-
name = jQuery('#wprm-manage-ingredients-name-' + id).text();
|
94 |
-
|
95 |
-
jQuery(helper.tooltip).find('a').data('id', id);
|
96 |
-
jQuery(helper.tooltip).find('.tooltip-header').text('#' + id + ' - ' + name);
|
97 |
-
|
98 |
-
if(count > 0) {
|
99 |
-
jQuery(helper.tooltip)
|
100 |
-
.find('.wprm-manage-ingredients-actions-delete')
|
101 |
-
.remove();
|
102 |
-
}
|
103 |
-
|
104 |
-
// Adjust tooltip height to fit contents.
|
105 |
-
var inner = jQuery(helper.tooltip).find('.tooltipster-content > div');
|
106 |
-
jQuery(helper.tooltip).height(inner.outerHeight(true) + 15);
|
107 |
-
},
|
108 |
-
interactive: true,
|
109 |
-
delay: 0,
|
110 |
-
side: 'left',
|
111 |
-
trigger: 'custom',
|
112 |
-
triggerOpen: {
|
113 |
-
mouseenter: true,
|
114 |
-
touchstart: true
|
115 |
-
},
|
116 |
-
triggerClose: {
|
117 |
-
click: true,
|
118 |
-
tap: true
|
119 |
-
},
|
120 |
-
});
|
121 |
-
|
122 |
-
jQuery('.wprm-manage-taxonomies-actions').tooltipster({
|
123 |
-
content: '<div class="wprm-manage-taxonomies-actions-tooltip">' + wprm_admin.manage.tooltip.taxonomies + '</div>',
|
124 |
-
contentAsHTML: true,
|
125 |
-
functionBefore: function() {
|
126 |
-
var instances = jQuery.tooltipster.instances();
|
127 |
-
jQuery.each(instances, function(i, instance){
|
128 |
-
instance.close();
|
129 |
-
});
|
130 |
-
},
|
131 |
-
functionReady: function(instance, helper) {
|
132 |
-
var id = parseInt(jQuery(helper.origin).data('id')),
|
133 |
-
count = parseInt(jQuery(helper.origin).data('count')),
|
134 |
-
name = jQuery('#wprm-manage-taxonomies-name-' + id).text();
|
135 |
-
|
136 |
-
jQuery(helper.tooltip).find('a').data('id', id);
|
137 |
-
jQuery(helper.tooltip).find('.tooltip-header').text('#' + id + ' - ' + name);
|
138 |
-
|
139 |
-
// Adjust tooltip height to fit contents.
|
140 |
-
var inner = jQuery(helper.tooltip).find('.tooltipster-content > div');
|
141 |
-
jQuery(helper.tooltip).height(inner.outerHeight(true) + 15);
|
142 |
-
},
|
143 |
-
interactive: true,
|
144 |
-
delay: 0,
|
145 |
-
side: 'left',
|
146 |
-
trigger: 'custom',
|
147 |
-
triggerOpen: {
|
148 |
-
mouseenter: true,
|
149 |
-
touchstart: true
|
150 |
-
},
|
151 |
-
triggerClose: {
|
152 |
-
click: true,
|
153 |
-
tap: true
|
154 |
-
},
|
155 |
-
});
|
156 |
-
|
157 |
-
jQuery('.wprm-manage-recipes-actions').tooltipster({
|
158 |
-
content: '<div class="wprm-manage-recipes-actions-tooltip">' + wprm_admin.manage.tooltip.recipes + '</div>',
|
159 |
-
contentAsHTML: true,
|
160 |
-
functionBefore: function() {
|
161 |
-
var instances = jQuery.tooltipster.instances();
|
162 |
-
jQuery.each(instances, function(i, instance){
|
163 |
-
instance.close();
|
164 |
-
});
|
165 |
-
},
|
166 |
-
functionReady: function(instance, helper) {
|
167 |
-
var id = parseInt(jQuery(helper.origin).data('id')),
|
168 |
-
name = jQuery('#wprm-manage-recipes-name-' + id).text();
|
169 |
-
|
170 |
-
jQuery(helper.tooltip).find('.tooltip-header').text('#' + id + ' - ' + name);
|
171 |
-
jQuery(helper.tooltip).find('a').data('id', id);
|
172 |
-
|
173 |
-
// Adjust tooltip height to fit contents.
|
174 |
-
var inner = jQuery(helper.tooltip).find('.tooltipster-content > div');
|
175 |
-
jQuery(helper.tooltip).height(inner.outerHeight(true) + 15);
|
176 |
-
},
|
177 |
-
interactive: true,
|
178 |
-
delay: 0,
|
179 |
-
side: 'left',
|
180 |
-
trigger: 'custom',
|
181 |
-
triggerOpen: {
|
182 |
-
mouseenter: true,
|
183 |
-
touchstart: true
|
184 |
-
},
|
185 |
-
triggerClose: {
|
186 |
-
click: true,
|
187 |
-
tap: true
|
188 |
-
},
|
189 |
-
});
|
190 |
-
|
191 |
-
jQuery('.wprm-manage-tooltip').tooltipster({
|
192 |
-
delay: 0,
|
193 |
-
side: 'left',
|
194 |
-
});
|
195 |
-
}
|
196 |
-
} );
|
197 |
-
|
198 |
-
initDatatableFilters(datatable);
|
199 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/admin/manage/interactions.js
DELETED
@@ -1,140 +0,0 @@
|
|
1 |
-
import * as api from './api';
|
2 |
-
import Modal from '../modal/Modal';
|
3 |
-
|
4 |
-
export default function initDatatableInteractions() {
|
5 |
-
jQuery(document).on('click', '.wprm-manage-recipes-seo', function(e) {
|
6 |
-
e.preventDefault();
|
7 |
-
|
8 |
-
var id = jQuery(this).data('id');
|
9 |
-
|
10 |
-
Modal.open(false, {
|
11 |
-
recipe_id: id
|
12 |
-
});
|
13 |
-
});
|
14 |
-
|
15 |
-
jQuery(document).on('change', '.wprm-manage-ingredients-link-nofollow', function(e) {
|
16 |
-
e.preventDefault();
|
17 |
-
|
18 |
-
var id = jQuery(this).data('id'),
|
19 |
-
nofollow = jQuery(this).val();
|
20 |
-
|
21 |
-
api.update_term_metadata(id, 'ingredient_link_nofollow', nofollow);
|
22 |
-
});
|
23 |
-
|
24 |
-
jQuery(document).on('click', '.wprm-manage-ingredients-actions-rename', function(e) {
|
25 |
-
e.preventDefault();
|
26 |
-
|
27 |
-
var id = jQuery(this).data('id'),
|
28 |
-
name = jQuery('#wprm-manage-ingredients-name-' + id).text();
|
29 |
-
|
30 |
-
var new_name = prompt('What do you want to rename "' + name + '" to?', name).trim();
|
31 |
-
if(new_name) {
|
32 |
-
api.rename_term(id, 'ingredient', new_name);
|
33 |
-
}
|
34 |
-
});
|
35 |
-
|
36 |
-
jQuery(document).on('click', '.wprm-manage-ingredients-actions-link', function(e) {
|
37 |
-
e.preventDefault();
|
38 |
-
|
39 |
-
var id = jQuery(this).data('id'),
|
40 |
-
name = jQuery('#wprm-manage-ingredients-name-' + id).text(),
|
41 |
-
link_container = jQuery('#wprm-manage-ingredients-link-' + id),
|
42 |
-
link = link_container.text();
|
43 |
-
|
44 |
-
var new_link = prompt('What do you want the link for "' + name + '" to be?', link).trim();
|
45 |
-
api.update_term_metadata(id, 'ingredient_link', new_link);
|
46 |
-
});
|
47 |
-
|
48 |
-
jQuery(document).on('click', '.wprm-manage-ingredients-actions-merge', function(e) {
|
49 |
-
e.preventDefault();
|
50 |
-
|
51 |
-
var id = jQuery(this).data('id'),
|
52 |
-
name = jQuery('#wprm-manage-ingredients-name-' + id).text();
|
53 |
-
|
54 |
-
var new_term = parseInt(prompt('What is the ID of the ingredient that you want to merge "' + name + '" into?', ''));
|
55 |
-
if(new_term) {
|
56 |
-
api.delete_or_merge_term(id, 'ingredient', new_term);
|
57 |
-
}
|
58 |
-
});
|
59 |
-
|
60 |
-
jQuery(document).on('click', '.wprm-manage-taxonomies-actions-rename', function(e) {
|
61 |
-
e.preventDefault();
|
62 |
-
|
63 |
-
var id = jQuery(this).data('id'),
|
64 |
-
name = jQuery('#wprm-manage-taxonomies-name-' + id).text(),
|
65 |
-
taxonomy = jQuery('.wprm-manage-taxonomies').data('taxonomy');
|
66 |
-
|
67 |
-
var new_name = prompt('What do you want to rename "' + name + '" to?', name).trim();
|
68 |
-
if(new_name) {
|
69 |
-
api.rename_term(id, taxonomy, new_name);
|
70 |
-
}
|
71 |
-
});
|
72 |
-
|
73 |
-
jQuery(document).on('click', '.wprm-manage-taxonomies-actions-merge', function(e) {
|
74 |
-
e.preventDefault();
|
75 |
-
|
76 |
-
var id = jQuery(this).data('id'),
|
77 |
-
name = jQuery('#wprm-manage-taxonomies-name-' + id).text(),
|
78 |
-
taxonomy = jQuery('.wprm-manage-taxonomies').data('taxonomy');
|
79 |
-
|
80 |
-
var new_term = parseInt(prompt('What is the ID of the term that you want to merge "' + name + '" into?', ''));
|
81 |
-
if(new_term) {
|
82 |
-
api.delete_or_merge_term(id, taxonomy, new_term);
|
83 |
-
}
|
84 |
-
});
|
85 |
-
|
86 |
-
jQuery(document).on('click', '.wprm-manage-ingredients-actions-delete', function(e) {
|
87 |
-
e.preventDefault();
|
88 |
-
|
89 |
-
var id = jQuery(this).data('id');
|
90 |
-
api.delete_or_merge_term(id, 'ingredient', 0);
|
91 |
-
});
|
92 |
-
|
93 |
-
jQuery(document).on('click', '.wprm-manage-taxonomies-actions-delete', function(e) {
|
94 |
-
e.preventDefault();
|
95 |
-
|
96 |
-
var id = jQuery(this).data('id'),
|
97 |
-
name = jQuery('#wprm-manage-taxonomies-name-' + id).text(),
|
98 |
-
taxonomy = jQuery('.wprm-manage-taxonomies').data('taxonomy');
|
99 |
-
|
100 |
-
if(confirm('Are you sure you want to delete "' + name + '"?')) {
|
101 |
-
api.delete_or_merge_term(id, taxonomy, 0);
|
102 |
-
}
|
103 |
-
});
|
104 |
-
|
105 |
-
jQuery(document).on('click', '.wprm-manage-recipes-actions-edit', function(e) {
|
106 |
-
e.preventDefault();
|
107 |
-
|
108 |
-
var id = jQuery(this).data('id');
|
109 |
-
|
110 |
-
Modal.open(false, {
|
111 |
-
recipe_id: id
|
112 |
-
});
|
113 |
-
});
|
114 |
-
|
115 |
-
jQuery(document).on('click', '.wprm-manage-recipes-actions-delete', function(e) {
|
116 |
-
e.preventDefault();
|
117 |
-
|
118 |
-
var id = jQuery(this).data('id'),
|
119 |
-
name = jQuery('#wprm-manage-recipes-name-' + id).text();
|
120 |
-
|
121 |
-
if(confirm('Are you sure you want to delete "' + name + '"?')) {
|
122 |
-
api.delete_recipe(id);
|
123 |
-
}
|
124 |
-
});
|
125 |
-
|
126 |
-
jQuery(document).on('click', '.wprm-manage-ingredients-bulk-delete', function(e) {
|
127 |
-
e.preventDefault();
|
128 |
-
|
129 |
-
var ingredients = jQuery('.wprm-manage-ingredients-bulk:checkbox:checked');
|
130 |
-
var ids = [];
|
131 |
-
|
132 |
-
ingredients.each(function() {
|
133 |
-
ids.push(parseInt(jQuery(this).val()));
|
134 |
-
});
|
135 |
-
|
136 |
-
if(ids.length > 0) {
|
137 |
-
api.delete_terms(ids, 'ingredient', 0);
|
138 |
-
}
|
139 |
-
});
|
140 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/admin/modal.js
DELETED
@@ -1,14 +0,0 @@
|
|
1 |
-
import Modal from './modal/Modal';
|
2 |
-
import './modal/tabs/import-text';
|
3 |
-
import './modal/tabs/recipe-snippets';
|
4 |
-
import './modal/tabs/recipe';
|
5 |
-
|
6 |
-
import '../../css/admin/modal.scss';
|
7 |
-
|
8 |
-
jQuery(document).ready(function($) {
|
9 |
-
let container = jQuery('.wprm-modal-container');
|
10 |
-
|
11 |
-
if (container) {
|
12 |
-
Modal.init(container);
|
13 |
-
}
|
14 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/admin/modal/Modal.js
DELETED
@@ -1,64 +0,0 @@
|
|
1 |
-
import Recipe from './Recipe';
|
2 |
-
import modalInit from './ModalInit';
|
3 |
-
|
4 |
-
let Modal = {
|
5 |
-
changes_made: false,
|
6 |
-
container: false,
|
7 |
-
gutenberg: false,
|
8 |
-
active_editor_id: false,
|
9 |
-
args: {},
|
10 |
-
actions: {},
|
11 |
-
recipe: Recipe,
|
12 |
-
init: function(container) {
|
13 |
-
this.container = container;
|
14 |
-
modalInit(this);
|
15 |
-
this.recipe.init();
|
16 |
-
},
|
17 |
-
open: function(editor_id, args = {}) {
|
18 |
-
this.args = args;
|
19 |
-
|
20 |
-
// Enable menu items
|
21 |
-
jQuery('.wprm-menu-item').show();
|
22 |
-
jQuery('.wprm-menu-hidden').hide();
|
23 |
-
|
24 |
-
this.active_editor_id = editor_id;
|
25 |
-
jQuery('.wprm-modal-container').show();
|
26 |
-
|
27 |
-
// Gutenberg check
|
28 |
-
this.gutenberg = args.hasOwnProperty( 'gutenberg' ) && args.gutenberg;
|
29 |
-
|
30 |
-
// Init tabs
|
31 |
-
var tabs = jQuery('.wprm-router').find('.wprm-menu-item');
|
32 |
-
jQuery(tabs).each(function() {
|
33 |
-
let init_callback = jQuery(this).data('init');
|
34 |
-
|
35 |
-
if (init_callback && typeof Modal.actions[init_callback] == 'function') {
|
36 |
-
Modal.actions[init_callback](args);
|
37 |
-
}
|
38 |
-
});
|
39 |
-
|
40 |
-
// Default to first menu item
|
41 |
-
jQuery('.wprm-menu').find('.wprm-menu-item').first().click();
|
42 |
-
|
43 |
-
// Optionally open a different menu item
|
44 |
-
if( args.hasOwnProperty( 'menu' ) ) {
|
45 |
-
var menu = jQuery('.wprm-menu').find('.wprm-menu-item[data-menu="' + args.menu + '"]');
|
46 |
-
|
47 |
-
if ( menu ) {
|
48 |
-
menu.click();
|
49 |
-
}
|
50 |
-
}
|
51 |
-
|
52 |
-
this.changes_made = false;
|
53 |
-
},
|
54 |
-
close: function() {
|
55 |
-
this.active_editor_id = false;
|
56 |
-
jQuery('.wprm-menu').removeClass('visible');
|
57 |
-
jQuery('.wprm-modal-container').hide();
|
58 |
-
},
|
59 |
-
disable_menu: function() {
|
60 |
-
jQuery('.wprm-frame-menu').find('.wprm-menu-item').hide();
|
61 |
-
jQuery('.wprm-menu-hidden').show();
|
62 |
-
},
|
63 |
-
}
|
64 |
-
export default Modal;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/admin/modal/ModalInit.js
DELETED
@@ -1,142 +0,0 @@
|
|
1 |
-
export default function modalInit(modal) {
|
2 |
-
// Closing Modal.
|
3 |
-
jQuery(modal.container).on('click', '.wprm-modal-close, .wprm-modal-backdrop', function() {
|
4 |
-
if( ! modal.changes_made || confirm(wprm_admin.modal.text.modal_close_confirm) ) {
|
5 |
-
modal.close();
|
6 |
-
}
|
7 |
-
});
|
8 |
-
|
9 |
-
// Modal Menu.
|
10 |
-
jQuery('.wprm-menu').on('click', '.wprm-menu-item', function() {
|
11 |
-
var menu_item = jQuery(this),
|
12 |
-
menu_target = menu_item.data('menu'),
|
13 |
-
menu_tab = menu_item.data('tab');
|
14 |
-
|
15 |
-
// Hide Menu if on Mobile
|
16 |
-
jQuery('.wprm-menu').removeClass('visible');
|
17 |
-
|
18 |
-
// Set clicked on tab as the active one
|
19 |
-
jQuery('.wprm-menu').find('.wprm-menu-item').removeClass('active');
|
20 |
-
menu_item.addClass('active');
|
21 |
-
|
22 |
-
// Show correct menu
|
23 |
-
jQuery('.wprm-frame-router').find('.wprm-router').removeClass('active');
|
24 |
-
jQuery('.wprm-frame-router').find('#wprm-menu-' + menu_target).addClass('active');
|
25 |
-
|
26 |
-
// Show the first tab as active or whichever tab was passed along
|
27 |
-
var active_tab = false;
|
28 |
-
jQuery('.wprm-router').find('.wprm-menu-item').removeClass('active');
|
29 |
-
jQuery('.wprm-frame-router').find('#wprm-menu-' + menu_target).find('.wprm-menu-item').each(function(index) {
|
30 |
-
if (index === 0 || jQuery(this).data('tab') == menu_tab) {
|
31 |
-
active_tab = jQuery(this);
|
32 |
-
}
|
33 |
-
});
|
34 |
-
|
35 |
-
if (active_tab) {
|
36 |
-
active_tab.click();
|
37 |
-
}
|
38 |
-
|
39 |
-
// Change main title
|
40 |
-
jQuery('.wprm-frame-title').find('h1').text(menu_item.text());
|
41 |
-
});
|
42 |
-
|
43 |
-
// Modal Menu on Mobile
|
44 |
-
jQuery(modal.container).on('click', '.wprm-frame-title', function() {
|
45 |
-
jQuery('.wprm-menu').toggleClass('visible');
|
46 |
-
});
|
47 |
-
|
48 |
-
// Modal Tabs
|
49 |
-
jQuery('.wprm-router').on('click', '.wprm-menu-item', function() {
|
50 |
-
var menu_item = jQuery(this),
|
51 |
-
tab_target = menu_item.data('tab'),
|
52 |
-
tab_button = menu_item.data('button');
|
53 |
-
|
54 |
-
// Set clicked on tab as the active one
|
55 |
-
jQuery('.wprm-router').find('.wprm-menu-item').removeClass('active');
|
56 |
-
menu_item.addClass('active');
|
57 |
-
|
58 |
-
// Hide action button if no callback is set
|
59 |
-
if (menu_item.data('callback')) {
|
60 |
-
jQuery('.wprm-button-action').text(tab_button).show();
|
61 |
-
|
62 |
-
if('wprm-menu-recipe' == menu_item.parents('.wprm-router').attr('id')) {
|
63 |
-
jQuery('.wprm-button-action-save').show();
|
64 |
-
} else {
|
65 |
-
jQuery('.wprm-button-action-save').hide();
|
66 |
-
}
|
67 |
-
} else {
|
68 |
-
jQuery('.wprm-button-action').hide();
|
69 |
-
jQuery('.wprm-button-action-save').hide();
|
70 |
-
}
|
71 |
-
|
72 |
-
// Show correct tab
|
73 |
-
jQuery('.wprm-frame-content').find('.wprm-frame-content-tab').removeClass('active');
|
74 |
-
jQuery('.wprm-frame-content').find('#wprm-tab-' + tab_target).addClass('active');
|
75 |
-
});
|
76 |
-
|
77 |
-
// Insert or Update Button
|
78 |
-
jQuery('.wprm-button-action').on('click', function() {
|
79 |
-
var active_tab = jQuery('.wprm-router.active').find('.wprm-menu-item.active'),
|
80 |
-
callback = active_tab.data('callback');
|
81 |
-
|
82 |
-
if (callback && typeof modal.actions[callback] == 'function') {
|
83 |
-
modal.actions[callback](jQuery(this));
|
84 |
-
}
|
85 |
-
});
|
86 |
-
|
87 |
-
// Prevent Divi Builder bug.
|
88 |
-
jQuery(modal.container).keydown( function(e) {
|
89 |
-
e.stopPropagation();
|
90 |
-
});
|
91 |
-
|
92 |
-
// Select Recipes Dropdown
|
93 |
-
jQuery('.wprm-recipes-dropdown').select2_wprm({
|
94 |
-
width: '250px',
|
95 |
-
ajax: {
|
96 |
-
type: 'POST',
|
97 |
-
url: wprm_admin.ajax_url,
|
98 |
-
dataType: 'json',
|
99 |
-
delay: 250,
|
100 |
-
data: function (params) {
|
101 |
-
return {
|
102 |
-
action: 'wprm_search_recipes',
|
103 |
-
security: wprm_admin.nonce,
|
104 |
-
search: params.term
|
105 |
-
};
|
106 |
-
},
|
107 |
-
processResults: function (out, params) {
|
108 |
-
return {
|
109 |
-
results: out.data.recipes_with_id,
|
110 |
-
};
|
111 |
-
},
|
112 |
-
cache: true
|
113 |
-
},
|
114 |
-
});
|
115 |
-
|
116 |
-
jQuery('.wprm-recipes-dropdown-with-first').select2_wprm({
|
117 |
-
width: '250px',
|
118 |
-
ajax: {
|
119 |
-
type: 'POST',
|
120 |
-
url: wprm_admin.ajax_url,
|
121 |
-
dataType: 'json',
|
122 |
-
delay: 250,
|
123 |
-
data: function (params) {
|
124 |
-
return {
|
125 |
-
action: 'wprm_search_recipes',
|
126 |
-
security: wprm_admin.nonce,
|
127 |
-
search: params.term
|
128 |
-
};
|
129 |
-
},
|
130 |
-
processResults: function (out, params) {
|
131 |
-
var default_options = [{
|
132 |
-
id: '0',
|
133 |
-
text: wprm_admin.modal.text.first_recipe_on_page,
|
134 |
-
}];
|
135 |
-
return {
|
136 |
-
results: default_options.concat(out.data.recipes_with_id),
|
137 |
-
};
|
138 |
-
},
|
139 |
-
cache: true
|
140 |
-
},
|
141 |
-
});
|
142 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/admin/modal/Recipe.js
DELETED
@@ -1,394 +0,0 @@
|
|
1 |
-
import * as utils from './utils';
|
2 |
-
import recipeInit from './RecipeInit';
|
3 |
-
import RichEditor from './RichEditor';
|
4 |
-
|
5 |
-
let Recipe = {
|
6 |
-
id: 0,
|
7 |
-
type: 'insert',
|
8 |
-
fields: false,
|
9 |
-
ingredient: {},
|
10 |
-
instructions: {},
|
11 |
-
prep_time_set: false,
|
12 |
-
cook_time_set: false,
|
13 |
-
total_time_set: false,
|
14 |
-
init: function() {
|
15 |
-
recipeInit(this);
|
16 |
-
},
|
17 |
-
clear: function() {
|
18 |
-
// Recipe Details
|
19 |
-
jQuery('#wprm-recipe-type').val('food').change();
|
20 |
-
utils.remove_media('image', jQuery('.wprm-recipe-image-container'));
|
21 |
-
jQuery('#wprm-recipe-name').val('');
|
22 |
-
RichEditor.clear(); // Recipe summary
|
23 |
-
jQuery('#wprm-recipe-author-display').val('default').change();
|
24 |
-
jQuery('#wprm-recipe-author-link').val('');
|
25 |
-
jQuery('#wprm-recipe-servings').val('');
|
26 |
-
jQuery('#wprm-recipe-servings-unit').val('');
|
27 |
-
jQuery('#wprm-recipe-calories').val('');
|
28 |
-
jQuery('#wprm-recipe-prep-time').val('');
|
29 |
-
jQuery('#wprm-recipe-cook-time').val('');
|
30 |
-
jQuery('#wprm-recipe-total-time').val('');
|
31 |
-
jQuery('#wprm-recipe-custom-time').val('');
|
32 |
-
jQuery('#wprm-recipe-custom-time-label').val('');
|
33 |
-
|
34 |
-
this.prep_time_set = false;
|
35 |
-
this.cook_time_set = false;
|
36 |
-
this.total_time_set = false;
|
37 |
-
|
38 |
-
jQuery('.wprm-recipe-tags').val(null).trigger('change');
|
39 |
-
|
40 |
-
// Default custom author.
|
41 |
-
var author_name_input = jQuery('#wprm-recipe-author-name');
|
42 |
-
author_name_input.val(author_name_input.data('default'));
|
43 |
-
|
44 |
-
// Ingredients & Instructions
|
45 |
-
jQuery('.wprm-recipe-ingredients .wprm-recipe-ingredients-instructions-delete, .wprm-recipe-instructions .wprm-recipe-ingredients-instructions-delete').each(function() {
|
46 |
-
jQuery(this).click();
|
47 |
-
});
|
48 |
-
jQuery('.wprm-recipe-ingredients-add').click();
|
49 |
-
jQuery('.wprm-recipe-instructions-add').click();
|
50 |
-
|
51 |
-
// Recipe Notes
|
52 |
-
utils.remove_media('video', jQuery('.wprm-recipe-video-container'));
|
53 |
-
if (typeof tinyMCE !== 'undefined' && tinyMCE.get('wprm_recipe_notes') && !tinyMCE.get('wprm_recipe_notes').isHidden()) {
|
54 |
-
tinyMCE.get('wprm_recipe_notes').focus(true);
|
55 |
-
|
56 |
-
// Check for error caused by EasyRecipe.
|
57 |
-
jQuery('.wprm-easyrecipe-warning').hide();
|
58 |
-
try {
|
59 |
-
tinyMCE.activeEditor.setContent('');
|
60 |
-
} catch(err) {
|
61 |
-
jQuery('.wprm-easyrecipe-warning').show();
|
62 |
-
}
|
63 |
-
} else {
|
64 |
-
jQuery('#wprm_recipe_notes').val('');
|
65 |
-
}
|
66 |
-
},
|
67 |
-
set: function(recipe) {
|
68 |
-
// Recipe Details
|
69 |
-
if (parseInt(recipe.image_id) > 0) {
|
70 |
-
utils.set_media('image', jQuery('.wprm-recipe-details-form #wprm-recipe-image-container'), recipe.image_id, recipe.image_url);
|
71 |
-
}
|
72 |
-
|
73 |
-
if (parseInt(recipe.pin_image_id) > 0) {
|
74 |
-
utils.set_media('image', jQuery('.wprm-recipe-details-form #wprm-recipe-pin-image-container'), recipe.pin_image_id, recipe.pin_image_url);
|
75 |
-
}
|
76 |
-
|
77 |
-
jQuery('#wprm-recipe-type').val(recipe.type).change();
|
78 |
-
jQuery('#wprm-recipe-name').val(recipe.name);
|
79 |
-
RichEditor.set(recipe.summary);
|
80 |
-
jQuery('#wprm-recipe-servings-unit').val(recipe.servings_unit);
|
81 |
-
jQuery('#wprm-recipe-custom-time-label').val(recipe.custom_time_label);
|
82 |
-
|
83 |
-
jQuery('#wprm-recipe-author-display').val(recipe.author_display).change();
|
84 |
-
jQuery('#wprm-recipe-author-name').val(recipe.author_name);
|
85 |
-
jQuery('#wprm-recipe-author-link').val(recipe.author_link);
|
86 |
-
|
87 |
-
var servings = parseInt(recipe.servings) > 0 ? parseInt(recipe.servings) : '',
|
88 |
-
calories = recipe.nutrition.calories ? parseFloat(recipe.nutrition.calories) : '',
|
89 |
-
prep_time = parseInt(recipe.prep_time) > 0 ? parseInt(recipe.prep_time) : '',
|
90 |
-
cook_time = parseInt(recipe.cook_time) > 0 ? parseInt(recipe.cook_time) : '',
|
91 |
-
total_time = parseInt(recipe.total_time) > 0 ? parseInt(recipe.total_time) : '',
|
92 |
-
custom_time = parseInt(recipe.custom_time) > 0 ? parseInt(recipe.custom_time) : '';
|
93 |
-
|
94 |
-
jQuery('#wprm-recipe-servings').val(servings);
|
95 |
-
jQuery('#wprm-recipe-calories').val(calories);
|
96 |
-
jQuery('#wprm-recipe-prep-time').val(prep_time);
|
97 |
-
jQuery('#wprm-recipe-cook-time').val(cook_time);
|
98 |
-
jQuery('#wprm-recipe-total-time').val(total_time);
|
99 |
-
jQuery('#wprm-recipe-custom-time').val(custom_time);
|
100 |
-
|
101 |
-
if (prep_time) this.prep_time_set = true;
|
102 |
-
if (cook_time) this.cook_time_set = true;
|
103 |
-
if (total_time) this.total_time_set = true;
|
104 |
-
|
105 |
-
for (var tag in recipe.tags) {
|
106 |
-
if (recipe.tags.hasOwnProperty(tag)) {
|
107 |
-
this.setTags(recipe, tag);
|
108 |
-
}
|
109 |
-
}
|
110 |
-
|
111 |
-
// Ingredients & Instructions
|
112 |
-
this.setIngredients(recipe.ingredients);
|
113 |
-
this.setInstructions(recipe.instructions);
|
114 |
-
|
115 |
-
// Recipe Notes
|
116 |
-
if (parseInt(recipe.video_id) > 0) {
|
117 |
-
utils.set_media('video',jQuery('.wprm-recipe-notes-form .wprm-recipe-video-container'), recipe.video_id, recipe.video_thumb_url);
|
118 |
-
} else if (recipe.video_embed) {
|
119 |
-
utils.set_media_embed('video',jQuery('.wprm-recipe-notes-form .wprm-recipe-video-container'), recipe.video_embed);
|
120 |
-
}
|
121 |
-
|
122 |
-
if (typeof tinyMCE !== 'undefined' && tinyMCE.get('wprm_recipe_notes') && !tinyMCE.get('wprm_recipe_notes').isHidden()) {
|
123 |
-
tinyMCE.get('wprm_recipe_notes').focus(true);
|
124 |
-
tinyMCE.activeEditor.setContent(recipe.notes);
|
125 |
-
} else {
|
126 |
-
jQuery('#wprm_recipe_notes').val(recipe.notes);
|
127 |
-
}
|
128 |
-
},
|
129 |
-
setTags: function(recipe, tag) {
|
130 |
-
var term_ids = [],
|
131 |
-
select = jQuery('#wprm-recipe-tag-' + tag);
|
132 |
-
|
133 |
-
for (var i = 0, l = recipe.tags[tag].length; i < l; i++) {
|
134 |
-
var term = recipe.tags[tag][i];
|
135 |
-
term_ids.push(term.term_id);
|
136 |
-
|
137 |
-
// Add term to options if not in there
|
138 |
-
if (select.find('option[value=' + term.term_id + ']').length === 0) {
|
139 |
-
select.append('<option value="' + term.term_id + '">' + term.name + '</option>');
|
140 |
-
}
|
141 |
-
}
|
142 |
-
select.val(term_ids).trigger('change');
|
143 |
-
},
|
144 |
-
setIngredients: function(ingredients) {
|
145 |
-
jQuery('.wprm-recipe-ingredients .wprm-recipe-ingredients-instructions-delete').each(function() {
|
146 |
-
jQuery(this).click();
|
147 |
-
});
|
148 |
-
|
149 |
-
var i, l, group, j, m;
|
150 |
-
|
151 |
-
for (i = 0, l = ingredients.length; i < l; i++) {
|
152 |
-
group = ingredients[i];
|
153 |
-
|
154 |
-
if (i > 0 || group.name !== '') {
|
155 |
-
Recipe.addIngredientGroup(group.name);
|
156 |
-
}
|
157 |
-
|
158 |
-
for (j = 0, m = group.ingredients.length; j < m; j++) {
|
159 |
-
var ingredient = group.ingredients[j];
|
160 |
-
var uid = Recipe.addIngredient(ingredient.amount, ingredient.unit, ingredient.name, ingredient.notes);
|
161 |
-
Recipe.ingredients[uid] = ingredient;
|
162 |
-
}
|
163 |
-
}
|
164 |
-
},
|
165 |
-
setInstructions: function(instructions) {
|
166 |
-
jQuery('.wprm-recipe-instructions .wprm-recipe-ingredients-instructions-delete').each(function() {
|
167 |
-
jQuery(this).click();
|
168 |
-
});
|
169 |
-
|
170 |
-
var i, l, group, j, m;
|
171 |
-
|
172 |
-
for (i = 0, l = instructions.length; i < l; i++) {
|
173 |
-
group = instructions[i];
|
174 |
-
|
175 |
-
if (i > 0 || group.name !== '') {
|
176 |
-
Recipe.addInstructionGroup(group.name);
|
177 |
-
}
|
178 |
-
|
179 |
-
for (j = 0, m = group.instructions.length; j < m; j++) {
|
180 |
-
var instruction = group.instructions[j];
|
181 |
-
var uid = Recipe.addInstruction(instruction.text, instruction.image);
|
182 |
-
Recipe.instructions[uid] = instruction;
|
183 |
-
}
|
184 |
-
}
|
185 |
-
},
|
186 |
-
get: function() {
|
187 |
-
// Default author display
|
188 |
-
var author_display = jQuery('#wprm-recipe-author-display').val();
|
189 |
-
|
190 |
-
if(author_display == 'default') {
|
191 |
-
author_display = jQuery('#wprm-recipe-author-display').find('option:first').data('default');
|
192 |
-
}
|
193 |
-
|
194 |
-
// Recipe Details
|
195 |
-
var recipe = {
|
196 |
-
type: jQuery('#wprm-recipe-type').val(),
|
197 |
-
image_id: jQuery('#wprm-recipe-image-id').val(),
|
198 |
-
pin_image_id: jQuery('#wprm-recipe-pin-image-id').val(),
|
199 |
-
video_id: jQuery('#wprm-recipe-video-id').val(),
|
200 |
-
video_embed: jQuery('#wprm-recipe-video-embed').val(),
|
201 |
-
name: jQuery('#wprm-recipe-name').val(),
|
202 |
-
summary: jQuery('#wprm-recipe-summary').val(),
|
203 |
-
author_display: author_display,
|
204 |
-
author_name: jQuery('#wprm-recipe-author-name').val(),
|
205 |
-
author_link: jQuery('#wprm-recipe-author-link').val(),
|
206 |
-
servings: jQuery('#wprm-recipe-servings').val(),
|
207 |
-
servings_unit: jQuery('#wprm-recipe-servings-unit').val(),
|
208 |
-
prep_time: jQuery('#wprm-recipe-prep-time').val(),
|
209 |
-
cook_time: jQuery('#wprm-recipe-cook-time').val(),
|
210 |
-
total_time: jQuery('#wprm-recipe-total-time').val(),
|
211 |
-
custom_time: jQuery('#wprm-recipe-custom-time').val(),
|
212 |
-
custom_time_label: jQuery('#wprm-recipe-custom-time-label').val(),
|
213 |
-
nutrition: {
|
214 |
-
calories: jQuery('#wprm-recipe-calories').val()
|
215 |
-
},
|
216 |
-
tags: {
|
217 |
-
course: jQuery('#wprm-recipe-tag-course').val(),
|
218 |
-
cuisine: jQuery('#wprm-recipe-tag-cuisine').val()
|
219 |
-
}
|
220 |
-
};
|
221 |
-
|
222 |
-
// Recipe Tags
|
223 |
-
recipe.tags = {};
|
224 |
-
jQuery('.wprm-recipe-tags').each(function() {
|
225 |
-
recipe.tags[jQuery(this).data('key')] = jQuery(this).val();
|
226 |
-
});
|
227 |
-
|
228 |
-
// Recipe Ingredients
|
229 |
-
recipe.ingredients = this.getIngredients();
|
230 |
-
|
231 |
-
// Recipe Instructions
|
232 |
-
var instructions = [];
|
233 |
-
var instruction_group = {
|
234 |
-
name: '',
|
235 |
-
instructions: []
|
236 |
-
};
|
237 |
-
jQuery('.wprm-recipe-instructions').find('tr').each(function() {
|
238 |
-
var row = jQuery(this);
|
239 |
-
if (row.hasClass('wprm-recipe-instruction-group')) {
|
240 |
-
// Add current instruction group to instructions
|
241 |
-
instructions.push(instruction_group);
|
242 |
-
|
243 |
-
instruction_group = {
|
244 |
-
name: row.find('.wprm-recipe-instruction-group-name').val(),
|
245 |
-
instructions: []
|
246 |
-
};
|
247 |
-
} else {
|
248 |
-
instruction_group.instructions.push({
|
249 |
-
text: row.find('textarea.wprm-recipe-instruction-text').val(),
|
250 |
-
image: row.find('.wprm-recipe-instruction-image').val()
|
251 |
-
});
|
252 |
-
}
|
253 |
-
});
|
254 |
-
// Add remaining instruction group
|
255 |
-
instructions.push(instruction_group);
|
256 |
-
|
257 |
-
recipe.instructions = instructions;
|
258 |
-
|
259 |
-
// Recipe Notes
|
260 |
-
if (typeof tinyMCE !== 'undefined' && tinyMCE.get('wprm_recipe_notes') && !tinyMCE.get('wprm_recipe_notes').isHidden()) {
|
261 |
-
recipe.notes = tinyMCE.get('wprm_recipe_notes').getContent();
|
262 |
-
} else {
|
263 |
-
recipe.notes = jQuery('#wprm_recipe_notes').val();
|
264 |
-
}
|
265 |
-
|
266 |
-
return recipe;
|
267 |
-
},
|
268 |
-
getIngredients: function() {
|
269 |
-
var ingredients = [];
|
270 |
-
var ingredient_group = {
|
271 |
-
name: '',
|
272 |
-
ingredients: []
|
273 |
-
};
|
274 |
-
jQuery('.wprm-recipe-ingredients').find('tr').each(function() {
|
275 |
-
var row = jQuery(this);
|
276 |
-
if (row.hasClass('wprm-recipe-ingredient-group')) {
|
277 |
-
// Add current ingredient group to ingredients
|
278 |
-
ingredients.push(ingredient_group);
|
279 |
-
|
280 |
-
ingredient_group = {
|
281 |
-
name: row.find('.wprm-recipe-ingredient-group-name').val(),
|
282 |
-
ingredients: []
|
283 |
-
};
|
284 |
-
} else {
|
285 |
-
var uid = row.data('uid'),
|
286 |
-
ingredient = {};
|
287 |
-
|
288 |
-
// Get original values.
|
289 |
-
if(Recipe.ingredients.hasOwnProperty(uid)) {
|
290 |
-
ingredient = Recipe.ingredients[uid];
|
291 |
-
}
|
292 |
-
|
293 |
-
// Update ingredients.
|
294 |
-
ingredient['amount'] = row.find('.wprm-recipe-ingredient-amount').val();
|
295 |
-
ingredient['unit'] = row.find('.wprm-recipe-ingredient-unit').val();
|
296 |
-
ingredient['name'] = row.find('.wprm-recipe-ingredient-name').val();
|
297 |
-
ingredient['notes'] = row.find('.wprm-recipe-ingredient-notes').val();
|
298 |
-
|
299 |
-
// Unit Conversion.
|
300 |
-
var converted = jQuery('#wprm-ingredient-conversion-' + uid);
|
301 |
-
|
302 |
-
if (converted.length > 0) {
|
303 |
-
var amount = converted.find('.wprmuc-system-2-amount').val(),
|
304 |
-
unit = converted.find('.wprmuc-system-2-unit').val();
|
305 |
-
|
306 |
-
ingredient['converted'] = {
|
307 |
-
2: {
|
308 |
-
amount: amount,
|
309 |
-
unit: unit,
|
310 |
-
}
|
311 |
-
};
|
312 |
-
}
|
313 |
-
|
314 |
-
// Add ingredient to group.
|
315 |
-
ingredient_group.ingredients.push(ingredient);
|
316 |
-
}
|
317 |
-
});
|
318 |
-
|
319 |
-
// Add remaining ingredient group
|
320 |
-
ingredients.push(ingredient_group);
|
321 |
-
|
322 |
-
return ingredients;
|
323 |
-
},
|
324 |
-
addIngredient: function(amount = '', unit = '', name = '', notes = '') {
|
325 |
-
var clone = jQuery('.wprm-recipe-ingredients-placeholder').find('.wprm-recipe-ingredient').clone();
|
326 |
-
jQuery('.wprm-recipe-ingredients-instructions-form .wprm-recipe-ingredients').append(clone);
|
327 |
-
|
328 |
-
clone.find('.wprm-recipe-ingredient-amount').val(utils.decode_html_entities(amount)).focus();
|
329 |
-
clone.find('.wprm-recipe-ingredient-unit').val(utils.decode_html_entities(unit));
|
330 |
-
clone.find('.wprm-recipe-ingredient-name').val(utils.decode_html_entities(name));
|
331 |
-
clone.find('.wprm-recipe-ingredient-notes').val(utils.decode_html_entities(notes));
|
332 |
-
|
333 |
-
while(true) {
|
334 |
-
var uid = Math.floor(Math.random() * 99999);
|
335 |
-
if(!Recipe.ingredients.hasOwnProperty(uid)) {
|
336 |
-
clone.data('uid', uid);
|
337 |
-
Recipe.ingredients[uid] = {};
|
338 |
-
return uid;
|
339 |
-
}
|
340 |
-
}
|
341 |
-
},
|
342 |
-
addIngredientGroup: function(name = '') {
|
343 |
-
var clone = jQuery('.wprm-recipe-ingredients-placeholder').find('.wprm-recipe-ingredient-group').clone();
|
344 |
-
jQuery('.wprm-recipe-ingredients-instructions-form .wprm-recipe-ingredients').append(clone);
|
345 |
-
clone.find('input:first').val(name).focus();
|
346 |
-
},
|
347 |
-
addInstruction: function(text = '', image_id = 0) {
|
348 |
-
var clone = jQuery('.wprm-recipe-instructions-placeholder').find('.wprm-recipe-instruction').clone();
|
349 |
-
|
350 |
-
clone.find('.wprm-recipe-instruction-text').addClass('wprm-rich-editor');
|
351 |
-
jQuery('.wprm-recipe-ingredients-instructions-form .wprm-recipe-instructions').append(clone);
|
352 |
-
clone.find('.wprm-recipe-instruction-text').val(text);
|
353 |
-
RichEditor.init();
|
354 |
-
clone.find('.wprm-recipe-instruction-text').focus();
|
355 |
-
|
356 |
-
// Get image thumbnail if there is an instruction image.
|
357 |
-
if (parseInt(image_id) > 0) {
|
358 |
-
var image_container = clone.find('.wprm-recipe-image-container'),
|
359 |
-
button = image_container.find('.wprm-recipe-image-add');
|
360 |
-
|
361 |
-
var data = {
|
362 |
-
action: 'wprm_get_thumbnail',
|
363 |
-
security: wprm_admin.nonce,
|
364 |
-
image_id: image_id
|
365 |
-
};
|
366 |
-
|
367 |
-
utils.start_loader(button);
|
368 |
-
|
369 |
-
jQuery.post(wprm_admin.ajax_url, data, function(out) {
|
370 |
-
utils.stop_loader(button);
|
371 |
-
|
372 |
-
if (out.success) {
|
373 |
-
utils.set_media('image',image_container, image_id, out.data.image_url);
|
374 |
-
}
|
375 |
-
}, 'json');
|
376 |
-
}
|
377 |
-
|
378 |
-
while(true) {
|
379 |
-
var uid = Math.floor(Math.random() * 99999);
|
380 |
-
if(!Recipe.instructions.hasOwnProperty(uid)) {
|
381 |
-
clone.data('uid', uid);
|
382 |
-
Recipe.instructions[uid] = {};
|
383 |
-
return uid;
|
384 |
-
}
|
385 |
-
}
|
386 |
-
|
387 |
-
},
|
388 |
-
addInstructionGroup: function(name = '') {
|
389 |
-
var clone = jQuery('.wprm-recipe-instructions-placeholder').find('.wprm-recipe-instruction-group').clone();
|
390 |
-
jQuery('.wprm-recipe-ingredients-instructions-form .wprm-recipe-instructions').append(clone);
|
391 |
-
clone.find('input:first').val(name).focus();
|
392 |
-
},
|
393 |
-
}
|
394 |
-
export default Recipe;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/admin/modal/RecipeInit.js
DELETED
@@ -1,138 +0,0 @@
|
|
1 |
-
import '../../../../vendor/select2/js/select2.min.js';
|
2 |
-
import '../../../../vendor/select2/css/select2.min.css';
|
3 |
-
|
4 |
-
import * as utils from './utils';
|
5 |
-
import Modal from './Modal';
|
6 |
-
import Recipe from './Recipe';
|
7 |
-
import RichEditor from './RichEditor';
|
8 |
-
|
9 |
-
export default function recipeInit(recipe) {
|
10 |
-
// Check for changes made
|
11 |
-
jQuery('.wprm-modal').on('change', 'input, textarea, #wprm-recipe-author-display, .wprm-recipe-tags, #wprm-ingredient-links-type', function() {
|
12 |
-
Modal.changes_made = true;
|
13 |
-
});
|
14 |
-
|
15 |
-
// Recipe and Instruction Image handler
|
16 |
-
jQuery('.wprm-recipe-details-form, .wprm-recipe-instructions-form').on('click', '.wprm-recipe-image-add', function(e) {
|
17 |
-
utils.select_media('image', jQuery(this).parents('.wprm-recipe-image-container'));
|
18 |
-
});
|
19 |
-
jQuery('.wprm-recipe-details-form, .wprm-recipe-instructions-form').on('click', '.wprm-recipe-image-remove', function(e) {
|
20 |
-
e.preventDefault();
|
21 |
-
utils.remove_media('image', jQuery(this).parents('.wprm-recipe-image-container'));
|
22 |
-
});
|
23 |
-
|
24 |
-
// Recipe Video handler
|
25 |
-
jQuery('.wprm-recipe-notes-form').on('click', '.wprm-recipe-video-add', function(e) {
|
26 |
-
utils.select_media('video', jQuery(this).parents('.wprm-recipe-video-container'));
|
27 |
-
});
|
28 |
-
jQuery('.wprm-recipe-notes-form').on('click', '.wprm-recipe-video-remove', function(e) {
|
29 |
-
utils.remove_media('video', jQuery(this).parents('.wprm-recipe-video-container'));
|
30 |
-
});
|
31 |
-
jQuery('.wprm-recipe-notes-form').on('click', '.wprm-recipe-video-embed', function(e) {
|
32 |
-
utils.set_media_embed('video', jQuery(this).parents('.wprm-recipe-video-container'), '');
|
33 |
-
});
|
34 |
-
|
35 |
-
// Initialize rich editor
|
36 |
-
RichEditor.init();
|
37 |
-
|
38 |
-
// Type
|
39 |
-
jQuery('#wprm-recipe-type').select2_wprm({
|
40 |
-
width: '95%'
|
41 |
-
});
|
42 |
-
|
43 |
-
// Author
|
44 |
-
jQuery('#wprm-recipe-author-display').select2_wprm({
|
45 |
-
width: '95%'
|
46 |
-
});
|
47 |
-
|
48 |
-
jQuery(document).on('change', '#wprm-recipe-author-display', function() {
|
49 |
-
var author_display = jQuery(this).val(),
|
50 |
-
default_display = jQuery(this).find('option:first').data('default');
|
51 |
-
|
52 |
-
if(author_display == 'custom' || (author_display == 'default' && default_display == 'custom')) {
|
53 |
-
jQuery('#wprm-recipe-author-name-container').show();
|
54 |
-
jQuery('#wprm-recipe-author-link-container').show();
|
55 |
-
} else {
|
56 |
-
jQuery('#wprm-recipe-author-name-container').hide();
|
57 |
-
jQuery('#wprm-recipe-author-link-container').hide();
|
58 |
-
}
|
59 |
-
});
|
60 |
-
jQuery('#wprm-recipe-author-display').change();
|
61 |
-
|
62 |
-
// Recipe Times
|
63 |
-
jQuery('.wprm-recipe-time').on('keyup change', function() {
|
64 |
-
var container = jQuery(this),
|
65 |
-
prep_time_container = jQuery('#wprm-recipe-prep-time'),
|
66 |
-
prep_time = prep_time_container.val(),
|
67 |
-
cook_time_container = jQuery('#wprm-recipe-cook-time'),
|
68 |
-
cook_time = cook_time_container.val(),
|
69 |
-
total_time_container = jQuery('#wprm-recipe-total-time'),
|
70 |
-
total_time = total_time_container.val();
|
71 |
-
|
72 |
-
if (container.is('#wprm-recipe-prep-time')) Recipe.prep_time_set = true;
|
73 |
-
if (container.is('#wprm-recipe-cook-time')) Recipe.cook_time_set = true;
|
74 |
-
if (container.is('#wprm-recipe-total-time')) Recipe.total_time_set = true;
|
75 |
-
|
76 |
-
if (prep_time && cook_time && !Recipe.total_time_set) total_time_container.val(parseInt(prep_time) + parseInt(cook_time));
|
77 |
-
if (total_time && prep_time && !Recipe.cook_time_set) cook_time_container.val(parseInt(total_time) - parseInt(prep_time));
|
78 |
-
if (total_time && cook_time && !Recipe.prep_time_set) prep_time_container.val(parseInt(total_time) - parseInt(cook_time));
|
79 |
-
});
|
80 |
-
|
81 |
-
// Recipe Tags
|
82 |
-
jQuery('.wprm-recipe-tags').select2_wprm({
|
83 |
-
width: '95%',
|
84 |
-
tags: true
|
85 |
-
});
|
86 |
-
|
87 |
-
// Add Recipe Ingredients and Instructions
|
88 |
-
jQuery('.wprm-recipe-ingredients-add').on('click', function() {
|
89 |
-
Recipe.addIngredient();
|
90 |
-
});
|
91 |
-
jQuery('.wprm-recipe-ingredients-add-group').on('click', function() {
|
92 |
-
Recipe.addIngredientGroup();
|
93 |
-
});
|
94 |
-
jQuery('.wprm-recipe-instructions-add').on('click', function() {
|
95 |
-
Recipe.addInstruction();
|
96 |
-
});
|
97 |
-
jQuery('.wprm-recipe-instructions-add-group').on('click', function() {
|
98 |
-
Recipe.addInstructionGroup();
|
99 |
-
});
|
100 |
-
|
101 |
-
// Add new ingredient/instruction on TAB
|
102 |
-
jQuery('.wprm-recipe-ingredients').on('keydown', '.wprm-recipe-ingredient-notes, .wprm-recipe-ingredient-group-name', function(e) {
|
103 |
-
var keyCode = e.keyCode || e.which,
|
104 |
-
input = jQuery(this);
|
105 |
-
|
106 |
-
if (!e.shiftKey && keyCode == 9 && jQuery(this).parents('tr').is('tr:last-child')) {
|
107 |
-
e.preventDefault();
|
108 |
-
Recipe.addIngredient();
|
109 |
-
}
|
110 |
-
});
|
111 |
-
jQuery('.wprm-recipe-instructions').on('keydown', '.wprm-recipe-instruction-text, .wprm-recipe-instruction-group-name', function(e) {
|
112 |
-
var keyCode = e.keyCode || e.which,
|
113 |
-
input = jQuery(this);
|
114 |
-
|
115 |
-
if (!e.shiftKey && keyCode == 9 && jQuery(this).parents('tr').is('tr:last-child')) {
|
116 |
-
e.preventDefault();
|
117 |
-
Recipe.addInstruction();
|
118 |
-
}
|
119 |
-
});
|
120 |
-
|
121 |
-
// Remove Recipe Ingredients and Instructions
|
122 |
-
jQuery('.wprm-recipe-ingredients-instructions-form').on('click', '.wprm-recipe-ingredients-instructions-delete', function() {
|
123 |
-
jQuery(this).parents('tr').remove();
|
124 |
-
});
|
125 |
-
|
126 |
-
// Sort Recipe Ingredients and Instructions
|
127 |
-
jQuery('.wprm-recipe-ingredients, .wprm-recipe-instructions').sortable({
|
128 |
-
opacity: 0.6,
|
129 |
-
revert: true,
|
130 |
-
cursor: 'move',
|
131 |
-
handle: '.wprm-recipe-ingredients-instructions-sort',
|
132 |
-
});
|
133 |
-
|
134 |
-
// Save recipe button.
|
135 |
-
jQuery('.wprm-button-action-save').on('click', function() {
|
136 |
-
Modal.actions.insert_update_recipe(jQuery(this));
|
137 |
-
});
|
138 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/admin/modal/RichEditor.js
DELETED
@@ -1,121 +0,0 @@
|
|
1 |
-
import rangy from 'rangy';
|
2 |
-
import MediumEditor from 'medium-editor';
|
3 |
-
import 'medium-editor/dist/css/medium-editor.css';
|
4 |
-
import 'medium-editor/dist/css/themes/beagle.css';
|
5 |
-
|
6 |
-
import {initRichEditorLinks, RichEditorLinksExtension} from './RichEditorLinks';
|
7 |
-
import Modal from './Modal';
|
8 |
-
|
9 |
-
let RichEditor = {
|
10 |
-
editor: false,
|
11 |
-
clear: function() {
|
12 |
-
this.editor.resetContent();
|
13 |
-
},
|
14 |
-
set: function(content) {
|
15 |
-
this.editor.setContent(content);
|
16 |
-
},
|
17 |
-
init: function() {
|
18 |
-
if (this.editor) {
|
19 |
-
this.editor.addElements('.wprm-rich-editor');
|
20 |
-
} else {
|
21 |
-
rangy.init();
|
22 |
-
initRichEditorLinks();
|
23 |
-
|
24 |
-
let args = {
|
25 |
-
placeholder: {
|
26 |
-
text: wprm_admin.modal.text.medium_editor_placeholder,
|
27 |
-
hideOnClick: true
|
28 |
-
},
|
29 |
-
autoLink: true,
|
30 |
-
anchorPreview: {
|
31 |
-
showWhenToolbarIsVisible: false,
|
32 |
-
},
|
33 |
-
imageDragging: false,
|
34 |
-
toolbar: {
|
35 |
-
buttons: ['bold', 'italic', 'underline', 'subscript', 'superscript']
|
36 |
-
},
|
37 |
-
extensions: {}
|
38 |
-
};
|
39 |
-
|
40 |
-
args.toolbar.buttons.push('links');
|
41 |
-
args.extensions.links = new this.extensions.links();
|
42 |
-
|
43 |
-
if(wprm_admin.addons.premium) {
|
44 |
-
args.toolbar.buttons.push('adjustable_servings');
|
45 |
-
args.toolbar.buttons.push('timer');
|
46 |
-
|
47 |
-
args.extensions.adjustable_servings = new this.extensions.adjustable_servings();
|
48 |
-
args.extensions.timer = new this.extensions.timer();
|
49 |
-
}
|
50 |
-
|
51 |
-
this.editor = new MediumEditor('.wprm-rich-editor', args);
|
52 |
-
this.editor.subscribe('editableInput', function() {
|
53 |
-
Modal.changes_made = true;
|
54 |
-
});
|
55 |
-
}
|
56 |
-
},
|
57 |
-
extensions: {
|
58 |
-
adjustable_servings: MediumEditor.Extension.extend({
|
59 |
-
name: 'adjustable_servings',
|
60 |
-
init: function () {
|
61 |
-
this.button = this.document.createElement('button');
|
62 |
-
this.button.classList.add('medium-editor-action');
|
63 |
-
this.button.innerHTML = '<b>Adjustable</b>';
|
64 |
-
this.button.title = 'Adjustable Quantity';
|
65 |
-
|
66 |
-
this.on(this.button, 'click', this.handleClick.bind(this));
|
67 |
-
},
|
68 |
-
getButton: function () {
|
69 |
-
return this.button;
|
70 |
-
},
|
71 |
-
handleClick: function (event) {
|
72 |
-
var selection = rangy.getSelection(),
|
73 |
-
range = selection.getRangeAt(0),
|
74 |
-
original_range = range.cloneRange(),
|
75 |
-
end_range = range.cloneRange(),
|
76 |
-
text = range.getDocument().createTextNode('[adjustable]'),
|
77 |
-
end_text = range.getDocument().createTextNode('[/adjustable]');
|
78 |
-
|
79 |
-
end_range.collapse(false);
|
80 |
-
end_range.insertNode(end_text);
|
81 |
-
end_range.detach();
|
82 |
-
range.setEndAfter(end_text);
|
83 |
-
|
84 |
-
range.insertNode(text);
|
85 |
-
rangy.getSelection().setSingleRange(original_range);
|
86 |
-
}
|
87 |
-
}),
|
88 |
-
timer: MediumEditor.Extension.extend({
|
89 |
-
name: 'timer',
|
90 |
-
init: function () {
|
91 |
-
this.button = this.document.createElement('button');
|
92 |
-
this.button.classList.add('medium-editor-action');
|
93 |
-
this.button.innerHTML = '<b>Timer</b>';
|
94 |
-
this.button.title = 'Timer';
|
95 |
-
|
96 |
-
this.on(this.button, 'click', this.handleClick.bind(this));
|
97 |
-
},
|
98 |
-
getButton: function () {
|
99 |
-
return this.button;
|
100 |
-
},
|
101 |
-
handleClick: function (event) {
|
102 |
-
var selection = rangy.getSelection(),
|
103 |
-
range = selection.getRangeAt(0),
|
104 |
-
original_range = range.cloneRange(),
|
105 |
-
end_range = range.cloneRange(),
|
106 |
-
text = range.getDocument().createTextNode('[timer minutes=0]'),
|
107 |
-
end_text = range.getDocument().createTextNode('[/timer]');
|
108 |
-
|
109 |
-
end_range.collapse(false);
|
110 |
-
end_range.insertNode(end_text);
|
111 |
-
end_range.detach();
|
112 |
-
range.setEndAfter(end_text);
|
113 |
-
|
114 |
-
range.insertNode(text);
|
115 |
-
rangy.getSelection().setSingleRange(original_range);
|
116 |
-
}
|
117 |
-
}),
|
118 |
-
links: RichEditorLinksExtension,
|
119 |
-
}
|
120 |
-
}
|
121 |
-
export default RichEditor;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/admin/modal/RichEditorLinks.js
DELETED
@@ -1,576 +0,0 @@
|
|
1 |
-
import MediumEditor from 'medium-editor';
|
2 |
-
|
3 |
-
export function initRichEditorLinks() {
|
4 |
-
// Source: medium-editor.js
|
5 |
-
MediumEditor.prototype.createLink = function (opts) {
|
6 |
-
var currentEditor = MediumEditor.selection.getSelectionElement(this.options.contentWindow),
|
7 |
-
customEvent = {},
|
8 |
-
targetUrl;
|
9 |
-
|
10 |
-
// Make sure the selection is within an element this editor is tracking
|
11 |
-
if (this.elements.indexOf(currentEditor) === -1) {
|
12 |
-
return;
|
13 |
-
}
|
14 |
-
|
15 |
-
try {
|
16 |
-
this.events.disableCustomEvent('editableInput');
|
17 |
-
// TODO: Deprecate support for opts.url in 6.0.0
|
18 |
-
if (opts.url) {
|
19 |
-
MediumEditor.util.deprecated('.url option for createLink', '.value', '6.0.0');
|
20 |
-
}
|
21 |
-
targetUrl = opts.url || opts.value;
|
22 |
-
if (targetUrl && targetUrl.trim().length > 0) {
|
23 |
-
var currentSelection = this.options.contentWindow.getSelection();
|
24 |
-
if (currentSelection) {
|
25 |
-
var currRange = currentSelection.getRangeAt(0),
|
26 |
-
commonAncestorContainer = currRange.commonAncestorContainer,
|
27 |
-
exportedSelection,
|
28 |
-
startContainerParentElement,
|
29 |
-
endContainerParentElement,
|
30 |
-
textNodes;
|
31 |
-
|
32 |
-
// If the selection is contained within a single text node
|
33 |
-
// and the selection starts at the beginning of the text node,
|
34 |
-
// MSIE still says the startContainer is the parent of the text node.
|
35 |
-
// If the selection is contained within a single text node, we
|
36 |
-
// want to just use the default browser 'createLink', so we need
|
37 |
-
// to account for this case and adjust the commonAncestorContainer accordingly
|
38 |
-
if (currRange.endContainer.nodeType === 3 &&
|
39 |
-
currRange.startContainer.nodeType !== 3 &&
|
40 |
-
currRange.startOffset === 0 &&
|
41 |
-
currRange.startContainer.firstChild === currRange.endContainer) {
|
42 |
-
commonAncestorContainer = currRange.endContainer;
|
43 |
-
}
|
44 |
-
|
45 |
-
startContainerParentElement = MediumEditor.util.getClosestBlockContainer(currRange.startContainer);
|
46 |
-
endContainerParentElement = MediumEditor.util.getClosestBlockContainer(currRange.endContainer);
|
47 |
-
|
48 |
-
// If the selection is not contained within a single text node
|
49 |
-
// but the selection is contained within the same block element
|
50 |
-
// we want to make sure we create a single link, and not multiple links
|
51 |
-
// which can happen with the built in browser functionality
|
52 |
-
if (commonAncestorContainer.nodeType !== 3 && commonAncestorContainer.textContent.length !== 0 && startContainerParentElement === endContainerParentElement) {
|
53 |
-
var parentElement = (startContainerParentElement || currentEditor),
|
54 |
-
fragment = this.options.ownerDocument.createDocumentFragment();
|
55 |
-
|
56 |
-
// since we are going to create a link from an extracted text,
|
57 |
-
// be sure that if we are updating a link, we won't let an empty link behind (see #754)
|
58 |
-
// (Workaroung for Chrome)
|
59 |
-
this.execAction('unlink');
|
60 |
-
|
61 |
-
exportedSelection = this.exportSelection();
|
62 |
-
fragment.appendChild(parentElement.cloneNode(true));
|
63 |
-
|
64 |
-
if (currentEditor === parentElement) {
|
65 |
-
// We have to avoid the editor itself being wiped out when it's the only block element,
|
66 |
-
// as our reference inside this.elements gets detached from the page when insertHTML runs.
|
67 |
-
// If we just use [parentElement, 0] and [parentElement, parentElement.childNodes.length]
|
68 |
-
// as the range boundaries, this happens whenever parentElement === currentEditor.
|
69 |
-
// The tradeoff to this workaround is that a orphaned tag can sometimes be left behind at
|
70 |
-
// the end of the editor's content.
|
71 |
-
// In Gecko:
|
72 |
-
// as an empty <strong></strong> if parentElement.lastChild is a <strong> tag.
|
73 |
-
// In WebKit:
|
74 |
-
// an invented <br /> tag at the end in the same situation
|
75 |
-
MediumEditor.selection.select(
|
76 |
-
this.options.ownerDocument,
|
77 |
-
parentElement.firstChild,
|
78 |
-
0,
|
79 |
-
parentElement.lastChild,
|
80 |
-
parentElement.lastChild.nodeType === 3 ?
|
81 |
-
parentElement.lastChild.nodeValue.length : parentElement.lastChild.childNodes.length
|
82 |
-
);
|
83 |
-
} else {
|
84 |
-
MediumEditor.selection.select(
|
85 |
-
this.options.ownerDocument,
|
86 |
-
parentElement,
|
87 |
-
0,
|
88 |
-
parentElement,
|
89 |
-
parentElement.childNodes.length
|
90 |
-
);
|
91 |
-
}
|
92 |
-
|
93 |
-
var modifiedExportedSelection = this.exportSelection();
|
94 |
-
|
95 |
-
textNodes = MediumEditor.util.findOrCreateMatchingTextNodes(
|
96 |
-
this.options.ownerDocument,
|
97 |
-
fragment,
|
98 |
-
{
|
99 |
-
start: exportedSelection.start - modifiedExportedSelection.start,
|
100 |
-
end: exportedSelection.end - modifiedExportedSelection.start,
|
101 |
-
editableElementIndex: exportedSelection.editableElementIndex
|
102 |
-
}
|
103 |
-
);
|
104 |
-
// If textNodes are not present, when changing link on images
|
105 |
-
// ex: <a><img src="http://image.test.com"></a>, change fragment to currRange.startContainer
|
106 |
-
// and set textNodes array to [imageElement, imageElement]
|
107 |
-
if (textNodes.length === 0) {
|
108 |
-
fragment = this.options.ownerDocument.createDocumentFragment();
|
109 |
-
fragment.appendChild(commonAncestorContainer.cloneNode(true));
|
110 |
-
textNodes = [fragment.firstChild.firstChild, fragment.firstChild.lastChild];
|
111 |
-
}
|
112 |
-
|
113 |
-
// Creates the link in the document fragment
|
114 |
-
MediumEditor.util.createLink(this.options.ownerDocument, textNodes, targetUrl.trim());
|
115 |
-
|
116 |
-
// Chrome trims the leading whitespaces when inserting HTML, which messes up restoring the selection.
|
117 |
-
var leadingWhitespacesCount = (fragment.firstChild.innerHTML.match(/^\s+/) || [''])[0].length;
|
118 |
-
|
119 |
-
// Now move the created link back into the original document in a way to preserve undo/redo history
|
120 |
-
MediumEditor.util.insertHTMLCommand(this.options.ownerDocument, fragment.firstChild.innerHTML.replace(/^\s+/, ''));
|
121 |
-
exportedSelection.start -= leadingWhitespacesCount;
|
122 |
-
exportedSelection.end -= leadingWhitespacesCount;
|
123 |
-
|
124 |
-
this.importSelection(exportedSelection);
|
125 |
-
} else {
|
126 |
-
this.options.ownerDocument.execCommand('createLink', false, targetUrl);
|
127 |
-
}
|
128 |
-
|
129 |
-
if (this.options.targetBlank || opts.target === '_blank') {
|
130 |
-
MediumEditor.util.setTargetBlank(MediumEditor.selection.getSelectionStart(this.options.ownerDocument), targetUrl);
|
131 |
-
} else {
|
132 |
-
MediumEditor.util.removeTargetBlank(MediumEditor.selection.getSelectionStart(this.options.ownerDocument), targetUrl);
|
133 |
-
}
|
134 |
-
|
135 |
-
if (opts.rel === 'nofollow') {
|
136 |
-
MediumEditor.util.setNofollow(MediumEditor.selection.getSelectionStart(this.options.ownerDocument), targetUrl);
|
137 |
-
} else {
|
138 |
-
MediumEditor.util.removeNofollow(MediumEditor.selection.getSelectionStart(this.options.ownerDocument), targetUrl);
|
139 |
-
}
|
140 |
-
|
141 |
-
if (opts.buttonClass) {
|
142 |
-
MediumEditor.util.addClassToAnchors(MediumEditor.selection.getSelectionStart(this.options.ownerDocument), opts.buttonClass);
|
143 |
-
}
|
144 |
-
}
|
145 |
-
}
|
146 |
-
// Fire input event for backwards compatibility if anyone was listening directly to the DOM input event
|
147 |
-
if (this.options.targetBlank || opts.target === '_blank' || opts.rel === 'nofollow' || opts.buttonClass) {
|
148 |
-
customEvent = this.options.ownerDocument.createEvent('HTMLEvents');
|
149 |
-
customEvent.initEvent('input', true, true, this.options.contentWindow);
|
150 |
-
for (var i = 0, len = this.elements.length; i < len; i += 1) {
|
151 |
-
this.elements[i].dispatchEvent(customEvent);
|
152 |
-
}
|
153 |
-
}
|
154 |
-
} finally {
|
155 |
-
this.events.enableCustomEvent('editableInput');
|
156 |
-
}
|
157 |
-
// Fire our custom editableInput event
|
158 |
-
this.events.triggerCustomEvent('editableInput', customEvent, currentEditor);
|
159 |
-
};
|
160 |
-
|
161 |
-
MediumEditor.util.setNofollow = function (el, anchorUrl) {
|
162 |
-
var i, url = anchorUrl || false;
|
163 |
-
if (el.nodeName.toLowerCase() === 'a') {
|
164 |
-
el.rel = 'nofollow';
|
165 |
-
} else {
|
166 |
-
el = el.getElementsByTagName('a');
|
167 |
-
|
168 |
-
for (i = 0; i < el.length; i += 1) {
|
169 |
-
if (false === url || url === el[i].attributes.href.value) {
|
170 |
-
el[i].rel = 'nofollow';
|
171 |
-
}
|
172 |
-
}
|
173 |
-
}
|
174 |
-
};
|
175 |
-
|
176 |
-
MediumEditor.util.removeNofollow = function (el, anchorUrl) {
|
177 |
-
var i;
|
178 |
-
if (el.nodeName.toLowerCase() === 'a') {
|
179 |
-
el.removeAttribute('rel');
|
180 |
-
} else {
|
181 |
-
el = el.getElementsByTagName('a');
|
182 |
-
|
183 |
-
for (i = 0; i < el.length; i += 1) {
|
184 |
-
if (anchorUrl === el[i].attributes.href.value) {
|
185 |
-
el[i].removeAttribute('rel');
|
186 |
-
}
|
187 |
-
}
|
188 |
-
}
|
189 |
-
};
|
190 |
-
};
|
191 |
-
|
192 |
-
export let RichEditorLinksExtension = MediumEditor.extensions.form.extend({
|
193 |
-
/* Anchor Form Options */
|
194 |
-
|
195 |
-
/* customClassOption: [string] (previously options.anchorButton + options.anchorButtonClass)
|
196 |
-
* Custom class name the user can optionally have added to their created links (ie 'button').
|
197 |
-
* If passed as a non-empty string, a checkbox will be displayed allowing the user to choose
|
198 |
-
* whether to have the class added to the created link or not.
|
199 |
-
*/
|
200 |
-
customClassOption: null,
|
201 |
-
|
202 |
-
/* customClassOptionText: [string]
|
203 |
-
* text to be shown in the checkbox when the __customClassOption__ is being used.
|
204 |
-
*/
|
205 |
-
customClassOptionText: 'Button',
|
206 |
-
|
207 |
-
/* linkValidation: [boolean] (previously options.checkLinkFormat)
|
208 |
-
* enables/disables check for common URL protocols on anchor links.
|
209 |
-
*/
|
210 |
-
linkValidation: false,
|
211 |
-
|
212 |
-
/* placeholderText: [string] (previously options.anchorInputPlaceholder)
|
213 |
-
* text to be shown as placeholder of the anchor input.
|
214 |
-
*/
|
215 |
-
placeholderText: 'Paste or type a link',
|
216 |
-
|
217 |
-
/* targetCheckbox: [boolean] (previously options.anchorTarget)
|
218 |
-
* enables/disables displaying a "Open in new window" checkbox, which when checked
|
219 |
-
* changes the `target` attribute of the created link.
|
220 |
-
*/
|
221 |
-
targetCheckbox: true,
|
222 |
-
|
223 |
-
/* targetCheckboxText: [string] (previously options.anchorInputCheckboxLabel)
|
224 |
-
* text to be shown in the checkbox enabled via the __targetCheckbox__ option.
|
225 |
-
*/
|
226 |
-
targetCheckboxText: 'Open in new tab',
|
227 |
-
|
228 |
-
nofollowCheckbox: true,
|
229 |
-
nofollowCheckboxText: 'Use nofollow',
|
230 |
-
|
231 |
-
// Options for the Button base class
|
232 |
-
name: 'links',
|
233 |
-
action: 'createLink',
|
234 |
-
aria: 'link',
|
235 |
-
tagNames: ['a'],
|
236 |
-
contentDefault: '<span class="dashicons dashicons-admin-links"></span>',
|
237 |
-
contentFA: '<i class="fa fa-link"></i>',
|
238 |
-
|
239 |
-
init: function () {
|
240 |
-
MediumEditor.extensions.form.prototype.init.apply(this, arguments);
|
241 |
-
|
242 |
-
this.subscribe('editableKeydown', this.handleKeydown.bind(this));
|
243 |
-
},
|
244 |
-
|
245 |
-
// Called when the button the toolbar is clicked
|
246 |
-
// Overrides ButtonExtension.handleClick
|
247 |
-
handleClick: function (event) {
|
248 |
-
event.preventDefault();
|
249 |
-
event.stopPropagation();
|
250 |
-
|
251 |
-
var range = MediumEditor.selection.getSelectionRange(this.document);
|
252 |
-
|
253 |
-
if (range.startContainer.nodeName.toLowerCase() === 'a' ||
|
254 |
-
range.endContainer.nodeName.toLowerCase() === 'a' ||
|
255 |
-
MediumEditor.util.getClosestTag(MediumEditor.selection.getSelectedParentElement(range), 'a')) {
|
256 |
-
return this.execAction('unlink');
|
257 |
-
}
|
258 |
-
|
259 |
-
if (!this.isDisplayed()) {
|
260 |
-
this.showForm();
|
261 |
-
}
|
262 |
-
|
263 |
-
return false;
|
264 |
-
},
|
265 |
-
|
266 |
-
// Called when user hits the defined shortcut (CTRL / COMMAND + K)
|
267 |
-
handleKeydown: function (event) {
|
268 |
-
if (MediumEditor.util.isKey(event, MediumEditor.util.keyCode.K) && MediumEditor.util.isMetaCtrlKey(event) && !event.shiftKey) {
|
269 |
-
this.handleClick(event);
|
270 |
-
}
|
271 |
-
},
|
272 |
-
|
273 |
-
// Called by medium-editor to append form to the toolbar
|
274 |
-
getForm: function () {
|
275 |
-
if (!this.form) {
|
276 |
-
this.form = this.createForm();
|
277 |
-
}
|
278 |
-
return this.form;
|
279 |
-
},
|
280 |
-
|
281 |
-
getTemplate: function () {
|
282 |
-
var template = [
|
283 |
-
'<input type="text" class="medium-editor-toolbar-input" placeholder="', this.placeholderText, '" style="padding-left: 25px; width: 265px;">'
|
284 |
-
];
|
285 |
-
|
286 |
-
template.push(
|
287 |
-
'<a href="#" class="medium-editor-toolbar-save">',
|
288 |
-
this.getEditorOption('buttonLabels') === 'fontawesome' ? '<i class="fa fa-check"></i>' : this.formSaveLabel,
|
289 |
-
'</a>'
|
290 |
-
);
|
291 |
-
|
292 |
-
template.push('<a href="#" class="medium-editor-toolbar-close">',
|
293 |
-
this.getEditorOption('buttonLabels') === 'fontawesome' ? '<i class="fa fa-times"></i>' : this.formCloseLabel,
|
294 |
-
'</a>');
|
295 |
-
|
296 |
-
// both of these options are slightly moot with the ability to
|
297 |
-
// override the various form buildup/serialize functions.
|
298 |
-
|
299 |
-
if (this.targetCheckbox) {
|
300 |
-
// fixme: ideally, this targetCheckboxText would be a formLabel too,
|
301 |
-
// figure out how to deprecate? also consider `fa-` icon default implcations.
|
302 |
-
template.push(
|
303 |
-
'<div class="medium-editor-toolbar-form-row" style="padding-left: 20px;">',
|
304 |
-
'<input type="checkbox" class="medium-editor-toolbar-anchor-target">',
|
305 |
-
'<label>',
|
306 |
-
this.targetCheckboxText,
|
307 |
-
'</label>',
|
308 |
-
'</div>'
|
309 |
-
);
|
310 |
-
}
|
311 |
-
|
312 |
-
if (this.nofollowCheckbox) {
|
313 |
-
template.push(
|
314 |
-
'<div class="medium-editor-toolbar-form-row" style="padding-left: 20px;">',
|
315 |
-
'<input type="checkbox" class="medium-editor-toolbar-anchor-nofollow">',
|
316 |
-
'<label>',
|
317 |
-
this.nofollowCheckboxText,
|
318 |
-
'</label>',
|
319 |
-
'</div>'
|
320 |
-
);
|
321 |
-
}
|
322 |
-
|
323 |
-
if (this.customClassOption) {
|
324 |
-
// fixme: expose this `Button` text as a formLabel property, too
|
325 |
-
// and provide similar access to a `fa-` icon default.
|
326 |
-
template.push(
|
327 |
-
'<div class="medium-editor-toolbar-form-row">',
|
328 |
-
'<input type="checkbox" class="medium-editor-toolbar-anchor-button">',
|
329 |
-
'<label>',
|
330 |
-
this.customClassOptionText,
|
331 |
-
'</label>',
|
332 |
-
'</div>'
|
333 |
-
);
|
334 |
-
}
|
335 |
-
|
336 |
-
return template.join('');
|
337 |
-
|
338 |
-
},
|
339 |
-
|
340 |
-
// Used by medium-editor when the default toolbar is to be displayed
|
341 |
-
isDisplayed: function () {
|
342 |
-
return MediumEditor.extensions.form.prototype.isDisplayed.apply(this);
|
343 |
-
},
|
344 |
-
|
345 |
-
hideForm: function () {
|
346 |
-
MediumEditor.extensions.form.prototype.hideForm.apply(this);
|
347 |
-
this.getInput().value = '';
|
348 |
-
},
|
349 |
-
|
350 |
-
showForm: function (opts) {
|
351 |
-
var input = this.getInput(),
|
352 |
-
targetCheckbox = this.getAnchorTargetCheckbox(),
|
353 |
-
nofollowCheckbox = this.getAnchorNofollowCheckbox(),
|
354 |
-
buttonCheckbox = this.getAnchorButtonCheckbox();
|
355 |
-
|
356 |
-
opts = opts || { value: '' };
|
357 |
-
// TODO: This is for backwards compatability
|
358 |
-
// We don't need to support the 'string' argument in 6.0.0
|
359 |
-
if (typeof opts === 'string') {
|
360 |
-
opts = {
|
361 |
-
value: opts
|
362 |
-
};
|
363 |
-
}
|
364 |
-
|
365 |
-
this.base.saveSelection();
|
366 |
-
this.hideToolbarDefaultActions();
|
367 |
-
MediumEditor.extensions.form.prototype.showForm.apply(this);
|
368 |
-
this.setToolbarPosition();
|
369 |
-
|
370 |
-
input.value = opts.value;
|
371 |
-
input.focus();
|
372 |
-
|
373 |
-
// If we have a target checkbox, we want it to be checked/unchecked
|
374 |
-
// based on whether the existing link has target=_blank
|
375 |
-
if (targetCheckbox) {
|
376 |
-
targetCheckbox.checked = opts.target === '_blank';
|
377 |
-
}
|
378 |
-
|
379 |
-
if (nofollowCheckbox) {
|
380 |
-
nofollowCheckbox.checked = opts.rel === 'nofollow';
|
381 |
-
}
|
382 |
-
|
383 |
-
// If we have a custom class checkbox, we want it to be checked/unchecked
|
384 |
-
// based on whether an existing link already has the class
|
385 |
-
if (buttonCheckbox) {
|
386 |
-
var classList = opts.buttonClass ? opts.buttonClass.split(' ') : [];
|
387 |
-
buttonCheckbox.checked = (classList.indexOf(this.customClassOption) !== -1);
|
388 |
-
}
|
389 |
-
},
|
390 |
-
|
391 |
-
// Called by core when tearing down medium-editor (destroy)
|
392 |
-
destroy: function () {
|
393 |
-
if (!this.form) {
|
394 |
-
return false;
|
395 |
-
}
|
396 |
-
|
397 |
-
if (this.form.parentNode) {
|
398 |
-
this.form.parentNode.removeChild(this.form);
|
399 |
-
}
|
400 |
-
|
401 |
-
delete this.form;
|
402 |
-
},
|
403 |
-
|
404 |
-
// core methods
|
405 |
-
|
406 |
-
getFormOpts: function () {
|
407 |
-
// no notion of private functions? wanted `_getFormOpts`
|
408 |
-
var targetCheckbox = this.getAnchorTargetCheckbox(),
|
409 |
-
nofollowCheckbox = this.getAnchorNofollowCheckbox(),
|
410 |
-
buttonCheckbox = this.getAnchorButtonCheckbox(),
|
411 |
-
opts = {
|
412 |
-
value: this.getInput().value.trim()
|
413 |
-
};
|
414 |
-
|
415 |
-
if (this.linkValidation) {
|
416 |
-
opts.value = this.checkLinkFormat(opts.value);
|
417 |
-
}
|
418 |
-
|
419 |
-
opts.target = '_self';
|
420 |
-
if (targetCheckbox && targetCheckbox.checked) {
|
421 |
-
opts.target = '_blank';
|
422 |
-
}
|
423 |
-
|
424 |
-
opts.rel = '';
|
425 |
-
if (nofollowCheckbox && nofollowCheckbox.checked) {
|
426 |
-
opts.rel = 'nofollow';
|
427 |
-
}
|
428 |
-
|
429 |
-
if (buttonCheckbox && buttonCheckbox.checked) {
|
430 |
-
opts.buttonClass = this.customClassOption;
|
431 |
-
}
|
432 |
-
|
433 |
-
return opts;
|
434 |
-
},
|
435 |
-
|
436 |
-
doFormSave: function () {
|
437 |
-
var opts = this.getFormOpts();
|
438 |
-
this.completeFormSave(opts);
|
439 |
-
},
|
440 |
-
|
441 |
-
completeFormSave: function (opts) {
|
442 |
-
this.base.restoreSelection();
|
443 |
-
this.execAction(this.action, opts);
|
444 |
-
this.base.checkSelection();
|
445 |
-
},
|
446 |
-
|
447 |
-
ensureEncodedUri: function (str) {
|
448 |
-
return str === decodeURI(str) ? encodeURI(str) : str;
|
449 |
-
},
|
450 |
-
|
451 |
-
ensureEncodedUriComponent: function (str) {
|
452 |
-
return str === decodeURIComponent(str) ? encodeURIComponent(str) : str;
|
453 |
-
},
|
454 |
-
|
455 |
-
ensureEncodedParam: function (param) {
|
456 |
-
var split = param.split('='),
|
457 |
-
key = split[0],
|
458 |
-
val = split[1];
|
459 |
-
|
460 |
-
return key + (val === undefined ? '' : '=' + this.ensureEncodedUriComponent(val));
|
461 |
-
},
|
462 |
-
|
463 |
-
ensureEncodedQuery: function (queryString) {
|
464 |
-
return queryString.split('&').map(this.ensureEncodedParam.bind(this)).join('&');
|
465 |
-
},
|
466 |
-
|
467 |
-
checkLinkFormat: function (value) {
|
468 |
-
// Matches any alphabetical characters followed by ://
|
469 |
-
// Matches protocol relative "//"
|
470 |
-
// Matches common external protocols "mailto:" "tel:" "maps:"
|
471 |
-
// Matches relative hash link, begins with "#"
|
472 |
-
var urlSchemeRegex = /^([a-z]+:)?\/\/|^(mailto|tel|maps):|^\#/i,
|
473 |
-
// telRegex is a regex for checking if the string is a telephone number
|
474 |
-
telRegex = /^\+?\s?\(?(?:\d\s?\-?\)?){3,20}$/,
|
475 |
-
split = value.split('?'),
|
476 |
-
path = split[0],
|
477 |
-
query = split[1];
|
478 |
-
|
479 |
-
if (telRegex.test(value)) {
|
480 |
-
return 'tel:' + value;
|
481 |
-
} else {
|
482 |
-
// Check for URL scheme and default to http:// if none found
|
483 |
-
return (urlSchemeRegex.test(value) ? '' : 'http://') +
|
484 |
-
// Ensure path is encoded
|
485 |
-
this.ensureEncodedUri(path) +
|
486 |
-
// Ensure query is encoded
|
487 |
-
(query === undefined ? '' : '?' + this.ensureEncodedQuery(query));
|
488 |
-
}
|
489 |
-
},
|
490 |
-
|
491 |
-
doFormCancel: function () {
|
492 |
-
this.base.restoreSelection();
|
493 |
-
this.base.checkSelection();
|
494 |
-
},
|
495 |
-
|
496 |
-
// form creation and event handling
|
497 |
-
attachFormEvents: function (form) {
|
498 |
-
var close = form.querySelector('.medium-editor-toolbar-close'),
|
499 |
-
save = form.querySelector('.medium-editor-toolbar-save'),
|
500 |
-
input = form.querySelector('.medium-editor-toolbar-input');
|
501 |
-
|
502 |
-
// Handle clicks on the form itself
|
503 |
-
this.on(form, 'click', this.handleFormClick.bind(this));
|
504 |
-
|
505 |
-
// Handle typing in the textbox
|
506 |
-
this.on(input, 'keyup', this.handleTextboxKeyup.bind(this));
|
507 |
-
|
508 |
-
// Handle close button clicks
|
509 |
-
this.on(close, 'click', this.handleCloseClick.bind(this));
|
510 |
-
|
511 |
-
// Handle save button clicks (capture)
|
512 |
-
this.on(save, 'click', this.handleSaveClick.bind(this), true);
|
513 |
-
|
514 |
-
},
|
515 |
-
|
516 |
-
createForm: function () {
|
517 |
-
var doc = this.document,
|
518 |
-
form = doc.createElement('div');
|
519 |
-
|
520 |
-
// Anchor Form (div)
|
521 |
-
form.className = 'medium-editor-toolbar-form';
|
522 |
-
form.id = 'medium-editor-toolbar-form-anchor-' + this.getEditorId();
|
523 |
-
form.innerHTML = this.getTemplate();
|
524 |
-
this.attachFormEvents(form);
|
525 |
-
|
526 |
-
return form;
|
527 |
-
},
|
528 |
-
|
529 |
-
getInput: function () {
|
530 |
-
return this.getForm().querySelector('input.medium-editor-toolbar-input');
|
531 |
-
},
|
532 |
-
|
533 |
-
getAnchorTargetCheckbox: function () {
|
534 |
-
return this.getForm().querySelector('.medium-editor-toolbar-anchor-target');
|
535 |
-
},
|
536 |
-
|
537 |
-
getAnchorNofollowCheckbox: function () {
|
538 |
-
return this.getForm().querySelector('.medium-editor-toolbar-anchor-nofollow');
|
539 |
-
},
|
540 |
-
|
541 |
-
getAnchorButtonCheckbox: function () {
|
542 |
-
return this.getForm().querySelector('.medium-editor-toolbar-anchor-button');
|
543 |
-
},
|
544 |
-
|
545 |
-
handleTextboxKeyup: function (event) {
|
546 |
-
// For ENTER -> create the anchor
|
547 |
-
if (event.keyCode === MediumEditor.util.keyCode.ENTER) {
|
548 |
-
event.preventDefault();
|
549 |
-
this.doFormSave();
|
550 |
-
return;
|
551 |
-
}
|
552 |
-
|
553 |
-
// For ESCAPE -> close the form
|
554 |
-
if (event.keyCode === MediumEditor.util.keyCode.ESCAPE) {
|
555 |
-
event.preventDefault();
|
556 |
-
this.doFormCancel();
|
557 |
-
}
|
558 |
-
},
|
559 |
-
|
560 |
-
handleFormClick: function (event) {
|
561 |
-
// make sure not to hide form when clicking inside the form
|
562 |
-
event.stopPropagation();
|
563 |
-
},
|
564 |
-
|
565 |
-
handleSaveClick: function (event) {
|
566 |
-
// Clicking Save -> create the anchor
|
567 |
-
event.preventDefault();
|
568 |
-
this.doFormSave();
|
569 |
-
},
|
570 |
-
|
571 |
-
handleCloseClick: function (event) {
|
572 |
-
// Click Close -> close the form
|
573 |
-
event.preventDefault();
|
574 |
-
this.doFormCancel();
|
575 |
-
}
|
576 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/admin/modal/tabs/import-text.js
DELETED
@@ -1,288 +0,0 @@
|
|
1 |
-
import '../../../../../vendor/texthighlighter/TextHighlighter.min.js';
|
2 |
-
|
3 |
-
import Modal from '../Modal';
|
4 |
-
import Recipe from '../Recipe';
|
5 |
-
import RichEditor from '../RichEditor';
|
6 |
-
|
7 |
-
let text_import_step = '';
|
8 |
-
let text_import_highlighter;
|
9 |
-
let text_import = {};
|
10 |
-
let text_import_waiting = false;
|
11 |
-
|
12 |
-
function start_text_import() {
|
13 |
-
jQuery('.wprm-button-import-text-reset').removeAttr('disabled');
|
14 |
-
jQuery('.wprm-button-import-text-clear').removeAttr('disabled');
|
15 |
-
jQuery('.wprm-button-import-text-next').removeAttr('disabled');
|
16 |
-
|
17 |
-
text_import_step = 'input';
|
18 |
-
jQuery('#import-text-highlight-sandbox').textHighlighter();
|
19 |
-
text_import_highlighter = jQuery('#import-text-highlight-sandbox').getHighlighter()
|
20 |
-
};
|
21 |
-
|
22 |
-
function btn_text_import_reset() {
|
23 |
-
btn_text_import_clear(true);
|
24 |
-
jQuery('#import-text-highlight-sandbox').text('');
|
25 |
-
text_import = {};
|
26 |
-
text_import_waiting = false;
|
27 |
-
|
28 |
-
jQuery('.wprm-button-import-text-reset').attr('disabled', 'disabled');
|
29 |
-
jQuery('.wprm-button-import-text-clear').attr('disabled', 'disabled');
|
30 |
-
jQuery('.wprm-button-import-text-next').attr('disabled', 'disabled');
|
31 |
-
|
32 |
-
jQuery('.import-text-step').hide();
|
33 |
-
jQuery('#import-text-step-input').show();
|
34 |
-
jQuery('#import-text-highlight-sandbox').hide();
|
35 |
-
};
|
36 |
-
|
37 |
-
function btn_text_import_clear(all) {
|
38 |
-
if(all || text_import_step == 'input') {
|
39 |
-
jQuery('#import-text-input-recipe').val('');
|
40 |
-
}
|
41 |
-
|
42 |
-
if(all || text_import_step == 'ingredient-groups') {
|
43 |
-
jQuery('#import-text-ingredient-groups').find('input').attr('checked', false);
|
44 |
-
}
|
45 |
-
|
46 |
-
if(all || text_import_step == 'instruction-groups') {
|
47 |
-
jQuery('#import-text-instruction-groups').find('input').attr('checked', false);
|
48 |
-
}
|
49 |
-
|
50 |
-
text_import_highlighter.removeHighlights();
|
51 |
-
};
|
52 |
-
|
53 |
-
function btn_text_import_next() {
|
54 |
-
if(text_import_step == 'input') {
|
55 |
-
text_import.raw = jQuery('#import-text-input-recipe').val();
|
56 |
-
jQuery('#import-text-highlight-sandbox').html(text_import.raw.replace(/\r?\n/g,'<br/>')).show();
|
57 |
-
|
58 |
-
text_import_step = 'name';
|
59 |
-
} else if(text_import_step == 'name') {
|
60 |
-
text_import.name = get_highlighted_text();
|
61 |
-
|
62 |
-
text_import_step = 'summary';
|
63 |
-
} else if(text_import_step == 'summary') {
|
64 |
-
text_import.summary = get_highlighted_text();
|
65 |
-
|
66 |
-
jQuery('#import-text-highlight-sandbox').show();
|
67 |
-
|
68 |
-
text_import_step = 'ingredients';
|
69 |
-
} else if(text_import_step == 'ingredients') {
|
70 |
-
var ingredients = text_import_highlighter.getHighlights();
|
71 |
-
text_import.ingredients_raw = ingredients;
|
72 |
-
|
73 |
-
jQuery('#import-text-ingredient-groups').html('');
|
74 |
-
for(var i = 0, l = ingredients.length; i<l; i++) {
|
75 |
-
var text = jQuery(ingredients[i]).text().trim();
|
76 |
-
text = text.replace(/^(\d\.\s+|[a-z]\)\s+|•\s+|[A-Z]\.\s+|[IVX]+\.\s+)/g, "");
|
77 |
-
var ingredient = '<div class="import-text-ingredient"><input type="checkbox" id="ingredient-' + i + '"> ' + '<label for="ingredient-' + i + '">' + text + '</label></div>';
|
78 |
-
jQuery('#import-text-ingredient-groups').append(ingredient);
|
79 |
-
}
|
80 |
-
jQuery('.import-text-group-warning').hide();
|
81 |
-
|
82 |
-
if(ingredients.length == 0) {
|
83 |
-
jQuery('#import-text-highlight-sandbox').show();
|
84 |
-
text_import.ingredients = [];
|
85 |
-
text_import_step = 'instructions';
|
86 |
-
} else {
|
87 |
-
jQuery('#import-text-highlight-sandbox').hide();
|
88 |
-
text_import_step = 'ingredient-groups';
|
89 |
-
}
|
90 |
-
} else if(text_import_step == 'ingredient-groups') {
|
91 |
-
var ingredients = [],
|
92 |
-
ingredient_group = {
|
93 |
-
name: '',
|
94 |
-
ingredients: []
|
95 |
-
};
|
96 |
-
|
97 |
-
jQuery('#import-text-ingredient-groups').find('.import-text-ingredient').each(function() {
|
98 |
-
var is_ingredient_group = jQuery(this).find('input').is(':checked'),
|
99 |
-
ingredient = jQuery(this).find('label').text();
|
100 |
-
|
101 |
-
if(is_ingredient_group) {
|
102 |
-
ingredients.push(ingredient_group);
|
103 |
-
|
104 |
-
ingredient_group = {
|
105 |
-
name: ingredient,
|
106 |
-
ingredients: []
|
107 |
-
}
|
108 |
-
} else {
|
109 |
-
ingredient_group.ingredients.push({raw: ingredient});
|
110 |
-
}
|
111 |
-
});
|
112 |
-
ingredients.push(ingredient_group);
|
113 |
-
|
114 |
-
text_import.ingredients = [];
|
115 |
-
|
116 |
-
// Parse ingredients
|
117 |
-
var data = {
|
118 |
-
action: 'wprm_parse_ingredients',
|
119 |
-
security: wprm_admin.nonce,
|
120 |
-
ingredients: ingredients
|
121 |
-
};
|
122 |
-
|
123 |
-
text_import_waiting = true;
|
124 |
-
jQuery.post(wprm_admin.ajax_url, data, function(out) {
|
125 |
-
text_import_waiting = false;
|
126 |
-
if (out.success) {
|
127 |
-
text_import.ingredients = out.data.ingredients;
|
128 |
-
}
|
129 |
-
}, 'json');
|
130 |
-
|
131 |
-
jQuery('#import-text-highlight-sandbox').show();
|
132 |
-
|
133 |
-
text_import_step = 'instructions';
|
134 |
-
} else if(text_import_step == 'instructions') {
|
135 |
-
var instructions = text_import_highlighter.getHighlights();
|
136 |
-
text_import.instructions_raw = instructions;
|
137 |
-
|
138 |
-
jQuery('#import-text-instruction-groups').html('');
|
139 |
-
for(var i = 0, l = instructions.length; i<l; i++) {
|
140 |
-
var text = jQuery(instructions[i]).text().trim();
|
141 |
-
text = text.replace(/^(\d\.\s+|[a-z]\)\s+|•\s+|[A-Z]\.\s+|[IVX]+\.\s+)/g, "");
|
142 |
-
var instruction = '<div class="import-text-instruction"><input type="checkbox" id="instruction-' + i + '"> ' + '<label for="instruction-' + i + '">' + text + '</label></div>';
|
143 |
-
jQuery('#import-text-instruction-groups').append(instruction);
|
144 |
-
}
|
145 |
-
jQuery('.import-text-group-warning').hide();
|
146 |
-
|
147 |
-
if(instructions.length == 0) {
|
148 |
-
jQuery('#import-text-highlight-sandbox').show();
|
149 |
-
text_import.instructions = [];
|
150 |
-
text_import_step = 'notes';
|
151 |
-
} else {
|
152 |
-
jQuery('#import-text-highlight-sandbox').hide();
|
153 |
-
text_import_step = 'instruction-groups';
|
154 |
-
}
|
155 |
-
} else if(text_import_step == 'instruction-groups') {
|
156 |
-
var instructions = [],
|
157 |
-
instruction_group = {
|
158 |
-
name: '',
|
159 |
-
instructions: []
|
160 |
-
};
|
161 |
-
|
162 |
-
jQuery('#import-text-instruction-groups').find('.import-text-instruction').each(function() {
|
163 |
-
var is_instruction_group = jQuery(this).find('input').is(':checked'),
|
164 |
-
instruction = jQuery(this).find('label').text();
|
165 |
-
|
166 |
-
if(is_instruction_group) {
|
167 |
-
instructions.push(instruction_group);
|
168 |
-
|
169 |
-
instruction_group = {
|
170 |
-
name: instruction,
|
171 |
-
instructions: []
|
172 |
-
}
|
173 |
-
} else {
|
174 |
-
instruction_group.instructions.push({text: instruction});
|
175 |
-
}
|
176 |
-
});
|
177 |
-
instructions.push(instruction_group);
|
178 |
-
|
179 |
-
text_import.instructions = instructions;
|
180 |
-
|
181 |
-
jQuery('#import-text-highlight-sandbox').show();
|
182 |
-
|
183 |
-
text_import_step = 'notes';
|
184 |
-
} else if(text_import_step == 'notes') {
|
185 |
-
text_import.notes = get_highlighted_text();
|
186 |
-
|
187 |
-
jQuery('#import-text-highlight-sandbox').hide();
|
188 |
-
jQuery('.wprm-button-import-text-reset').attr('disabled', 'disabled');
|
189 |
-
jQuery('.wprm-button-import-text-clear').attr('disabled', 'disabled');
|
190 |
-
jQuery('.wprm-button-import-text-next').attr('disabled', 'disabled');
|
191 |
-
|
192 |
-
if(text_import_waiting) {
|
193 |
-
text_import_step = 'waiting';
|
194 |
-
text_import_waiting_check();
|
195 |
-
} else {
|
196 |
-
jQuery('.wprm-button-import-text-reset').removeAttr('disabled');
|
197 |
-
import_recipe();
|
198 |
-
text_import_step = 'finished';
|
199 |
-
}
|
200 |
-
} else if(text_import_step == 'waiting') {
|
201 |
-
if(!text_import_waiting) {
|
202 |
-
jQuery('.wprm-button-import-text-reset').removeAttr('disabled');
|
203 |
-
import_recipe();
|
204 |
-
text_import_step = 'finished';
|
205 |
-
}
|
206 |
-
}
|
207 |
-
|
208 |
-
jQuery('.import-text-step').hide();
|
209 |
-
jQuery('#import-text-step-' + text_import_step).show();
|
210 |
-
text_import_highlighter.removeHighlights();
|
211 |
-
};
|
212 |
-
|
213 |
-
function text_import_waiting_check() {
|
214 |
-
if(text_import_waiting) {
|
215 |
-
setTimeout(text_import_waiting_check, 200);
|
216 |
-
} else {
|
217 |
-
btn_text_import_next();
|
218 |
-
}
|
219 |
-
};
|
220 |
-
|
221 |
-
function get_highlighted_text() {
|
222 |
-
var highlight_parts = text_import_highlighter.getHighlights();
|
223 |
-
var highlight = '';
|
224 |
-
|
225 |
-
for(var i = 0, l = highlight_parts.length; i<l; i++) {
|
226 |
-
if(i > 0) {
|
227 |
-
highlight += ' ';
|
228 |
-
}
|
229 |
-
highlight += jQuery(highlight_parts[i]).text().trim();
|
230 |
-
}
|
231 |
-
|
232 |
-
return highlight;
|
233 |
-
};
|
234 |
-
|
235 |
-
function import_recipe() {
|
236 |
-
if(text_import.name) {
|
237 |
-
jQuery('#wprm-recipe-name').val(text_import.name);
|
238 |
-
}
|
239 |
-
|
240 |
-
if(text_import.summary) {
|
241 |
-
RichEditor.set(text_import.summary);
|
242 |
-
}
|
243 |
-
|
244 |
-
if(text_import.notes) {
|
245 |
-
if (typeof tinyMCE !== 'undefined' && tinyMCE.get('wprm_recipe_notes') && !tinyMCE.get('wprm_recipe_notes').isHidden()) {
|
246 |
-
tinyMCE.get('wprm_recipe_notes').focus(true);
|
247 |
-
tinyMCE.activeEditor.setContent(text_import.notes);
|
248 |
-
} else {
|
249 |
-
jQuery('#wprm_recipe_notes').val(text_import.notes);
|
250 |
-
}
|
251 |
-
}
|
252 |
-
|
253 |
-
if(text_import.instructions.length > 0) {
|
254 |
-
Recipe.setInstructions(text_import.instructions);
|
255 |
-
}
|
256 |
-
|
257 |
-
if(text_import.ingredients.length > 0) {
|
258 |
-
Recipe.setIngredients(text_import.ingredients);
|
259 |
-
}
|
260 |
-
};
|
261 |
-
|
262 |
-
jQuery(document).ready(function($) {
|
263 |
-
jQuery('#import-text-input-recipe').on('keydown change', function() {
|
264 |
-
start_text_import();
|
265 |
-
});
|
266 |
-
|
267 |
-
jQuery('.wprm-button-import-text-reset').on('click', function() {
|
268 |
-
if(confirm(wprm_admin.modal.text.import_text_reset)) {
|
269 |
-
btn_text_import_reset();
|
270 |
-
}
|
271 |
-
});
|
272 |
-
|
273 |
-
jQuery('.wprm-button-import-text-clear').on('click', function() {
|
274 |
-
btn_text_import_clear(false);
|
275 |
-
});
|
276 |
-
|
277 |
-
jQuery('.wprm-button-import-text-next').on('click', function() {
|
278 |
-
btn_text_import_next();
|
279 |
-
});
|
280 |
-
|
281 |
-
jQuery('.import-text-input-groups').on('change', 'input', function() {
|
282 |
-
var groups = jQuery(this).parents('.import-text-input-groups');
|
283 |
-
|
284 |
-
if(groups.find('input').length == groups.find('input:checked').length) {
|
285 |
-
jQuery('.import-text-group-warning').show();
|
286 |
-
}
|
287 |
-
});
|
288 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/admin/modal/tabs/recipe-snippets.js
DELETED
@@ -1,70 +0,0 @@
|
|
1 |
-
import Modal from '../Modal';
|
2 |
-
import * as utils from '../utils';
|
3 |
-
|
4 |
-
Modal.actions.reset_snippets = function(args) {
|
5 |
-
jQuery('#wprm-recipe-jump-id').val('0').trigger('change');
|
6 |
-
jQuery('#wprm-recipe-jump-text').val('');
|
7 |
-
|
8 |
-
jQuery('#wprm-recipe-jump-video-id').val('0').trigger('change');
|
9 |
-
jQuery('#wprm-recipe-jump-video-text').val('');
|
10 |
-
|
11 |
-
jQuery('#wprm-recipe-print-id').val('0').trigger('change');
|
12 |
-
jQuery('#wprm-recipe-print-text').val('');
|
13 |
-
}
|
14 |
-
|
15 |
-
Modal.actions.insert_jump_to_recipe = function(button) {
|
16 |
-
var id = parseInt(jQuery('#wprm-recipe-jump-id').val()),
|
17 |
-
text = utils.shortcode_escape(jQuery('#wprm-recipe-jump-text').val()),
|
18 |
-
shortcode = '[wprm-recipe-jump';
|
19 |
-
|
20 |
-
if (id > 0) {
|
21 |
-
shortcode += ' id="' + id + '"';
|
22 |
-
}
|
23 |
-
|
24 |
-
if (text) {
|
25 |
-
shortcode += ' text="' + text + '"';
|
26 |
-
}
|
27 |
-
|
28 |
-
shortcode += ']';
|
29 |
-
|
30 |
-
utils.add_text_to_editor(shortcode);
|
31 |
-
Modal.close();
|
32 |
-
};
|
33 |
-
|
34 |
-
Modal.actions.insert_jump_to_video = function(button) {
|
35 |
-
var id = parseInt(jQuery('#wprm-recipe-jump-video-id').val()),
|
36 |
-
text = utils.shortcode_escape(jQuery('#wprm-recipe-jump-video-text').val()),
|
37 |
-
shortcode = '[wprm-recipe-jump-video';
|
38 |
-
|
39 |
-
if (id > 0) {
|
40 |
-
shortcode += ' id="' + id + '"';
|
41 |
-
}
|
42 |
-
|
43 |
-
if (text) {
|
44 |
-
shortcode += ' text="' + text + '"';
|
45 |
-
}
|
46 |
-
|
47 |
-
shortcode += ']';
|
48 |
-
|
49 |
-
utils.add_text_to_editor(shortcode);
|
50 |
-
Modal.close();
|
51 |
-
};
|
52 |
-
|
53 |
-
Modal.actions.insert_print_recipe = function(button) {
|
54 |
-
var id = parseInt(jQuery('#wprm-recipe-print-id').val()),
|
55 |
-
text = utils.shortcode_escape(jQuery('#wprm-recipe-print-text').val()),
|
56 |
-
shortcode = '[wprm-recipe-print';
|
57 |
-
|
58 |
-
if (id > 0) {
|
59 |
-
shortcode += ' id="' + id + '"';
|
60 |
-
}
|
61 |
-
|
62 |
-
if (text) {
|
63 |
-
shortcode += ' text="' + text + '"';
|
64 |
-
}
|
65 |
-
|
66 |
-
shortcode += ']';
|
67 |
-
|
68 |
-
utils.add_text_to_editor(shortcode);
|
69 |
-
Modal.close();
|
70 |
-
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/admin/modal/tabs/recipe.js
DELETED
@@ -1,173 +0,0 @@
|
|
1 |
-
import * as utils from '../utils';
|
2 |
-
import Modal from '../Modal';
|
3 |
-
import Recipe from '../Recipe';
|
4 |
-
|
5 |
-
Modal.actions.set_recipe = function(args) {
|
6 |
-
let recipe_id = args.recipe_id ? args.recipe_id : 0;
|
7 |
-
let clone_recipe_id = args.clone_recipe_id ? args.clone_recipe_id : 0;
|
8 |
-
|
9 |
-
Recipe.id = recipe_id;
|
10 |
-
Recipe.type = 0 === recipe_id ? 'insert' : 'update';
|
11 |
-
Recipe.fields = false;
|
12 |
-
Recipe.ingredients = {};
|
13 |
-
Recipe.instructions = {};
|
14 |
-
|
15 |
-
Recipe.clear();
|
16 |
-
|
17 |
-
if ('insert' === Recipe.type) {
|
18 |
-
var button = jQuery('.wprm-button-action'),
|
19 |
-
button_save = jQuery('.wprm-button-action-save');
|
20 |
-
|
21 |
-
jQuery('.wprm-router.active').find('.wprm-menu-item').each(function() {
|
22 |
-
jQuery(this).data('button', wprm_admin.modal.text.action_button_insert);
|
23 |
-
});
|
24 |
-
button.text(wprm_admin.modal.text.action_button_insert);
|
25 |
-
button_save.show();
|
26 |
-
|
27 |
-
if(clone_recipe_id) {
|
28 |
-
var data = {
|
29 |
-
action: 'wprm_get_recipe',
|
30 |
-
security: wprm_admin.nonce,
|
31 |
-
recipe_id: clone_recipe_id
|
32 |
-
};
|
33 |
-
|
34 |
-
utils.start_loader(button);
|
35 |
-
utils.start_loader(button_save);
|
36 |
-
|
37 |
-
jQuery.post(wprm_admin.ajax_url, data, function(out) {
|
38 |
-
utils.stop_loader(button);
|
39 |
-
utils.stop_loader(button_save);
|
40 |
-
|
41 |
-
if (out.success) {
|
42 |
-
Recipe.fields = out.data.recipe;
|
43 |
-
Recipe.set(out.data.recipe);
|
44 |
-
Modal.changes_made = false;
|
45 |
-
}
|
46 |
-
}, 'json');
|
47 |
-
}
|
48 |
-
} else {
|
49 |
-
var button = jQuery('.wprm-button-action'),
|
50 |
-
button_save = jQuery('.wprm-button-action-save');
|
51 |
-
|
52 |
-
jQuery('.wprm-router.active').find('.wprm-menu-item').each(function() {
|
53 |
-
jQuery(this).data('button', wprm_admin.modal.text.action_button_update);
|
54 |
-
});
|
55 |
-
button.text(wprm_admin.modal.text.action_button_update);
|
56 |
-
button_save.show();
|
57 |
-
|
58 |
-
Modal.disable_menu();
|
59 |
-
|
60 |
-
var data = {
|
61 |
-
action: 'wprm_get_recipe',
|
62 |
-
security: wprm_admin.nonce,
|
63 |
-
recipe_id: recipe_id
|
64 |
-
};
|
65 |
-
|
66 |
-
utils.start_loader(button);
|
67 |
-
utils.start_loader(button_save);
|
68 |
-
|
69 |
-
jQuery.post(wprm_admin.ajax_url, data, function(out) {
|
70 |
-
utils.stop_loader(button);
|
71 |
-
utils.stop_loader(button_save);
|
72 |
-
|
73 |
-
if (out.success) {
|
74 |
-
Recipe.fields = out.data.recipe;
|
75 |
-
Recipe.set(out.data.recipe);
|
76 |
-
Modal.changes_made = false;
|
77 |
-
jQuery('.wprm-frame-title').find('h1').text(wprm_admin.modal.text.edit_recipe);
|
78 |
-
}
|
79 |
-
}, 'json');
|
80 |
-
}
|
81 |
-
}
|
82 |
-
|
83 |
-
Modal.actions.insert_update_recipe = function(button) {
|
84 |
-
let recipe = Recipe.get();
|
85 |
-
|
86 |
-
// Ajax call to recipe saver
|
87 |
-
var data = {
|
88 |
-
action: 'wprm_save_recipe',
|
89 |
-
security: wprm_admin.nonce,
|
90 |
-
recipe_id: Recipe.id,
|
91 |
-
recipe: recipe
|
92 |
-
};
|
93 |
-
|
94 |
-
jQuery('.wprm-button-action-save').prop('disabled', true);
|
95 |
-
utils.start_loader(button);
|
96 |
-
|
97 |
-
jQuery.ajax({
|
98 |
-
type: 'POST',
|
99 |
-
url: wprm_admin.ajax_url,
|
100 |
-
data: data,
|
101 |
-
success: function(out) {
|
102 |
-
utils.stop_loader(button);
|
103 |
-
jQuery('.wprm-button-action-save').prop('disabled', false);
|
104 |
-
|
105 |
-
if (out.success) {
|
106 |
-
if (Recipe.id === 0) {
|
107 |
-
Recipe.id = out.data.id;
|
108 |
-
}
|
109 |
-
|
110 |
-
if(!button.hasClass('wprm-button-action-save')) {
|
111 |
-
if ( Modal.gutenberg ) {
|
112 |
-
Modal.args.gutenbergCallback(Recipe.id);
|
113 |
-
} else {
|
114 |
-
if ('insert' === Recipe.type) {
|
115 |
-
utils.add_text_to_editor('[wprm-recipe id="' + out.data.id + '"]');
|
116 |
-
} else if(Modal.active_editor_id) {
|
117 |
-
// Refresh content in editor to reload recipe preview
|
118 |
-
if (typeof tinyMCE !== 'undefined' && tinyMCE.get(Modal.active_editor_id) && !tinyMCE.get(Modal.active_editor_id).isHidden()) {
|
119 |
-
tinyMCE.get(Modal.active_editor_id).focus(true);
|
120 |
-
tinyMCE.activeEditor.setContent(tinyMCE.activeEditor.getContent());
|
121 |
-
}
|
122 |
-
}
|
123 |
-
|
124 |
-
if(jQuery('.wprm-manage-datatable').length > 0) {
|
125 |
-
jQuery('.wprm-manage-datatable').DataTable().ajax.reload(null, false);
|
126 |
-
}
|
127 |
-
if ( Modal.args.callback ) {
|
128 |
-
Modal.args.callback(Recipe);
|
129 |
-
}
|
130 |
-
}
|
131 |
-
|
132 |
-
Modal.close();
|
133 |
-
}
|
134 |
-
}
|
135 |
-
},
|
136 |
-
error: function(out) {
|
137 |
-
console.log(out);
|
138 |
-
alert( 'An error occured during saving. This could have happened because you got logged out of WordPress. If so, a login form should show up now.' );
|
139 |
-
if (wp.heartbeat) {
|
140 |
-
wp.heartbeat.connectNow();
|
141 |
-
}
|
142 |
-
utils.stop_loader(button);
|
143 |
-
jQuery('.wprm-button-action-save').prop('disabled', false);
|
144 |
-
},
|
145 |
-
dataType: 'json',
|
146 |
-
});
|
147 |
-
};
|
148 |
-
|
149 |
-
Modal.actions.edit_recipe = function(button) {
|
150 |
-
var id = parseInt(jQuery('#wprm-edit-recipe-id').val());
|
151 |
-
if(id != 0) {
|
152 |
-
var editor = Modal.active_editor_id;
|
153 |
-
Modal.close();
|
154 |
-
Modal.open(editor, {
|
155 |
-
recipe_id: id
|
156 |
-
});
|
157 |
-
}
|
158 |
-
};
|
159 |
-
|
160 |
-
Modal.actions.insert_recipe = function(button) {
|
161 |
-
var id = parseInt(jQuery('#wprm-insert-recipe-id').val());
|
162 |
-
if(id != 0) {
|
163 |
-
var shortcode = '[wprm-recipe id="' + id + '"]';
|
164 |
-
|
165 |
-
if ( Modal.gutenberg ) {
|
166 |
-
Modal.args.gutenbergCallback(id);
|
167 |
-
} else {
|
168 |
-
utils.add_text_to_editor(shortcode);
|
169 |
-
}
|
170 |
-
|
171 |
-
Modal.close();
|
172 |
-
}
|
173 |
-
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/admin/modal/utils.js
DELETED
@@ -1,137 +0,0 @@
|
|
1 |
-
import Modal from './Modal';
|
2 |
-
|
3 |
-
const shortcode_escape_map = {
|
4 |
-
'"': "'",
|
5 |
-
'[': '{',
|
6 |
-
']': '}'
|
7 |
-
};
|
8 |
-
|
9 |
-
export function shortcode_escape(text) {
|
10 |
-
return String(text).replace(/["]/g, function(s) {
|
11 |
-
return shortcode_escape_map[s];
|
12 |
-
});
|
13 |
-
};
|
14 |
-
|
15 |
-
export function add_text_to_editor(text) {
|
16 |
-
text = ' ' + text + ' ';
|
17 |
-
|
18 |
-
if (Modal.active_editor_id) {
|
19 |
-
if (typeof tinyMCE == 'undefined' || !tinyMCE.get(Modal.active_editor_id) || tinyMCE.get(Modal.active_editor_id).isHidden()) {
|
20 |
-
var current = jQuery('textarea#' + Modal.active_editor_id).val();
|
21 |
-
jQuery('textarea#' + Modal.active_editor_id).val(current + text);
|
22 |
-
} else {
|
23 |
-
tinyMCE.get(Modal.active_editor_id).focus(true);
|
24 |
-
tinyMCE.activeEditor.selection.collapse(false);
|
25 |
-
tinyMCE.activeEditor.execCommand('mceInsertContent', false, text);
|
26 |
-
}
|
27 |
-
}
|
28 |
-
};
|
29 |
-
|
30 |
-
export function select_media(type, container) {
|
31 |
-
let media_arguments = {
|
32 |
-
title: wprm_admin.modal.text.media_title,
|
33 |
-
button: {
|
34 |
-
text: wprm_admin.modal.text.media_button
|
35 |
-
},
|
36 |
-
multiple: false,
|
37 |
-
};
|
38 |
-
|
39 |
-
// Check what media type we're getting.
|
40 |
-
if ( 'video' === type ) {
|
41 |
-
media_arguments.frame = 'video';
|
42 |
-
media_arguments.state = 'video-details';
|
43 |
-
} else {
|
44 |
-
// Default to image.
|
45 |
-
media_arguments.library = {
|
46 |
-
type: 'image',
|
47 |
-
};
|
48 |
-
}
|
49 |
-
|
50 |
-
// Create a new media frame (don't reuse because we have multiple different inputs)
|
51 |
-
let frame = wp.media(media_arguments);
|
52 |
-
|
53 |
-
|
54 |
-
// Handle image selection
|
55 |
-
frame.on('select', function() {
|
56 |
-
var attachment = frame.state().get('selection').first().toJSON();
|
57 |
-
set_media('image',container, attachment.id, attachment.url);
|
58 |
-
});
|
59 |
-
|
60 |
-
// Handle video selection
|
61 |
-
frame.on('update', function() {
|
62 |
-
let attachment = frame.state().media.attachment;
|
63 |
-
|
64 |
-
if ( attachment ) {
|
65 |
-
set_media('video',container, attachment.attributes.id, attachment.attributes.thumb.src);
|
66 |
-
}
|
67 |
-
});
|
68 |
-
|
69 |
-
// Finally, open the modal on click
|
70 |
-
frame.open();
|
71 |
-
};
|
72 |
-
|
73 |
-
export function set_media(type, container, media_id, media_url) {
|
74 |
-
// Set placeholder if no media URL for video.
|
75 |
-
if ( 'video' === type && '' === media_url ) {
|
76 |
-
media_url = wprm_admin.wprm_url + 'assets/images/video.png';
|
77 |
-
}
|
78 |
-
|
79 |
-
container.find('.wprm-recipe-' + type + '-preview').html('');
|
80 |
-
container.find('.wprm-recipe-' + type + '-preview').append('<img src="' + media_url + '" />');
|
81 |
-
container.find('input').val(media_id);
|
82 |
-
|
83 |
-
container.find('.wprm-recipe-' + type + '-add').addClass('hidden');
|
84 |
-
container.find('.wprm-recipe-' + type + '-remove').removeClass('hidden');
|
85 |
-
|
86 |
-
if ( 'video' === type ) {
|
87 |
-
container.find('.wprm-recipe-' + type + '-embed').addClass('hidden');
|
88 |
-
}
|
89 |
-
|
90 |
-
Modal.changes_made = true;
|
91 |
-
};
|
92 |
-
|
93 |
-
export function remove_media(type, container) {
|
94 |
-
container.find('.wprm-recipe-' + type + '-preview').html('');
|
95 |
-
container.find('input').val('');
|
96 |
-
|
97 |
-
container.find('.wprm-recipe-' + type + '-add').removeClass('hidden');
|
98 |
-
container.find('.wprm-recipe-' + type + '-remove').addClass('hidden');
|
99 |
-
|
100 |
-
if ( 'video' === type ) {
|
101 |
-
container.find('.wprm-recipe-' + type + '-embed').removeClass('hidden');
|
102 |
-
container.find('#wprm-recipe-' + type + '-embed').val('').addClass('hidden');
|
103 |
-
}
|
104 |
-
|
105 |
-
Modal.changes_made = true;
|
106 |
-
};
|
107 |
-
|
108 |
-
export function set_media_embed(type, container, code) {
|
109 |
-
container.find('.wprm-recipe-' + type + '-add').addClass('hidden');
|
110 |
-
container.find('.wprm-recipe-' + type + '-embed').addClass('hidden');
|
111 |
-
|
112 |
-
container.find('#wprm-recipe-' + type + '-embed').val(code).removeClass('hidden');
|
113 |
-
container.find('.wprm-recipe-' + type + '-remove').removeClass('hidden');
|
114 |
-
|
115 |
-
Modal.changes_made = true;
|
116 |
-
};
|
117 |
-
|
118 |
-
export function start_loader(button) {
|
119 |
-
button
|
120 |
-
.prop('disabled', true)
|
121 |
-
.css('width', button.outerWidth())
|
122 |
-
.data('text', button.html())
|
123 |
-
.html('...');
|
124 |
-
};
|
125 |
-
|
126 |
-
export function stop_loader(button) {
|
127 |
-
button
|
128 |
-
.prop('disabled', false)
|
129 |
-
.css('width', '')
|
130 |
-
.html(button.data('text'));
|
131 |
-
};
|
132 |
-
|
133 |
-
export function decode_html_entities(html) {
|
134 |
-
var txt = document.createElement("textarea");
|
135 |
-
txt.innerHTML = html;
|
136 |
-
return txt.value;
|
137 |
-
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/blocks/recipe-roundup/index.js
CHANGED
@@ -18,7 +18,6 @@ const {
|
|
18 |
import Sidebar from './Sidebar';
|
19 |
|
20 |
import '../../../css/blocks/recipe.scss';
|
21 |
-
import '../../../css/blocks/modal.scss';
|
22 |
|
23 |
registerBlockType( 'wp-recipe-maker/recipe-roundup-item', {
|
24 |
title: __( 'WPRM Recipe Roundup Item' ),
|
@@ -79,13 +78,16 @@ registerBlockType( 'wp-recipe-maker/recipe-roundup-item', {
|
|
79 |
<Button
|
80 |
isLarge
|
81 |
onClick={ () => {
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
|
|
|
|
|
|
89 |
}}>
|
90 |
{ __( 'Select Recipe' ) }
|
91 |
</Button>
|
18 |
import Sidebar from './Sidebar';
|
19 |
|
20 |
import '../../../css/blocks/recipe.scss';
|
|
|
21 |
|
22 |
registerBlockType( 'wp-recipe-maker/recipe-roundup-item', {
|
23 |
title: __( 'WPRM Recipe Roundup Item' ),
|
78 |
<Button
|
79 |
isLarge
|
80 |
onClick={ () => {
|
81 |
+
WPRM_Modal.open( 'select', {
|
82 |
+
title: __( 'Recipe Roundup Item' ),
|
83 |
+
button: __( 'Use' ),
|
84 |
+
fields: {
|
85 |
+
recipe: {},
|
86 |
+
},
|
87 |
+
insertCallback: ( fields ) => {
|
88 |
+
modalCallback( fields.recipe.id );
|
89 |
+
},
|
90 |
+
} );
|
91 |
}}>
|
92 |
{ __( 'Select Recipe' ) }
|
93 |
</Button>
|
assets/js/blocks/recipe/index.js
CHANGED
@@ -16,7 +16,6 @@ const {
|
|
16 |
} = wp.editor;
|
17 |
|
18 |
import '../../../css/blocks/recipe.scss';
|
19 |
-
import '../../../css/blocks/modal.scss';
|
20 |
|
21 |
registerBlockType( 'wp-recipe-maker/recipe', {
|
22 |
title: __( 'WPRM Recipe' ),
|
@@ -52,9 +51,9 @@ registerBlockType( 'wp-recipe-maker/recipe', {
|
|
52 |
edit: (props) => {
|
53 |
const { attributes, setAttributes, isSelected, className } = props;
|
54 |
|
55 |
-
const modalCallback = (
|
56 |
setAttributes({
|
57 |
-
id,
|
58 |
updated: Date.now(),
|
59 |
});
|
60 |
};
|
@@ -86,12 +85,10 @@ registerBlockType( 'wp-recipe-maker/recipe', {
|
|
86 |
icon: 'edit',
|
87 |
title: __( 'Edit Recipe' ),
|
88 |
onClick: () => {
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
});
|
94 |
-
WPRecipeMaker.admin.Modal.disable_menu();
|
95 |
}
|
96 |
}
|
97 |
]}
|
@@ -129,24 +126,24 @@ registerBlockType( 'wp-recipe-maker/recipe', {
|
|
129 |
isPrimary
|
130 |
isLarge
|
131 |
onClick={ () => {
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
gutenbergCallback: modalCallback,
|
136 |
-
});
|
137 |
-
WPRecipeMaker.admin.Modal.disable_menu();
|
138 |
}}>
|
139 |
{ __( 'Create new Recipe' ) }
|
140 |
</Button> <Button
|
141 |
isLarge
|
142 |
onClick={ () => {
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
|
|
|
|
|
|
150 |
}}>
|
151 |
{ __( 'Insert existing Recipe' ) }
|
152 |
</Button> {
|
@@ -155,13 +152,20 @@ registerBlockType( 'wp-recipe-maker/recipe', {
|
|
155 |
<Button
|
156 |
isLarge
|
157 |
onClick={ () => {
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
165 |
}}>
|
166 |
{ __( 'Create new from existing Recipe' ) }
|
167 |
</Button>
|
16 |
} = wp.editor;
|
17 |
|
18 |
import '../../../css/blocks/recipe.scss';
|
|
|
19 |
|
20 |
registerBlockType( 'wp-recipe-maker/recipe', {
|
21 |
title: __( 'WPRM Recipe' ),
|
51 |
edit: (props) => {
|
52 |
const { attributes, setAttributes, isSelected, className } = props;
|
53 |
|
54 |
+
const modalCallback = ( recipe ) => {
|
55 |
setAttributes({
|
56 |
+
id: recipe.id,
|
57 |
updated: Date.now(),
|
58 |
});
|
59 |
};
|
85 |
icon: 'edit',
|
86 |
title: __( 'Edit Recipe' ),
|
87 |
onClick: () => {
|
88 |
+
WPRM_Modal.open( 'recipe', {
|
89 |
+
recipeId: attributes.id,
|
90 |
+
saveCallback: modalCallback,
|
91 |
+
} );
|
|
|
|
|
92 |
}
|
93 |
}
|
94 |
]}
|
126 |
isPrimary
|
127 |
isLarge
|
128 |
onClick={ () => {
|
129 |
+
WPRM_Modal.open( 'recipe', {
|
130 |
+
saveCallback: modalCallback,
|
131 |
+
} );
|
|
|
|
|
|
|
132 |
}}>
|
133 |
{ __( 'Create new Recipe' ) }
|
134 |
</Button> <Button
|
135 |
isLarge
|
136 |
onClick={ () => {
|
137 |
+
WPRM_Modal.open( 'select', {
|
138 |
+
title: 'Insert existing Recipe',
|
139 |
+
button: 'Insert',
|
140 |
+
fields: {
|
141 |
+
recipe: {},
|
142 |
+
},
|
143 |
+
insertCallback: ( fields ) => {
|
144 |
+
modalCallback( fields.recipe );
|
145 |
+
},
|
146 |
+
} );
|
147 |
}}>
|
148 |
{ __( 'Insert existing Recipe' ) }
|
149 |
</Button> {
|
152 |
<Button
|
153 |
isLarge
|
154 |
onClick={ () => {
|
155 |
+
WPRM_Modal.open( 'select', {
|
156 |
+
title: 'Create new from existing Recipe',
|
157 |
+
button: 'Clone Recipe',
|
158 |
+
fields: {
|
159 |
+
recipe: {},
|
160 |
+
},
|
161 |
+
nextStepCallback: ( fields ) => {
|
162 |
+
WPRM_Modal.open( 'recipe', {
|
163 |
+
recipeId: fields.recipe.id,
|
164 |
+
cloneRecipe: true,
|
165 |
+
saveCallback: modalCallback,
|
166 |
+
}, true );
|
167 |
+
},
|
168 |
+
} );
|
169 |
}}>
|
170 |
{ __( 'Create new from existing Recipe' ) }
|
171 |
</Button>
|
assets/js/other/{shortcode-preview-tinymce.js → tinymce-shortcode-preview.js}
RENAMED
@@ -58,14 +58,21 @@
|
|
58 |
|
59 |
if (event.button !== 2 && shortcode.length > 0) {
|
60 |
if (dom.getAttrib(node, 'data-wprm-recipe-remove')) {
|
61 |
-
if (confirm(wprm_admin.
|
62 |
editor.dom.remove(node.parentNode);
|
63 |
}
|
64 |
} else {
|
65 |
var id = jQuery(shortcode).data('wprm-recipe');
|
66 |
-
|
67 |
-
|
68 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
69 |
}
|
70 |
}
|
71 |
});
|
58 |
|
59 |
if (event.button !== 2 && shortcode.length > 0) {
|
60 |
if (dom.getAttrib(node, 'data-wprm-recipe-remove')) {
|
61 |
+
if (confirm(wprm_admin.text.shortcode_remove)) {
|
62 |
editor.dom.remove(node.parentNode);
|
63 |
}
|
64 |
} else {
|
65 |
var id = jQuery(shortcode).data('wprm-recipe');
|
66 |
+
WPRM_Modal.open( 'recipe', {
|
67 |
+
recipeId: id,
|
68 |
+
saveCallback: ( recipe ) => {
|
69 |
+
// Refresh tinyMCE.
|
70 |
+
if ( typeof tinyMCE !== 'undefined' && tinyMCE.get(editor.id) && !tinyMCE.get(editor.id).isHidden() ) {
|
71 |
+
tinyMCE.get(editor.id).focus(true);
|
72 |
+
tinyMCE.activeEditor.setContent(tinyMCE.activeEditor.getContent());
|
73 |
+
}
|
74 |
+
},
|
75 |
+
} );
|
76 |
}
|
77 |
}
|
78 |
});
|
assets/js/other/{shortcode-button-tinymce.js → tinymce-toolbar-button.js}
RENAMED
@@ -16,7 +16,10 @@
|
|
16 |
});
|
17 |
|
18 |
ed.addCommand('wp_recipe_maker', function() {
|
19 |
-
|
|
|
|
|
|
|
20 |
});
|
21 |
},
|
22 |
|
16 |
});
|
17 |
|
18 |
ed.addCommand('wp_recipe_maker', function() {
|
19 |
+
WPRM_Modal.open( 'menu', {
|
20 |
+
insertCallback: ( shortcode ) => WPRM_Modal.addTextToEditor( shortcode, ed.id ),
|
21 |
+
saveCallback: ( recipe ) => WPRM_Modal.addTextToEditor( '[wprm-recipe id="' + recipe.id + '"]', ed.id ),
|
22 |
+
} );
|
23 |
});
|
24 |
},
|
25 |
|
assets/js/public/print.js
CHANGED
@@ -2,10 +2,20 @@ import { get_active_system } from '../../../../wp-recipe-maker-premium/addons-pr
|
|
2 |
|
3 |
function print_recipe(recipe_id, servings, system) {
|
4 |
const urlParts = wprm_public.home_url.split(/\?(.+)/);
|
5 |
-
let printUrl = urlParts[0]
|
6 |
|
7 |
-
if (
|
8 |
-
printUrl += '
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
}
|
10 |
|
11 |
var print_window = window.open(printUrl, '_blank');
|
@@ -36,9 +46,13 @@ jQuery(document).ready(function($) {
|
|
36 |
if (recipe_id) {
|
37 |
e.preventDefault();
|
38 |
|
39 |
-
var recipe = jQuery('#wprm-recipe-container-' + recipe_id);
|
40 |
var servings = false,
|
41 |
-
system = 1
|
|
|
|
|
|
|
|
|
|
|
42 |
|
43 |
if (0 < recipe.length) {
|
44 |
servings = parseInt(recipe.find('.wprm-recipe-servings').data('servings'));
|
2 |
|
3 |
function print_recipe(recipe_id, servings, system) {
|
4 |
const urlParts = wprm_public.home_url.split(/\?(.+)/);
|
5 |
+
let printUrl = urlParts[0];
|
6 |
|
7 |
+
if ( wprm_public.permalinks ) {
|
8 |
+
printUrl += 'wprm_print/' + recipe_id;
|
9 |
+
|
10 |
+
if ( urlParts[1] ) {
|
11 |
+
printUrl += '?' + urlParts[1];
|
12 |
+
}
|
13 |
+
} else {
|
14 |
+
printUrl += '?wprm_print=' + recipe_id;
|
15 |
+
|
16 |
+
if ( urlParts[1] ) {
|
17 |
+
printUrl += '&' + urlParts[1];
|
18 |
+
}
|
19 |
}
|
20 |
|
21 |
var print_window = window.open(printUrl, '_blank');
|
46 |
if (recipe_id) {
|
47 |
e.preventDefault();
|
48 |
|
|
|
49 |
var servings = false,
|
50 |
+
system = 1,
|
51 |
+
recipe = jQuery('#wprm-recipe-container-' + recipe_id);
|
52 |
+
|
53 |
+
if ( ! recipe.length ) {
|
54 |
+
recipe = jQuery(this).parents('.wprm-recipe');
|
55 |
+
}
|
56 |
|
57 |
if (0 < recipe.length) {
|
58 |
servings = parseInt(recipe.find('.wprm-recipe-servings').data('servings'));
|
assets/js/shared/Api.js
ADDED
@@ -0,0 +1,113 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
const recipeEndpoint = wprm_admin.endpoints.recipe;
|
2 |
+
const noticeEndpoint = wprm_admin.endpoints.notices;
|
3 |
+
|
4 |
+
export default {
|
5 |
+
getRecipe(id) {
|
6 |
+
return fetch(`${recipeEndpoint}/${id}`, {
|
7 |
+
method: 'GET',
|
8 |
+
headers: {
|
9 |
+
'X-WP-Nonce': wprm_admin.api_nonce,
|
10 |
+
'Accept': 'application/json',
|
11 |
+
'Content-Type': 'application/json',
|
12 |
+
},
|
13 |
+
credentials: 'same-origin',
|
14 |
+
}).then(function (response) {
|
15 |
+
if ( response.ok ) {
|
16 |
+
return response.json();
|
17 |
+
} else {
|
18 |
+
console.log(response);
|
19 |
+
alert( 'Something went wrong. Please contact support.' );
|
20 |
+
return false;
|
21 |
+
}
|
22 |
+
});
|
23 |
+
},
|
24 |
+
saveRecipe(recipe) {
|
25 |
+
const data = {
|
26 |
+
recipe,
|
27 |
+
};
|
28 |
+
|
29 |
+
// Default to create new recipe.
|
30 |
+
let url = recipeEndpoint;
|
31 |
+
let method = 'POST';
|
32 |
+
|
33 |
+
// Recipe ID set? Update an existing one.
|
34 |
+
const recipeId = recipe.id ? parseInt(recipe.id) : false;
|
35 |
+
if ( recipeId ) {
|
36 |
+
url += `/${recipeId}`
|
37 |
+
method = 'PUT';
|
38 |
+
}
|
39 |
+
|
40 |
+
return fetch(url, {
|
41 |
+
method,
|
42 |
+
headers: {
|
43 |
+
'X-WP-Nonce': wprm_admin.api_nonce,
|
44 |
+
'Accept': 'application/json',
|
45 |
+
'Content-Type': 'application/json',
|
46 |
+
},
|
47 |
+
credentials: 'same-origin',
|
48 |
+
body: JSON.stringify(data),
|
49 |
+
}).then(function (response) {
|
50 |
+
if ( response.ok ) {
|
51 |
+
return response.json();
|
52 |
+
} else {
|
53 |
+
console.log(response);
|
54 |
+
alert( 'Something went wrong. Please contact support.' );
|
55 |
+
return false;
|
56 |
+
}
|
57 |
+
});
|
58 |
+
},
|
59 |
+
deleteRecipe(id) {
|
60 |
+
return fetch(`${recipeEndpoint}/${id}`, {
|
61 |
+
method: 'DELETE',
|
62 |
+
headers: {
|
63 |
+
'X-WP-Nonce': wprm_admin.api_nonce,
|
64 |
+
'Accept': 'application/json',
|
65 |
+
'Content-Type': 'application/json',
|
66 |
+
},
|
67 |
+
credentials: 'same-origin',
|
68 |
+
}).then(function (response) {
|
69 |
+
if ( response.ok ) {
|
70 |
+
return response.json();
|
71 |
+
} else {
|
72 |
+
console.log(response);
|
73 |
+
alert( 'Something went wrong. Please contact support.' );
|
74 |
+
return false;
|
75 |
+
}
|
76 |
+
});
|
77 |
+
},
|
78 |
+
deleteRecipeRevision(recipe_id, revision_id) {
|
79 |
+
return fetch(`${recipeEndpoint}/${recipe_id}/revisions/${revision_id}?force=true`, {
|
80 |
+
method: 'DELETE',
|
81 |
+
headers: {
|
82 |
+
'X-WP-Nonce': wprm_admin.api_nonce,
|
83 |
+
'Accept': 'application/json',
|
84 |
+
'Content-Type': 'application/json',
|
85 |
+
},
|
86 |
+
credentials: 'same-origin',
|
87 |
+
}).then(function (response) {
|
88 |
+
if ( response.ok ) {
|
89 |
+
return response.json();
|
90 |
+
} else {
|
91 |
+
console.log(response);
|
92 |
+
alert( 'Something went wrong. Please contact support.' );
|
93 |
+
return false;
|
94 |
+
}
|
95 |
+
});
|
96 |
+
},
|
97 |
+
dismissNotice(id) {
|
98 |
+
const data = {
|
99 |
+
id,
|
100 |
+
};
|
101 |
+
|
102 |
+
return fetch(`${noticeEndpoint}`, {
|
103 |
+
method: 'DELETE',
|
104 |
+
headers: {
|
105 |
+
'X-WP-Nonce': wprm_admin.api_nonce,
|
106 |
+
'Accept': 'application/json',
|
107 |
+
'Content-Type': 'application/json',
|
108 |
+
},
|
109 |
+
credentials: 'same-origin',
|
110 |
+
body: JSON.stringify(data),
|
111 |
+
});
|
112 |
+
},
|
113 |
+
};
|
assets/js/shared/Button.js
ADDED
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import React from 'react';
|
2 |
+
|
3 |
+
import Tooltip from './Tooltip';
|
4 |
+
|
5 |
+
import '../../css/admin/shared/button.scss';
|
6 |
+
|
7 |
+
const Button = (props) => {
|
8 |
+
let buttonDisabled = false;
|
9 |
+
let tooltipContent = props.help ? props.help : false;
|
10 |
+
let className = 'button';
|
11 |
+
|
12 |
+
// Check if there are requirements.
|
13 |
+
if ( props.required ) {
|
14 |
+
if ( ! wprm_admin.addons.hasOwnProperty( props.required ) || true !== wprm_admin.addons[ props.required ] ) {
|
15 |
+
buttonDisabled = true;
|
16 |
+
|
17 |
+
if ( 'premium' !== props.required ) {
|
18 |
+
const capitalized = props.required[0].toUpperCase() + props.required.substring(1);
|
19 |
+
tooltipContent = `WP Recipe Maker ${capitalized} Bundle Only`;
|
20 |
+
} else {
|
21 |
+
tooltipContent = 'WP Recipe Maker Premium Only';
|
22 |
+
}
|
23 |
+
}
|
24 |
+
}
|
25 |
+
|
26 |
+
// Extra class if primary button.
|
27 |
+
if ( props.isPrimary ) {
|
28 |
+
className += ' button-primary';
|
29 |
+
}
|
30 |
+
|
31 |
+
// Extra class if disabled. Don't actually use disabled or tooltip won't work.
|
32 |
+
if ( buttonDisabled ) {
|
33 |
+
className += ' wprm-button-required';
|
34 |
+
}
|
35 |
+
|
36 |
+
return (
|
37 |
+
<Tooltip content={ tooltipContent }>
|
38 |
+
<button
|
39 |
+
className={ className }
|
40 |
+
tabIndex={ props.disableTab ? '-1' : null }
|
41 |
+
onClick={ buttonDisabled ? () => {
|
42 |
+
if ( confirm( 'Want to learn more about the version required for this feature?' ) ) {
|
43 |
+
window.open( 'https://bootstrapped.ventures/wp-recipe-maker/get-the-plugin/', '_blank' );
|
44 |
+
}
|
45 |
+
} : props.onClick }
|
46 |
+
>
|
47 |
+
{ props.children }
|
48 |
+
</button>
|
49 |
+
</Tooltip>
|
50 |
+
);
|
51 |
+
}
|
52 |
+
|
53 |
+
export default Button;
|
assets/js/shared/ErrorBoundary.js
ADDED
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import React, { Component, Fragment } from 'react';
|
2 |
+
|
3 |
+
import '../../css/admin/shared/error-boundary.scss';
|
4 |
+
|
5 |
+
export default class ErrorBoundary extends Component {
|
6 |
+
|
7 |
+
constructor(props) {
|
8 |
+
super(props);
|
9 |
+
|
10 |
+
this.state = {
|
11 |
+
hasError: false,
|
12 |
+
error: false,
|
13 |
+
info: false,
|
14 |
+
}
|
15 |
+
}
|
16 |
+
|
17 |
+
componentDidCatch(error, info) {
|
18 |
+
this.setState({
|
19 |
+
hasError: true,
|
20 |
+
error,
|
21 |
+
info,
|
22 |
+
});
|
23 |
+
}
|
24 |
+
|
25 |
+
render() {
|
26 |
+
return (
|
27 |
+
<Fragment>
|
28 |
+
{
|
29 |
+
this.state.hasError
|
30 |
+
?
|
31 |
+
<div className="wprm-error-boundary">
|
32 |
+
<p>
|
33 |
+
<strong>Something went wrong</strong><br/>
|
34 |
+
Please contact <a href="mailto:support@bootstrapped.ventures">support@bootstrapped.ventures</a> and send along the following information:</p>
|
35 |
+
<pre>
|
36 |
+
{ this.props.module ? `Module: ${ this.props.module }\n` : null }
|
37 |
+
{ this.state.error ? `Error: ${ this.state.error.toString() }\n` : null }
|
38 |
+
{ this.state.info ? `Stack: ${ this.state.info.componentStack }` : null }
|
39 |
+
</pre>
|
40 |
+
</div>
|
41 |
+
:
|
42 |
+
this.props.children
|
43 |
+
}
|
44 |
+
</Fragment>
|
45 |
+
);
|
46 |
+
}
|
47 |
+
}
|
assets/js/shared/Icon.js
ADDED
@@ -0,0 +1,79 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import React from 'react';
|
2 |
+
import SVG from 'react-inlinesvg';
|
3 |
+
|
4 |
+
import '../../css/admin/shared/icon.scss';
|
5 |
+
import Tooltip from './Tooltip';
|
6 |
+
|
7 |
+
import IconAdjustable from '../../icons/admin/adjustable.svg';
|
8 |
+
import IconBold from '../../icons/admin/bold.svg';
|
9 |
+
import IconClock from '../../icons/admin/clock.svg';
|
10 |
+
import IconClose from '../../icons/admin/close.svg';
|
11 |
+
import IconCheckboxAlternate from '../../icons/admin/checkbox-alternate.svg';
|
12 |
+
import IconCheckboxChecked from '../../icons/admin/checkbox-checked.svg';
|
13 |
+
import IconCheckboxEmpty from '../../icons/admin/checkbox-empty.svg';
|
14 |
+
import IconCheckmark from '../../icons/admin/checkmark.svg';
|
15 |
+
import IconDuplicate from '../../icons/admin/duplicate.svg';
|
16 |
+
import IconDrag from '../../icons/admin/drag.svg';
|
17 |
+
import IconEye from '../../icons/admin/eye.svg';
|
18 |
+
import IconItalic from '../../icons/admin/italic.svg';
|
19 |
+
import IconLink from '../../icons/admin/link.svg';
|
20 |
+
import IconMerge from '../../icons/admin/merge.svg';
|
21 |
+
import IconPencil from '../../icons/admin/pencil.svg';
|
22 |
+
import IconQuestion from '../../icons/admin/question.svg';
|
23 |
+
import IconStarEmpty from '../../icons/admin/star-empty.svg';
|
24 |
+
import IconStarFull from '../../icons/admin/star-full.svg';
|
25 |
+
import IconSubscript from '../../icons/admin/subscript.svg';
|
26 |
+
import IconSuperscript from '../../icons/admin/superscript.svg';
|
27 |
+
import IconTrash from '../../icons/admin/trash.svg';
|
28 |
+
import IconUnderline from '../../icons/admin/underline.svg';
|
29 |
+
import IconUnlink from '../../icons/admin/unlink.svg';
|
30 |
+
|
31 |
+
const icons = {
|
32 |
+
adjustable: IconAdjustable,
|
33 |
+
bold: IconBold,
|
34 |
+
clock: IconClock,
|
35 |
+
close: IconClose,
|
36 |
+
'checkbox-alternate': IconCheckboxAlternate,
|
37 |
+
'checkbox-checked': IconCheckboxChecked,
|
38 |
+
'checkbox-empty': IconCheckboxEmpty,
|
39 |
+
checkmark: IconCheckmark,
|
40 |
+
duplicate: IconDuplicate,
|
41 |
+
drag: IconDrag,
|
42 |
+
eye: IconEye,
|
43 |
+
italic: IconItalic,
|
44 |
+
link: IconLink,
|
45 |
+
merge: IconMerge,
|
46 |
+
pencil: IconPencil,
|
47 |
+
question: IconQuestion,
|
48 |
+
'star-empty': IconStarEmpty,
|
49 |
+
'star-full': IconStarFull,
|
50 |
+
subscript: IconSubscript,
|
51 |
+
superscript: IconSuperscript,
|
52 |
+
trash: IconTrash,
|
53 |
+
underline: IconUnderline,
|
54 |
+
unlink: IconUnlink,
|
55 |
+
};
|
56 |
+
|
57 |
+
const Icon = (props) => {
|
58 |
+
let icon = icons.hasOwnProperty(props.type) ? icons[props.type] : false;
|
59 |
+
|
60 |
+
if ( !icon ) {
|
61 |
+
return null;
|
62 |
+
}
|
63 |
+
|
64 |
+
const className = props.className ? `wprm-admin-icon ${props.className}` : 'wprm-admin-icon';
|
65 |
+
|
66 |
+
return (
|
67 |
+
<Tooltip content={props.title}>
|
68 |
+
<span
|
69 |
+
className={ className }
|
70 |
+
onClick={props.onClick}
|
71 |
+
>
|
72 |
+
<SVG
|
73 |
+
src={icon}
|
74 |
+
/>
|
75 |
+
</span>
|
76 |
+
</Tooltip>
|
77 |
+
);
|
78 |
+
}
|
79 |
+
export default Icon;
|
assets/js/shared/Loader.js
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import React from 'react';
|
2 |
+
|
3 |
+
import '../../css/admin/shared/loader.scss';
|
4 |
+
|
5 |
+
const Loader = (props) => {
|
6 |
+
return (
|
7 |
+
<div className="wprm-admin-loader"></div>
|
8 |
+
);
|
9 |
+
}
|
10 |
+
export default Loader;
|
assets/js/shared/Tooltip.js
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import React from 'react';
|
2 |
+
import Tippy from '@tippy.js/react'
|
3 |
+
|
4 |
+
const Tooltip = (props) => {
|
5 |
+
if ( ! props.content ) {
|
6 |
+
return props.children;
|
7 |
+
}
|
8 |
+
|
9 |
+
return (
|
10 |
+
<Tippy
|
11 |
+
content={<div dangerouslySetInnerHTML={ { __html: props.content } } />}
|
12 |
+
zIndex={100000}
|
13 |
+
>
|
14 |
+
{ props.children }
|
15 |
+
</Tippy>
|
16 |
+
);
|
17 |
+
}
|
18 |
+
export default Tooltip;
|
assets/js/shared/Translations.js
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
export function __wprm( text, domain = 'wp-recipe-maker' ) {
|
2 |
+
if ( wprm_admin_modal.translations.hasOwnProperty( text ) ) {
|
3 |
+
return wprm_admin_modal.translations[ text ];
|
4 |
+
} else {
|
5 |
+
return text;
|
6 |
+
}
|
7 |
+
};
|
dist/admin-manage.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.wprm-manage-recipes-recipe-actions{display:flex;justify-content:space-between;align-items:center}.wprm-manage-recipes-recipe-actions .wprm-manage-icon{cursor:pointer}.wprm-manage-recipes-select-columns{margin-bottom:20px}.wprm-manage-recipes-select-columns span{display:inline-flex;align-items:center;margin-right:10px}.wprm-manage-recipes-select-columns span input{margin-top:0;margin-bottom:0}.wprm-manage .wprm-manage-header{margin-top:20px}.wprm-manage .wprm-manage-recipes-filters .select2_wprm-container,.wprm-manage .wprm-manage-recipes-filters .wprm-manage-recipes-filter{margin-left:5px;z-index:100}.wprm-manage .wprm-manage-recipes-filters .select2_wprm-container{max-width:300px}.wprm-manage .wprm-manage-datatable{display:none}.wprm-manage .wprm-manage-datatable .wprm-icon{cursor:pointer;color:#444}.wprm-manage .dataTables_wrapper{margin-top:20px}.wprm-manage .dataTables_wrapper .wprm-manage-datatable{display:table}.wprm-manage .wprm-manage-recipes-rating-details{font-size:.7em}.wprm-manage .wprm-manage-recipes-seo{margin:0 auto;width:15px;height:15px;border:1px solid #444;border-radius:50%}.wprm-manage .wprm-manage-recipes-seo.wprm-manage-recipes-seo-bad{background-color:#e74c3c}.wprm-manage .wprm-manage-recipes-seo.wprm-manage-recipes-seo-warning{background-color:#e67e22}.wprm-manage .wprm-manage-recipes-seo.wprm-manage-recipes-seo-rating{background-color:#f1c40f}.wprm-manage .wprm-manage-recipes-seo.wprm-manage-recipes-seo-good{background-color:#27ae60}.wprm-manage .wprm-manage-recipes-seo:hover{cursor:pointer}.wprm-manage .wprm-manage-recipes-seo-tooltip{display:none}.wprm-manage .wprm-manage-action-icon{cursor:pointer;margin-left:5px}.wprm-manage-custom-taxonomies-actions-tooltip,.wprm-manage-ingredients-actions-tooltip,.wprm-manage-recipes-actions-tooltip,.wprm-manage-taxonomies-actions-tooltip{text-align:right;min-width:250px;font-size:14px}.wprm-manage-custom-taxonomies-actions-tooltip .tooltip-header,.wprm-manage-ingredients-actions-tooltip .tooltip-header,.wprm-manage-recipes-actions-tooltip .tooltip-header,.wprm-manage-taxonomies-actions-tooltip .tooltip-header{margin-bottom:5px;font-weight:700}.wprm-manage-custom-taxonomies-actions-tooltip a,.wprm-manage-ingredients-actions-tooltip a,.wprm-manage-recipes-actions-tooltip a,.wprm-manage-taxonomies-actions-tooltip a{color:#fff;display:block;text-decoration:none}.wprm-manage-custom-taxonomies-actions-tooltip a:hover,.wprm-manage-ingredients-actions-tooltip a:hover,.wprm-manage-recipes-actions-tooltip a:hover,.wprm-manage-taxonomies-actions-tooltip a:hover{text-decoration:underline}.ReactTable{position:relative;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;border:1px solid rgba(0,0,0,.1)}.ReactTable *{box-sizing:border-box}.ReactTable .rt-table{-ms-flex:auto 1;flex:auto 1;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch;width:100%;border-collapse:collapse;overflow:auto}.ReactTable .rt-table,.ReactTable .rt-thead{-webkit-box-flex:1;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal}.ReactTable .rt-thead{-ms-flex:1 0 auto;flex:1 0 auto;-ms-flex-direction:column;flex-direction:column;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ReactTable .rt-thead.-headerGroups{background:rgba(0,0,0,.03)}.ReactTable .rt-thead.-filters,.ReactTable .rt-thead.-headerGroups{border-bottom:1px solid rgba(0,0,0,.05)}.ReactTable .rt-thead.-filters input,.ReactTable .rt-thead.-filters select{border:1px solid rgba(0,0,0,.1);background:#fff;padding:5px 7px;font-size:inherit;border-radius:3px;font-weight:400;outline:none}.ReactTable .rt-thead.-filters .rt-th{border-right:1px solid rgba(0,0,0,.02)}.ReactTable .rt-thead.-header{box-shadow:0 2px 15px 0 rgba(0,0,0,.15)}.ReactTable .rt-thead .rt-tr{text-align:center}.ReactTable .rt-thead .rt-td,.ReactTable .rt-thead .rt-th{padding:5px;line-height:normal;position:relative;border-right:1px solid rgba(0,0,0,.05);transition:box-shadow .3s cubic-bezier(.175,.885,.32,1.275);box-shadow:inset 0 0 0 0 transparent}.ReactTable .rt-thead .rt-td.-sort-asc,.ReactTable .rt-thead .rt-th.-sort-asc{box-shadow:inset 0 3px 0 0 rgba(0,0,0,.6)}.ReactTable .rt-thead .rt-td.-sort-desc,.ReactTable .rt-thead .rt-th.-sort-desc{box-shadow:inset 0 -3px 0 0 rgba(0,0,0,.6)}.ReactTable .rt-thead .rt-td.-cursor-pointer,.ReactTable .rt-thead .rt-th.-cursor-pointer{cursor:pointer}.ReactTable .rt-thead .rt-td:last-child,.ReactTable .rt-thead .rt-th:last-child{border-right:0}.ReactTable .rt-thead .rt-resizable-header{overflow:visible}.ReactTable .rt-thead .rt-resizable-header:last-child{overflow:hidden}.ReactTable .rt-thead .rt-resizable-header-content{overflow:hidden;text-overflow:ellipsis}.ReactTable .rt-thead .rt-header-pivot{border-right-color:#f7f7f7}.ReactTable .rt-thead .rt-header-pivot:after,.ReactTable .rt-thead .rt-header-pivot:before{left:100%;top:50%;border:solid transparent;content:" ";height:0;width:0;position:absolute;pointer-events:none}.ReactTable .rt-thead .rt-header-pivot:after{border-color:hsla(0,0%,100%,0);border-left-color:#fff;border-width:8px;margin-top:-8px}.ReactTable .rt-thead .rt-header-pivot:before{border-color:hsla(0,0%,40%,0);border-left-color:#f7f7f7;border-width:10px;margin-top:-10px}.ReactTable .rt-tbody{-webkit-box-flex:99999;-ms-flex:99999 1 auto;flex:99999 1 auto;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;overflow:auto}.ReactTable .rt-tbody .rt-tr-group{border-bottom:1px solid rgba(0,0,0,.05)}.ReactTable .rt-tbody .rt-tr-group:last-child{border-bottom:0}.ReactTable .rt-tbody .rt-td{border-right:1px solid rgba(0,0,0,.02)}.ReactTable .rt-tbody .rt-td:last-child{border-right:0}.ReactTable .rt-tbody .rt-expandable{cursor:pointer;text-overflow:clip}.ReactTable .rt-tr-group{-webkit-box-flex:1;-ms-flex:1 0 auto;flex:1 0 auto;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch}.ReactTable .rt-tr{-webkit-box-flex:1;-ms-flex:1 0 auto;flex:1 0 auto;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex}.ReactTable .rt-td,.ReactTable .rt-th{-webkit-box-flex:1;-ms-flex:1 0 0px;flex:1 0 0;white-space:nowrap;text-overflow:ellipsis;padding:7px 5px;overflow:hidden;transition:.3s ease;transition-property:width,min-width,padding,opacity}.ReactTable .rt-td.-hidden,.ReactTable .rt-th.-hidden{width:0!important;min-width:0!important;padding:0!important;border:0!important;opacity:0!important}.ReactTable .rt-expander{display:inline-block;position:relative;margin:0;color:transparent;margin:0 10px}.ReactTable .rt-expander:after{content:"";position:absolute;width:0;height:0;top:50%;left:50%;-webkit-transform:translate(-50%,-50%) rotate(-90deg);transform:translate(-50%,-50%) rotate(-90deg);border-left:5.04px solid transparent;border-right:5.04px solid transparent;border-top:7px solid rgba(0,0,0,.8);transition:all .3s cubic-bezier(.175,.885,.32,1.275);cursor:pointer}.ReactTable .rt-expander.-open:after{-webkit-transform:translate(-50%,-50%) rotate(0);transform:translate(-50%,-50%) rotate(0)}.ReactTable .rt-resizer{display:inline-block;position:absolute;width:36px;top:0;bottom:0;right:-18px;cursor:col-resize;z-index:10}.ReactTable .rt-tfoot{-webkit-box-flex:1;-ms-flex:1 0 auto;flex:1 0 auto;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;box-shadow:0 0 15px 0 rgba(0,0,0,.15)}.ReactTable .rt-tfoot .rt-td{border-right:1px solid rgba(0,0,0,.05)}.ReactTable .rt-tfoot .rt-td:last-child{border-right:0}.ReactTable.-striped .rt-tr.-odd{background:rgba(0,0,0,.03)}.ReactTable.-highlight .rt-tbody .rt-tr:not(.-padRow):hover{background:rgba(0,0,0,.05)}.ReactTable .-pagination{z-index:1;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch;-ms-flex-wrap:wrap;flex-wrap:wrap;padding:3px;box-shadow:0 0 15px 0 rgba(0,0,0,.1);border-top:2px solid rgba(0,0,0,.1)}.ReactTable .-pagination input,.ReactTable .-pagination select{border:1px solid rgba(0,0,0,.1);background:#fff;padding:5px 7px;font-size:inherit;border-radius:3px;font-weight:400;outline:none}.ReactTable .-pagination .-btn{-webkit-appearance:none;-moz-appearance:none;appearance:none;display:block;width:100%;height:100%;border:0;border-radius:3px;padding:6px;font-size:1em;color:rgba(0,0,0,.6);background:rgba(0,0,0,.1);transition:all .1s ease;cursor:pointer;outline:none}.ReactTable .-pagination .-btn[disabled]{opacity:.5;cursor:default}.ReactTable .-pagination .-btn:not([disabled]):hover{background:rgba(0,0,0,.3);color:#fff}.ReactTable .-pagination .-next,.ReactTable .-pagination .-previous{-webkit-box-flex:1;-ms-flex:1;flex:1;text-align:center}.ReactTable .-pagination .-center{-webkit-box-flex:1.5;-ms-flex:1.5;flex:1.5;text-align:center;margin-bottom:0;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-ms-flex-pack:distribute;justify-content:space-around}.ReactTable .-pagination .-pageInfo{display:inline-block;margin:3px 10px;white-space:nowrap}.ReactTable .-pagination .-pageJump{display:inline-block}.ReactTable .-pagination .-pageJump input{width:70px;text-align:center}.ReactTable .-pagination .-pageSizeOptions{margin:3px 10px}.ReactTable .rt-noData{left:50%;top:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);z-index:1;padding:20px;color:rgba(0,0,0,.5)}.ReactTable .-loading,.ReactTable .rt-noData{display:block;position:absolute;background:hsla(0,0%,100%,.8);transition:all .3s ease;pointer-events:none}.ReactTable .-loading{left:0;right:0;top:0;bottom:0;z-index:-1;opacity:0}.ReactTable .-loading>div{position:absolute;display:block;text-align:center;width:100%;top:50%;left:0;font-size:15px;color:rgba(0,0,0,.6);-webkit-transform:translateY(-52%);transform:translateY(-52%);transition:all .3s cubic-bezier(.25,.46,.45,.94)}.ReactTable .-loading.-active{opacity:1;z-index:2;pointer-events:all}.ReactTable .-loading.-active>div{-webkit-transform:translateY(50%);transform:translateY(50%)}.ReactTable .rt-resizing .rt-td,.ReactTable .rt-resizing .rt-th{transition:none!important;cursor:col-resize;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}
|
1 |
+
.wprm-admin-icon{opacity:.5;margin-top:2px}.wprm-admin-icon:hover{opacity:1;cursor:pointer}.wprm-manage-nutrition-nutrition-container{width:100%}.wprm-manage-nutrition-nutrition-container .wprm-manage-nutrition-nutrition{display:flex;width:100%}.wprm-manage-nutrition-nutrition-container .wprm-manage-nutrition-nutrition .wprm-manage-nutrition-nutrition-label{flex:auto;margin-right:5px}.wprm-manage-nutrition-nutrition-container .wprm-manage-nutrition-nutrition .wprm-manage-nutrition-nutrition-value-unit{flex:0 0 75px}.wprm-manage-nutrition-nutrition-container .wprm-manage-nutrition-nutrition .wprm-manage-nutrition-nutrition-value-unit .wprm-manage-nutrition-nutrition-unit{margin-left:2px;font-size:10px}.wprm-manage-recipes-nutrition-container{width:100%}.wprm-manage-recipes-nutrition-container .wprm-manage-recipes-nutrition{display:flex;width:100%}.wprm-manage-recipes-nutrition-container .wprm-manage-recipes-nutrition .wprm-manage-recipes-nutrition-label{flex:auto;margin-right:5px}.wprm-manage-recipes-nutrition-container .wprm-manage-recipes-nutrition .wprm-manage-recipes-nutrition-value-unit{flex:0 0 75px}.wprm-manage-recipes-nutrition-container .wprm-manage-recipes-nutrition .wprm-manage-recipes-nutrition-value-unit .wprm-manage-recipes-nutrition-unit{margin-left:2px;font-size:10px}.wprm-admin-manage-image{display:block;max-width:75px;max-height:75px;margin:0 auto}.wprm-admin-manage-seo-indicator{width:100%;height:14px;border:1px solid #23282d;border-radius:4px;background-color:#fff;display:flex;cursor:pointer}.wprm-admin-manage-seo-indicator .wprm-admin-manage-seo-indicator-block{flex:0 0 25%;height:100%}.wprm-admin-manage-seo-indicator .wprm-admin-manage-seo-indicator-block:first-child{border-top-left-radius:3px;border-bottom-left-radius:3px}.wprm-admin-manage-seo-indicator .wprm-admin-manage-seo-indicator-block:nth-child(4){border-top-right-radius:3px;border-bottom-right-radius:3px}.wprm-admin-manage-seo-indicator.wprm-admin-manage-seo-indicator-other{display:block;font-size:10px;line-height:10px;text-align:center}.wprm-admin-manage-seo-indicator.wprm-admin-manage-seo-indicator-bad{border-color:#921e12}.wprm-admin-manage-seo-indicator.wprm-admin-manage-seo-indicator-bad .wprm-admin-manage-seo-indicator-block:first-child{background-color:#e74c3c}.wprm-admin-manage-seo-indicator.wprm-admin-manage-seo-indicator-warning{border-color:#7b410e}.wprm-admin-manage-seo-indicator.wprm-admin-manage-seo-indicator-warning .wprm-admin-manage-seo-indicator-block:first-child,.wprm-admin-manage-seo-indicator.wprm-admin-manage-seo-indicator-warning .wprm-admin-manage-seo-indicator-block:nth-child(2){background-color:#e67e22}.wprm-admin-manage-seo-indicator.wprm-admin-manage-seo-indicator-rating{border-color:#796307}.wprm-admin-manage-seo-indicator.wprm-admin-manage-seo-indicator-rating .wprm-admin-manage-seo-indicator-block:first-child,.wprm-admin-manage-seo-indicator.wprm-admin-manage-seo-indicator-rating .wprm-admin-manage-seo-indicator-block:nth-child(2),.wprm-admin-manage-seo-indicator.wprm-admin-manage-seo-indicator-rating .wprm-admin-manage-seo-indicator-block:nth-child(3){background-color:#f1c40f}.wprm-admin-manage-seo-indicator.wprm-admin-manage-seo-indicator-good{border-color:#104627}.wprm-admin-manage-seo-indicator.wprm-admin-manage-seo-indicator-good .wprm-admin-manage-seo-indicator-block{background-color:#27ae60}.wprm-admin-manage-recipes-ratings-container{width:100%;display:flex;align-items:center}.wprm-admin-manage-recipes-ratings-container .wprm-admin-manage-recipes-ratings-average{flex:0 0 40px;margin-right:10px;text-align:right;font-weight:700}.wprm-admin-manage-recipes-ratings-container .wprm-admin-manage-recipes-ratings-details{font-size:10px;display:flex;flex-direction:column}.wprm-admin-manage-recipes-ratings-container .wprm-admin-manage-recipes-ratings-details .wprm-admin-manage-recipes-ratings-details-none{opacity:.5}.wprm-admin-manage-recipes-ratings-container .wprm-admin-manage-recipes-ratings-details a{margin-left:2px;opacity:.7;text-decoration:none}.wprm-admin-manage-recipes-ratings-container .wprm-admin-manage-recipes-ratings-details a:hover{opacity:1}.wprm-manage-ingredients-group-container{display:flex;align-items:center}.wprm-manage-ingredients-group-container span{margin-left:5px}.wprm-manage-ingredients-link-container{display:flex;align-items:center}.wprm-manage-ingredients-link-container a{margin-left:5px;font-size:11px}.wprm-admin-manage-notices .wprm-admin-notice{margin-bottom:15px;background-color:#fff;border:1px solid #0073aa;border-radius:4px;padding:10px;display:flex;align-items:center}.wprm-admin-manage-notices .wprm-admin-notice .wprm-admin-notice-content{flex:1}.wprm-admin-manage-notices .wprm-admin-notice .wprm-admin-notice-content .wprm-admin-notice-title{font-weight:700;margin-bottom:5px}.wprm-admin-manage-notices .wprm-admin-notice .wprm-admin-notice-dismiss .wprm-admin-icon{opacity:1}.ReactTable{position:relative;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;border:1px solid rgba(0,0,0,.1)}.ReactTable *{box-sizing:border-box}.ReactTable .rt-table{-ms-flex:auto 1;flex:auto 1;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch;width:100%;border-collapse:collapse;overflow:auto}.ReactTable .rt-table,.ReactTable .rt-thead{-webkit-box-flex:1;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal}.ReactTable .rt-thead{-ms-flex:1 0 auto;flex:1 0 auto;-ms-flex-direction:column;flex-direction:column;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ReactTable .rt-thead.-headerGroups{background:rgba(0,0,0,.03)}.ReactTable .rt-thead.-filters,.ReactTable .rt-thead.-headerGroups{border-bottom:1px solid rgba(0,0,0,.05)}.ReactTable .rt-thead.-filters input,.ReactTable .rt-thead.-filters select{border:1px solid rgba(0,0,0,.1);background:#fff;padding:5px 7px;font-size:inherit;border-radius:3px;font-weight:400;outline:none}.ReactTable .rt-thead.-filters .rt-th{border-right:1px solid rgba(0,0,0,.02)}.ReactTable .rt-thead.-header{box-shadow:0 2px 15px 0 rgba(0,0,0,.15)}.ReactTable .rt-thead .rt-tr{text-align:center}.ReactTable .rt-thead .rt-td,.ReactTable .rt-thead .rt-th{padding:5px;line-height:normal;position:relative;border-right:1px solid rgba(0,0,0,.05);transition:box-shadow .3s cubic-bezier(.175,.885,.32,1.275);box-shadow:inset 0 0 0 0 transparent}.ReactTable .rt-thead .rt-td.-sort-asc,.ReactTable .rt-thead .rt-th.-sort-asc{box-shadow:inset 0 3px 0 0 rgba(0,0,0,.6)}.ReactTable .rt-thead .rt-td.-sort-desc,.ReactTable .rt-thead .rt-th.-sort-desc{box-shadow:inset 0 -3px 0 0 rgba(0,0,0,.6)}.ReactTable .rt-thead .rt-td.-cursor-pointer,.ReactTable .rt-thead .rt-th.-cursor-pointer{cursor:pointer}.ReactTable .rt-thead .rt-td:last-child,.ReactTable .rt-thead .rt-th:last-child{border-right:0}.ReactTable .rt-thead .rt-th:focus{outline:none}.ReactTable .rt-thead .rt-resizable-header{overflow:visible}.ReactTable .rt-thead .rt-resizable-header:last-child{overflow:hidden}.ReactTable .rt-thead .rt-resizable-header-content{overflow:hidden;text-overflow:ellipsis}.ReactTable .rt-thead .rt-header-pivot{border-right-color:#f7f7f7}.ReactTable .rt-thead .rt-header-pivot:after,.ReactTable .rt-thead .rt-header-pivot:before{left:100%;top:50%;border:solid transparent;content:" ";height:0;width:0;position:absolute;pointer-events:none}.ReactTable .rt-thead .rt-header-pivot:after{border-color:hsla(0,0%,100%,0);border-left-color:#fff;border-width:8px;margin-top:-8px}.ReactTable .rt-thead .rt-header-pivot:before{border-color:hsla(0,0%,40%,0);border-left-color:#f7f7f7;border-width:10px;margin-top:-10px}.ReactTable .rt-tbody{-webkit-box-flex:99999;-ms-flex:99999 1 auto;flex:99999 1 auto;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;overflow:auto}.ReactTable .rt-tbody .rt-tr-group{border-bottom:1px solid rgba(0,0,0,.05)}.ReactTable .rt-tbody .rt-tr-group:last-child{border-bottom:0}.ReactTable .rt-tbody .rt-td{border-right:1px solid rgba(0,0,0,.02)}.ReactTable .rt-tbody .rt-td:last-child{border-right:0}.ReactTable .rt-tbody .rt-expandable{cursor:pointer;text-overflow:clip}.ReactTable .rt-tr-group{-webkit-box-flex:1;-ms-flex:1 0 auto;flex:1 0 auto;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch}.ReactTable .rt-tr{-webkit-box-flex:1;-ms-flex:1 0 auto;flex:1 0 auto;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex}.ReactTable .rt-td,.ReactTable .rt-th{-webkit-box-flex:1;-ms-flex:1 0 0px;flex:1 0 0;white-space:nowrap;text-overflow:ellipsis;padding:7px 5px;overflow:hidden;transition:.3s ease;transition-property:width,min-width,padding,opacity}.ReactTable .rt-td.-hidden,.ReactTable .rt-th.-hidden{width:0!important;min-width:0!important;padding:0!important;border:0!important;opacity:0!important}.ReactTable .rt-expander{display:inline-block;position:relative;margin:0;color:transparent;margin:0 10px}.ReactTable .rt-expander:after{content:"";position:absolute;width:0;height:0;top:50%;left:50%;-webkit-transform:translate(-50%,-50%) rotate(-90deg);transform:translate(-50%,-50%) rotate(-90deg);border-left:5.04px solid transparent;border-right:5.04px solid transparent;border-top:7px solid rgba(0,0,0,.8);transition:all .3s cubic-bezier(.175,.885,.32,1.275);cursor:pointer}.ReactTable .rt-expander.-open:after{-webkit-transform:translate(-50%,-50%) rotate(0);transform:translate(-50%,-50%) rotate(0)}.ReactTable .rt-resizer{display:inline-block;position:absolute;width:36px;top:0;bottom:0;right:-18px;cursor:col-resize;z-index:10}.ReactTable .rt-tfoot{-webkit-box-flex:1;-ms-flex:1 0 auto;flex:1 0 auto;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;box-shadow:0 0 15px 0 rgba(0,0,0,.15)}.ReactTable .rt-tfoot .rt-td{border-right:1px solid rgba(0,0,0,.05)}.ReactTable .rt-tfoot .rt-td:last-child{border-right:0}.ReactTable.-striped .rt-tr.-odd{background:rgba(0,0,0,.03)}.ReactTable.-highlight .rt-tbody .rt-tr:not(.-padRow):hover{background:rgba(0,0,0,.05)}.ReactTable .-pagination{z-index:1;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch;-ms-flex-wrap:wrap;flex-wrap:wrap;padding:3px;box-shadow:0 0 15px 0 rgba(0,0,0,.1);border-top:2px solid rgba(0,0,0,.1)}.ReactTable .-pagination input,.ReactTable .-pagination select{border:1px solid rgba(0,0,0,.1);background:#fff;padding:5px 7px;font-size:inherit;border-radius:3px;font-weight:400;outline:none}.ReactTable .-pagination .-btn{-webkit-appearance:none;-moz-appearance:none;appearance:none;display:block;width:100%;height:100%;border:0;border-radius:3px;padding:6px;font-size:1em;color:rgba(0,0,0,.6);background:rgba(0,0,0,.1);transition:all .1s ease;cursor:pointer;outline:none}.ReactTable .-pagination .-btn[disabled]{opacity:.5;cursor:default}.ReactTable .-pagination .-btn:not([disabled]):hover{background:rgba(0,0,0,.3);color:#fff}.ReactTable .-pagination .-next,.ReactTable .-pagination .-previous{-webkit-box-flex:1;-ms-flex:1;flex:1;text-align:center}.ReactTable .-pagination .-center{-webkit-box-flex:1.5;-ms-flex:1.5;flex:1.5;text-align:center;margin-bottom:0;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-ms-flex-pack:distribute;justify-content:space-around}.ReactTable .-pagination .-pageInfo{display:inline-block;margin:3px 10px;white-space:nowrap}.ReactTable .-pagination .-pageJump{display:inline-block}.ReactTable .-pagination .-pageJump input{width:70px;text-align:center}.ReactTable .-pagination .-pageSizeOptions{margin:3px 10px}.ReactTable .rt-noData{left:50%;top:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);z-index:1;padding:20px;color:rgba(0,0,0,.5)}.ReactTable .-loading,.ReactTable .rt-noData{display:block;position:absolute;background:hsla(0,0%,100%,.8);transition:all .3s ease;pointer-events:none}.ReactTable .-loading{left:0;right:0;top:0;bottom:0;z-index:-1;opacity:0}.ReactTable .-loading>div{position:absolute;display:block;text-align:center;width:100%;top:50%;left:0;font-size:15px;color:rgba(0,0,0,.6);-webkit-transform:translateY(-52%);transform:translateY(-52%);transition:all .3s cubic-bezier(.25,.46,.45,.94)}.ReactTable .-loading.-active{opacity:1;z-index:2;pointer-events:all}.ReactTable .-loading.-active>div{-webkit-transform:translateY(50%);transform:translateY(50%)}.ReactTable .rt-resizing .rt-td,.ReactTable .rt-resizing .rt-th{transition:none!important;cursor:col-resize;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.wprm-admin-table-totals{font-style:italic}.ReactTable.wprm-admin-table{border-color:#23282d;border-radius:4px}.ReactTable.wprm-admin-table .pagination-bottom,.ReactTable.wprm-admin-table .rt-thead{background-color:#23282d;color:#fff;z-index:3}.ReactTable.wprm-admin-table .rt-thead.-header{box-shadow:none}.ReactTable.wprm-admin-table .rt-thead .rt-th{font-weight:500}.ReactTable.wprm-admin-table .rt-thead .rt-th.wprm-admin-table-help-text{font-weight:300;font-size:12px;text-align:left;display:flex;align-items:center}.ReactTable.wprm-admin-table .rt-thead .rt-td.-sort-asc,.ReactTable.wprm-admin-table .rt-thead .rt-th.-sort-asc{box-shadow:inset 0 4px 0 0 #0073aa;background-color:#32373c}.ReactTable.wprm-admin-table .rt-thead .rt-td.-sort-desc,.ReactTable.wprm-admin-table .rt-thead .rt-th.-sort-desc{box-shadow:inset 0 -4px 0 0 #0073aa;background-color:#32373c}.ReactTable.wprm-admin-table .wprm-admin-table-checkbox-container{font-size:0;display:flex;align-items:center;justify-content:center}.ReactTable.wprm-admin-table .wprm-admin-table-checkbox-container input[type=checkbox]{-webkit-appearance:checkbox;appearance:checkbox;margin-top:2px}.ReactTable.wprm-admin-table .wprm-admin-table-checkbox-container input[type=checkbox]:before{display:none}.ReactTable.wprm-admin-table .rt-td{display:flex;align-items:center;overflow-wrap:break-word;word-break:break-all;white-space:normal}.ReactTable.wprm-admin-table .pagination-bottom .-btn{color:#fff;background:hsla(0,0%,100%,.1)}.wprm-admin-manage-select-columns-container h4{margin:0 0 5px}.wprm-admin-manage-select-columns{margin:-3px}.wprm-admin-manage-select-columns .wprm-admin-manage-select-columns-column{display:inline-flex;align-items:center;margin:3px;padding:2px 4px;border-radius:4px;border:1px solid #23282d;opacity:.5;cursor:pointer}.wprm-admin-manage-select-columns .wprm-admin-manage-select-columns-column:hover{opacity:1}.wprm-admin-manage-select-columns .wprm-admin-manage-select-columns-column.wprm-admin-manage-select-columns-column-selected{opacity:1;background-color:#23282d;color:#fff}.wprm-admin-manage-select-columns .wprm-admin-manage-select-columns-column.wprm-admin-manage-select-columns-column-selected:hover{opacity:.8}.wprm-admin-manage-select-columns .wprm-admin-manage-select-columns-column.wprm-admin-manage-select-columns-column-filtered{background-color:#0073aa;border-color:#0073aa;cursor:not-allowed}#update-nag,.error,.is-dismissible,.update-nag,.updated{display:none}#wprm-admin-manage-header .wprm-admin-manage-menu{margin:-5px;margin-bottom:15px;border-bottom:none}#wprm-admin-manage-header .wprm-admin-manage-menu .nav-tab{box-sizing:border-box;height:36px;margin-left:5px;margin-top:5px;border-bottom:1px solid #ccc}#wprm-admin-manage-header .wprm-admin-manage-menu .nav-tab.nav-tab-active{margin-bottom:0}#wprm-admin-manage-content .wprm-admin-manage-header{display:flex;flex-wrap:wrap-reverse;justify-content:space-between;align-items:center;margin-bottom:15px}#wprm-admin-manage-content .wprm-admin-manage-header .wprm-admin-manage-header-buttons{display:flex;align-items:center;margin-bottom:10px}#wprm-admin-manage-content .wprm-admin-manage-header .wprm-admin-manage-header-buttons .button:not(.button-primary){margin-right:10px}#wprm-admin-manage-content .wprm-admin-manage-page .wprm-admin-manage-table-container .wprm-admin-manage-table{height:calc(100vh - 50px)}#wprm-admin-manage-content .wprm-admin-manage-page .wprm-admin-manage-table-container .wprm-admin-manage-table .wprm-admin-manage-actions{width:100%;display:flex;justify-content:space-evenly;align-items:center}#wprm-admin-manage-content .wprm-admin-manage-page .wprm-admin-manage-table-container .wprm-admin-manage-table .wprm-admin-manage-text-filter{width:100%}@media screen and (min-width:782px){#wprm-admin-manage-content .wprm-admin-manage-header{flex-wrap:nowrap}#wprm-admin-manage-content .wprm-admin-manage-header .wprm-admin-manage-header-buttons{margin-bottom:0}}@media screen and (min-height:768px){#wprm-admin-manage{height:calc(100vh - 65px);display:flex;flex-direction:column}#wprm-admin-manage #wprm-admin-manage-content{flex:1}#wprm-admin-manage #wprm-admin-manage-content .wprm-admin-manage-page{height:100%;display:flex;flex-direction:column}#wprm-admin-manage #wprm-admin-manage-content .wprm-admin-manage-page .wprm-admin-manage-table-container{flex:1;display:flex;flex-direction:column}#wprm-admin-manage #wprm-admin-manage-content .wprm-admin-manage-page .wprm-admin-manage-table-container .wprm-admin-manage-table-inner{flex:1;position:relative}#wprm-admin-manage #wprm-admin-manage-content .wprm-admin-manage-page .wprm-admin-manage-table-container .wprm-admin-manage-table-inner .wprm-admin-manage-table{position:absolute;top:0;bottom:0;left:0;right:0;height:100%}}
|
dist/admin-manage.js
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
-
var WPRecipeMaker=WPRecipeMaker||{};WPRecipeMaker["admin-manage"]=function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=909)}([function(e,t,n){var r=n(2),o=n(22),i=n(13),a=n(14),u=n(19),l=function(e,t,n){var c,s,f,p,d=e&l.F,h=e&l.G,v=e&l.S,m=e&l.P,g=e&l.B,y=h?r:v?r[t]||(r[t]={}):(r[t]||{}).prototype,b=h?o:o[t]||(o[t]={}),w=b.prototype||(b.prototype={});h&&(n=t);for(c in n)f=((s=!d&&y&&void 0!==y[c])?y:n)[c],p=g&&s?u(f,r):m&&"function"==typeof f?u(Function.call,f):f,y&&a(y,c,f,e&l.U),b[c]!=f&&i(b,c,p),m&&w[c]!=f&&(w[c]=f)};r.core=o,l.F=1,l.G=2,l.S=4,l.P=8,l.B=16,l.W=32,l.U=64,l.R=128,e.exports=l},function(e,t,n){var r=n(4);e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t,n){"use strict";e.exports=n(415)},function(e,t,n){var r=n(54)("wks"),o=n(34),i=n(2).Symbol,a="function"==typeof i;(e.exports=function(e){return r[e]||(r[e]=a&&i[e]||(a?i:o)("Symbol."+e))}).store=r},function(e,t,n){e.exports=!n(3)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(e,t,n){var r=n(1),o=n(98),i=n(23),a=Object.defineProperty;t.f=n(7)?Object.defineProperty:function(e,t,n){if(r(e),t=i(t,!0),r(n),o)try{return a(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},function(e,t,n){var r=n(25),o=Math.min;e.exports=function(e){return e>0?o(r(e),9007199254740991):0}},function(e,t,n){var r=n(24);e.exports=function(e){return Object(r(e))}},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t,n){var r=n(8),o=n(33);e.exports=n(7)?function(e,t,n){return r.f(e,t,o(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t,n){var r=n(2),o=n(13),i=n(12),a=n(34)("src"),u=Function.toString,l=(""+u).split("toString");n(22).inspectSource=function(e){return u.call(e)},(e.exports=function(e,t,n,u){var c="function"==typeof n;c&&(i(n,"name")||o(n,"name",t)),e[t]!==n&&(c&&(i(n,a)||o(n,a,e[t]?""+e[t]:l.join(String(t)))),e===r?e[t]=n:u?e[t]?e[t]=n:o(e,t,n):(delete e[t],o(e,t,n)))})(Function.prototype,"toString",function(){return"function"==typeof this&&this[a]||u.call(this)})},function(e,t,n){var r=n(0),o=n(3),i=n(24),a=/"/g,u=function(e,t,n,r){var o=String(i(e)),u="<"+t;return""!==n&&(u+=" "+n+'="'+String(r).replace(a,""")+'"'),u+">"+o+"</"+t+">"};e.exports=function(e,t){var n={};n[e]=t(u),r(r.P+r.F*o(function(){var t=""[e]('"');return t!==t.toLowerCase()||t.split('"').length>3}),"String",n)}},function(e,t,n){var r=n(49),o=n(24);e.exports=function(e){return r(o(e))}},function(e,t,n){var r=n(50),o=n(33),i=n(16),a=n(23),u=n(12),l=n(98),c=Object.getOwnPropertyDescriptor;t.f=n(7)?c:function(e,t){if(e=i(e),t=a(t,!0),l)try{return c(e,t)}catch(e){}if(u(e,t))return o(!r.f.call(e,t),e[t])}},function(e,t,n){var r=n(12),o=n(10),i=n(71)("IE_PROTO"),a=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=o(e),r(e,i)?e[i]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?a:null}},function(e,t,n){var r=n(11);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,o){return e.call(t,n,r,o)}}return function(){return e.apply(t,arguments)}}},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t,n){"use strict";var r=n(3);e.exports=function(e,t){return!!e&&r(function(){t?e.call(null,function(){},1):e.call(null)})}},function(e,t){var n=e.exports={version:"2.5.3"};"number"==typeof __e&&(__e=n)},function(e,t,n){var r=n(4);e.exports=function(e,t){if(!r(e))return e;var n,o;if(t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;if("function"==typeof(n=e.valueOf)&&!r(o=n.call(e)))return o;if(!t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;throw TypeError("Can't convert object to primitive value")}},function(e,t){e.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}},function(e,t){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}},function(e,t,n){var r=n(0),o=n(22),i=n(3);e.exports=function(e,t){var n=(o.Object||{})[e]||Object[e],a={};a[e]=t(n),r(r.S+r.F*i(function(){n(1)}),"Object",a)}},function(e,t,n){var r=n(19),o=n(49),i=n(10),a=n(9),u=n(88);e.exports=function(e,t){var n=1==e,l=2==e,c=3==e,s=4==e,f=6==e,p=5==e||f,d=t||u;return function(t,u,h){for(var v,m,g=i(t),y=o(g),b=r(u,h,3),w=a(y.length),x=0,S=n?d(t,w):l?d(t,0):void 0;w>x;x++)if((p||x in y)&&(m=b(v=y[x],x,g),e))if(n)S[x]=m;else if(m)switch(e){case 3:return!0;case 5:return v;case 6:return x;case 2:S.push(v)}else if(s)return!1;return f?-1:c||s?s:S}}},,function(e,t,n){"use strict";if(n(7)){var r=n(35),o=n(2),i=n(3),a=n(0),u=n(64),l=n(94),c=n(19),s=n(41),f=n(33),p=n(13),d=n(43),h=n(25),v=n(9),m=n(124),g=n(37),y=n(23),b=n(12),w=n(51),x=n(4),S=n(10),E=n(85),P=n(38),_=n(18),C=n(39).f,T=n(87),k=n(34),N=n(6),O=n(27),M=n(55),I=n(62),R=n(90),F=n(46),j=n(59),D=n(40),L=n(89),A=n(114),z=n(8),U=n(17),W=z.f,B=U.f,V=o.RangeError,H=o.TypeError,G=o.Uint8Array,K=Array.prototype,q=l.ArrayBuffer,Z=l.DataView,J=O(0),X=O(2),$=O(3),Q=O(4),Y=O(5),ee=O(6),te=M(!0),ne=M(!1),re=R.values,oe=R.keys,ie=R.entries,ae=K.lastIndexOf,ue=K.reduce,le=K.reduceRight,ce=K.join,se=K.sort,fe=K.slice,pe=K.toString,de=K.toLocaleString,he=N("iterator"),ve=N("toStringTag"),me=k("typed_constructor"),ge=k("def_constructor"),ye=u.CONSTR,be=u.TYPED,we=u.VIEW,xe=O(1,function(e,t){return Ce(I(e,e[ge]),t)}),Se=i(function(){return 1===new G(new Uint16Array([1]).buffer)[0]}),Ee=!!G&&!!G.prototype.set&&i(function(){new G(1).set({})}),Pe=function(e,t){var n=h(e);if(n<0||n%t)throw V("Wrong offset!");return n},_e=function(e){if(x(e)&&be in e)return e;throw H(e+" is not a typed array!")},Ce=function(e,t){if(!(x(e)&&me in e))throw H("It is not a typed array constructor!");return new e(t)},Te=function(e,t){return ke(I(e,e[ge]),t)},ke=function(e,t){for(var n=0,r=t.length,o=Ce(e,r);r>n;)o[n]=t[n++];return o},Ne=function(e,t,n){W(e,t,{get:function(){return this._d[n]}})},Oe=function(e){var t,n,r,o,i,a,u=S(e),l=arguments.length,s=l>1?arguments[1]:void 0,f=void 0!==s,p=T(u);if(void 0!=p&&!E(p)){for(a=p.call(u),r=[],t=0;!(i=a.next()).done;t++)r.push(i.value);u=r}for(f&&l>2&&(s=c(s,arguments[2],2)),t=0,n=v(u.length),o=Ce(this,n);n>t;t++)o[t]=f?s(u[t],t):u[t];return o},Me=function(){for(var e=0,t=arguments.length,n=Ce(this,t);t>e;)n[e]=arguments[e++];return n},Ie=!!G&&i(function(){de.call(new G(1))}),Re=function(){return de.apply(Ie?fe.call(_e(this)):_e(this),arguments)},Fe={copyWithin:function(e,t){return A.call(_e(this),e,t,arguments.length>2?arguments[2]:void 0)},every:function(e){return Q(_e(this),e,arguments.length>1?arguments[1]:void 0)},fill:function(e){return L.apply(_e(this),arguments)},filter:function(e){return Te(this,X(_e(this),e,arguments.length>1?arguments[1]:void 0))},find:function(e){return Y(_e(this),e,arguments.length>1?arguments[1]:void 0)},findIndex:function(e){return ee(_e(this),e,arguments.length>1?arguments[1]:void 0)},forEach:function(e){J(_e(this),e,arguments.length>1?arguments[1]:void 0)},indexOf:function(e){return ne(_e(this),e,arguments.length>1?arguments[1]:void 0)},includes:function(e){return te(_e(this),e,arguments.length>1?arguments[1]:void 0)},join:function(e){return ce.apply(_e(this),arguments)},lastIndexOf:function(e){return ae.apply(_e(this),arguments)},map:function(e){return xe(_e(this),e,arguments.length>1?arguments[1]:void 0)},reduce:function(e){return ue.apply(_e(this),arguments)},reduceRight:function(e){return le.apply(_e(this),arguments)},reverse:function(){for(var e,t=_e(this).length,n=Math.floor(t/2),r=0;r<n;)e=this[r],this[r++]=this[--t],this[t]=e;return this},some:function(e){return $(_e(this),e,arguments.length>1?arguments[1]:void 0)},sort:function(e){return se.call(_e(this),e)},subarray:function(e,t){var n=_e(this),r=n.length,o=g(e,r);return new(I(n,n[ge]))(n.buffer,n.byteOffset+o*n.BYTES_PER_ELEMENT,v((void 0===t?r:g(t,r))-o))}},je=function(e,t){return Te(this,fe.call(_e(this),e,t))},De=function(e){_e(this);var t=Pe(arguments[1],1),n=this.length,r=S(e),o=v(r.length),i=0;if(o+t>n)throw V("Wrong length!");for(;i<o;)this[t+i]=r[i++]},Le={entries:function(){return ie.call(_e(this))},keys:function(){return oe.call(_e(this))},values:function(){return re.call(_e(this))}},Ae=function(e,t){return x(e)&&e[be]&&"symbol"!=typeof t&&t in e&&String(+t)==String(t)},ze=function(e,t){return Ae(e,t=y(t,!0))?f(2,e[t]):B(e,t)},Ue=function(e,t,n){return!(Ae(e,t=y(t,!0))&&x(n)&&b(n,"value"))||b(n,"get")||b(n,"set")||n.configurable||b(n,"writable")&&!n.writable||b(n,"enumerable")&&!n.enumerable?W(e,t,n):(e[t]=n.value,e)};ye||(U.f=ze,z.f=Ue),a(a.S+a.F*!ye,"Object",{getOwnPropertyDescriptor:ze,defineProperty:Ue}),i(function(){pe.call({})})&&(pe=de=function(){return ce.call(this)});var We=d({},Fe);d(We,Le),p(We,he,Le.values),d(We,{slice:je,set:De,constructor:function(){},toString:pe,toLocaleString:Re}),Ne(We,"buffer","b"),Ne(We,"byteOffset","o"),Ne(We,"byteLength","l"),Ne(We,"length","e"),W(We,ve,{get:function(){return this[be]}}),e.exports=function(e,t,n,l){var c=e+((l=!!l)?"Clamped":"")+"Array",f="get"+e,d="set"+e,h=o[c],g=h||{},y=h&&_(h),b=!h||!u.ABV,S={},E=h&&h.prototype,T=function(e,n){W(e,n,{get:function(){return function(e,n){var r=e._d;return r.v[f](n*t+r.o,Se)}(this,n)},set:function(e){return function(e,n,r){var o=e._d;l&&(r=(r=Math.round(r))<0?0:r>255?255:255&r),o.v[d](n*t+o.o,r,Se)}(this,n,e)},enumerable:!0})};b?(h=n(function(e,n,r,o){s(e,h,c,"_d");var i,a,u,l,f=0,d=0;if(x(n)){if(!(n instanceof q||"ArrayBuffer"==(l=w(n))||"SharedArrayBuffer"==l))return be in n?ke(h,n):Oe.call(h,n);i=n,d=Pe(r,t);var g=n.byteLength;if(void 0===o){if(g%t)throw V("Wrong length!");if((a=g-d)<0)throw V("Wrong length!")}else if((a=v(o)*t)+d>g)throw V("Wrong length!");u=a/t}else u=m(n),i=new q(a=u*t);for(p(e,"_d",{b:i,o:d,l:a,e:u,v:new Z(i)});f<u;)T(e,f++)}),E=h.prototype=P(We),p(E,"constructor",h)):i(function(){h(1)})&&i(function(){new h(-1)})&&j(function(e){new h,new h(null),new h(1.5),new h(e)},!0)||(h=n(function(e,n,r,o){var i;return s(e,h,c),x(n)?n instanceof q||"ArrayBuffer"==(i=w(n))||"SharedArrayBuffer"==i?void 0!==o?new g(n,Pe(r,t),o):void 0!==r?new g(n,Pe(r,t)):new g(n):be in n?ke(h,n):Oe.call(h,n):new g(m(n))}),J(y!==Function.prototype?C(g).concat(C(y)):C(g),function(e){e in h||p(h,e,g[e])}),h.prototype=E,r||(E.constructor=h));var k=E[he],N=!!k&&("values"==k.name||void 0==k.name),O=Le.values;p(h,me,!0),p(E,be,c),p(E,we,!0),p(E,ge,h),(l?new h(1)[ve]==c:ve in E)||W(E,ve,{get:function(){return c}}),S[c]=h,a(a.G+a.W+a.F*(h!=g),S),a(a.S,c,{BYTES_PER_ELEMENT:t}),a(a.S+a.F*i(function(){g.of.call(h,1)}),c,{from:Oe,of:Me}),"BYTES_PER_ELEMENT"in E||p(E,"BYTES_PER_ELEMENT",t),a(a.P,c,Fe),D(c),a(a.P+a.F*Ee,c,{set:De}),a(a.P+a.F*!N,c,Le),r||E.toString==pe||(E.toString=pe),a(a.P+a.F*i(function(){new h(1).slice()}),c,{slice:je}),a(a.P+a.F*(i(function(){return[1,2].toLocaleString()!=new h([1,2]).toLocaleString()})||!i(function(){E.toLocaleString.call([1,2])})),c,{toLocaleString:Re}),F[c]=N?k:O,r||N||p(E,he,O)}}else e.exports=function(){}},function(e,t,n){var r=n(119),o=n(0),i=n(54)("metadata"),a=i.store||(i.store=new(n(122))),u=function(e,t,n){var o=a.get(e);if(!o){if(!n)return;a.set(e,o=new r)}var i=o.get(t);if(!i){if(!n)return;o.set(t,i=new r)}return i};e.exports={store:a,map:u,has:function(e,t,n){var r=u(t,n,!1);return void 0!==r&&r.has(e)},get:function(e,t,n){var r=u(t,n,!1);return void 0===r?void 0:r.get(e)},set:function(e,t,n,r){u(n,r,!0).set(e,t)},keys:function(e,t){var n=u(e,t,!1),r=[];return n&&n.forEach(function(e,t){r.push(t)}),r},key:function(e){return void 0===e||"symbol"==typeof e?e:String(e)},exp:function(e){o(o.S,"Reflect",e)}}},function(e,t,n){var r=n(34)("meta"),o=n(4),i=n(12),a=n(8).f,u=0,l=Object.isExtensible||function(){return!0},c=!n(3)(function(){return l(Object.preventExtensions({}))}),s=function(e){a(e,r,{value:{i:"O"+ ++u,w:{}}})},f=e.exports={KEY:r,NEED:!1,fastKey:function(e,t){if(!o(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!i(e,r)){if(!l(e))return"F";if(!t)return"E";s(e)}return e[r].i},getWeak:function(e,t){if(!i(e,r)){if(!l(e))return!0;if(!t)return!1;s(e)}return e[r].w},onFreeze:function(e){return c&&f.NEED&&l(e)&&!i(e,r)&&s(e),e}}},function(e,t,n){var r=n(6)("unscopables"),o=Array.prototype;void 0==o[r]&&n(13)(o,r,{}),e.exports=function(e){o[r][e]=!0}},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t){var n=0,r=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++n+r).toString(36))}},function(e,t){e.exports=!1},function(e,t,n){var r=n(100),o=n(72);e.exports=Object.keys||function(e){return r(e,o)}},function(e,t,n){var r=n(25),o=Math.max,i=Math.min;e.exports=function(e,t){return(e=r(e))<0?o(e+t,0):i(e,t)}},function(e,t,n){var r=n(1),o=n(101),i=n(72),a=n(71)("IE_PROTO"),u=function(){},l=function(){var e,t=n(69)("iframe"),r=i.length;for(t.style.display="none",n(73).appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("<script>document.F=Object<\/script>"),e.close(),l=e.F;r--;)delete l.prototype[i[r]];return l()};e.exports=Object.create||function(e,t){var n;return null!==e?(u.prototype=r(e),n=new u,u.prototype=null,n[a]=e):n=l(),void 0===t?n:o(n,t)}},function(e,t,n){var r=n(100),o=n(72).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return r(e,o)}},function(e,t,n){"use strict";var r=n(2),o=n(8),i=n(7),a=n(6)("species");e.exports=function(e){var t=r[e];i&&t&&!t[a]&&o.f(t,a,{configurable:!0,get:function(){return this}})}},function(e,t){e.exports=function(e,t,n,r){if(!(e instanceof t)||void 0!==r&&r in e)throw TypeError(n+": incorrect invocation!");return e}},function(e,t,n){var r=n(19),o=n(112),i=n(85),a=n(1),u=n(9),l=n(87),c={},s={};(t=e.exports=function(e,t,n,f,p){var d,h,v,m,g=p?function(){return e}:l(e),y=r(n,f,t?2:1),b=0;if("function"!=typeof g)throw TypeError(e+" is not iterable!");if(i(g)){for(d=u(e.length);d>b;b++)if((m=t?y(a(h=e[b])[0],h[1]):y(e[b]))===c||m===s)return m}else for(v=g.call(e);!(h=v.next()).done;)if((m=o(v,y,h.value,t))===c||m===s)return m}).BREAK=c,t.RETURN=s},function(e,t,n){var r=n(14);e.exports=function(e,t,n){for(var o in t)r(e,o,t[o],n);return e}},function(e,t,n){var r=n(8).f,o=n(12),i=n(6)("toStringTag");e.exports=function(e,t,n){e&&!o(e=n?e:e.prototype,i)&&r(e,i,{configurable:!0,value:t})}},function(e,t,n){var r=n(0),o=n(24),i=n(3),a=n(75),u="["+a+"]",l=RegExp("^"+u+u+"*"),c=RegExp(u+u+"*$"),s=function(e,t,n){var o={},u=i(function(){return!!a[e]()||"
"!="
"[e]()}),l=o[e]=u?t(f):a[e];n&&(o[n]=l),r(r.P+r.F*u,"String",o)},f=s.trim=function(e,t){return e=String(o(e)),1&t&&(e=e.replace(l,"")),2&t&&(e=e.replace(c,"")),e};e.exports=s},function(e,t){e.exports={}},function(e,t,n){var r=n(4);e.exports=function(e,t){if(!r(e)||e._t!==t)throw TypeError("Incompatible receiver, "+t+" required!");return e}},,function(e,t,n){var r=n(20);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==r(e)?e.split(""):Object(e)}},function(e,t){t.f={}.propertyIsEnumerable},function(e,t,n){var r=n(20),o=n(6)("toStringTag"),i="Arguments"==r(function(){return arguments}());e.exports=function(e){var t,n,a;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),o))?n:i?r(t):"Object"==(a=r(t))&&"function"==typeof t.callee?"Arguments":a}},function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){e.exports=n(422)()},function(e,t,n){var r=n(2),o=r["__core-js_shared__"]||(r["__core-js_shared__"]={});e.exports=function(e){return o[e]||(o[e]={})}},function(e,t,n){var r=n(16),o=n(9),i=n(37);e.exports=function(e){return function(t,n,a){var u,l=r(t),c=o(l.length),s=i(a,c);if(e&&n!=n){for(;c>s;)if((u=l[s++])!=u)return!0}else for(;c>s;s++)if((e||s in l)&&l[s]===n)return e||s||0;return!e&&-1}}},function(e,t){t.f=Object.getOwnPropertySymbols},function(e,t,n){var r=n(20);e.exports=Array.isArray||function(e){return"Array"==r(e)}},function(e,t,n){var r=n(4),o=n(20),i=n(6)("match");e.exports=function(e){var t;return r(e)&&(void 0!==(t=e[i])?!!t:"RegExp"==o(e))}},function(e,t,n){var r=n(6)("iterator"),o=!1;try{var i=[7][r]();i.return=function(){o=!0},Array.from(i,function(){throw 2})}catch(e){}e.exports=function(e,t){if(!t&&!o)return!1;var n=!1;try{var i=[7],a=i[r]();a.next=function(){return{done:n=!0}},i[r]=function(){return a},e(i)}catch(e){}return n}},function(e,t,n){"use strict";var r=n(1);e.exports=function(){var e=r(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t}},function(e,t,n){"use strict";var r=n(13),o=n(14),i=n(3),a=n(24),u=n(6);e.exports=function(e,t,n){var l=u(e),c=n(a,l,""[e]),s=c[0],f=c[1];i(function(){var t={};return t[l]=function(){return 7},7!=""[e](t)})&&(o(String.prototype,e,s),r(RegExp.prototype,l,2==t?function(e,t){return f.call(e,this,t)}:function(e){return f.call(e,this)}))}},function(e,t,n){var r=n(1),o=n(11),i=n(6)("species");e.exports=function(e,t){var n,a=r(e).constructor;return void 0===a||void 0==(n=r(a)[i])?t:o(n)}},function(e,t,n){"use strict";var r=n(2),o=n(0),i=n(14),a=n(43),u=n(31),l=n(42),c=n(41),s=n(4),f=n(3),p=n(59),d=n(44),h=n(76);e.exports=function(e,t,n,v,m,g){var y=r[e],b=y,w=m?"set":"add",x=b&&b.prototype,S={},E=function(e){var t=x[e];i(x,e,"delete"==e?function(e){return!(g&&!s(e))&&t.call(this,0===e?0:e)}:"has"==e?function(e){return!(g&&!s(e))&&t.call(this,0===e?0:e)}:"get"==e?function(e){return g&&!s(e)?void 0:t.call(this,0===e?0:e)}:"add"==e?function(e){return t.call(this,0===e?0:e),this}:function(e,n){return t.call(this,0===e?0:e,n),this})};if("function"==typeof b&&(g||x.forEach&&!f(function(){(new b).entries().next()}))){var P=new b,_=P[w](g?{}:-0,1)!=P,C=f(function(){P.has(1)}),T=p(function(e){new b(e)}),k=!g&&f(function(){for(var e=new b,t=5;t--;)e[w](t,t);return!e.has(-0)});T||((b=t(function(t,n){c(t,b,e);var r=h(new y,t,b);return void 0!=n&&l(n,m,r[w],r),r})).prototype=x,x.constructor=b),(C||k)&&(E("delete"),E("has"),m&&E("get")),(k||_)&&E(w),g&&x.clear&&delete x.clear}else b=v.getConstructor(t,e,m,w),a(b.prototype,n),u.NEED=!0;return d(b,e),S[e]=b,o(o.G+o.W+o.F*(b!=y),S),g||v.setStrong(b,e,m),b}},function(e,t,n){for(var r,o=n(2),i=n(13),a=n(34),u=a("typed_array"),l=a("view"),c=!(!o.ArrayBuffer||!o.DataView),s=c,f=0,p="Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array".split(",");f<9;)(r=o[p[f++]])?(i(r.prototype,u,!0),i(r.prototype,l,!0)):s=!1;e.exports={ABV:c,CONSTR:s,TYPED:u,VIEW:l}},function(e,t,n){"use strict";e.exports=n(35)||!n(3)(function(){var e=Math.random();__defineSetter__.call(null,e,function(){}),delete n(2)[e]})},function(e,t,n){"use strict";var r=n(0);e.exports=function(e){r(r.S,e,{of:function(){for(var e=arguments.length,t=new Array(e);e--;)t[e]=arguments[e];return new this(t)}})}},function(e,t,n){"use strict";var r=n(0),o=n(11),i=n(19),a=n(42);e.exports=function(e){r(r.S,e,{from:function(e){var t,n,r,u,l=arguments[1];return o(this),(t=void 0!==l)&&o(l),void 0==e?new this:(n=[],t?(r=0,u=i(l,arguments[2],2),a(e,!1,function(e){n.push(u(e,r++))})):a(e,!1,n.push,n),new this(n))}})}},,function(e,t,n){var r=n(4),o=n(2).document,i=r(o)&&r(o.createElement);e.exports=function(e){return i?o.createElement(e):{}}},function(e,t,n){var r=n(2),o=n(22),i=n(35),a=n(99),u=n(8).f;e.exports=function(e){var t=o.Symbol||(o.Symbol=i?{}:r.Symbol||{});"_"==e.charAt(0)||e in t||u(t,e,{value:a.f(e)})}},function(e,t,n){var r=n(54)("keys"),o=n(34);e.exports=function(e){return r[e]||(r[e]=o(e))}},function(e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(e,t,n){var r=n(2).document;e.exports=r&&r.documentElement},function(e,t,n){var r=n(4),o=n(1),i=function(e,t){if(o(e),!r(t)&&null!==t)throw TypeError(t+": can't set as prototype!")};e.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(e,t,r){try{(r=n(19)(Function.call,n(17).f(Object.prototype,"__proto__").set,2))(e,[]),t=!(e instanceof Array)}catch(e){t=!0}return function(e,n){return i(e,n),t?e.__proto__=n:r(e,n),e}}({},!1):void 0),check:i}},function(e,t){e.exports="\t\n\v\f\r \u2028\u2029\ufeff"},function(e,t,n){var r=n(4),o=n(74).set;e.exports=function(e,t,n){var i,a=t.constructor;return a!==n&&"function"==typeof a&&(i=a.prototype)!==n.prototype&&r(i)&&o&&o(e,i),e}},function(e,t,n){"use strict";var r=n(25),o=n(24);e.exports=function(e){var t=String(o(this)),n="",i=r(e);if(i<0||i==1/0)throw RangeError("Count can't be negative");for(;i>0;(i>>>=1)&&(t+=t))1&i&&(n+=t);return n}},function(e,t){e.exports=Math.sign||function(e){return 0==(e=+e)||e!=e?e:e<0?-1:1}},function(e,t){var n=Math.expm1;e.exports=!n||n(10)>22025.465794806718||n(10)<22025.465794806718||-2e-17!=n(-2e-17)?function(e){return 0==(e=+e)?e:e>-1e-6&&e<1e-6?e+e*e/2:Math.exp(e)-1}:n},function(e,t,n){var r=n(25),o=n(24);e.exports=function(e){return function(t,n){var i,a,u=String(o(t)),l=r(n),c=u.length;return l<0||l>=c?e?"":void 0:(i=u.charCodeAt(l))<55296||i>56319||l+1===c||(a=u.charCodeAt(l+1))<56320||a>57343?e?u.charAt(l):i:e?u.slice(l,l+2):a-56320+(i-55296<<10)+65536}}},function(e,t,n){"use strict";var r=n(35),o=n(0),i=n(14),a=n(13),u=n(12),l=n(46),c=n(82),s=n(44),f=n(18),p=n(6)("iterator"),d=!([].keys&&"next"in[].keys()),h=function(){return this};e.exports=function(e,t,n,v,m,g,y){c(n,t,v);var b,w,x,S=function(e){if(!d&&e in C)return C[e];switch(e){case"keys":case"values":return function(){return new n(this,e)}}return function(){return new n(this,e)}},E=t+" Iterator",P="values"==m,_=!1,C=e.prototype,T=C[p]||C["@@iterator"]||m&&C[m],k=!d&&T||S(m),N=m?P?S("entries"):k:void 0,O="Array"==t?C.entries||T:T;if(O&&(x=f(O.call(new e)))!==Object.prototype&&x.next&&(s(x,E,!0),r||u(x,p)||a(x,p,h)),P&&T&&"values"!==T.name&&(_=!0,k=function(){return T.call(this)}),r&&!y||!d&&!_&&C[p]||a(C,p,k),l[t]=k,l[E]=h,m)if(b={values:P?k:S("values"),keys:g?k:S("keys"),entries:N},y)for(w in b)w in C||i(C,w,b[w]);else o(o.P+o.F*(d||_),t,b);return b}},function(e,t,n){"use strict";var r=n(38),o=n(33),i=n(44),a={};n(13)(a,n(6)("iterator"),function(){return this}),e.exports=function(e,t,n){e.prototype=r(a,{next:o(1,n)}),i(e,t+" Iterator")}},function(e,t,n){var r=n(58),o=n(24);e.exports=function(e,t,n){if(r(t))throw TypeError("String#"+n+" doesn't accept regex!");return String(o(e))}},function(e,t,n){var r=n(6)("match");e.exports=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[r]=!1,!"/./"[e](t)}catch(e){}}return!0}},function(e,t,n){var r=n(46),o=n(6)("iterator"),i=Array.prototype;e.exports=function(e){return void 0!==e&&(r.Array===e||i[o]===e)}},function(e,t,n){"use strict";var r=n(8),o=n(33);e.exports=function(e,t,n){t in e?r.f(e,t,o(0,n)):e[t]=n}},function(e,t,n){var r=n(51),o=n(6)("iterator"),i=n(46);e.exports=n(22).getIteratorMethod=function(e){if(void 0!=e)return e[o]||e["@@iterator"]||i[r(e)]}},function(e,t,n){var r=n(234);e.exports=function(e,t){return new(r(e))(t)}},function(e,t,n){"use strict";var r=n(10),o=n(37),i=n(9);e.exports=function(e){for(var t=r(this),n=i(t.length),a=arguments.length,u=o(a>1?arguments[1]:void 0,n),l=a>2?arguments[2]:void 0,c=void 0===l?n:o(l,n);c>u;)t[u++]=e;return t}},function(e,t,n){"use strict";var r=n(32),o=n(115),i=n(46),a=n(16);e.exports=n(81)(Array,"Array",function(e,t){this._t=a(e),this._i=0,this._k=t},function(){var e=this._t,t=this._k,n=this._i++;return!e||n>=e.length?(this._t=void 0,o(1)):"keys"==t?o(0,n):"values"==t?o(0,e[n]):o(0,[n,e[n]])},"values"),i.Arguments=i.Array,r("keys"),r("values"),r("entries")},function(e,t,n){var r,o,i,a=n(19),u=n(105),l=n(73),c=n(69),s=n(2),f=s.process,p=s.setImmediate,d=s.clearImmediate,h=s.MessageChannel,v=s.Dispatch,m=0,g={},y=function(){var e=+this;if(g.hasOwnProperty(e)){var t=g[e];delete g[e],t()}},b=function(e){y.call(e.data)};p&&d||(p=function(e){for(var t=[],n=1;arguments.length>n;)t.push(arguments[n++]);return g[++m]=function(){u("function"==typeof e?e:Function(e),t)},r(m),m},d=function(e){delete g[e]},"process"==n(20)(f)?r=function(e){f.nextTick(a(y,e,1))}:v&&v.now?r=function(e){v.now(a(y,e,1))}:h?(i=(o=new h).port2,o.port1.onmessage=b,r=a(i.postMessage,i,1)):s.addEventListener&&"function"==typeof postMessage&&!s.importScripts?(r=function(e){s.postMessage(e+"","*")},s.addEventListener("message",b,!1)):r="onreadystatechange"in c("script")?function(e){l.appendChild(c("script")).onreadystatechange=function(){l.removeChild(this),y.call(e)}}:function(e){setTimeout(a(y,e,1),0)}),e.exports={set:p,clear:d}},function(e,t,n){var r=n(2),o=n(91).set,i=r.MutationObserver||r.WebKitMutationObserver,a=r.process,u=r.Promise,l="process"==n(20)(a);e.exports=function(){var e,t,n,c=function(){var r,o;for(l&&(r=a.domain)&&r.exit();e;){o=e.fn,e=e.next;try{o()}catch(r){throw e?n():t=void 0,r}}t=void 0,r&&r.enter()};if(l)n=function(){a.nextTick(c)};else if(!i||r.navigator&&r.navigator.standalone)if(u&&u.resolve){var s=u.resolve();n=function(){s.then(c)}}else n=function(){o.call(r,c)};else{var f=!0,p=document.createTextNode("");new i(c).observe(p,{characterData:!0}),n=function(){p.data=f=!f}}return function(r){var o={fn:r,next:void 0};t&&(t.next=o),e||(e=o,n()),t=o}}},function(e,t,n){"use strict";var r=n(11);e.exports.f=function(e){return new function(e){var t,n;this.promise=new e(function(e,r){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=r}),this.resolve=r(t),this.reject=r(n)}(e)}},function(e,t,n){"use strict";function r(e,t,n){var r,o,i,a=new Array(n),u=8*n-t-1,l=(1<<u)-1,c=l>>1,s=23===t?A(2,-24)-A(2,-77):0,f=0,p=e<0||0===e&&1/e<0?1:0;for((e=L(e))!=e||e===j?(o=e!=e?1:0,r=l):(r=z(U(e)/W),e*(i=A(2,-r))<1&&(r--,i*=2),e+=r+c>=1?s/i:s*A(2,1-c),e*i>=2&&(r++,i/=2),r+c>=l?(o=0,r=l):r+c>=1?(o=(e*i-1)*A(2,t),r+=c):(o=e*A(2,c-1)*A(2,t),r=0));t>=8;a[f++]=255&o,o/=256,t-=8);for(r=r<<t|o,u+=t;u>0;a[f++]=255&r,r/=256,u-=8);return a[--f]|=128*p,a}function o(e,t,n){var r,o=8*n-t-1,i=(1<<o)-1,a=i>>1,u=o-7,l=n-1,c=e[l--],s=127&c;for(c>>=7;u>0;s=256*s+e[l],l--,u-=8);for(r=s&(1<<-u)-1,s>>=-u,u+=t;u>0;r=256*r+e[l],l--,u-=8);if(0===s)s=1-a;else{if(s===i)return r?NaN:c?-j:j;r+=A(2,t),s-=a}return(c?-1:1)*r*A(2,s-t)}function i(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]}function a(e){return[255&e]}function u(e){return[255&e,e>>8&255]}function l(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]}function c(e){return r(e,52,8)}function s(e){return r(e,23,4)}function f(e,t,n){C(e[N],t,{get:function(){return this[n]}})}function p(e,t,n,r){var o=P(+n);if(o+t>e[V])throw F(O);var i=e[B]._b,a=o+e[H],u=i.slice(a,a+t);return r?u:u.reverse()}function d(e,t,n,r,o,i){var a=P(+n);if(a+t>e[V])throw F(O);for(var u=e[B]._b,l=a+e[H],c=r(+o),s=0;s<t;s++)u[l+s]=c[i?s:t-s-1]}var h=n(2),v=n(7),m=n(35),g=n(64),y=n(13),b=n(43),w=n(3),x=n(41),S=n(25),E=n(9),P=n(124),_=n(39).f,C=n(8).f,T=n(89),k=n(44),N="prototype",O="Wrong index!",M=h.ArrayBuffer,I=h.DataView,R=h.Math,F=h.RangeError,j=h.Infinity,D=M,L=R.abs,A=R.pow,z=R.floor,U=R.log,W=R.LN2,B=v?"_b":"buffer",V=v?"_l":"byteLength",H=v?"_o":"byteOffset";if(g.ABV){if(!w(function(){M(1)})||!w(function(){new M(-1)})||w(function(){return new M,new M(1.5),new M(NaN),"ArrayBuffer"!=M.name})){for(var G,K=(M=function(e){return x(this,M),new D(P(e))})[N]=D[N],q=_(D),Z=0;q.length>Z;)(G=q[Z++])in M||y(M,G,D[G]);m||(K.constructor=M)}var J=new I(new M(2)),X=I[N].setInt8;J.setInt8(0,2147483648),J.setInt8(1,2147483649),(J.getInt8(0)||!J.getInt8(1))&&b(I[N],{setInt8:function(e,t){X.call(this,e,t<<24>>24)},setUint8:function(e,t){X.call(this,e,t<<24>>24)}},!0)}else M=function(e){x(this,M,"ArrayBuffer");var t=P(e);this._b=T.call(new Array(t),0),this[V]=t},I=function(e,t,n){x(this,I,"DataView"),x(e,M,"DataView");var r=e[V],o=S(t);if(o<0||o>r)throw F("Wrong offset!");if(o+(n=void 0===n?r-o:E(n))>r)throw F("Wrong length!");this[B]=e,this[H]=o,this[V]=n},v&&(f(M,"byteLength","_l"),f(I,"buffer","_b"),f(I,"byteLength","_l"),f(I,"byteOffset","_o")),b(I[N],{getInt8:function(e){return p(this,1,e)[0]<<24>>24},getUint8:function(e){return p(this,1,e)[0]},getInt16:function(e){var t=p(this,2,e,arguments[1]);return(t[1]<<8|t[0])<<16>>16},getUint16:function(e){var t=p(this,2,e,arguments[1]);return t[1]<<8|t[0]},getInt32:function(e){return i(p(this,4,e,arguments[1]))},getUint32:function(e){return i(p(this,4,e,arguments[1]))>>>0},getFloat32:function(e){return o(p(this,4,e,arguments[1]),23,4)},getFloat64:function(e){return o(p(this,8,e,arguments[1]),52,8)},setInt8:function(e,t){d(this,1,e,a,t)},setUint8:function(e,t){d(this,1,e,a,t)},setInt16:function(e,t){d(this,2,e,u,t,arguments[2])},setUint16:function(e,t){d(this,2,e,u,t,arguments[2])},setInt32:function(e,t){d(this,4,e,l,t,arguments[2])},setUint32:function(e,t){d(this,4,e,l,t,arguments[2])},setFloat32:function(e,t){d(this,4,e,s,t,arguments[2])},setFloat64:function(e,t){d(this,8,e,c,t,arguments[2])}});k(M,"ArrayBuffer"),k(I,"DataView"),y(I[N],g.VIEW,!0),t.ArrayBuffer=M,t.DataView=I},function(e,t,n){var r=n(2).navigator;e.exports=r&&r.userAgent||""},,function(e,t,n){"use strict";!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}(),e.exports=n(414)},function(e,t,n){e.exports=!n(7)&&!n(3)(function(){return 7!=Object.defineProperty(n(69)("div"),"a",{get:function(){return 7}}).a})},function(e,t,n){t.f=n(6)},function(e,t,n){var r=n(12),o=n(16),i=n(55)(!1),a=n(71)("IE_PROTO");e.exports=function(e,t){var n,u=o(e),l=0,c=[];for(n in u)n!=a&&r(u,n)&&c.push(n);for(;t.length>l;)r(u,n=t[l++])&&(~i(c,n)||c.push(n));return c}},function(e,t,n){var r=n(8),o=n(1),i=n(36);e.exports=n(7)?Object.defineProperties:function(e,t){o(e);for(var n,a=i(t),u=a.length,l=0;u>l;)r.f(e,n=a[l++],t[n]);return e}},function(e,t,n){var r=n(16),o=n(39).f,i={}.toString,a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function(e){return a&&"[object Window]"==i.call(e)?function(e){try{return o(e)}catch(e){return a.slice()}}(e):o(r(e))}},function(e,t,n){"use strict";var r=n(36),o=n(56),i=n(50),a=n(10),u=n(49),l=Object.assign;e.exports=!l||n(3)(function(){var e={},t={},n=Symbol(),r="abcdefghijklmnopqrst";return e[n]=7,r.split("").forEach(function(e){t[e]=e}),7!=l({},e)[n]||Object.keys(l({},t)).join("")!=r})?function(e,t){for(var n=a(e),l=arguments.length,c=1,s=o.f,f=i.f;l>c;)for(var p,d=u(arguments[c++]),h=s?r(d).concat(s(d)):r(d),v=h.length,m=0;v>m;)f.call(d,p=h[m++])&&(n[p]=d[p]);return n}:l},function(e,t,n){"use strict";var r=n(11),o=n(4),i=n(105),a=[].slice,u={};e.exports=Function.bind||function(e){var t=r(this),n=a.call(arguments,1),l=function(){var r=n.concat(a.call(arguments));return this instanceof l?function(e,t,n){if(!(t in u)){for(var r=[],o=0;o<t;o++)r[o]="a["+o+"]";u[t]=Function("F,a","return new F("+r.join(",")+")")}return u[t](e,n)}(t,r.length,r):i(t,r,e)};return o(t.prototype)&&(l.prototype=t.prototype),l}},function(e,t){e.exports=function(e,t,n){var r=void 0===n;switch(t.length){case 0:return r?e():e.call(n);case 1:return r?e(t[0]):e.call(n,t[0]);case 2:return r?e(t[0],t[1]):e.call(n,t[0],t[1]);case 3:return r?e(t[0],t[1],t[2]):e.call(n,t[0],t[1],t[2]);case 4:return r?e(t[0],t[1],t[2],t[3]):e.call(n,t[0],t[1],t[2],t[3])}return e.apply(n,t)}},function(e,t,n){var r=n(2).parseInt,o=n(45).trim,i=n(75),a=/^[-+]?0[xX]/;e.exports=8!==r(i+"08")||22!==r(i+"0x16")?function(e,t){var n=o(String(e),3);return r(n,t>>>0||(a.test(n)?16:10))}:r},function(e,t,n){var r=n(2).parseFloat,o=n(45).trim;e.exports=1/r(n(75)+"-0")!=-1/0?function(e){var t=o(String(e),3),n=r(t);return 0===n&&"-"==t.charAt(0)?-0:n}:r},function(e,t,n){var r=n(20);e.exports=function(e,t){if("number"!=typeof e&&"Number"!=r(e))throw TypeError(t);return+e}},function(e,t,n){var r=n(4),o=Math.floor;e.exports=function(e){return!r(e)&&isFinite(e)&&o(e)===e}},function(e,t){e.exports=Math.log1p||function(e){return(e=+e)>-1e-8&&e<1e-8?e-e*e/2:Math.log(1+e)}},function(e,t,n){var r=n(78),o=Math.pow,i=o(2,-52),a=o(2,-23),u=o(2,127)*(2-a),l=o(2,-126);e.exports=Math.fround||function(e){var t,n,o=Math.abs(e),c=r(e);return o<l?c*(o/l/a+1/i-1/i)*l*a:(n=(t=(1+a/i)*o)-(t-o))>u||n!=n?c*(1/0):c*n}},function(e,t,n){var r=n(1);e.exports=function(e,t,n,o){try{return o?t(r(n)[0],n[1]):t(n)}catch(t){var i=e.return;throw void 0!==i&&r(i.call(e)),t}}},function(e,t,n){var r=n(11),o=n(10),i=n(49),a=n(9);e.exports=function(e,t,n,u,l){r(t);var c=o(e),s=i(c),f=a(c.length),p=l?f-1:0,d=l?-1:1;if(n<2)for(;;){if(p in s){u=s[p],p+=d;break}if(p+=d,l?p<0:f<=p)throw TypeError("Reduce of empty array with no initial value")}for(;l?p>=0:f>p;p+=d)p in s&&(u=t(u,s[p],p,c));return u}},function(e,t,n){"use strict";var r=n(10),o=n(37),i=n(9);e.exports=[].copyWithin||function(e,t){var n=r(this),a=i(n.length),u=o(e,a),l=o(t,a),c=arguments.length>2?arguments[2]:void 0,s=Math.min((void 0===c?a:o(c,a))-l,a-u),f=1;for(l<u&&u<l+s&&(f=-1,l+=s-1,u+=s-1);s-- >0;)l in n?n[u]=n[l]:delete n[u],u+=f,l+=f;return n}},function(e,t){e.exports=function(e,t){return{value:t,done:!!e}}},function(e,t,n){n(7)&&"g"!=/./g.flags&&n(8).f(RegExp.prototype,"flags",{configurable:!0,get:n(60)})},function(e,t){e.exports=function(e){try{return{e:!1,v:e()}}catch(e){return{e:!0,v:e}}}},function(e,t,n){var r=n(1),o=n(4),i=n(93);e.exports=function(e,t){if(r(e),o(t)&&t.constructor===e)return t;var n=i.f(e);return(0,n.resolve)(t),n.promise}},function(e,t,n){"use strict";var r=n(120),o=n(47);e.exports=n(63)("Map",function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}},{get:function(e){var t=r.getEntry(o(this,"Map"),e);return t&&t.v},set:function(e,t){return r.def(o(this,"Map"),0===e?0:e,t)}},r,!0)},function(e,t,n){"use strict";var r=n(8).f,o=n(38),i=n(43),a=n(19),u=n(41),l=n(42),c=n(81),s=n(115),f=n(40),p=n(7),d=n(31).fastKey,h=n(47),v=p?"_s":"size",m=function(e,t){var n,r=d(t);if("F"!==r)return e._i[r];for(n=e._f;n;n=n.n)if(n.k==t)return n};e.exports={getConstructor:function(e,t,n,c){var s=e(function(e,r){u(e,s,t,"_i"),e._t=t,e._i=o(null),e._f=void 0,e._l=void 0,e[v]=0,void 0!=r&&l(r,n,e[c],e)});return i(s.prototype,{clear:function(){for(var e=h(this,t),n=e._i,r=e._f;r;r=r.n)r.r=!0,r.p&&(r.p=r.p.n=void 0),delete n[r.i];e._f=e._l=void 0,e[v]=0},delete:function(e){var n=h(this,t),r=m(n,e);if(r){var o=r.n,i=r.p;delete n._i[r.i],r.r=!0,i&&(i.n=o),o&&(o.p=i),n._f==r&&(n._f=o),n._l==r&&(n._l=i),n[v]--}return!!r},forEach:function(e){h(this,t);for(var n,r=a(e,arguments.length>1?arguments[1]:void 0,3);n=n?n.n:this._f;)for(r(n.v,n.k,this);n&&n.r;)n=n.p},has:function(e){return!!m(h(this,t),e)}}),p&&r(s.prototype,"size",{get:function(){return h(this,t)[v]}}),s},def:function(e,t,n){var r,o,i=m(e,t);return i?i.v=n:(e._l=i={i:o=d(t,!0),k:t,v:n,p:r=e._l,n:void 0,r:!1},e._f||(e._f=i),r&&(r.n=i),e[v]++,"F"!==o&&(e._i[o]=i)),e},getEntry:m,setStrong:function(e,t,n){c(e,t,function(e,n){this._t=h(e,t),this._k=n,this._l=void 0},function(){for(var e=this._k,t=this._l;t&&t.r;)t=t.p;return this._t&&(this._l=t=t?t.n:this._t._f)?"keys"==e?s(0,t.k):"values"==e?s(0,t.v):s(0,[t.k,t.v]):(this._t=void 0,s(1))},n?"entries":"values",!n,!0),f(t)}}},function(e,t,n){"use strict";var r=n(120),o=n(47);e.exports=n(63)("Set",function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}},{add:function(e){return r.def(o(this,"Set"),e=0===e?0:e,e)}},r)},function(e,t,n){"use strict";var r,o=n(27)(0),i=n(14),a=n(31),u=n(103),l=n(123),c=n(4),s=n(3),f=n(47),p=a.getWeak,d=Object.isExtensible,h=l.ufstore,v={},m=function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}},g={get:function(e){if(c(e)){var t=p(e);return!0===t?h(f(this,"WeakMap")).get(e):t?t[this._i]:void 0}},set:function(e,t){return l.def(f(this,"WeakMap"),e,t)}},y=e.exports=n(63)("WeakMap",m,g,l,!0,!0);s(function(){return 7!=(new y).set((Object.freeze||Object)(v),7).get(v)})&&(u((r=l.getConstructor(m,"WeakMap")).prototype,g),a.NEED=!0,o(["delete","has","get","set"],function(e){var t=y.prototype,n=t[e];i(t,e,function(t,o){if(c(t)&&!d(t)){this._f||(this._f=new r);var i=this._f[e](t,o);return"set"==e?this:i}return n.call(this,t,o)})}))},function(e,t,n){"use strict";var r=n(43),o=n(31).getWeak,i=n(1),a=n(4),u=n(41),l=n(42),c=n(27),s=n(12),f=n(47),p=c(5),d=c(6),h=0,v=function(e){return e._l||(e._l=new m)},m=function(){this.a=[]},g=function(e,t){return p(e.a,function(e){return e[0]===t})};m.prototype={get:function(e){var t=g(this,e);if(t)return t[1]},has:function(e){return!!g(this,e)},set:function(e,t){var n=g(this,e);n?n[1]=t:this.a.push([e,t])},delete:function(e){var t=d(this.a,function(t){return t[0]===e});return~t&&this.a.splice(t,1),!!~t}},e.exports={getConstructor:function(e,t,n,i){var c=e(function(e,r){u(e,c,t,"_i"),e._t=t,e._i=h++,e._l=void 0,void 0!=r&&l(r,n,e[i],e)});return r(c.prototype,{delete:function(e){if(!a(e))return!1;var n=o(e);return!0===n?v(f(this,t)).delete(e):n&&s(n,this._i)&&delete n[this._i]},has:function(e){if(!a(e))return!1;var n=o(e);return!0===n?v(f(this,t)).has(e):n&&s(n,this._i)}}),c},def:function(e,t,n){var r=o(i(t),!0);return!0===r?v(e).set(t,n):r[e._i]=n,e},ufstore:v}},function(e,t,n){var r=n(25),o=n(9);e.exports=function(e){if(void 0===e)return 0;var t=r(e),n=o(t);if(t!==n)throw RangeError("Wrong length!");return n}},function(e,t,n){var r=n(39),o=n(56),i=n(1),a=n(2).Reflect;e.exports=a&&a.ownKeys||function(e){var t=r.f(i(e)),n=o.f;return n?t.concat(n(e)):t}},function(e,t,n){"use strict";var r=n(57),o=n(4),i=n(9),a=n(19),u=n(6)("isConcatSpreadable");e.exports=function e(t,n,l,c,s,f,p,d){for(var h,v,m=s,g=0,y=!!p&&a(p,d,3);g<c;){if(g in l){if(h=y?y(l[g],g,n):l[g],v=!1,o(h)&&(v=void 0!==(v=h[u])?!!v:r(h)),v&&f>0)m=e(t,n,h,i(h.length),m,f-1)-1;else{if(m>=9007199254740991)throw TypeError();t[m]=h}m++}g++}return m}},function(e,t,n){var r=n(9),o=n(77),i=n(24);e.exports=function(e,t,n,a){var u=String(i(e)),l=u.length,c=void 0===n?" ":String(n),s=r(t);if(s<=l||""==c)return u;var f=s-l,p=o.call(c,Math.ceil(f/c.length));return p.length>f&&(p=p.slice(0,f)),a?p+u:u+p}},function(e,t,n){var r=n(36),o=n(16),i=n(50).f;e.exports=function(e){return function(t){for(var n,a=o(t),u=r(a),l=u.length,c=0,s=[];l>c;)i.call(a,n=u[c++])&&s.push(e?[n,a[n]]:a[n]);return s}}},function(e,t,n){var r=n(51),o=n(130);e.exports=function(e){return function(){if(r(this)!=e)throw TypeError(e+"#toJSON isn't generic");return o(this)}}},function(e,t,n){var r=n(42);e.exports=function(e,t){var n=[];return r(e,!1,n.push,n,t),n}},function(e,t){e.exports=Math.scale||function(e,t,n,r,o){return 0===arguments.length||e!=e||t!=t||n!=n||r!=r||o!=o?NaN:e===1/0||e===-1/0?e:(e-t)*(o-r)/(n-t)+r}},,,,,,,,,function(e,t,n){"use strict";var r=function(e){};e.exports=function(e,t,n,o,i,a,u,l){if(r(t),!e){var c;if(void 0===t)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var s=[n,o,i,a,u,l],f=0;(c=new Error(t.replace(/%s/g,function(){return s[f++]}))).name="Invariant Violation"}throw c.framesToPop=1,c}}},function(e,t,n){"use strict";(function(e){function t(e,t,n){e[t]||Object[r](e,t,{writable:!0,configurable:!0,value:n})}if(n(143),n(340),n(341),e._babelPolyfill)throw new Error("only one instance of babel-polyfill is allowed");e._babelPolyfill=!0;var r="defineProperty";t(String.prototype,"padLeft","".padStart),t(String.prototype,"padRight","".padEnd),"pop,reverse,shift,keys,values,entries,indexOf,every,some,forEach,map,filter,find,findIndex,includes,join,slice,concat,push,splice,unshift,sort,lastIndexOf,reduce,reduceRight,copyWithin,fill".split(",").forEach(function(e){[][e]&&t(Array,e,Function.call.bind([][e]))})}).call(t,n(52))},function(e,t,n){"use strict";function r(e){return function(){return e}}var o=function(){};o.thatReturns=r,o.thatReturnsFalse=r(!1),o.thatReturnsTrue=r(!0),o.thatReturnsNull=r(null),o.thatReturnsThis=function(){return this},o.thatReturnsArgument=function(e){return e},e.exports=o},function(e,t,n){n(144),n(146),n(147),n(148),n(149),n(150),n(151),n(152),n(153),n(154),n(155),n(156),n(157),n(158),n(159),n(160),n(162),n(163),n(164),n(165),n(166),n(167),n(168),n(169),n(170),n(171),n(172),n(173),n(174),n(175),n(176),n(177),n(178),n(179),n(180),n(181),n(182),n(183),n(184),n(185),n(186),n(187),n(188),n(189),n(190),n(191),n(192),n(193),n(194),n(195),n(196),n(197),n(198),n(199),n(200),n(201),n(202),n(203),n(204),n(205),n(206),n(207),n(208),n(209),n(210),n(211),n(212),n(213),n(214),n(215),n(216),n(217),n(218),n(219),n(220),n(221),n(222),n(224),n(225),n(227),n(228),n(229),n(230),n(231),n(232),n(233),n(235),n(236),n(237),n(238),n(239),n(240),n(241),n(242),n(243),n(244),n(245),n(246),n(247),n(90),n(248),n(249),n(116),n(250),n(251),n(252),n(253),n(254),n(119),n(121),n(122),n(255),n(256),n(257),n(258),n(259),n(260),n(261),n(262),n(263),n(264),n(265),n(266),n(267),n(268),n(269),n(270),n(271),n(272),n(273),n(274),n(275),n(276),n(277),n(278),n(279),n(280),n(281),n(282),n(283),n(284),n(285),n(286),n(287),n(288),n(289),n(290),n(291),n(292),n(293),n(294),n(295),n(296),n(297),n(298),n(299),n(300),n(301),n(302),n(303),n(304),n(305),n(306),n(307),n(308),n(309),n(310),n(311),n(312),n(313),n(314),n(315),n(316),n(317),n(318),n(319),n(320),n(321),n(322),n(323),n(324),n(325),n(326),n(327),n(328),n(329),n(330),n(331),n(332),n(333),n(334),n(335),n(336),n(337),n(338),n(339),e.exports=n(22)},function(e,t,n){"use strict";var r=n(2),o=n(12),i=n(7),a=n(0),u=n(14),l=n(31).KEY,c=n(3),s=n(54),f=n(44),p=n(34),d=n(6),h=n(99),v=n(70),m=n(145),g=n(57),y=n(1),b=n(4),w=n(16),x=n(23),S=n(33),E=n(38),P=n(102),_=n(17),C=n(8),T=n(36),k=_.f,N=C.f,O=P.f,M=r.Symbol,I=r.JSON,R=I&&I.stringify,F=d("_hidden"),j=d("toPrimitive"),D={}.propertyIsEnumerable,L=s("symbol-registry"),A=s("symbols"),z=s("op-symbols"),U=Object.prototype,W="function"==typeof M,B=r.QObject,V=!B||!B.prototype||!B.prototype.findChild,H=i&&c(function(){return 7!=E(N({},"a",{get:function(){return N(this,"a",{value:7}).a}})).a})?function(e,t,n){var r=k(U,t);r&&delete U[t],N(e,t,n),r&&e!==U&&N(U,t,r)}:N,G=function(e){var t=A[e]=E(M.prototype);return t._k=e,t},K=W&&"symbol"==typeof M.iterator?function(e){return"symbol"==typeof e}:function(e){return e instanceof M},q=function(e,t,n){return e===U&&q(z,t,n),y(e),t=x(t,!0),y(n),o(A,t)?(n.enumerable?(o(e,F)&&e[F][t]&&(e[F][t]=!1),n=E(n,{enumerable:S(0,!1)})):(o(e,F)||N(e,F,S(1,{})),e[F][t]=!0),H(e,t,n)):N(e,t,n)},Z=function(e,t){y(e);for(var n,r=m(t=w(t)),o=0,i=r.length;i>o;)q(e,n=r[o++],t[n]);return e},J=function(e){var t=D.call(this,e=x(e,!0));return!(this===U&&o(A,e)&&!o(z,e))&&(!(t||!o(this,e)||!o(A,e)||o(this,F)&&this[F][e])||t)},X=function(e,t){if(e=w(e),t=x(t,!0),e!==U||!o(A,t)||o(z,t)){var n=k(e,t);return!n||!o(A,t)||o(e,F)&&e[F][t]||(n.enumerable=!0),n}},$=function(e){for(var t,n=O(w(e)),r=[],i=0;n.length>i;)o(A,t=n[i++])||t==F||t==l||r.push(t);return r},Q=function(e){for(var t,n=e===U,r=O(n?z:w(e)),i=[],a=0;r.length>a;)o(A,t=r[a++])&&(n?o(U,t):1)&&i.push(A[t]);return i};W||(u((M=function(){if(this instanceof M)throw TypeError("Symbol is not a constructor!");var e=p(arguments.length>0?arguments[0]:void 0),t=function(n){this===U&&t.call(z,n),o(this,F)&&o(this[F],e)&&(this[F][e]=!1),H(this,e,S(1,n))};return i&&V&&H(U,e,{configurable:!0,set:t}),G(e)}).prototype,"toString",function(){return this._k}),_.f=X,C.f=q,n(39).f=P.f=$,n(50).f=J,n(56).f=Q,i&&!n(35)&&u(U,"propertyIsEnumerable",J,!0),h.f=function(e){return G(d(e))}),a(a.G+a.W+a.F*!W,{Symbol:M});for(var Y="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),ee=0;Y.length>ee;)d(Y[ee++]);for(var te=T(d.store),ne=0;te.length>ne;)v(te[ne++]);a(a.S+a.F*!W,"Symbol",{for:function(e){return o(L,e+="")?L[e]:L[e]=M(e)},keyFor:function(e){if(!K(e))throw TypeError(e+" is not a symbol!");for(var t in L)if(L[t]===e)return t},useSetter:function(){V=!0},useSimple:function(){V=!1}}),a(a.S+a.F*!W,"Object",{create:function(e,t){return void 0===t?E(e):Z(E(e),t)},defineProperty:q,defineProperties:Z,getOwnPropertyDescriptor:X,getOwnPropertyNames:$,getOwnPropertySymbols:Q}),I&&a(a.S+a.F*(!W||c(function(){var e=M();return"[null]"!=R([e])||"{}"!=R({a:e})||"{}"!=R(Object(e))})),"JSON",{stringify:function(e){for(var t,n,r=[e],o=1;arguments.length>o;)r.push(arguments[o++]);if(n=t=r[1],(b(t)||void 0!==e)&&!K(e))return g(t)||(t=function(e,t){if("function"==typeof n&&(t=n.call(this,e,t)),!K(t))return t}),r[1]=t,R.apply(I,r)}}),M.prototype[j]||n(13)(M.prototype,j,M.prototype.valueOf),f(M,"Symbol"),f(Math,"Math",!0),f(r.JSON,"JSON",!0)},function(e,t,n){var r=n(36),o=n(56),i=n(50);e.exports=function(e){var t=r(e),n=o.f;if(n)for(var a,u=n(e),l=i.f,c=0;u.length>c;)l.call(e,a=u[c++])&&t.push(a);return t}},function(e,t,n){var r=n(0);r(r.S,"Object",{create:n(38)})},function(e,t,n){var r=n(0);r(r.S+r.F*!n(7),"Object",{defineProperty:n(8).f})},function(e,t,n){var r=n(0);r(r.S+r.F*!n(7),"Object",{defineProperties:n(101)})},function(e,t,n){var r=n(16),o=n(17).f;n(26)("getOwnPropertyDescriptor",function(){return function(e,t){return o(r(e),t)}})},function(e,t,n){var r=n(10),o=n(18);n(26)("getPrototypeOf",function(){return function(e){return o(r(e))}})},function(e,t,n){var r=n(10),o=n(36);n(26)("keys",function(){return function(e){return o(r(e))}})},function(e,t,n){n(26)("getOwnPropertyNames",function(){return n(102).f})},function(e,t,n){var r=n(4),o=n(31).onFreeze;n(26)("freeze",function(e){return function(t){return e&&r(t)?e(o(t)):t}})},function(e,t,n){var r=n(4),o=n(31).onFreeze;n(26)("seal",function(e){return function(t){return e&&r(t)?e(o(t)):t}})},function(e,t,n){var r=n(4),o=n(31).onFreeze;n(26)("preventExtensions",function(e){return function(t){return e&&r(t)?e(o(t)):t}})},function(e,t,n){var r=n(4);n(26)("isFrozen",function(e){return function(t){return!r(t)||!!e&&e(t)}})},function(e,t,n){var r=n(4);n(26)("isSealed",function(e){return function(t){return!r(t)||!!e&&e(t)}})},function(e,t,n){var r=n(4);n(26)("isExtensible",function(e){return function(t){return!!r(t)&&(!e||e(t))}})},function(e,t,n){var r=n(0);r(r.S+r.F,"Object",{assign:n(103)})},function(e,t,n){var r=n(0);r(r.S,"Object",{is:n(161)})},function(e,t){e.exports=Object.is||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}},function(e,t,n){var r=n(0);r(r.S,"Object",{setPrototypeOf:n(74).set})},function(e,t,n){"use strict";var r=n(51),o={};o[n(6)("toStringTag")]="z",o+""!="[object z]"&&n(14)(Object.prototype,"toString",function(){return"[object "+r(this)+"]"},!0)},function(e,t,n){var r=n(0);r(r.P,"Function",{bind:n(104)})},function(e,t,n){var r=n(8).f,o=Function.prototype,i=/^\s*function ([^ (]*)/;"name"in o||n(7)&&r(o,"name",{configurable:!0,get:function(){try{return(""+this).match(i)[1]}catch(e){return""}}})},function(e,t,n){"use strict";var r=n(4),o=n(18),i=n(6)("hasInstance"),a=Function.prototype;i in a||n(8).f(a,i,{value:function(e){if("function"!=typeof this||!r(e))return!1;if(!r(this.prototype))return e instanceof this;for(;e=o(e);)if(this.prototype===e)return!0;return!1}})},function(e,t,n){var r=n(0),o=n(106);r(r.G+r.F*(parseInt!=o),{parseInt:o})},function(e,t,n){var r=n(0),o=n(107);r(r.G+r.F*(parseFloat!=o),{parseFloat:o})},function(e,t,n){"use strict";var r=n(2),o=n(12),i=n(20),a=n(76),u=n(23),l=n(3),c=n(39).f,s=n(17).f,f=n(8).f,p=n(45).trim,d=r.Number,h=d,v=d.prototype,m="Number"==i(n(38)(v)),g="trim"in String.prototype,y=function(e){var t=u(e,!1);if("string"==typeof t&&t.length>2){var n,r,o,i=(t=g?t.trim():p(t,3)).charCodeAt(0);if(43===i||45===i){if(88===(n=t.charCodeAt(2))||120===n)return NaN}else if(48===i){switch(t.charCodeAt(1)){case 66:case 98:r=2,o=49;break;case 79:case 111:r=8,o=55;break;default:return+t}for(var a,l=t.slice(2),c=0,s=l.length;c<s;c++)if((a=l.charCodeAt(c))<48||a>o)return NaN;return parseInt(l,r)}}return+t};if(!d(" 0o1")||!d("0b1")||d("+0x1")){d=function(e){var t=arguments.length<1?0:e,n=this;return n instanceof d&&(m?l(function(){v.valueOf.call(n)}):"Number"!=i(n))?a(new h(y(t)),n,d):y(t)};for(var b,w=n(7)?c(h):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),x=0;w.length>x;x++)o(h,b=w[x])&&!o(d,b)&&f(d,b,s(h,b));d.prototype=v,v.constructor=d,n(14)(r,"Number",d)}},function(e,t,n){"use strict";var r=n(0),o=n(25),i=n(108),a=n(77),u=1..toFixed,l=Math.floor,c=[0,0,0,0,0,0],s="Number.toFixed: incorrect invocation!",f=function(e,t){for(var n=-1,r=t;++n<6;)r+=e*c[n],c[n]=r%1e7,r=l(r/1e7)},p=function(e){for(var t=6,n=0;--t>=0;)n+=c[t],c[t]=l(n/e),n=n%e*1e7},d=function(){for(var e=6,t="";--e>=0;)if(""!==t||0===e||0!==c[e]){var n=String(c[e]);t=""===t?n:t+a.call("0",7-n.length)+n}return t},h=function(e,t,n){return 0===t?n:t%2==1?h(e,t-1,n*e):h(e*e,t/2,n)};r(r.P+r.F*(!!u&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==(0xde0b6b3a7640080).toFixed(0))||!n(3)(function(){u.call({})})),"Number",{toFixed:function(e){var t,n,r,u,l=i(this,s),c=o(e),v="",m="0";if(c<0||c>20)throw RangeError(s);if(l!=l)return"NaN";if(l<=-1e21||l>=1e21)return String(l);if(l<0&&(v="-",l=-l),l>1e-21)if(n=(t=function(e){for(var t=0,n=e;n>=4096;)t+=12,n/=4096;for(;n>=2;)t+=1,n/=2;return t}(l*h(2,69,1))-69)<0?l*h(2,-t,1):l/h(2,t,1),n*=4503599627370496,(t=52-t)>0){for(f(0,n),r=c;r>=7;)f(1e7,0),r-=7;for(f(h(10,r,1),0),r=t-1;r>=23;)p(1<<23),r-=23;p(1<<r),f(1,1),p(2),m=d()}else f(0,n),f(1<<-t,0),m=d()+a.call("0",c);return m=c>0?v+((u=m.length)<=c?"0."+a.call("0",c-u)+m:m.slice(0,u-c)+"."+m.slice(u-c)):v+m}})},function(e,t,n){"use strict";var r=n(0),o=n(3),i=n(108),a=1..toPrecision;r(r.P+r.F*(o(function(){return"1"!==a.call(1,void 0)})||!o(function(){a.call({})})),"Number",{toPrecision:function(e){var t=i(this,"Number#toPrecision: incorrect invocation!");return void 0===e?a.call(t):a.call(t,e)}})},function(e,t,n){var r=n(0);r(r.S,"Number",{EPSILON:Math.pow(2,-52)})},function(e,t,n){var r=n(0),o=n(2).isFinite;r(r.S,"Number",{isFinite:function(e){return"number"==typeof e&&o(e)}})},function(e,t,n){var r=n(0);r(r.S,"Number",{isInteger:n(109)})},function(e,t,n){var r=n(0);r(r.S,"Number",{isNaN:function(e){return e!=e}})},function(e,t,n){var r=n(0),o=n(109),i=Math.abs;r(r.S,"Number",{isSafeInteger:function(e){return o(e)&&i(e)<=9007199254740991}})},function(e,t,n){var r=n(0);r(r.S,"Number",{MAX_SAFE_INTEGER:9007199254740991})},function(e,t,n){var r=n(0);r(r.S,"Number",{MIN_SAFE_INTEGER:-9007199254740991})},function(e,t,n){var r=n(0),o=n(107);r(r.S+r.F*(Number.parseFloat!=o),"Number",{parseFloat:o})},function(e,t,n){var r=n(0),o=n(106);r(r.S+r.F*(Number.parseInt!=o),"Number",{parseInt:o})},function(e,t,n){var r=n(0),o=n(110),i=Math.sqrt,a=Math.acosh;r(r.S+r.F*!(a&&710==Math.floor(a(Number.MAX_VALUE))&&a(1/0)==1/0),"Math",{acosh:function(e){return(e=+e)<1?NaN:e>94906265.62425156?Math.log(e)+Math.LN2:o(e-1+i(e-1)*i(e+1))}})},function(e,t,n){var r=n(0),o=Math.asinh;r(r.S+r.F*!(o&&1/o(0)>0),"Math",{asinh:function e(t){return isFinite(t=+t)&&0!=t?t<0?-e(-t):Math.log(t+Math.sqrt(t*t+1)):t}})},function(e,t,n){var r=n(0),o=Math.atanh;r(r.S+r.F*!(o&&1/o(-0)<0),"Math",{atanh:function(e){return 0==(e=+e)?e:Math.log((1+e)/(1-e))/2}})},function(e,t,n){var r=n(0),o=n(78);r(r.S,"Math",{cbrt:function(e){return o(e=+e)*Math.pow(Math.abs(e),1/3)}})},function(e,t,n){var r=n(0);r(r.S,"Math",{clz32:function(e){return(e>>>=0)?31-Math.floor(Math.log(e+.5)*Math.LOG2E):32}})},function(e,t,n){var r=n(0),o=Math.exp;r(r.S,"Math",{cosh:function(e){return(o(e=+e)+o(-e))/2}})},function(e,t,n){var r=n(0),o=n(79);r(r.S+r.F*(o!=Math.expm1),"Math",{expm1:o})},function(e,t,n){var r=n(0);r(r.S,"Math",{fround:n(111)})},function(e,t,n){var r=n(0),o=Math.abs;r(r.S,"Math",{hypot:function(e,t){for(var n,r,i=0,a=0,u=arguments.length,l=0;a<u;)l<(n=o(arguments[a++]))?(i=i*(r=l/n)*r+1,l=n):i+=n>0?(r=n/l)*r:n;return l===1/0?1/0:l*Math.sqrt(i)}})},function(e,t,n){var r=n(0),o=Math.imul;r(r.S+r.F*n(3)(function(){return-5!=o(4294967295,5)||2!=o.length}),"Math",{imul:function(e,t){var n=+e,r=+t,o=65535&n,i=65535&r;return 0|o*i+((65535&n>>>16)*i+o*(65535&r>>>16)<<16>>>0)}})},function(e,t,n){var r=n(0);r(r.S,"Math",{log10:function(e){return Math.log(e)*Math.LOG10E}})},function(e,t,n){var r=n(0);r(r.S,"Math",{log1p:n(110)})},function(e,t,n){var r=n(0);r(r.S,"Math",{log2:function(e){return Math.log(e)/Math.LN2}})},function(e,t,n){var r=n(0);r(r.S,"Math",{sign:n(78)})},function(e,t,n){var r=n(0),o=n(79),i=Math.exp;r(r.S+r.F*n(3)(function(){return-2e-17!=!Math.sinh(-2e-17)}),"Math",{sinh:function(e){return Math.abs(e=+e)<1?(o(e)-o(-e))/2:(i(e-1)-i(-e-1))*(Math.E/2)}})},function(e,t,n){var r=n(0),o=n(79),i=Math.exp;r(r.S,"Math",{tanh:function(e){var t=o(e=+e),n=o(-e);return t==1/0?1:n==1/0?-1:(t-n)/(i(e)+i(-e))}})},function(e,t,n){var r=n(0);r(r.S,"Math",{trunc:function(e){return(e>0?Math.floor:Math.ceil)(e)}})},function(e,t,n){var r=n(0),o=n(37),i=String.fromCharCode,a=String.fromCodePoint;r(r.S+r.F*(!!a&&1!=a.length),"String",{fromCodePoint:function(e){for(var t,n=[],r=arguments.length,a=0;r>a;){if(t=+arguments[a++],o(t,1114111)!==t)throw RangeError(t+" is not a valid code point");n.push(t<65536?i(t):i(55296+((t-=65536)>>10),t%1024+56320))}return n.join("")}})},function(e,t,n){var r=n(0),o=n(16),i=n(9);r(r.S,"String",{raw:function(e){for(var t=o(e.raw),n=i(t.length),r=arguments.length,a=[],u=0;n>u;)a.push(String(t[u++])),u<r&&a.push(String(arguments[u]));return a.join("")}})},function(e,t,n){"use strict";n(45)("trim",function(e){return function(){return e(this,3)}})},function(e,t,n){"use strict";var r=n(80)(!0);n(81)(String,"String",function(e){this._t=String(e),this._i=0},function(){var e,t=this._t,n=this._i;return n>=t.length?{value:void 0,done:!0}:(e=r(t,n),this._i+=e.length,{value:e,done:!1})})},function(e,t,n){"use strict";var r=n(0),o=n(80)(!1);r(r.P,"String",{codePointAt:function(e){return o(this,e)}})},function(e,t,n){"use strict";var r=n(0),o=n(9),i=n(83),a="".endsWith;r(r.P+r.F*n(84)("endsWith"),"String",{endsWith:function(e){var t=i(this,e,"endsWith"),n=arguments.length>1?arguments[1]:void 0,r=o(t.length),u=void 0===n?r:Math.min(o(n),r),l=String(e);return a?a.call(t,l,u):t.slice(u-l.length,u)===l}})},function(e,t,n){"use strict";var r=n(0),o=n(83);r(r.P+r.F*n(84)("includes"),"String",{includes:function(e){return!!~o(this,e,"includes").indexOf(e,arguments.length>1?arguments[1]:void 0)}})},function(e,t,n){var r=n(0);r(r.P,"String",{repeat:n(77)})},function(e,t,n){"use strict";var r=n(0),o=n(9),i=n(83),a="".startsWith;r(r.P+r.F*n(84)("startsWith"),"String",{startsWith:function(e){var t=i(this,e,"startsWith"),n=o(Math.min(arguments.length>1?arguments[1]:void 0,t.length)),r=String(e);return a?a.call(t,r,n):t.slice(n,n+r.length)===r}})},function(e,t,n){"use strict";n(15)("anchor",function(e){return function(t){return e(this,"a","name",t)}})},function(e,t,n){"use strict";n(15)("big",function(e){return function(){return e(this,"big","","")}})},function(e,t,n){"use strict";n(15)("blink",function(e){return function(){return e(this,"blink","","")}})},function(e,t,n){"use strict";n(15)("bold",function(e){return function(){return e(this,"b","","")}})},function(e,t,n){"use strict";n(15)("fixed",function(e){return function(){return e(this,"tt","","")}})},function(e,t,n){"use strict";n(15)("fontcolor",function(e){return function(t){return e(this,"font","color",t)}})},function(e,t,n){"use strict";n(15)("fontsize",function(e){return function(t){return e(this,"font","size",t)}})},function(e,t,n){"use strict";n(15)("italics",function(e){return function(){return e(this,"i","","")}})},function(e,t,n){"use strict";n(15)("link",function(e){return function(t){return e(this,"a","href",t)}})},function(e,t,n){"use strict";n(15)("small",function(e){return function(){return e(this,"small","","")}})},function(e,t,n){"use strict";n(15)("strike",function(e){return function(){return e(this,"strike","","")}})},function(e,t,n){"use strict";n(15)("sub",function(e){return function(){return e(this,"sub","","")}})},function(e,t,n){"use strict";n(15)("sup",function(e){return function(){return e(this,"sup","","")}})},function(e,t,n){var r=n(0);r(r.S,"Date",{now:function(){return(new Date).getTime()}})},function(e,t,n){"use strict";var r=n(0),o=n(10),i=n(23);r(r.P+r.F*n(3)(function(){return null!==new Date(NaN).toJSON()||1!==Date.prototype.toJSON.call({toISOString:function(){return 1}})}),"Date",{toJSON:function(e){var t=o(this),n=i(t);return"number"!=typeof n||isFinite(n)?t.toISOString():null}})},function(e,t,n){var r=n(0),o=n(223);r(r.P+r.F*(Date.prototype.toISOString!==o),"Date",{toISOString:o})},function(e,t,n){"use strict";var r=n(3),o=Date.prototype.getTime,i=Date.prototype.toISOString,a=function(e){return e>9?e:"0"+e};e.exports=r(function(){return"0385-07-25T07:06:39.999Z"!=i.call(new Date(-5e13-1))})||!r(function(){i.call(new Date(NaN))})?function(){if(!isFinite(o.call(this)))throw RangeError("Invalid time value");var e=this,t=e.getUTCFullYear(),n=e.getUTCMilliseconds(),r=t<0?"-":t>9999?"+":"";return r+("00000"+Math.abs(t)).slice(r?-6:-4)+"-"+a(e.getUTCMonth()+1)+"-"+a(e.getUTCDate())+"T"+a(e.getUTCHours())+":"+a(e.getUTCMinutes())+":"+a(e.getUTCSeconds())+"."+(n>99?n:"0"+a(n))+"Z"}:i},function(e,t,n){var r=Date.prototype,o=r.toString,i=r.getTime;new Date(NaN)+""!="Invalid Date"&&n(14)(r,"toString",function(){var e=i.call(this);return e==e?o.call(this):"Invalid Date"})},function(e,t,n){var r=n(6)("toPrimitive"),o=Date.prototype;r in o||n(13)(o,r,n(226))},function(e,t,n){"use strict";var r=n(1),o=n(23);e.exports=function(e){if("string"!==e&&"number"!==e&&"default"!==e)throw TypeError("Incorrect hint");return o(r(this),"number"!=e)}},function(e,t,n){var r=n(0);r(r.S,"Array",{isArray:n(57)})},function(e,t,n){"use strict";var r=n(19),o=n(0),i=n(10),a=n(112),u=n(85),l=n(9),c=n(86),s=n(87);o(o.S+o.F*!n(59)(function(e){Array.from(e)}),"Array",{from:function(e){var t,n,o,f,p=i(e),d="function"==typeof this?this:Array,h=arguments.length,v=h>1?arguments[1]:void 0,m=void 0!==v,g=0,y=s(p);if(m&&(v=r(v,h>2?arguments[2]:void 0,2)),void 0==y||d==Array&&u(y))for(n=new d(t=l(p.length));t>g;g++)c(n,g,m?v(p[g],g):p[g]);else for(f=y.call(p),n=new d;!(o=f.next()).done;g++)c(n,g,m?a(f,v,[o.value,g],!0):o.value);return n.length=g,n}})},function(e,t,n){"use strict";var r=n(0),o=n(86);r(r.S+r.F*n(3)(function(){function e(){}return!(Array.of.call(e)instanceof e)}),"Array",{of:function(){for(var e=0,t=arguments.length,n=new("function"==typeof this?this:Array)(t);t>e;)o(n,e,arguments[e++]);return n.length=t,n}})},function(e,t,n){"use strict";var r=n(0),o=n(16),i=[].join;r(r.P+r.F*(n(49)!=Object||!n(21)(i)),"Array",{join:function(e){return i.call(o(this),void 0===e?",":e)}})},function(e,t,n){"use strict";var r=n(0),o=n(73),i=n(20),a=n(37),u=n(9),l=[].slice;r(r.P+r.F*n(3)(function(){o&&l.call(o)}),"Array",{slice:function(e,t){var n=u(this.length),r=i(this);if(t=void 0===t?n:t,"Array"==r)return l.call(this,e,t);for(var o=a(e,n),c=a(t,n),s=u(c-o),f=new Array(s),p=0;p<s;p++)f[p]="String"==r?this.charAt(o+p):this[o+p];return f}})},function(e,t,n){"use strict";var r=n(0),o=n(11),i=n(10),a=n(3),u=[].sort,l=[1,2,3];r(r.P+r.F*(a(function(){l.sort(void 0)})||!a(function(){l.sort(null)})||!n(21)(u)),"Array",{sort:function(e){return void 0===e?u.call(i(this)):u.call(i(this),o(e))}})},function(e,t,n){"use strict";var r=n(0),o=n(27)(0),i=n(21)([].forEach,!0);r(r.P+r.F*!i,"Array",{forEach:function(e){return o(this,e,arguments[1])}})},function(e,t,n){var r=n(4),o=n(57),i=n(6)("species");e.exports=function(e){var t;return o(e)&&("function"!=typeof(t=e.constructor)||t!==Array&&!o(t.prototype)||(t=void 0),r(t)&&null===(t=t[i])&&(t=void 0)),void 0===t?Array:t}},function(e,t,n){"use strict";var r=n(0),o=n(27)(1);r(r.P+r.F*!n(21)([].map,!0),"Array",{map:function(e){return o(this,e,arguments[1])}})},function(e,t,n){"use strict";var r=n(0),o=n(27)(2);r(r.P+r.F*!n(21)([].filter,!0),"Array",{filter:function(e){return o(this,e,arguments[1])}})},function(e,t,n){"use strict";var r=n(0),o=n(27)(3);r(r.P+r.F*!n(21)([].some,!0),"Array",{some:function(e){return o(this,e,arguments[1])}})},function(e,t,n){"use strict";var r=n(0),o=n(27)(4);r(r.P+r.F*!n(21)([].every,!0),"Array",{every:function(e){return o(this,e,arguments[1])}})},function(e,t,n){"use strict";var r=n(0),o=n(113);r(r.P+r.F*!n(21)([].reduce,!0),"Array",{reduce:function(e){return o(this,e,arguments.length,arguments[1],!1)}})},function(e,t,n){"use strict";var r=n(0),o=n(113);r(r.P+r.F*!n(21)([].reduceRight,!0),"Array",{reduceRight:function(e){return o(this,e,arguments.length,arguments[1],!0)}})},function(e,t,n){"use strict";var r=n(0),o=n(55)(!1),i=[].indexOf,a=!!i&&1/[1].indexOf(1,-0)<0;r(r.P+r.F*(a||!n(21)(i)),"Array",{indexOf:function(e){return a?i.apply(this,arguments)||0:o(this,e,arguments[1])}})},function(e,t,n){"use strict";var r=n(0),o=n(16),i=n(25),a=n(9),u=[].lastIndexOf,l=!!u&&1/[1].lastIndexOf(1,-0)<0;r(r.P+r.F*(l||!n(21)(u)),"Array",{lastIndexOf:function(e){if(l)return u.apply(this,arguments)||0;var t=o(this),n=a(t.length),r=n-1;for(arguments.length>1&&(r=Math.min(r,i(arguments[1]))),r<0&&(r=n+r);r>=0;r--)if(r in t&&t[r]===e)return r||0;return-1}})},function(e,t,n){var r=n(0);r(r.P,"Array",{copyWithin:n(114)}),n(32)("copyWithin")},function(e,t,n){var r=n(0);r(r.P,"Array",{fill:n(89)}),n(32)("fill")},function(e,t,n){"use strict";var r=n(0),o=n(27)(5),i=!0;"find"in[]&&Array(1).find(function(){i=!1}),r(r.P+r.F*i,"Array",{find:function(e){return o(this,e,arguments.length>1?arguments[1]:void 0)}}),n(32)("find")},function(e,t,n){"use strict";var r=n(0),o=n(27)(6),i="findIndex",a=!0;i in[]&&Array(1)[i](function(){a=!1}),r(r.P+r.F*a,"Array",{findIndex:function(e){return o(this,e,arguments.length>1?arguments[1]:void 0)}}),n(32)(i)},function(e,t,n){n(40)("Array")},function(e,t,n){var r=n(2),o=n(76),i=n(8).f,a=n(39).f,u=n(58),l=n(60),c=r.RegExp,s=c,f=c.prototype,p=/a/g,d=/a/g,h=new c(p)!==p;if(n(7)&&(!h||n(3)(function(){return d[n(6)("match")]=!1,c(p)!=p||c(d)==d||"/a/i"!=c(p,"i")}))){c=function(e,t){var n=this instanceof c,r=u(e),i=void 0===t;return!n&&r&&e.constructor===c&&i?e:o(h?new s(r&&!i?e.source:e,t):s((r=e instanceof c)?e.source:e,r&&i?l.call(e):t),n?this:f,c)};for(var v=a(s),m=0;v.length>m;)!function(e){e in c||i(c,e,{configurable:!0,get:function(){return s[e]},set:function(t){s[e]=t}})}(v[m++]);f.constructor=c,c.prototype=f,n(14)(r,"RegExp",c)}n(40)("RegExp")},function(e,t,n){"use strict";n(116);var r=n(1),o=n(60),i=n(7),a=/./.toString,u=function(e){n(14)(RegExp.prototype,"toString",e,!0)};n(3)(function(){return"/a/b"!=a.call({source:"a",flags:"b"})})?u(function(){var e=r(this);return"/".concat(e.source,"/","flags"in e?e.flags:!i&&e instanceof RegExp?o.call(e):void 0)}):"toString"!=a.name&&u(function(){return a.call(this)})},function(e,t,n){n(61)("match",1,function(e,t,n){return[function(n){"use strict";var r=e(this),o=void 0==n?void 0:n[t];return void 0!==o?o.call(n,r):new RegExp(n)[t](String(r))},n]})},function(e,t,n){n(61)("replace",2,function(e,t,n){return[function(r,o){"use strict";var i=e(this),a=void 0==r?void 0:r[t];return void 0!==a?a.call(r,i,o):n.call(String(i),r,o)},n]})},function(e,t,n){n(61)("search",1,function(e,t,n){return[function(n){"use strict";var r=e(this),o=void 0==n?void 0:n[t];return void 0!==o?o.call(n,r):new RegExp(n)[t](String(r))},n]})},function(e,t,n){n(61)("split",2,function(e,t,r){"use strict";var o=n(58),i=r,a=[].push;if("c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length){var u=void 0===/()??/.exec("")[1];r=function(e,t){var n=String(this);if(void 0===e&&0===t)return[];if(!o(e))return i.call(n,e,t);var r,l,c,s,f,p=[],d=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),h=0,v=void 0===t?4294967295:t>>>0,m=new RegExp(e.source,d+"g");for(u||(r=new RegExp("^"+m.source+"$(?!\\s)",d));(l=m.exec(n))&&!((c=l.index+l[0].length)>h&&(p.push(n.slice(h,l.index)),!u&&l.length>1&&l[0].replace(r,function(){for(f=1;f<arguments.length-2;f++)void 0===arguments[f]&&(l[f]=void 0)}),l.length>1&&l.index<n.length&&a.apply(p,l.slice(1)),s=l[0].length,h=c,p.length>=v));)m.lastIndex===l.index&&m.lastIndex++;return h===n.length?!s&&m.test("")||p.push(""):p.push(n.slice(h)),p.length>v?p.slice(0,v):p}}else"0".split(void 0,0).length&&(r=function(e,t){return void 0===e&&0===t?[]:i.call(this,e,t)});return[function(n,o){var i=e(this),a=void 0==n?void 0:n[t];return void 0!==a?a.call(n,i,o):r.call(String(i),n,o)},r]})},function(e,t,n){"use strict";var r,o,i,a,u=n(35),l=n(2),c=n(19),s=n(51),f=n(0),p=n(4),d=n(11),h=n(41),v=n(42),m=n(62),g=n(91).set,y=n(92)(),b=n(93),w=n(117),x=n(118),S=l.TypeError,E=l.process,P=l.Promise,_="process"==s(E),C=function(){},T=o=b.f,k=!!function(){try{var e=P.resolve(1),t=(e.constructor={})[n(6)("species")]=function(e){e(C,C)};return(_||"function"==typeof PromiseRejectionEvent)&&e.then(C)instanceof t}catch(e){}}(),N=function(e){var t;return!(!p(e)||"function"!=typeof(t=e.then))&&t},O=function(e,t){if(!e._n){e._n=!0;var n=e._c;y(function(){for(var r=e._v,o=1==e._s,i=0;n.length>i;)!function(t){var n,i,a=o?t.ok:t.fail,u=t.resolve,l=t.reject,c=t.domain;try{a?(o||(2==e._h&&R(e),e._h=1),!0===a?n=r:(c&&c.enter(),n=a(r),c&&c.exit()),n===t.promise?l(S("Promise-chain cycle")):(i=N(n))?i.call(n,u,l):u(n)):l(r)}catch(e){l(e)}}(n[i++]);e._c=[],e._n=!1,t&&!e._h&&M(e)})}},M=function(e){g.call(l,function(){var t,n,r,o=e._v,i=I(e);if(i&&(t=w(function(){_?E.emit("unhandledRejection",o,e):(n=l.onunhandledrejection)?n({promise:e,reason:o}):(r=l.console)&&r.error&&r.error("Unhandled promise rejection",o)}),e._h=_||I(e)?2:1),e._a=void 0,i&&t.e)throw t.v})},I=function(e){return 1!==e._h&&0===(e._a||e._c).length},R=function(e){g.call(l,function(){var t;_?E.emit("rejectionHandled",e):(t=l.onrejectionhandled)&&t({promise:e,reason:e._v})})},F=function(e){var t=this;t._d||(t._d=!0,(t=t._w||t)._v=e,t._s=2,t._a||(t._a=t._c.slice()),O(t,!0))},j=function(e){var t,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===e)throw S("Promise can't be resolved itself");(t=N(e))?y(function(){var r={_w:n,_d:!1};try{t.call(e,c(j,r,1),c(F,r,1))}catch(e){F.call(r,e)}}):(n._v=e,n._s=1,O(n,!1))}catch(e){F.call({_w:n,_d:!1},e)}}};k||(P=function(e){h(this,P,"Promise","_h"),d(e),r.call(this);try{e(c(j,this,1),c(F,this,1))}catch(e){F.call(this,e)}},(r=function(e){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=n(43)(P.prototype,{then:function(e,t){var n=T(m(this,P));return n.ok="function"!=typeof e||e,n.fail="function"==typeof t&&t,n.domain=_?E.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&O(this,!1),n.promise},catch:function(e){return this.then(void 0,e)}}),i=function(){var e=new r;this.promise=e,this.resolve=c(j,e,1),this.reject=c(F,e,1)},b.f=T=function(e){return e===P||e===a?new i(e):o(e)}),f(f.G+f.W+f.F*!k,{Promise:P}),n(44)(P,"Promise"),n(40)("Promise"),a=n(22).Promise,f(f.S+f.F*!k,"Promise",{reject:function(e){var t=T(this);return(0,t.reject)(e),t.promise}}),f(f.S+f.F*(u||!k),"Promise",{resolve:function(e){return x(u&&this===a?P:this,e)}}),f(f.S+f.F*!(k&&n(59)(function(e){P.all(e).catch(C)})),"Promise",{all:function(e){var t=this,n=T(t),r=n.resolve,o=n.reject,i=w(function(){var n=[],i=0,a=1;v(e,!1,function(e){var u=i++,l=!1;n.push(void 0),a++,t.resolve(e).then(function(e){l||(l=!0,n[u]=e,--a||r(n))},o)}),--a||r(n)});return i.e&&o(i.v),n.promise},race:function(e){var t=this,n=T(t),r=n.reject,o=w(function(){v(e,!1,function(e){t.resolve(e).then(n.resolve,r)})});return o.e&&r(o.v),n.promise}})},function(e,t,n){"use strict";var r=n(123),o=n(47);n(63)("WeakSet",function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}},{add:function(e){return r.def(o(this,"WeakSet"),e,!0)}},r,!1,!0)},function(e,t,n){"use strict";var r=n(0),o=n(64),i=n(94),a=n(1),u=n(37),l=n(9),c=n(4),s=n(2).ArrayBuffer,f=n(62),p=i.ArrayBuffer,d=i.DataView,h=o.ABV&&s.isView,v=p.prototype.slice,m=o.VIEW;r(r.G+r.W+r.F*(s!==p),{ArrayBuffer:p}),r(r.S+r.F*!o.CONSTR,"ArrayBuffer",{isView:function(e){return h&&h(e)||c(e)&&m in e}}),r(r.P+r.U+r.F*n(3)(function(){return!new p(2).slice(1,void 0).byteLength}),"ArrayBuffer",{slice:function(e,t){if(void 0!==v&&void 0===t)return v.call(a(this),e);for(var n=a(this).byteLength,r=u(e,n),o=u(void 0===t?n:t,n),i=new(f(this,p))(l(o-r)),c=new d(this),s=new d(i),h=0;r<o;)s.setUint8(h++,c.getUint8(r++));return i}}),n(40)("ArrayBuffer")},function(e,t,n){var r=n(0);r(r.G+r.W+r.F*!n(64).ABV,{DataView:n(94).DataView})},function(e,t,n){n(29)("Int8",1,function(e){return function(t,n,r){return e(this,t,n,r)}})},function(e,t,n){n(29)("Uint8",1,function(e){return function(t,n,r){return e(this,t,n,r)}})},function(e,t,n){n(29)("Uint8",1,function(e){return function(t,n,r){return e(this,t,n,r)}},!0)},function(e,t,n){n(29)("Int16",2,function(e){return function(t,n,r){return e(this,t,n,r)}})},function(e,t,n){n(29)("Uint16",2,function(e){return function(t,n,r){return e(this,t,n,r)}})},function(e,t,n){n(29)("Int32",4,function(e){return function(t,n,r){return e(this,t,n,r)}})},function(e,t,n){n(29)("Uint32",4,function(e){return function(t,n,r){return e(this,t,n,r)}})},function(e,t,n){n(29)("Float32",4,function(e){return function(t,n,r){return e(this,t,n,r)}})},function(e,t,n){n(29)("Float64",8,function(e){return function(t,n,r){return e(this,t,n,r)}})},function(e,t,n){var r=n(0),o=n(11),i=n(1),a=(n(2).Reflect||{}).apply,u=Function.apply;r(r.S+r.F*!n(3)(function(){a(function(){})}),"Reflect",{apply:function(e,t,n){var r=o(e),l=i(n);return a?a(r,t,l):u.call(r,t,l)}})},function(e,t,n){var r=n(0),o=n(38),i=n(11),a=n(1),u=n(4),l=n(3),c=n(104),s=(n(2).Reflect||{}).construct,f=l(function(){function e(){}return!(s(function(){},[],e)instanceof e)}),p=!l(function(){s(function(){})});r(r.S+r.F*(f||p),"Reflect",{construct:function(e,t){i(e),a(t);var n=arguments.length<3?e:i(arguments[2]);if(p&&!f)return s(e,t,n);if(e==n){switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3])}var r=[null];return r.push.apply(r,t),new(c.apply(e,r))}var l=n.prototype,d=o(u(l)?l:Object.prototype),h=Function.apply.call(e,d,t);return u(h)?h:d}})},function(e,t,n){var r=n(8),o=n(0),i=n(1),a=n(23);o(o.S+o.F*n(3)(function(){Reflect.defineProperty(r.f({},1,{value:1}),1,{value:2})}),"Reflect",{defineProperty:function(e,t,n){i(e),t=a(t,!0),i(n);try{return r.f(e,t,n),!0}catch(e){return!1}}})},function(e,t,n){var r=n(0),o=n(17).f,i=n(1);r(r.S,"Reflect",{deleteProperty:function(e,t){var n=o(i(e),t);return!(n&&!n.configurable)&&delete e[t]}})},function(e,t,n){"use strict";var r=n(0),o=n(1),i=function(e){this._t=o(e),this._i=0;var t,n=this._k=[];for(t in e)n.push(t)};n(82)(i,"Object",function(){var e,t=this._k;do{if(this._i>=t.length)return{value:void 0,done:!0}}while(!((e=t[this._i++])in this._t));return{value:e,done:!1}}),r(r.S,"Reflect",{enumerate:function(e){return new i(e)}})},function(e,t,n){var r=n(17),o=n(18),i=n(12),a=n(0),u=n(4),l=n(1);a(a.S,"Reflect",{get:function e(t,n){var a,c,s=arguments.length<3?t:arguments[2];return l(t)===s?t[n]:(a=r.f(t,n))?i(a,"value")?a.value:void 0!==a.get?a.get.call(s):void 0:u(c=o(t))?e(c,n,s):void 0}})},function(e,t,n){var r=n(17),o=n(0),i=n(1);o(o.S,"Reflect",{getOwnPropertyDescriptor:function(e,t){return r.f(i(e),t)}})},function(e,t,n){var r=n(0),o=n(18),i=n(1);r(r.S,"Reflect",{getPrototypeOf:function(e){return o(i(e))}})},function(e,t,n){var r=n(0);r(r.S,"Reflect",{has:function(e,t){return t in e}})},function(e,t,n){var r=n(0),o=n(1),i=Object.isExtensible;r(r.S,"Reflect",{isExtensible:function(e){return o(e),!i||i(e)}})},function(e,t,n){var r=n(0);r(r.S,"Reflect",{ownKeys:n(125)})},function(e,t,n){var r=n(0),o=n(1),i=Object.preventExtensions;r(r.S,"Reflect",{preventExtensions:function(e){o(e);try{return i&&i(e),!0}catch(e){return!1}}})},function(e,t,n){var r=n(8),o=n(17),i=n(18),a=n(12),u=n(0),l=n(33),c=n(1),s=n(4);u(u.S,"Reflect",{set:function e(t,n,u){var f,p,d=arguments.length<4?t:arguments[3],h=o.f(c(t),n);if(!h){if(s(p=i(t)))return e(p,n,u,d);h=l(0)}return a(h,"value")?!(!1===h.writable||!s(d))&&((f=o.f(d,n)||l(0)).value=u,r.f(d,n,f),!0):void 0!==h.set&&(h.set.call(d,u),!0)}})},function(e,t,n){var r=n(0),o=n(74);o&&r(r.S,"Reflect",{setPrototypeOf:function(e,t){o.check(e,t);try{return o.set(e,t),!0}catch(e){return!1}}})},function(e,t,n){"use strict";var r=n(0),o=n(55)(!0);r(r.P,"Array",{includes:function(e){return o(this,e,arguments.length>1?arguments[1]:void 0)}}),n(32)("includes")},function(e,t,n){"use strict";var r=n(0),o=n(126),i=n(10),a=n(9),u=n(11),l=n(88);r(r.P,"Array",{flatMap:function(e){var t,n,r=i(this);return u(e),t=a(r.length),n=l(r,0),o(n,r,r,t,0,1,e,arguments[1]),n}}),n(32)("flatMap")},function(e,t,n){"use strict";var r=n(0),o=n(126),i=n(10),a=n(9),u=n(25),l=n(88);r(r.P,"Array",{flatten:function(){var e=arguments[0],t=i(this),n=a(t.length),r=l(t,0);return o(r,t,t,n,0,void 0===e?1:u(e)),r}}),n(32)("flatten")},function(e,t,n){"use strict";var r=n(0),o=n(80)(!0);r(r.P,"String",{at:function(e){return o(this,e)}})},function(e,t,n){"use strict";var r=n(0),o=n(127),i=n(95);r(r.P+r.F*/Version\/10\.\d+(\.\d+)? Safari\//.test(i),"String",{padStart:function(e){return o(this,e,arguments.length>1?arguments[1]:void 0,!0)}})},function(e,t,n){"use strict";var r=n(0),o=n(127),i=n(95);r(r.P+r.F*/Version\/10\.\d+(\.\d+)? Safari\//.test(i),"String",{padEnd:function(e){return o(this,e,arguments.length>1?arguments[1]:void 0,!1)}})},function(e,t,n){"use strict";n(45)("trimLeft",function(e){return function(){return e(this,1)}},"trimStart")},function(e,t,n){"use strict";n(45)("trimRight",function(e){return function(){return e(this,2)}},"trimEnd")},function(e,t,n){"use strict";var r=n(0),o=n(24),i=n(9),a=n(58),u=n(60),l=RegExp.prototype,c=function(e,t){this._r=e,this._s=t};n(82)(c,"RegExp String",function(){var e=this._r.exec(this._s);return{value:e,done:null===e}}),r(r.P,"String",{matchAll:function(e){if(o(this),!a(e))throw TypeError(e+" is not a regexp!");var t=String(this),n="flags"in l?String(e.flags):u.call(e),r=new RegExp(e.source,~n.indexOf("g")?n:"g"+n);return r.lastIndex=i(e.lastIndex),new c(r,t)}})},function(e,t,n){n(70)("asyncIterator")},function(e,t,n){n(70)("observable")},function(e,t,n){var r=n(0),o=n(125),i=n(16),a=n(17),u=n(86);r(r.S,"Object",{getOwnPropertyDescriptors:function(e){for(var t,n,r=i(e),l=a.f,c=o(r),s={},f=0;c.length>f;)void 0!==(n=l(r,t=c[f++]))&&u(s,t,n);return s}})},function(e,t,n){var r=n(0),o=n(128)(!1);r(r.S,"Object",{values:function(e){return o(e)}})},function(e,t,n){var r=n(0),o=n(128)(!0);r(r.S,"Object",{entries:function(e){return o(e)}})},function(e,t,n){"use strict";var r=n(0),o=n(10),i=n(11),a=n(8);n(7)&&r(r.P+n(65),"Object",{__defineGetter__:function(e,t){a.f(o(this),e,{get:i(t),enumerable:!0,configurable:!0})}})},function(e,t,n){"use strict";var r=n(0),o=n(10),i=n(11),a=n(8);n(7)&&r(r.P+n(65),"Object",{__defineSetter__:function(e,t){a.f(o(this),e,{set:i(t),enumerable:!0,configurable:!0})}})},function(e,t,n){"use strict";var r=n(0),o=n(10),i=n(23),a=n(18),u=n(17).f;n(7)&&r(r.P+n(65),"Object",{__lookupGetter__:function(e){var t,n=o(this),r=i(e,!0);do{if(t=u(n,r))return t.get}while(n=a(n))}})},function(e,t,n){"use strict";var r=n(0),o=n(10),i=n(23),a=n(18),u=n(17).f;n(7)&&r(r.P+n(65),"Object",{__lookupSetter__:function(e){var t,n=o(this),r=i(e,!0);do{if(t=u(n,r))return t.set}while(n=a(n))}})},function(e,t,n){var r=n(0);r(r.P+r.R,"Map",{toJSON:n(129)("Map")})},function(e,t,n){var r=n(0);r(r.P+r.R,"Set",{toJSON:n(129)("Set")})},function(e,t,n){n(66)("Map")},function(e,t,n){n(66)("Set")},function(e,t,n){n(66)("WeakMap")},function(e,t,n){n(66)("WeakSet")},function(e,t,n){n(67)("Map")},function(e,t,n){n(67)("Set")},function(e,t,n){n(67)("WeakMap")},function(e,t,n){n(67)("WeakSet")},function(e,t,n){var r=n(0);r(r.G,{global:n(2)})},function(e,t,n){var r=n(0);r(r.S,"System",{global:n(2)})},function(e,t,n){var r=n(0),o=n(20);r(r.S,"Error",{isError:function(e){return"Error"===o(e)}})},function(e,t,n){var r=n(0);r(r.S,"Math",{clamp:function(e,t,n){return Math.min(n,Math.max(t,e))}})},function(e,t,n){var r=n(0);r(r.S,"Math",{DEG_PER_RAD:Math.PI/180})},function(e,t,n){var r=n(0),o=180/Math.PI;r(r.S,"Math",{degrees:function(e){return e*o}})},function(e,t,n){var r=n(0),o=n(131),i=n(111);r(r.S,"Math",{fscale:function(e,t,n,r,a){return i(o(e,t,n,r,a))}})},function(e,t,n){var r=n(0);r(r.S,"Math",{iaddh:function(e,t,n,r){var o=e>>>0,i=n>>>0;return(t>>>0)+(r>>>0)+((o&i|(o|i)&~(o+i>>>0))>>>31)|0}})},function(e,t,n){var r=n(0);r(r.S,"Math",{isubh:function(e,t,n,r){var o=e>>>0,i=n>>>0;return(t>>>0)-(r>>>0)-((~o&i|~(o^i)&o-i>>>0)>>>31)|0}})},function(e,t,n){var r=n(0);r(r.S,"Math",{imulh:function(e,t){var n=+e,r=+t,o=65535&n,i=65535&r,a=n>>16,u=r>>16,l=(a*i>>>0)+(o*i>>>16);return a*u+(l>>16)+((o*u>>>0)+(65535&l)>>16)}})},function(e,t,n){var r=n(0);r(r.S,"Math",{RAD_PER_DEG:180/Math.PI})},function(e,t,n){var r=n(0),o=Math.PI/180;r(r.S,"Math",{radians:function(e){return e*o}})},function(e,t,n){var r=n(0);r(r.S,"Math",{scale:n(131)})},function(e,t,n){var r=n(0);r(r.S,"Math",{umulh:function(e,t){var n=+e,r=+t,o=65535&n,i=65535&r,a=n>>>16,u=r>>>16,l=(a*i>>>0)+(o*i>>>16);return a*u+(l>>>16)+((o*u>>>0)+(65535&l)>>>16)}})},function(e,t,n){var r=n(0);r(r.S,"Math",{signbit:function(e){return(e=+e)!=e?e:0==e?1/e==1/0:e>0}})},function(e,t,n){"use strict";var r=n(0),o=n(22),i=n(2),a=n(62),u=n(118);r(r.P+r.R,"Promise",{finally:function(e){var t=a(this,o.Promise||i.Promise),n="function"==typeof e;return this.then(n?function(n){return u(t,e()).then(function(){return n})}:e,n?function(n){return u(t,e()).then(function(){throw n})}:e)}})},function(e,t,n){"use strict";var r=n(0),o=n(93),i=n(117);r(r.S,"Promise",{try:function(e){var t=o.f(this),n=i(e);return(n.e?t.reject:t.resolve)(n.v),t.promise}})},function(e,t,n){var r=n(30),o=n(1),i=r.key,a=r.set;r.exp({defineMetadata:function(e,t,n,r){a(e,t,o(n),i(r))}})},function(e,t,n){var r=n(30),o=n(1),i=r.key,a=r.map,u=r.store;r.exp({deleteMetadata:function(e,t){var n=arguments.length<3?void 0:i(arguments[2]),r=a(o(t),n,!1);if(void 0===r||!r.delete(e))return!1;if(r.size)return!0;var l=u.get(t);return l.delete(n),!!l.size||u.delete(t)}})},function(e,t,n){var r=n(30),o=n(1),i=n(18),a=r.has,u=r.get,l=r.key,c=function(e,t,n){if(a(e,t,n))return u(e,t,n);var r=i(t);return null!==r?c(e,r,n):void 0};r.exp({getMetadata:function(e,t){return c(e,o(t),arguments.length<3?void 0:l(arguments[2]))}})},function(e,t,n){var r=n(121),o=n(130),i=n(30),a=n(1),u=n(18),l=i.keys,c=i.key,s=function(e,t){var n=l(e,t),i=u(e);if(null===i)return n;var a=s(i,t);return a.length?n.length?o(new r(n.concat(a))):a:n};i.exp({getMetadataKeys:function(e){return s(a(e),arguments.length<2?void 0:c(arguments[1]))}})},function(e,t,n){var r=n(30),o=n(1),i=r.get,a=r.key;r.exp({getOwnMetadata:function(e,t){return i(e,o(t),arguments.length<3?void 0:a(arguments[2]))}})},function(e,t,n){var r=n(30),o=n(1),i=r.keys,a=r.key;r.exp({getOwnMetadataKeys:function(e){return i(o(e),arguments.length<2?void 0:a(arguments[1]))}})},function(e,t,n){var r=n(30),o=n(1),i=n(18),a=r.has,u=r.key,l=function(e,t,n){if(a(e,t,n))return!0;var r=i(t);return null!==r&&l(e,r,n)};r.exp({hasMetadata:function(e,t){return l(e,o(t),arguments.length<3?void 0:u(arguments[2]))}})},function(e,t,n){var r=n(30),o=n(1),i=r.has,a=r.key;r.exp({hasOwnMetadata:function(e,t){return i(e,o(t),arguments.length<3?void 0:a(arguments[2]))}})},function(e,t,n){var r=n(30),o=n(1),i=n(11),a=r.key,u=r.set;r.exp({metadata:function(e,t){return function(n,r){u(e,t,(void 0!==r?o:i)(n),a(r))}}})},function(e,t,n){var r=n(0),o=n(92)(),i=n(2).process,a="process"==n(20)(i);r(r.G,{asap:function(e){var t=a&&i.domain;o(t?t.bind(e):e)}})},function(e,t,n){"use strict";var r=n(0),o=n(2),i=n(22),a=n(92)(),u=n(6)("observable"),l=n(11),c=n(1),s=n(41),f=n(43),p=n(13),d=n(42),h=d.RETURN,v=function(e){return null==e?void 0:l(e)},m=function(e){var t=e._c;t&&(e._c=void 0,t())},g=function(e){return void 0===e._o},y=function(e){g(e)||(e._o=void 0,m(e))},b=function(e,t){c(e),this._c=void 0,this._o=e,e=new w(this);try{var n=t(e),r=n;null!=n&&("function"==typeof n.unsubscribe?n=function(){r.unsubscribe()}:l(n),this._c=n)}catch(t){return void e.error(t)}g(this)&&m(this)};b.prototype=f({},{unsubscribe:function(){y(this)}});var w=function(e){this._s=e};w.prototype=f({},{next:function(e){var t=this._s;if(!g(t)){var n=t._o;try{var r=v(n.next);if(r)return r.call(n,e)}catch(e){try{y(t)}finally{throw e}}}},error:function(e){var t=this._s;if(g(t))throw e;var n=t._o;t._o=void 0;try{var r=v(n.error);if(!r)throw e;e=r.call(n,e)}catch(e){try{m(t)}finally{throw e}}return m(t),e},complete:function(e){var t=this._s;if(!g(t)){var n=t._o;t._o=void 0;try{var r=v(n.complete);e=r?r.call(n,e):void 0}catch(e){try{m(t)}finally{throw e}}return m(t),e}}});var x=function(e){s(this,x,"Observable","_f")._f=l(e)};f(x.prototype,{subscribe:function(e){return new b(e,this._f)},forEach:function(e){var t=this;return new(i.Promise||o.Promise)(function(n,r){l(e);var o=t.subscribe({next:function(t){try{return e(t)}catch(e){r(e),o.unsubscribe()}},error:r,complete:n})})}}),f(x,{from:function(e){var t="function"==typeof this?this:x,n=v(c(e)[u]);if(n){var r=c(n.call(e));return r.constructor===t?r:new t(function(e){return r.subscribe(e)})}return new t(function(t){var n=!1;return a(function(){if(!n){try{if(d(e,!1,function(e){if(t.next(e),n)return h})===h)return}catch(e){if(n)throw e;return void t.error(e)}t.complete()}}),function(){n=!0}})},of:function(){for(var e=0,t=arguments.length,n=new Array(t);e<t;)n[e]=arguments[e++];return new("function"==typeof this?this:x)(function(e){var t=!1;return a(function(){if(!t){for(var r=0;r<n.length;++r)if(e.next(n[r]),t)return;e.complete()}}),function(){t=!0}})}}),p(x.prototype,u,function(){return this}),r(r.G,{Observable:x}),n(40)("Observable")},function(e,t,n){var r=n(2),o=n(0),i=n(95),a=[].slice,u=/MSIE .\./.test(i),l=function(e){return function(t,n){var r=arguments.length>2,o=!!r&&a.call(arguments,2);return e(r?function(){("function"==typeof t?t:Function(t)).apply(this,o)}:t,n)}};o(o.G+o.B+o.F*u,{setTimeout:l(r.setTimeout),setInterval:l(r.setInterval)})},function(e,t,n){var r=n(0),o=n(91);r(r.G+r.B,{setImmediate:o.set,clearImmediate:o.clear})},function(e,t,n){for(var r=n(90),o=n(36),i=n(14),a=n(2),u=n(13),l=n(46),c=n(6),s=c("iterator"),f=c("toStringTag"),p=l.Array,d={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},h=o(d),v=0;v<h.length;v++){var m,g=h[v],y=d[g],b=a[g],w=b&&b.prototype;if(w&&(w[s]||u(w,s,p),w[f]||u(w,f,g),l[g]=p,y))for(m in r)w[m]||i(w,m,r[m],!0)}},function(e,t,n){(function(t){!function(t){"use strict";function n(e,t,n,i){var a=t&&t.prototype instanceof o?t:o,u=Object.create(a.prototype),l=new p(i||[]);return u._invoke=function(e,t,n){var o=P;return function(i,a){if(o===C)throw new Error("Generator is already running");if(o===T){if("throw"===i)throw a;return h()}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var l=c(u,n);if(l){if(l===k)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===P)throw o=T,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=C;var s=r(e,t,n);if("normal"===s.type){if(o=n.done?T:_,s.arg===k)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(o=T,n.method="throw",n.arg=s.arg)}}}(e,n,l),u}function r(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}function o(){}function i(){}function a(){}function u(e){["next","throw","return"].forEach(function(t){e[t]=function(e){return this._invoke(t,e)}})}function l(e){function n(t,o,i,a){var u=r(e[t],e,o);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==typeof c&&g.call(c,"__await")?Promise.resolve(c.__await).then(function(e){n("next",e,i,a)},function(e){n("throw",e,i,a)}):Promise.resolve(c).then(function(e){l.value=e,i(l)},a)}a(u.arg)}"object"==typeof t.process&&t.process.domain&&(n=t.process.domain.bind(n));var o;this._invoke=function(e,t){function r(){return new Promise(function(r,o){n(e,t,r,o)})}return o=o?o.then(r,r):r()}}function c(e,t){var n=e.iterator[t.method];if(n===v){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=v,c(e,t),"throw"===t.method))return k;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return k}var o=r(n,e.iterator,t.arg);if("throw"===o.type)return t.method="throw",t.arg=o.arg,t.delegate=null,k;var i=o.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=v),t.delegate=null,k):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,k)}function s(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function f(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function p(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(s,this),this.reset(!0)}function d(e){if(e){var t=e[b];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,r=function t(){for(;++n<e.length;)if(g.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=v,t.done=!0,t};return r.next=r}}return{next:h}}function h(){return{value:v,done:!0}}var v,m=Object.prototype,g=m.hasOwnProperty,y="function"==typeof Symbol?Symbol:{},b=y.iterator||"@@iterator",w=y.asyncIterator||"@@asyncIterator",x=y.toStringTag||"@@toStringTag",S="object"==typeof e,E=t.regeneratorRuntime;if(E)S&&(e.exports=E);else{(E=t.regeneratorRuntime=S?e.exports:{}).wrap=n;var P="suspendedStart",_="suspendedYield",C="executing",T="completed",k={},N={};N[b]=function(){return this};var O=Object.getPrototypeOf,M=O&&O(O(d([])));M&&M!==m&&g.call(M,b)&&(N=M);var I=a.prototype=o.prototype=Object.create(N);i.prototype=I.constructor=a,a.constructor=i,a[x]=i.displayName="GeneratorFunction",E.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===i||"GeneratorFunction"===(t.displayName||t.name))},E.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,a):(e.__proto__=a,x in e||(e[x]="GeneratorFunction")),e.prototype=Object.create(I),e},E.awrap=function(e){return{__await:e}},u(l.prototype),l.prototype[w]=function(){return this},E.AsyncIterator=l,E.async=function(e,t,r,o){var i=new l(n(e,t,r,o));return E.isGeneratorFunction(t)?i:i.next().then(function(e){return e.done?e.value:i.next()})},u(I),I[x]="Generator",I[b]=function(){return this},I.toString=function(){return"[object Generator]"},E.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},E.values=d,p.prototype={constructor:p,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=v,this.done=!1,this.delegate=null,this.method="next",this.arg=v,this.tryEntries.forEach(f),!e)for(var t in this)"t"===t.charAt(0)&&g.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=v)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){function t(t,r){return i.type="throw",i.arg=e,n.next=t,r&&(n.method="next",n.arg=v),!!r}if(this.done)throw e;for(var n=this,r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r],i=o.completion;if("root"===o.tryLoc)return t("end");if(o.tryLoc<=this.prev){var a=g.call(o,"catchLoc"),u=g.call(o,"finallyLoc");if(a&&u){if(this.prev<o.catchLoc)return t(o.catchLoc,!0);if(this.prev<o.finallyLoc)return t(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return t(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return t(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&g.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,k):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),k},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),f(n),k}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;f(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:d(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=v),k}}}}("object"==typeof t?t:"object"==typeof window?window:"object"==typeof self?self:this)}).call(t,n(52))},function(e,t,n){n(342),e.exports=n(22).RegExp.escape},function(e,t,n){var r=n(0),o=n(343)(/[\\^$*+?.()|[\]{}]/g,"\\$&");r(r.S,"RegExp",{escape:function(e){return o(e)}})},function(e,t){e.exports=function(e,t){var n=t===Object(t)?function(e){return t[e]}:t;return function(t){return String(t).replace(e,n)}}},,,,,,,,,function(e,t,n){"use strict";/*
|
2 |
object-assign
|
3 |
(c) Sindre Sorhus
|
4 |
@license MIT
|
5 |
*/
|
6 |
-
var r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,a,u=function(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),l=1;l<arguments.length;l++){for(var c in n=Object(arguments[l]))o.call(n,c)&&(u[c]=n[c]);if(r){a=r(n);for(var s=0;s<a.length;s++)i.call(n,a[s])&&(u[a[s]]=n[a[s]])}}return u}},function(e,t,n){"use strict";var r={}
|
7 |
Copyright (c) 2017 Jed Watson.
|
8 |
Licensed under the MIT License (MIT), see
|
9 |
http://jedwatson.github.io/classnames
|
@@ -13,20 +13,57 @@ var r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.pr
|
|
13 |
Licensed under the MIT License (MIT), see
|
14 |
http://jedwatson.github.io/classnames
|
15 |
*/
|
16 |
-
!function(){"use strict";function n(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var i=typeof r;if("string"===i||"number"===i)e.push(r);else if(Array.isArray(r)&&r.length){var a=n.apply(null,r);a&&e.push(a)}else if("object"===i)for(var u in r)o.call(r,u)&&r[u]&&e.push(u)}}return e.join(" ")}var o={}.hasOwnProperty;void 0!==e&&e.exports?(n.default=n,e.exports=n):void 0===(r=function(){return n}.apply(t,[]))||(e.exports=r)}()},,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";function r(e){this.request=e.request,this.xhr=e.xhr,this.headers=e.headers||{},this.status=e.status||0,this.text=e.text,this.body=e.body,this.contentType=e.contentType,this.isHttpError=e.status>=400}var o=n(379),i=n(380);r.prototype.header=o.prototype.header,r.fromRequest=function(e){return new r(i(e))},e.exports=r},function(e,t,n){"use strict";function r(e){var t="string"==typeof e?{url:e}:e||{};this.method=t.method?t.method.toUpperCase():"GET",this.url=t.url,this.headers=t.headers||{},this.body=t.body,this.timeout=t.timeout||0,this.errorOn404=null==t.errorOn404||t.errorOn404,this.onload=t.onload,this.onerror=t.onerror}r.prototype.abort=function(){if(!this.aborted)return this.aborted=!0,this.xhr.abort(),this},r.prototype.header=function(e,t){var n;for(n in this.headers)if(this.headers.hasOwnProperty(n)&&e.toLowerCase()===n.toLowerCase()){if(1===arguments.length)return this.headers[n];delete this.headers[n];break}if(null!=t)return this.headers[e]=t,t},e.exports=r},function(e,t,n){"use strict";var r=n(354);e.exports=function(e){var t=e.xhr,n={request:e,xhr:t};try{var o,i,a,u={};if(t.getAllResponseHeaders)for(o=t.getAllResponseHeaders().split("\n"),i=0;i<o.length;i++)(a=o[i].match(/\s*([^\s]+):\s+([^\s]+)/))&&(u[a[1]]=a[2]);n=r(n,{status:t.status,contentType:t.contentType||t.getResponseHeader&&t.getResponseHeader("Content-Type"),headers:u,text:t.responseText,body:t.response||t.responseText})}catch(e){}return n}},function(e,t,n){"use strict";e.exports=function(e){var t,n=!1;return function(){return n||(n=!0,t=e.apply(this,arguments)),t}}},,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";var r=n(5),o=n.n(r),i=n(53),a=n.n(i),u=n(424),l=n.n(u),c=n(429),s=n.n(c),f=n(431),p=function(){return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{!r&&u.return&&u.return()}finally{if(o)throw i}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),d=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),h=l.a.use(s.a),v={PENDING:"pending",LOADING:"loading",LOADED:"loaded",FAILED:"failed",UNSUPPORTED:"unsupported"},m={},g={},y=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.handleLoad=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];e?n.fail(e):n.isActive&&n.setState({loadedText:t.text,status:v.LOADED},function(){n.props.onLoad(n.props.src,r)})},n.state={status:v.PENDING},n.isActive=!1,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,o.a.PureComponent),d(t,[{key:"componentWillMount",value:function(){this.isActive=!0}},{key:"componentDidMount",value:function(){this.state.status===v.PENDING&&(this.props.supportTest()?this.props.src?this.startLoad():this.fail(Object(f.a)("Missing source")):this.fail(Object(f.e)()))}},{key:"componentDidUpdate",value:function(e){e.src!==this.props.src&&(this.props.src?this.startLoad():this.fail(Object(f.a)("Missing source")))}},{key:"componentWillUnmount",value:function(){this.isActive=!1}},{key:"getFile",value:function(e){var t=this,n=this.props,r=n.cacheGetRequests,o=n.src;if(r){if(g[o]){var i=p(g[o],2),a=i[0],u=i[1];e(a,u,!0)}m[o]||(m[o]=[],h.get(o,function(e,n){m[o].forEach(function(r){g[o]=[e,n],o===t.props.src&&r(e,n)})})),m[o].push(e)}else h.get(o,function(n,r){o===t.props.src&&e(n,r)})}},{key:"fail",value:function(e){var t=this,n=e.isUnsupportedBrowserError?v.UNSUPPORTED:v.FAILED;this.isActive&&this.setState({status:n},function(){"function"==typeof t.props.onError&&t.props.onError(e)})}},{key:"startLoad",value:function(){this.isActive&&this.setState({status:v.LOADING},this.load)}},{key:"load",value:function(){var e=this.props.src.match(/data:image\/svg[^,]*?(;base64)?,(.*)/);return e?this.handleLoad(null,{text:e[1]?atob(e[2]):decodeURIComponent(e[2])}):this.getFile(this.handleLoad)}},{key:"getClassName",value:function(){var e="isvg "+this.state.status;return this.props.className&&(e+=" "+this.props.className),e}},{key:"processSVG",value:function(e){var t=this.props,n=t.uniquifyIDs,r=t.uniqueHash,o=t.baseURL;return n?Object(f.d)(e,r||Object(f.c)(),o):e}},{key:"renderContents",value:function(){switch(this.state.status){case v.UNSUPPORTED:case v.FAILED:return this.props.children;default:return this.props.preloader}}},{key:"render",value:function(){var e=void 0,t=void 0;return this.state.loadedText?t={__html:this.processSVG(this.state.loadedText)}:e=this.renderContents(),this.props.wrapper({style:this.props.style,className:this.getClassName(),dangerouslySetInnerHTML:t},e)}}]),t}();y.propTypes={baseURL:a.a.string,cacheGetRequests:a.a.bool,children:a.a.node,className:a.a.string,onError:a.a.func,onLoad:a.a.func,preloader:a.a.node,src:a.a.string.isRequired,style:a.a.object,supportTest:a.a.func,uniqueHash:a.a.string,uniquifyIDs:a.a.bool,wrapper:a.a.func},y.defaultProps={baseURL:"",cacheGetRequests:!1,onLoad:function(){},supportTest:f.b,uniquifyIDs:!0,wrapper:o.a.createFactory("span")},t.a=y},,,,,,function(e,t,n){"use strict";function r(e){for(var t=arguments.length-1,n="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=0;r<t;r++)n+="&args[]="+encodeURIComponent(arguments[r+1]);yr(!1,"Minified React error #"+e+"; visit %s for the full message or use the non-minified dev environment for full errors and additional helpful warnings. ",n)}function o(){if(kr)for(var e in Nr){var t=Nr[e],n=kr.indexOf(e);if(-1<n||r("96",e),!Or[n])for(var o in t.extractEvents||r("97",e),Or[n]=t,n=t.eventTypes){var a=void 0,u=n[o],l=t,c=o;Mr.hasOwnProperty(c)&&r("99",c),Mr[c]=u;var s=u.phasedRegistrationNames;if(s){for(a in s)s.hasOwnProperty(a)&&i(s[a],l,c);a=!0}else u.registrationName?(i(u.registrationName,l,c),a=!0):a=!1;a||r("98",o,e)}}}function i(e,t,n){Ir[e]&&r("100",e),Ir[e]=t,Rr[e]=t.eventTypes[n].dependencies}function a(e){kr&&r("101"),kr=Array.prototype.slice.call(e),o()}function u(e){var t,n=!1;for(t in e)if(e.hasOwnProperty(t)){var i=e[t];Nr.hasOwnProperty(t)&&Nr[t]===i||(Nr[t]&&r("102",t),Nr[t]=i,n=!0)}n&&o()}function l(e,t,n,r){t=e.type||"unknown-event",e.currentTarget=Lr(r),Tr.invokeGuardedCallbackAndCatchFirstError(t,n,void 0,e),e.currentTarget=null}function c(e,t){return null==t&&r("30"),null==e?t:Array.isArray(e)?Array.isArray(t)?(e.push.apply(e,t),e):(e.push(t),e):Array.isArray(t)?[e].concat(t):[e,t]}function s(e,t,n){Array.isArray(e)?e.forEach(t,n):e&&t.call(n,e)}function f(e,t){if(e){var n=e._dispatchListeners,r=e._dispatchInstances;if(Array.isArray(n))for(var o=0;o<n.length&&!e.isPropagationStopped();o++)l(e,t,n[o],r[o]);else n&&l(e,t,n,r);e._dispatchListeners=null,e._dispatchInstances=null,e.isPersistent()||e.constructor.release(e)}}function p(e){return f(e,!0)}function d(e){return f(e,!1)}function h(e,t){var n=e.stateNode;if(!n)return null;var o=jr(n);if(!o)return null;n=o[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":(o=!o.disabled)||(o=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!o;break e;default:e=!1}return e?null:(n&&"function"!=typeof n&&r("231",t,typeof n),n)}function v(e,t){null!==e&&(Ar=c(Ar,e)),e=Ar,Ar=null,e&&(t?s(e,p):s(e,d),Ar&&r("95"),Tr.rethrowCaughtError())}function m(e,t,n,r){for(var o=null,i=0;i<Or.length;i++){var a=Or[i];a&&(a=a.extractEvents(e,t,n,r))&&(o=c(o,a))}v(o,!1)}function g(e){if(e[Br])return e[Br];for(;!e[Br];){if(!e.parentNode)return null;e=e.parentNode}return 5===(e=e[Br]).tag||6===e.tag?e:null}function y(e){if(5===e.tag||6===e.tag)return e.stateNode;r("33")}function b(e){return e[Vr]||null}function w(e){do{e=e.return}while(e&&5!==e.tag);return e||null}function x(e,t,n){for(var r=[];e;)r.push(e),e=w(e);for(e=r.length;0<e--;)t(r[e],"captured",n);for(e=0;e<r.length;e++)t(r[e],"bubbled",n)}function S(e,t,n){(t=h(e,n.dispatchConfig.phasedRegistrationNames[t]))&&(n._dispatchListeners=c(n._dispatchListeners,t),n._dispatchInstances=c(n._dispatchInstances,e))}function E(e){e&&e.dispatchConfig.phasedRegistrationNames&&x(e._targetInst,S,e)}function P(e){if(e&&e.dispatchConfig.phasedRegistrationNames){var t=e._targetInst;x(t=t?w(t):null,S,e)}}function _(e,t,n){e&&n&&n.dispatchConfig.registrationName&&(t=h(e,n.dispatchConfig.registrationName))&&(n._dispatchListeners=c(n._dispatchListeners,t),n._dispatchInstances=c(n._dispatchInstances,e))}function C(e){e&&e.dispatchConfig.registrationName&&_(e._targetInst,null,e)}function T(e){s(e,E)}function k(e,t,n,r){if(n&&r)e:{for(var o=n,i=r,a=0,u=o;u;u=w(u))a++;u=0;for(var l=i;l;l=w(l))u++;for(;0<a-u;)o=w(o),a--;for(;0<u-a;)i=w(i),u--;for(;a--;){if(o===i||o===i.alternate)break e;o=w(o),i=w(i)}o=null}else o=null;for(i=o,o=[];n&&n!==i&&(null===(a=n.alternate)||a!==i);)o.push(n),n=w(n);for(n=[];r&&r!==i&&(null===(a=r.alternate)||a!==i);)n.push(r),r=w(r);for(r=0;r<o.length;r++)_(o[r],"bubbled",e);for(e=n.length;0<e--;)_(n[e],"captured",t)}function N(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n["ms"+e]="MS"+t,n["O"+e]="o"+t.toLowerCase(),n}function O(e){if(qr[e])return qr[e];if(!Kr[e])return e;var t,n=Kr[e];for(t in n)if(n.hasOwnProperty(t)&&t in Zr)return qr[e]=n[t];return e}function M(){return!eo&&wr.canUseDOM&&(eo="textContent"in document.documentElement?"textContent":"innerText"),eo}function I(){if(to._fallbackText)return to._fallbackText;var e,t,n=to._startText,r=n.length,o=R(),i=o.length;for(e=0;e<r&&n[e]===o[e];e++);var a=r-e;for(t=1;t<=a&&n[r-t]===o[i-t];t++);return to._fallbackText=o.slice(e,1<t?1-t:void 0),to._fallbackText}function R(){return"value"in to._root?to._root.value:to._root[M()]}function F(e,t,n,r){for(var o in this.dispatchConfig=e,this._targetInst=t,this.nativeEvent=n,e=this.constructor.Interface)e.hasOwnProperty(o)&&((t=e[o])?this[o]=t(n):"target"===o?this.target=r:this[o]=n[o]);return this.isDefaultPrevented=(null!=n.defaultPrevented?n.defaultPrevented:!1===n.returnValue)?Sr.thatReturnsTrue:Sr.thatReturnsFalse,this.isPropagationStopped=Sr.thatReturnsFalse,this}function j(e,t,n,r){if(this.eventPool.length){var o=this.eventPool.pop();return this.call(o,e,t,n,r),o}return new this(e,t,n,r)}function D(e){e instanceof this||r("223"),e.destructor(),10>this.eventPool.length&&this.eventPool.push(e)}function L(e){e.eventPool=[],e.getPooled=j,e.release=D}function A(e,t){switch(e){case"keyup":return-1!==ao.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"blur":return!0;default:return!1}}function z(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}function U(e){if(e=Dr(e)){go&&"function"==typeof go.restoreControlledState||r("194");var t=jr(e.stateNode);go.restoreControlledState(e.stateNode,e.type,t)}}function W(e){bo?wo?wo.push(e):wo=[e]:bo=e}function B(){return null!==bo||null!==wo}function V(){if(bo){var e=bo,t=wo;if(wo=bo=null,U(e),t)for(e=0;e<t.length;e++)U(t[e])}}function H(e,t){return e(t)}function G(e,t,n){return e(t,n)}function K(){}function q(e,t){if(So)return e(t);So=!0;try{return H(e,t)}finally{So=!1,B()&&(K(),V())}}function Z(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!Eo[e.type]:"textarea"===t}function J(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}function X(e,t){return!(!wr.canUseDOM||t&&!("addEventListener"in document))&&((t=(e="on"+e)in document)||((t=document.createElement("div")).setAttribute(e,"return;"),t="function"==typeof t[e]),t)}function $(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function Q(e){e._valueTracker||(e._valueTracker=function(e){var t=$(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&void 0!==n&&"function"==typeof n.get&&"function"==typeof n.set){var o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(e){r=""+e,i.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function Y(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=$(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function ee(e){return null===e||void 0===e?null:"function"==typeof(e=Do&&e[Do]||e["@@iterator"])?e:null}function te(e){var t=e.type;if("function"==typeof t)return t.displayName||t.name;if("string"==typeof t)return t;switch(t){case Ro:return"AsyncMode";case Io:return"Context.Consumer";case ko:return"ReactFragment";case To:return"ReactPortal";case Oo:return"Profiler("+e.pendingProps.id+")";case Mo:return"Context.Provider";case No:return"StrictMode";case jo:return"Timeout"}if("object"==typeof t&&null!==t)switch(t.$$typeof){case Fo:return""!==(e=t.render.displayName||t.render.name||"")?"ForwardRef("+e+")":"ForwardRef"}return null}function ne(e){var t="";do{e:switch(e.tag){case 0:case 1:case 2:case 5:var n=e._debugOwner,r=e._debugSource,o=te(e),i=null;n&&(i=te(n)),n=r,o="\n in "+(o||"Unknown")+(n?" (at "+n.fileName.replace(/^.*[\\\/]/,"")+":"+n.lineNumber+")":i?" (created by "+i+")":"");break e;default:o=""}t+=o,e=e.return}while(e);return t}function re(e,t,n,r,o){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t}function oe(e){return e[1].toUpperCase()}function ie(e,t,n,r){var o=Uo.hasOwnProperty(t)?Uo[t]:null;(null!==o?0===o.type:!r&&(2<t.length&&("o"===t[0]||"O"===t[0])&&("n"===t[1]||"N"===t[1])))||(function(e,t,n,r){if(null===t||void 0===t||function(e,t,n,r){if(null!==n&&0===n.type)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return!r&&(null!==n?!n.acceptsBooleans:"data-"!==(e=e.toLowerCase().slice(0,5))&&"aria-"!==e);default:return!1}}(e,t,n,r))return!0;if(r)return!1;if(null!==n)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}(t,n,o,r)&&(n=null),r||null===o?function(e){return!!zo.hasOwnProperty(e)||!Ao.hasOwnProperty(e)&&(Lo.test(e)?zo[e]=!0:(Ao[e]=!0,!1))}(t)&&(null===n?e.removeAttribute(t):e.setAttribute(t,""+n)):o.mustUseProperty?e[o.propertyName]=null===n?3!==o.type&&"":n:(t=o.attributeName,r=o.attributeNamespace,null===n?e.removeAttribute(t):(n=3===(o=o.type)||4===o&&!0===n?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}function ae(e,t){var n=t.checked;return xr({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=n?n:e._wrapperState.initialChecked})}function ue(e,t){var n=null==t.defaultValue?"":t.defaultValue,r=null!=t.checked?t.checked:t.defaultChecked;n=pe(null!=t.value?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function le(e,t){null!=(t=t.checked)&&ie(e,"checked",t,!1)}function ce(e,t){le(e,t);var n=pe(t.value);null!=n&&("number"===t.type?(0===n&&""===e.value||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n)),t.hasOwnProperty("value")?fe(e,t.type,n):t.hasOwnProperty("defaultValue")&&fe(e,t.type,pe(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function se(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){t=""+e._wrapperState.initialValue;var r=e.value;n||t===r||(e.value=t),e.defaultValue=t}""!==(n=e.name)&&(e.name=""),e.defaultChecked=!e.defaultChecked,e.defaultChecked=!e.defaultChecked,""!==n&&(e.name=n)}function fe(e,t,n){"number"===t&&e.ownerDocument.activeElement===e||(null==n?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}function pe(e){switch(typeof e){case"boolean":case"number":case"object":case"string":case"undefined":return e;default:return""}}function de(e,t,n){return(e=F.getPooled(Bo.change,e,t,n)).type="change",W(n),T(e),e}function he(e){v(e,!1)}function ve(e){if(Y(y(e)))return e}function me(e,t){if("change"===e)return t}function ge(){Vo&&(Vo.detachEvent("onpropertychange",ye),Ho=Vo=null)}function ye(e){"value"===e.propertyName&&ve(Ho)&&q(he,e=de(Ho,e,J(e)))}function be(e,t,n){"focus"===e?(ge(),Ho=n,(Vo=t).attachEvent("onpropertychange",ye)):"blur"===e&&ge()}function we(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return ve(Ho)}function xe(e,t){if("click"===e)return ve(t)}function Se(e,t){if("input"===e||"change"===e)return ve(t)}function Ee(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=Zo[e])&&!!t[e]}function Pe(){return Ee}function _e(e){var t=e;if(e.alternate)for(;t.return;)t=t.return;else{if(0!=(2&t.effectTag))return 1;for(;t.return;)if(0!=(2&(t=t.return).effectTag))return 1}return 3===t.tag?2:3}function Ce(e){2!==_e(e)&&r("188")}function Te(e){var t=e.alternate;if(!t)return 3===(t=_e(e))&&r("188"),1===t?null:e;for(var n=e,o=t;;){var i=n.return,a=i?i.alternate:null;if(!i||!a)break;if(i.child===a.child){for(var u=i.child;u;){if(u===n)return Ce(i),e;if(u===o)return Ce(i),t;u=u.sibling}r("188")}if(n.return!==o.return)n=i,o=a;else{u=!1;for(var l=i.child;l;){if(l===n){u=!0,n=i,o=a;break}if(l===o){u=!0,o=i,n=a;break}l=l.sibling}if(!u){for(l=a.child;l;){if(l===n){u=!0,n=a,o=i;break}if(l===o){u=!0,o=a,n=i;break}l=l.sibling}u||r("189")}}n.alternate!==o&&r("190")}return 3!==n.tag&&r("188"),n.stateNode.current===n?e:t}function ke(e){if(!(e=Te(e)))return null;for(var t=e;;){if(5===t.tag||6===t.tag)return t;if(t.child)t.child.return=t,t=t.child;else{if(t===e)break;for(;!t.sibling;){if(!t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}}return null}function Ne(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}function Oe(e,t){var n=e[0],r="on"+((e=e[1])[0].toUpperCase()+e.slice(1));t={phasedRegistrationNames:{bubbled:r,captured:r+"Capture"},dependencies:[n],isInteractive:t},si[e]=t,fi[n]=t}function Me(e){var t=e.targetInst;do{if(!t){e.ancestors.push(t);break}var n;for(n=t;n.return;)n=n.return;if(!(n=3!==n.tag?null:n.stateNode.containerInfo))break;e.ancestors.push(t),t=g(n)}while(t);for(n=0;n<e.ancestors.length;n++)t=e.ancestors[n],m(e.topLevelType,t,e.nativeEvent,J(e.nativeEvent))}function Ie(e){vi=!!e}function Re(e,t){if(!t)return null;var n=(di(e)?je:De).bind(null,e);t.addEventListener(e,n,!1)}function Fe(e,t){if(!t)return null;var n=(di(e)?je:De).bind(null,e);t.addEventListener(e,n,!0)}function je(e,t){G(De,e,t)}function De(e,t){if(vi){var n=J(t);if(null===(n=g(n))||"number"!=typeof n.tag||2===_e(n)||(n=null),hi.length){var r=hi.pop();r.topLevelType=e,r.nativeEvent=t,r.targetInst=n,e=r}else e={topLevelType:e,nativeEvent:t,targetInst:n,ancestors:[]};try{q(Me,e)}finally{e.topLevelType=null,e.nativeEvent=null,e.targetInst=null,e.ancestors.length=0,10>hi.length&&hi.push(e)}}}function Le(e){return Object.prototype.hasOwnProperty.call(e,bi)||(e[bi]=yi++,gi[e[bi]]={}),gi[e[bi]]}function Ae(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function ze(e,t){var n,r=Ae(e);for(e=0;r;){if(3===r.nodeType){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Ae(r)}}function Ue(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}function We(e,t){if(_i||null==Si||Si!==Er())return null;var n=Si;return n="selectionStart"in n&&Ue(n)?{start:n.selectionStart,end:n.selectionEnd}:window.getSelection?{anchorNode:(n=window.getSelection()).anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}:void 0,Pi&&Pr(Pi,n)?null:(Pi=n,(e=F.getPooled(xi.select,Ei,e,t)).type="select",e.target=Si,T(e),e)}function Be(e,t){return e=xr({children:void 0},t),(t=function(e){var t="";return br.Children.forEach(e,function(e){null==e||"string"!=typeof e&&"number"!=typeof e||(t+=e)}),t}(t.children))&&(e.children=t),e}function Ve(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o<n.length;o++)t["$"+n[o]]=!0;for(n=0;n<e.length;n++)o=t.hasOwnProperty("$"+e[n].value),e[n].selected!==o&&(e[n].selected=o),o&&r&&(e[n].defaultSelected=!0)}else{for(n=""+n,t=null,o=0;o<e.length;o++){if(e[o].value===n)return e[o].selected=!0,void(r&&(e[o].defaultSelected=!0));null!==t||e[o].disabled||(t=e[o])}null!==t&&(t.selected=!0)}}function He(e,t){var n=t.value;e._wrapperState={initialValue:null!=n?n:t.defaultValue,wasMultiple:!!t.multiple}}function Ge(e,t){return null!=t.dangerouslySetInnerHTML&&r("91"),xr({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Ke(e,t){var n=t.value;null==n&&(n=t.defaultValue,null!=(t=t.children)&&(null!=n&&r("92"),Array.isArray(t)&&(1>=t.length||r("93"),t=t[0]),n=""+t),null==n&&(n="")),e._wrapperState={initialValue:""+n}}function qe(e,t){var n=t.value;null!=n&&((n=""+n)!==e.value&&(e.value=n),null==t.defaultValue&&(e.defaultValue=n)),null!=t.defaultValue&&(e.defaultValue=t.defaultValue)}function Ze(e){var t=e.textContent;t===e._wrapperState.initialValue&&(e.value=t)}function Je(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Xe(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?Je(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}function $e(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}function Qe(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=0===n.indexOf("--"),o=n,i=t[n];o=null==i||"boolean"==typeof i||""===i?"":r||"number"!=typeof i||0===i||Yi.hasOwnProperty(o)&&Yi[o]?(""+i).trim():i+"px","float"===n&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}function Ye(e,t,n){t&&(ta[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML)&&r("137",e,n()),null!=t.dangerouslySetInnerHTML&&(null!=t.children&&r("60"),"object"==typeof t.dangerouslySetInnerHTML&&"__html"in t.dangerouslySetInnerHTML||r("61")),null!=t.style&&"object"!=typeof t.style&&r("62",n()))}function et(e,t){if(-1===e.indexOf("-"))return"string"==typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}function tt(e,t){var n=Le(e=9===e.nodeType||11===e.nodeType?e:e.ownerDocument);t=Rr[t];for(var r=0;r<t.length;r++){var o=t[r];if(!n.hasOwnProperty(o)||!n[o]){switch(o){case"scroll":Fe("scroll",e);break;case"focus":case"blur":Fe("focus",e),Fe("blur",e),n.blur=!0,n.focus=!0;break;case"cancel":case"close":X(o,!0)&&Fe(o,e);break;case"invalid":case"submit":case"reset":break;default:-1===Yr.indexOf(o)&&Re(o,e)}n[o]=!0}}}function nt(e,t,n,r){return n=9===n.nodeType?n:n.ownerDocument,r===Xi.html&&(r=Je(e)),r===Xi.html?"script"===e?((e=n.createElement("div")).innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):e="string"==typeof t.is?n.createElement(e,{is:t.is}):n.createElement(e):e=n.createElementNS(r,e),e}function rt(e,t){return(9===t.nodeType?t:t.ownerDocument).createTextNode(e)}function ot(e,t,n,r){var o=et(t,n);switch(t){case"iframe":case"object":Re("load",e);var i=n;break;case"video":case"audio":for(i=0;i<Yr.length;i++)Re(Yr[i],e);i=n;break;case"source":Re("error",e),i=n;break;case"img":case"image":case"link":Re("error",e),Re("load",e),i=n;break;case"form":Re("reset",e),Re("submit",e),i=n;break;case"details":Re("toggle",e),i=n;break;case"input":ue(e,n),i=ae(e,n),Re("invalid",e),tt(r,"onChange");break;case"option":i=Be(e,n);break;case"select":He(e,n),i=xr({},n,{value:void 0}),Re("invalid",e),tt(r,"onChange");break;case"textarea":Ke(e,n),i=Ge(e,n),Re("invalid",e),tt(r,"onChange");break;default:i=n}Ye(t,i,na);var a,u=i;for(a in u)if(u.hasOwnProperty(a)){var l=u[a];"style"===a?Qe(e,l):"dangerouslySetInnerHTML"===a?null!=(l=l?l.__html:void 0)&&Qi(e,l):"children"===a?"string"==typeof l?("textarea"!==t||""!==l)&&$e(e,l):"number"==typeof l&&$e(e,""+l):"suppressContentEditableWarning"!==a&&"suppressHydrationWarning"!==a&&"autoFocus"!==a&&(Ir.hasOwnProperty(a)?null!=l&&tt(r,a):null!=l&&ie(e,a,l,o))}switch(t){case"input":Q(e),se(e,n,!1);break;case"textarea":Q(e),Ze(e);break;case"option":null!=n.value&&e.setAttribute("value",n.value);break;case"select":e.multiple=!!n.multiple,null!=(t=n.value)?Ve(e,!!n.multiple,t,!1):null!=n.defaultValue&&Ve(e,!!n.multiple,n.defaultValue,!0);break;default:"function"==typeof i.onClick&&(e.onclick=Sr)}}function it(e,t,n,r,o){var i=null;switch(t){case"input":n=ae(e,n),r=ae(e,r),i=[];break;case"option":n=Be(e,n),r=Be(e,r),i=[];break;case"select":n=xr({},n,{value:void 0}),r=xr({},r,{value:void 0}),i=[];break;case"textarea":n=Ge(e,n),r=Ge(e,r),i=[];break;default:"function"!=typeof n.onClick&&"function"==typeof r.onClick&&(e.onclick=Sr)}Ye(t,r,na),t=e=void 0;var a=null;for(e in n)if(!r.hasOwnProperty(e)&&n.hasOwnProperty(e)&&null!=n[e])if("style"===e){var u=n[e];for(t in u)u.hasOwnProperty(t)&&(a||(a={}),a[t]="")}else"dangerouslySetInnerHTML"!==e&&"children"!==e&&"suppressContentEditableWarning"!==e&&"suppressHydrationWarning"!==e&&"autoFocus"!==e&&(Ir.hasOwnProperty(e)?i||(i=[]):(i=i||[]).push(e,null));for(e in r){var l=r[e];if(u=null!=n?n[e]:void 0,r.hasOwnProperty(e)&&l!==u&&(null!=l||null!=u))if("style"===e)if(u){for(t in u)!u.hasOwnProperty(t)||l&&l.hasOwnProperty(t)||(a||(a={}),a[t]="");for(t in l)l.hasOwnProperty(t)&&u[t]!==l[t]&&(a||(a={}),a[t]=l[t])}else a||(i||(i=[]),i.push(e,a)),a=l;else"dangerouslySetInnerHTML"===e?(l=l?l.__html:void 0,u=u?u.__html:void 0,null!=l&&u!==l&&(i=i||[]).push(e,""+l)):"children"===e?u===l||"string"!=typeof l&&"number"!=typeof l||(i=i||[]).push(e,""+l):"suppressContentEditableWarning"!==e&&"suppressHydrationWarning"!==e&&(Ir.hasOwnProperty(e)?(null!=l&&tt(o,e),i||u===l||(i=[])):(i=i||[]).push(e,l))}return a&&(i=i||[]).push("style",a),i}function at(e,t,n,r,o){"input"===n&&"radio"===o.type&&null!=o.name&&le(e,o),et(n,r),r=et(n,o);for(var i=0;i<t.length;i+=2){var a=t[i],u=t[i+1];"style"===a?Qe(e,u):"dangerouslySetInnerHTML"===a?Qi(e,u):"children"===a?$e(e,u):ie(e,a,u,r)}switch(n){case"input":ce(e,o);break;case"textarea":qe(e,o);break;case"select":e._wrapperState.initialValue=void 0,t=e._wrapperState.wasMultiple,e._wrapperState.wasMultiple=!!o.multiple,null!=(n=o.value)?Ve(e,!!o.multiple,n,!1):t!==!!o.multiple&&(null!=o.defaultValue?Ve(e,!!o.multiple,o.defaultValue,!0):Ve(e,!!o.multiple,o.multiple?[]:"",!1))}}function ut(e,t,n,r,o){switch(t){case"iframe":case"object":Re("load",e);break;case"video":case"audio":for(r=0;r<Yr.length;r++)Re(Yr[r],e);break;case"source":Re("error",e);break;case"img":case"image":case"link":Re("error",e),Re("load",e);break;case"form":Re("reset",e),Re("submit",e);break;case"details":Re("toggle",e);break;case"input":ue(e,n),Re("invalid",e),tt(o,"onChange");break;case"select":He(e,n),Re("invalid",e),tt(o,"onChange");break;case"textarea":Ke(e,n),Re("invalid",e),tt(o,"onChange")}for(var i in Ye(t,n,na),r=null,n)if(n.hasOwnProperty(i)){var a=n[i];"children"===i?"string"==typeof a?e.textContent!==a&&(r=["children",a]):"number"==typeof a&&e.textContent!==""+a&&(r=["children",""+a]):Ir.hasOwnProperty(i)&&null!=a&&tt(o,i)}switch(t){case"input":Q(e),se(e,n,!0);break;case"textarea":Q(e),Ze(e);break;case"select":case"option":break;default:"function"==typeof n.onClick&&(e.onclick=Sr)}return r}function lt(e,t){return e.nodeValue!==t}function ct(e,t){switch(e){case"button":case"input":case"select":case"textarea":return!!t.autoFocus}return!1}function st(e,t){return"textarea"===e||"string"==typeof t.children||"number"==typeof t.children||"object"==typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&"string"==typeof t.dangerouslySetInnerHTML.__html}function ft(e){for(e=e.nextSibling;e&&1!==e.nodeType&&3!==e.nodeType;)e=e.nextSibling;return e}function pt(e){for(e=e.firstChild;e&&1!==e.nodeType&&3!==e.nodeType;)e=e.nextSibling;return e}function dt(e){return{current:e}}function ht(e){0>sa||(e.current=ca[sa],ca[sa]=null,sa--)}function vt(e,t){ca[++sa]=e.current,e.current=t}function mt(e){return yt(e)?da:fa.current}function gt(e,t){var n=e.type.contextTypes;if(!n)return Cr;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o,i={};for(o in n)i[o]=t[o];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function yt(e){return 2===e.tag&&null!=e.type.childContextTypes}function bt(e){yt(e)&&(ht(pa),ht(fa))}function wt(e){ht(pa),ht(fa)}function xt(e,t,n){fa.current!==Cr&&r("168"),vt(fa,t),vt(pa,n)}function St(e,t){var n=e.stateNode,o=e.type.childContextTypes;if("function"!=typeof n.getChildContext)return t;for(var i in n=n.getChildContext())i in o||r("108",te(e)||"Unknown",i);return xr({},t,n)}function Et(e){if(!yt(e))return!1;var t=e.stateNode;return t=t&&t.__reactInternalMemoizedMergedChildContext||Cr,da=fa.current,vt(fa,t),vt(pa,pa.current),!0}function Pt(e,t){var n=e.stateNode;if(n||r("169"),t){var o=St(e,da);n.__reactInternalMemoizedMergedChildContext=o,ht(pa),ht(fa),vt(fa,o)}else ht(pa);vt(pa,t)}function _t(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=null,this.index=0,this.ref=null,this.pendingProps=t,this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.effectTag=0,this.lastEffect=this.firstEffect=this.nextEffect=null,this.expirationTime=0,this.alternate=null}function Ct(e,t,n){var r=e.alternate;return null===r?((r=new _t(e.tag,t,e.key,e.mode)).type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.effectTag=0,r.nextEffect=null,r.firstEffect=null,r.lastEffect=null),r.expirationTime=n,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function Tt(e,t,n){var o=e.type,i=e.key;if(e=e.props,"function"==typeof o)var a=o.prototype&&o.prototype.isReactComponent?2:0;else if("string"==typeof o)a=5;else switch(o){case ko:return kt(e.children,t,n,i);case Ro:a=11,t|=3;break;case No:a=11,t|=2;break;case Oo:return(o=new _t(15,e,i,4|t)).type=Oo,o.expirationTime=n,o;case jo:a=16,t|=2;break;default:e:{switch("object"==typeof o&&null!==o?o.$$typeof:null){case Mo:a=13;break e;case Io:a=12;break e;case Fo:a=14;break e;default:r("130",null==o?o:typeof o,"")}a=void 0}}return(t=new _t(a,e,i,t)).type=o,t.expirationTime=n,t}function kt(e,t,n,r){return(e=new _t(10,e,r,t)).expirationTime=n,e}function Nt(e,t,n){return(e=new _t(6,e,null,t)).expirationTime=n,e}function Ot(e,t,n){return(t=new _t(4,null!==e.children?e.children:[],e.key,t)).expirationTime=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Mt(e,t,n){return e={current:t=new _t(3,null,null,t?3:0),containerInfo:e,pendingChildren:null,earliestPendingTime:0,latestPendingTime:0,earliestSuspendedTime:0,latestSuspendedTime:0,latestPingedTime:0,pendingCommitExpirationTime:0,finishedWork:null,context:null,pendingContext:null,hydrate:n,remainingExpirationTime:0,firstBatch:null,nextScheduledRoot:null},t.stateNode=e}function It(e){return function(t){try{return e(t)}catch(e){}}}function Rt(e){"function"==typeof ha&&ha(e)}function Ft(e){"function"==typeof va&&va(e)}function jt(e){return{expirationTime:0,baseState:e,firstUpdate:null,lastUpdate:null,firstCapturedUpdate:null,lastCapturedUpdate:null,firstEffect:null,lastEffect:null,firstCapturedEffect:null,lastCapturedEffect:null}}function Dt(e){return{expirationTime:e.expirationTime,baseState:e.baseState,firstUpdate:e.firstUpdate,lastUpdate:e.lastUpdate,firstCapturedUpdate:null,lastCapturedUpdate:null,firstEffect:null,lastEffect:null,firstCapturedEffect:null,lastCapturedEffect:null}}function Lt(e){return{expirationTime:e,tag:0,payload:null,callback:null,next:null,nextEffect:null}}function At(e,t,n){null===e.lastUpdate?e.firstUpdate=e.lastUpdate=t:(e.lastUpdate.next=t,e.lastUpdate=t),(0===e.expirationTime||e.expirationTime>n)&&(e.expirationTime=n)}function zt(e,t,n){var r=e.alternate;if(null===r){var o=e.updateQueue,i=null;null===o&&(o=e.updateQueue=jt(e.memoizedState))}else o=e.updateQueue,i=r.updateQueue,null===o?null===i?(o=e.updateQueue=jt(e.memoizedState),i=r.updateQueue=jt(r.memoizedState)):o=e.updateQueue=Dt(i):null===i&&(i=r.updateQueue=Dt(o));null===i||o===i?At(o,t,n):null===o.lastUpdate||null===i.lastUpdate?(At(o,t,n),At(i,t,n)):(At(o,t,n),i.lastUpdate=t)}function Ut(e,t,n){var r=e.updateQueue;null===(r=null===r?e.updateQueue=jt(e.memoizedState):Wt(e,r)).lastCapturedUpdate?r.firstCapturedUpdate=r.lastCapturedUpdate=t:(r.lastCapturedUpdate.next=t,r.lastCapturedUpdate=t),(0===r.expirationTime||r.expirationTime>n)&&(r.expirationTime=n)}function Wt(e,t){var n=e.alternate;return null!==n&&t===n.updateQueue&&(t=e.updateQueue=Dt(t)),t}function Bt(e,t,n,r,o,i){switch(n.tag){case 1:return"function"==typeof(e=n.payload)?e.call(i,r,o):e;case 3:e.effectTag=-1025&e.effectTag|64;case 0:if(null===(o="function"==typeof(e=n.payload)?e.call(i,r,o):e)||void 0===o)break;return xr({},r,o);case 2:ma=!0}return r}function Vt(e,t,n,r,o){if(ma=!1,!(0===t.expirationTime||t.expirationTime>o)){for(var i=(t=Wt(e,t)).baseState,a=null,u=0,l=t.firstUpdate,c=i;null!==l;){var s=l.expirationTime;s>o?(null===a&&(a=l,i=c),(0===u||u>s)&&(u=s)):(c=Bt(e,0,l,c,n,r),null!==l.callback&&(e.effectTag|=32,l.nextEffect=null,null===t.lastEffect?t.firstEffect=t.lastEffect=l:(t.lastEffect.nextEffect=l,t.lastEffect=l))),l=l.next}for(s=null,l=t.firstCapturedUpdate;null!==l;){var f=l.expirationTime;f>o?(null===s&&(s=l,null===a&&(i=c)),(0===u||u>f)&&(u=f)):(c=Bt(e,0,l,c,n,r),null!==l.callback&&(e.effectTag|=32,l.nextEffect=null,null===t.lastCapturedEffect?t.firstCapturedEffect=t.lastCapturedEffect=l:(t.lastCapturedEffect.nextEffect=l,t.lastCapturedEffect=l))),l=l.next}null===a&&(t.lastUpdate=null),null===s?t.lastCapturedUpdate=null:e.effectTag|=32,null===a&&null===s&&(i=c),t.baseState=i,t.firstUpdate=a,t.firstCapturedUpdate=s,t.expirationTime=u,e.memoizedState=c}}function Ht(e,t){"function"!=typeof e&&r("191",e),e.call(t)}function Gt(e,t,n){for(null!==t.firstCapturedUpdate&&(null!==t.lastUpdate&&(t.lastUpdate.next=t.firstCapturedUpdate,t.lastUpdate=t.lastCapturedUpdate),t.firstCapturedUpdate=t.lastCapturedUpdate=null),e=t.firstEffect,t.firstEffect=t.lastEffect=null;null!==e;){var r=e.callback;null!==r&&(e.callback=null,Ht(r,n)),e=e.nextEffect}for(e=t.firstCapturedEffect,t.firstCapturedEffect=t.lastCapturedEffect=null;null!==e;)null!==(t=e.callback)&&(e.callback=null,Ht(t,n)),e=e.nextEffect}function Kt(e,t){return{value:e,source:t,stack:ne(t)}}function qt(e){var t=e.type._context;vt(ba,t._changedBits),vt(ya,t._currentValue),vt(ga,e),t._currentValue=e.pendingProps.value,t._changedBits=e.stateNode}function Zt(e){var t=ba.current,n=ya.current;ht(ga),ht(ya),ht(ba),(e=e.type._context)._currentValue=n,e._changedBits=t}function Jt(e){return e===wa&&r("174"),e}function Xt(e,t){vt(Ea,t),vt(Sa,e),vt(xa,wa);var n=t.nodeType;switch(n){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Xe(null,"");break;default:t=Xe(t=(n=8===n?t.parentNode:t).namespaceURI||null,n=n.tagName)}ht(xa),vt(xa,t)}function $t(e){ht(xa),ht(Sa),ht(Ea)}function Qt(e){Sa.current===e&&(ht(xa),ht(Sa))}function Yt(e,t,n){var r=e.memoizedState;r=null===(t=t(n,r))||void 0===t?r:xr({},r,t),e.memoizedState=r,null!==(e=e.updateQueue)&&0===e.expirationTime&&(e.baseState=r)}function en(e,t,n,r,o,i){var a=e.stateNode;return e=e.type,"function"==typeof a.shouldComponentUpdate?a.shouldComponentUpdate(n,o,i):!e.prototype||!e.prototype.isPureReactComponent||(!Pr(t,n)||!Pr(r,o))}function tn(e,t,n,r){e=t.state,"function"==typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,r),"function"==typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Pa.enqueueReplaceState(t,t.state,null)}function nn(e,t){var n=e.type,r=e.stateNode,o=e.pendingProps,i=mt(e);r.props=o,r.state=e.memoizedState,r.refs=Cr,r.context=gt(e,i),null!==(i=e.updateQueue)&&(Vt(e,i,o,r,t),r.state=e.memoizedState),"function"==typeof(i=e.type.getDerivedStateFromProps)&&(Yt(e,i,o),r.state=e.memoizedState),"function"==typeof n.getDerivedStateFromProps||"function"==typeof r.getSnapshotBeforeUpdate||"function"!=typeof r.UNSAFE_componentWillMount&&"function"!=typeof r.componentWillMount||(n=r.state,"function"==typeof r.componentWillMount&&r.componentWillMount(),"function"==typeof r.UNSAFE_componentWillMount&&r.UNSAFE_componentWillMount(),n!==r.state&&Pa.enqueueReplaceState(r,r.state,null),null!==(i=e.updateQueue)&&(Vt(e,i,o,r,t),r.state=e.memoizedState)),"function"==typeof r.componentDidMount&&(e.effectTag|=4)}function rn(e,t,n){if(null!==(e=n.ref)&&"function"!=typeof e&&"object"!=typeof e){if(n._owner){var o=void 0;(n=n._owner)&&(2!==n.tag&&r("110"),o=n.stateNode),o||r("147",e);var i=""+e;return null!==t&&null!==t.ref&&"function"==typeof t.ref&&t.ref._stringRef===i?t.ref:((t=function(e){var t=o.refs===Cr?o.refs={}:o.refs;null===e?delete t[i]:t[i]=e})._stringRef=i,t)}"string"!=typeof e&&r("148"),n._owner||r("254",e)}return e}function on(e,t){"textarea"!==e.type&&r("31","[object Object]"===Object.prototype.toString.call(t)?"object with keys {"+Object.keys(t).join(", ")+"}":t,"")}function an(e){function t(t,n){if(e){var r=t.lastEffect;null!==r?(r.nextEffect=n,t.lastEffect=n):t.firstEffect=t.lastEffect=n,n.nextEffect=null,n.effectTag=8}}function n(n,r){if(!e)return null;for(;null!==r;)t(n,r),r=r.sibling;return null}function o(e,t){for(e=new Map;null!==t;)null!==t.key?e.set(t.key,t):e.set(t.index,t),t=t.sibling;return e}function i(e,t,n){return(e=Ct(e,t,n)).index=0,e.sibling=null,e}function a(t,n,r){return t.index=r,e?null!==(r=t.alternate)?(r=r.index)<n?(t.effectTag=2,n):r:(t.effectTag=2,n):n}function u(t){return e&&null===t.alternate&&(t.effectTag=2),t}function l(e,t,n,r){return null===t||6!==t.tag?((t=Nt(n,e.mode,r)).return=e,t):((t=i(t,n,r)).return=e,t)}function c(e,t,n,r){return null!==t&&t.type===n.type?((r=i(t,n.props,r)).ref=rn(e,t,n),r.return=e,r):((r=Tt(n,e.mode,r)).ref=rn(e,t,n),r.return=e,r)}function s(e,t,n,r){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?((t=Ot(n,e.mode,r)).return=e,t):((t=i(t,n.children||[],r)).return=e,t)}function f(e,t,n,r,o){return null===t||10!==t.tag?((t=kt(n,e.mode,r,o)).return=e,t):((t=i(t,n,r)).return=e,t)}function p(e,t,n){if("string"==typeof t||"number"==typeof t)return(t=Nt(""+t,e.mode,n)).return=e,t;if("object"==typeof t&&null!==t){switch(t.$$typeof){case Co:return(n=Tt(t,e.mode,n)).ref=rn(e,null,t),n.return=e,n;case To:return(t=Ot(t,e.mode,n)).return=e,t}if(_a(t)||ee(t))return(t=kt(t,e.mode,n,null)).return=e,t;on(e,t)}return null}function d(e,t,n,r){var o=null!==t?t.key:null;if("string"==typeof n||"number"==typeof n)return null!==o?null:l(e,t,""+n,r);if("object"==typeof n&&null!==n){switch(n.$$typeof){case Co:return n.key===o?n.type===ko?f(e,t,n.props.children,r,o):c(e,t,n,r):null;case To:return n.key===o?s(e,t,n,r):null}if(_a(n)||ee(n))return null!==o?null:f(e,t,n,r,null);on(e,n)}return null}function h(e,t,n,r,o){if("string"==typeof r||"number"==typeof r)return l(t,e=e.get(n)||null,""+r,o);if("object"==typeof r&&null!==r){switch(r.$$typeof){case Co:return e=e.get(null===r.key?n:r.key)||null,r.type===ko?f(t,e,r.props.children,o,r.key):c(t,e,r,o);case To:return s(t,e=e.get(null===r.key?n:r.key)||null,r,o)}if(_a(r)||ee(r))return f(t,e=e.get(n)||null,r,o,null);on(t,r)}return null}function v(r,i,u,l){for(var c=null,s=null,f=i,v=i=0,m=null;null!==f&&v<u.length;v++){f.index>v?(m=f,f=null):m=f.sibling;var g=d(r,f,u[v],l);if(null===g){null===f&&(f=m);break}e&&f&&null===g.alternate&&t(r,f),i=a(g,i,v),null===s?c=g:s.sibling=g,s=g,f=m}if(v===u.length)return n(r,f),c;if(null===f){for(;v<u.length;v++)(f=p(r,u[v],l))&&(i=a(f,i,v),null===s?c=f:s.sibling=f,s=f);return c}for(f=o(r,f);v<u.length;v++)(m=h(f,r,v,u[v],l))&&(e&&null!==m.alternate&&f.delete(null===m.key?v:m.key),i=a(m,i,v),null===s?c=m:s.sibling=m,s=m);return e&&f.forEach(function(e){return t(r,e)}),c}function m(i,u,l,c){var s=ee(l);"function"!=typeof s&&r("150"),null==(l=s.call(l))&&r("151");for(var f=s=null,v=u,m=u=0,g=null,y=l.next();null!==v&&!y.done;m++,y=l.next()){v.index>m?(g=v,v=null):g=v.sibling;var b=d(i,v,y.value,c);if(null===b){v||(v=g);break}e&&v&&null===b.alternate&&t(i,v),u=a(b,u,m),null===f?s=b:f.sibling=b,f=b,v=g}if(y.done)return n(i,v),s;if(null===v){for(;!y.done;m++,y=l.next())null!==(y=p(i,y.value,c))&&(u=a(y,u,m),null===f?s=y:f.sibling=y,f=y);return s}for(v=o(i,v);!y.done;m++,y=l.next())null!==(y=h(v,i,m,y.value,c))&&(e&&null!==y.alternate&&v.delete(null===y.key?m:y.key),u=a(y,u,m),null===f?s=y:f.sibling=y,f=y);return e&&v.forEach(function(e){return t(i,e)}),s}return function(e,o,a,l){var c="object"==typeof a&&null!==a&&a.type===ko&&null===a.key;c&&(a=a.props.children);var s="object"==typeof a&&null!==a;if(s)switch(a.$$typeof){case Co:e:{for(s=a.key,c=o;null!==c;){if(c.key===s){if(10===c.tag?a.type===ko:c.type===a.type){n(e,c.sibling),(o=i(c,a.type===ko?a.props.children:a.props,l)).ref=rn(e,c,a),o.return=e,e=o;break e}n(e,c);break}t(e,c),c=c.sibling}a.type===ko?((o=kt(a.props.children,e.mode,l,a.key)).return=e,e=o):((l=Tt(a,e.mode,l)).ref=rn(e,o,a),l.return=e,e=l)}return u(e);case To:e:{for(c=a.key;null!==o;){if(o.key===c){if(4===o.tag&&o.stateNode.containerInfo===a.containerInfo&&o.stateNode.implementation===a.implementation){n(e,o.sibling),(o=i(o,a.children||[],l)).return=e,e=o;break e}n(e,o);break}t(e,o),o=o.sibling}(o=Ot(a,e.mode,l)).return=e,e=o}return u(e)}if("string"==typeof a||"number"==typeof a)return a=""+a,null!==o&&6===o.tag?(n(e,o.sibling),(o=i(o,a,l)).return=e,e=o):(n(e,o),(o=Nt(a,e.mode,l)).return=e,e=o),u(e);if(_a(a))return v(e,o,a,l);if(ee(a))return m(e,o,a,l);if(s&&on(e,a),void 0===a&&!c)switch(e.tag){case 2:case 1:r("152",(l=e.type).displayName||l.name||"Component")}return n(e,o)}}function un(e,t){var n=new _t(5,null,null,0);n.type="DELETED",n.stateNode=t,n.return=e,n.effectTag=8,null!==e.lastEffect?(e.lastEffect.nextEffect=n,e.lastEffect=n):e.firstEffect=e.lastEffect=n}function ln(e,t){switch(e.tag){case 5:var n=e.type;return null!==(t=1!==t.nodeType||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t)&&(e.stateNode=t,!0);case 6:return null!==(t=""===e.pendingProps||3!==t.nodeType?null:t)&&(e.stateNode=t,!0);default:return!1}}function cn(e){if(Oa){var t=Na;if(t){var n=t;if(!ln(e,t)){if(!(t=ft(n))||!ln(e,t))return e.effectTag|=2,Oa=!1,void(ka=e);un(ka,n)}ka=e,Na=pt(t)}else e.effectTag|=2,Oa=!1,ka=e}}function sn(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag;)e=e.return;ka=e}function fn(e){if(e!==ka)return!1;if(!Oa)return sn(e),Oa=!0,!1;var t=e.type;if(5!==e.tag||"head"!==t&&"body"!==t&&!st(t,e.memoizedProps))for(t=Na;t;)un(e,t),t=ft(t);return sn(e),Na=ka?ft(e.stateNode):null,!0}function pn(){Na=ka=null,Oa=!1}function dn(e,t,n){hn(e,t,n,t.expirationTime)}function hn(e,t,n,r){t.child=null===e?Ta(t,null,n,r):Ca(t,e.child,n,r)}function vn(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.effectTag|=128)}function mn(e,t,n,r,o){vn(e,t);var i=0!=(64&t.effectTag);if(!n&&!i)return r&&Pt(t,!1),bn(e,t);n=t.stateNode,Po.current=t;var a=i?null:n.render();return t.effectTag|=1,i&&(hn(e,t,null,o),t.child=null),hn(e,t,a,o),t.memoizedState=n.state,t.memoizedProps=n.props,r&&Pt(t,!0),t.child}function gn(e){var t=e.stateNode;t.pendingContext?xt(0,t.pendingContext,t.pendingContext!==t.context):t.context&&xt(0,t.context,!1),Xt(e,t.containerInfo)}function yn(e,t,n,r){var o=e.child;for(null!==o&&(o.return=e);null!==o;){switch(o.tag){case 12:var i=0|o.stateNode;if(o.type===t&&0!=(i&n)){for(i=o;null!==i;){var a=i.alternate;if(0===i.expirationTime||i.expirationTime>r)i.expirationTime=r,null!==a&&(0===a.expirationTime||a.expirationTime>r)&&(a.expirationTime=r);else{if(null===a||!(0===a.expirationTime||a.expirationTime>r))break;a.expirationTime=r}i=i.return}i=null}else i=o.child;break;case 13:i=o.type===e.type?null:o.child;break;default:i=o.child}if(null!==i)i.return=o;else for(i=o;null!==i;){if(i===e){i=null;break}if(null!==(o=i.sibling)){o.return=i.return,i=o;break}i=i.return}o=i}}function bn(e,t){if(null!==e&&t.child!==e.child&&r("153"),null!==t.child){var n=Ct(e=t.child,e.pendingProps,e.expirationTime);for(t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=Ct(e,e.pendingProps,e.expirationTime)).return=t;n.sibling=null}return t.child}function wn(e,t,n){if(0===t.expirationTime||t.expirationTime>n){switch(t.tag){case 3:gn(t);break;case 2:Et(t);break;case 4:Xt(t,t.stateNode.containerInfo);break;case 13:qt(t)}return null}switch(t.tag){case 0:null!==e&&r("155");var o=t.type,i=t.pendingProps,a=mt(t);return o=o(i,a=gt(t,a)),t.effectTag|=1,"object"==typeof o&&null!==o&&"function"==typeof o.render&&void 0===o.$$typeof?(a=t.type,t.tag=2,t.memoizedState=null!==o.state&&void 0!==o.state?o.state:null,"function"==typeof(a=a.getDerivedStateFromProps)&&Yt(t,a,i),i=Et(t),o.updater=Pa,t.stateNode=o,o._reactInternalFiber=t,nn(t,n),e=mn(e,t,!0,i,n)):(t.tag=1,dn(e,t,o),t.memoizedProps=i,e=t.child),e;case 1:return i=t.type,n=t.pendingProps,pa.current||t.memoizedProps!==n?(i=i(n,o=gt(t,o=mt(t))),t.effectTag|=1,dn(e,t,i),t.memoizedProps=n,e=t.child):e=bn(e,t),e;case 2:if(i=Et(t),null===e)if(null===t.stateNode){var u=t.pendingProps,l=t.type;o=mt(t);var c=2===t.tag&&null!=t.type.contextTypes;u=new l(u,a=c?gt(t,o):Cr),t.memoizedState=null!==u.state&&void 0!==u.state?u.state:null,u.updater=Pa,t.stateNode=u,u._reactInternalFiber=t,c&&((c=t.stateNode).__reactInternalMemoizedUnmaskedChildContext=o,c.__reactInternalMemoizedMaskedChildContext=a),nn(t,n),o=!0}else{l=t.type,o=t.stateNode,c=t.memoizedProps,a=t.pendingProps,o.props=c;var s=o.context;u=gt(t,u=mt(t));var f=l.getDerivedStateFromProps;(l="function"==typeof f||"function"==typeof o.getSnapshotBeforeUpdate)||"function"!=typeof o.UNSAFE_componentWillReceiveProps&&"function"!=typeof o.componentWillReceiveProps||(c!==a||s!==u)&&tn(t,o,a,u),ma=!1;var p=t.memoizedState;s=o.state=p;var d=t.updateQueue;null!==d&&(Vt(t,d,a,o,n),s=t.memoizedState),c!==a||p!==s||pa.current||ma?("function"==typeof f&&(Yt(t,f,a),s=t.memoizedState),(c=ma||en(t,c,a,p,s,u))?(l||"function"!=typeof o.UNSAFE_componentWillMount&&"function"!=typeof o.componentWillMount||("function"==typeof o.componentWillMount&&o.componentWillMount(),"function"==typeof o.UNSAFE_componentWillMount&&o.UNSAFE_componentWillMount()),"function"==typeof o.componentDidMount&&(t.effectTag|=4)):("function"==typeof o.componentDidMount&&(t.effectTag|=4),t.memoizedProps=a,t.memoizedState=s),o.props=a,o.state=s,o.context=u,o=c):("function"==typeof o.componentDidMount&&(t.effectTag|=4),o=!1)}else l=t.type,o=t.stateNode,a=t.memoizedProps,c=t.pendingProps,o.props=a,s=o.context,u=gt(t,u=mt(t)),(l="function"==typeof(f=l.getDerivedStateFromProps)||"function"==typeof o.getSnapshotBeforeUpdate)||"function"!=typeof o.UNSAFE_componentWillReceiveProps&&"function"!=typeof o.componentWillReceiveProps||(a!==c||s!==u)&&tn(t,o,c,u),ma=!1,s=t.memoizedState,p=o.state=s,null!==(d=t.updateQueue)&&(Vt(t,d,c,o,n),p=t.memoizedState),a!==c||s!==p||pa.current||ma?("function"==typeof f&&(Yt(t,f,c),p=t.memoizedState),(f=ma||en(t,a,c,s,p,u))?(l||"function"!=typeof o.UNSAFE_componentWillUpdate&&"function"!=typeof o.componentWillUpdate||("function"==typeof o.componentWillUpdate&&o.componentWillUpdate(c,p,u),"function"==typeof o.UNSAFE_componentWillUpdate&&o.UNSAFE_componentWillUpdate(c,p,u)),"function"==typeof o.componentDidUpdate&&(t.effectTag|=4),"function"==typeof o.getSnapshotBeforeUpdate&&(t.effectTag|=256)):("function"!=typeof o.componentDidUpdate||a===e.memoizedProps&&s===e.memoizedState||(t.effectTag|=4),"function"!=typeof o.getSnapshotBeforeUpdate||a===e.memoizedProps&&s===e.memoizedState||(t.effectTag|=256),t.memoizedProps=c,t.memoizedState=p),o.props=c,o.state=p,o.context=u,o=f):("function"!=typeof o.componentDidUpdate||a===e.memoizedProps&&s===e.memoizedState||(t.effectTag|=4),"function"!=typeof o.getSnapshotBeforeUpdate||a===e.memoizedProps&&s===e.memoizedState||(t.effectTag|=256),o=!1);return mn(e,t,o,i,n);case 3:return gn(t),null!==(i=t.updateQueue)?(o=null!==(o=t.memoizedState)?o.element:null,Vt(t,i,t.pendingProps,null,n),(i=t.memoizedState.element)===o?(pn(),e=bn(e,t)):(o=t.stateNode,(o=(null===e||null===e.child)&&o.hydrate)&&(Na=pt(t.stateNode.containerInfo),ka=t,o=Oa=!0),o?(t.effectTag|=2,t.child=Ta(t,null,i,n)):(pn(),dn(e,t,i)),e=t.child)):(pn(),e=bn(e,t)),e;case 5:return Jt(Ea.current),(i=Jt(xa.current))!==(o=Xe(i,t.type))&&(vt(Sa,t),vt(xa,o)),null===e&&cn(t),i=t.type,c=t.memoizedProps,o=t.pendingProps,a=null!==e?e.memoizedProps:null,pa.current||c!==o||((c=1&t.mode&&!!o.hidden)&&(t.expirationTime=1073741823),c&&1073741823===n)?(c=o.children,st(i,o)?c=null:a&&st(i,a)&&(t.effectTag|=16),vn(e,t),1073741823!==n&&1&t.mode&&o.hidden?(t.expirationTime=1073741823,t.memoizedProps=o,e=null):(dn(e,t,c),t.memoizedProps=o,e=t.child)):e=bn(e,t),e;case 6:return null===e&&cn(t),t.memoizedProps=t.pendingProps,null;case 16:return null;case 4:return Xt(t,t.stateNode.containerInfo),i=t.pendingProps,pa.current||t.memoizedProps!==i?(null===e?t.child=Ca(t,null,i,n):dn(e,t,i),t.memoizedProps=i,e=t.child):e=bn(e,t),e;case 14:return i=t.type.render,n=t.pendingProps,o=t.ref,pa.current||t.memoizedProps!==n||o!==(null!==e?e.ref:null)?(dn(e,t,i=i(n,o)),t.memoizedProps=n,e=t.child):e=bn(e,t),e;case 10:return n=t.pendingProps,pa.current||t.memoizedProps!==n?(dn(e,t,n),t.memoizedProps=n,e=t.child):e=bn(e,t),e;case 11:return n=t.pendingProps.children,pa.current||null!==n&&t.memoizedProps!==n?(dn(e,t,n),t.memoizedProps=n,e=t.child):e=bn(e,t),e;case 15:return n=t.pendingProps,t.memoizedProps===n?e=bn(e,t):(dn(e,t,n.children),t.memoizedProps=n,e=t.child),e;case 13:return function(e,t,n){var r=t.type._context,o=t.pendingProps,i=t.memoizedProps,a=!0;if(pa.current)a=!1;else if(i===o)return t.stateNode=0,qt(t),bn(e,t);var u=o.value;if(t.memoizedProps=o,null===i)u=1073741823;else if(i.value===o.value){if(i.children===o.children&&a)return t.stateNode=0,qt(t),bn(e,t);u=0}else{var l=i.value;if(l===u&&(0!==l||1/l==1/u)||l!=l&&u!=u){if(i.children===o.children&&a)return t.stateNode=0,qt(t),bn(e,t);u=0}else if(u="function"==typeof r._calculateChangedBits?r._calculateChangedBits(l,u):1073741823,0==(u|=0)){if(i.children===o.children&&a)return t.stateNode=0,qt(t),bn(e,t)}else yn(t,r,u,n)}return t.stateNode=u,qt(t),dn(e,t,o.children),t.child}(e,t,n);case 12:e:if(o=t.type,a=t.pendingProps,c=t.memoizedProps,i=o._currentValue,u=o._changedBits,pa.current||0!==u||c!==a){if(t.memoizedProps=a,(void 0===(l=a.unstable_observedBits)||null===l)&&(l=1073741823),t.stateNode=l,0!=(u&l))yn(t,o,u,n);else if(c===a){e=bn(e,t);break e}n=(n=a.children)(i),t.effectTag|=1,dn(e,t,n),e=t.child}else e=bn(e,t);return e;default:r("156")}}function xn(e){e.effectTag|=4}function Sn(e,t){var n=t.pendingProps;switch(t.tag){case 1:return null;case 2:return bt(t),null;case 3:$t(),wt();var o=t.stateNode;return o.pendingContext&&(o.context=o.pendingContext,o.pendingContext=null),(null===e||null===e.child)&&(fn(t),t.effectTag&=-3),Ma(t),null;case 5:Qt(t),o=Jt(Ea.current);var i=t.type;if(null!==e&&null!=t.stateNode){var a=e.memoizedProps,u=t.stateNode,l=Jt(xa.current);u=it(u,i,a,n,o),Ia(e,t,u,i,a,n,o,l),e.ref!==t.ref&&(t.effectTag|=128)}else{if(!n)return null===t.stateNode&&r("166"),null;if(e=Jt(xa.current),fn(t))n=t.stateNode,i=t.type,a=t.memoizedProps,n[Br]=t,n[Vr]=a,o=ut(n,i,a,e,o),t.updateQueue=o,null!==o&&xn(t);else{(e=nt(i,n,o,e))[Br]=t,e[Vr]=n;e:for(a=t.child;null!==a;){if(5===a.tag||6===a.tag)e.appendChild(a.stateNode);else if(4!==a.tag&&null!==a.child){a.child.return=a,a=a.child;continue}if(a===t)break;for(;null===a.sibling;){if(null===a.return||a.return===t)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}ot(e,i,n,o),ct(i,n)&&xn(t),t.stateNode=e}null!==t.ref&&(t.effectTag|=128)}return null;case 6:if(e&&null!=t.stateNode)Ra(e,t,e.memoizedProps,n);else{if("string"!=typeof n)return null===t.stateNode&&r("166"),null;o=Jt(Ea.current),Jt(xa.current),fn(t)?(o=t.stateNode,n=t.memoizedProps,o[Br]=t,lt(o,n)&&xn(t)):((o=rt(n,o))[Br]=t,t.stateNode=o)}return null;case 14:case 16:case 10:case 11:case 15:return null;case 4:return $t(),Ma(t),null;case 13:return Zt(t),null;case 12:return null;case 0:r("167");default:r("156")}}function En(e,t){var n=t.source;null===t.stack&&null!==n&&ne(n),null!==n&&te(n),t=t.value,null!==e&&2===e.tag&&te(e);try{t&&t.suppressReactErrorLogging||console.error(t)}catch(e){e&&e.suppressReactErrorLogging||console.error(e)}}function Pn(e){var t=e.ref;if(null!==t)if("function"==typeof t)try{t(null)}catch(t){An(e,t)}else t.current=null}function _n(e){switch(Ft(e),e.tag){case 2:Pn(e);var t=e.stateNode;if("function"==typeof t.componentWillUnmount)try{t.props=e.memoizedProps,t.state=e.memoizedState,t.componentWillUnmount()}catch(t){An(e,t)}break;case 5:Pn(e);break;case 4:kn(e)}}function Cn(e){return 5===e.tag||3===e.tag||4===e.tag}function Tn(e){e:{for(var t=e.return;null!==t;){if(Cn(t)){var n=t;break e}t=t.return}r("160"),n=void 0}var o=t=void 0;switch(n.tag){case 5:t=n.stateNode,o=!1;break;case 3:case 4:t=n.stateNode.containerInfo,o=!0;break;default:r("161")}16&n.effectTag&&($e(t,""),n.effectTag&=-17);e:t:for(n=e;;){for(;null===n.sibling;){if(null===n.return||Cn(n.return)){n=null;break e}n=n.return}for(n.sibling.return=n.return,n=n.sibling;5!==n.tag&&6!==n.tag;){if(2&n.effectTag)continue t;if(null===n.child||4===n.tag)continue t;n.child.return=n,n=n.child}if(!(2&n.effectTag)){n=n.stateNode;break e}}for(var i=e;;){if(5===i.tag||6===i.tag)if(n)if(o){var a=t,u=i.stateNode,l=n;8===a.nodeType?a.parentNode.insertBefore(u,l):a.insertBefore(u,l)}else t.insertBefore(i.stateNode,n);else o?(a=t,u=i.stateNode,8===a.nodeType?a.parentNode.insertBefore(u,a):a.appendChild(u)):t.appendChild(i.stateNode);else if(4!==i.tag&&null!==i.child){i.child.return=i,i=i.child;continue}if(i===e)break;for(;null===i.sibling;){if(null===i.return||i.return===e)return;i=i.return}i.sibling.return=i.return,i=i.sibling}}function kn(e){for(var t=e,n=!1,o=void 0,i=void 0;;){if(!n){n=t.return;e:for(;;){switch(null===n&&r("160"),n.tag){case 5:o=n.stateNode,i=!1;break e;case 3:case 4:o=n.stateNode.containerInfo,i=!0;break e}n=n.return}n=!0}if(5===t.tag||6===t.tag){e:for(var a=t,u=a;;)if(_n(u),null!==u.child&&4!==u.tag)u.child.return=u,u=u.child;else{if(u===a)break;for(;null===u.sibling;){if(null===u.return||u.return===a)break e;u=u.return}u.sibling.return=u.return,u=u.sibling}i?(a=o,u=t.stateNode,8===a.nodeType?a.parentNode.removeChild(u):a.removeChild(u)):o.removeChild(t.stateNode)}else if(4===t.tag?o=t.stateNode.containerInfo:_n(t),null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return;4===(t=t.return).tag&&(n=!1)}t.sibling.return=t.return,t=t.sibling}}function Nn(e,t){switch(t.tag){case 2:break;case 5:var n=t.stateNode;if(null!=n){var o=t.memoizedProps;e=null!==e?e.memoizedProps:o;var i=t.type,a=t.updateQueue;t.updateQueue=null,null!==a&&(n[Vr]=o,at(n,a,i,e,o))}break;case 6:null===t.stateNode&&r("162"),t.stateNode.nodeValue=t.memoizedProps;break;case 3:case 15:case 16:break;default:r("163")}}function On(e,t,n){(n=Lt(n)).tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){nr(r),En(e,t)},n}function Mn(e,t,n){(n=Lt(n)).tag=3;var r=e.stateNode;return null!==r&&"function"==typeof r.componentDidCatch&&(n.callback=function(){null===Za?Za=new Set([this]):Za.add(this);var n=t.value,r=t.stack;En(e,t),this.componentDidCatch(n,{componentStack:null!==r?r:""})}),n}function In(e,t,n,r,o,i){n.effectTag|=512,n.firstEffect=n.lastEffect=null,r=Kt(r,n),e=t;do{switch(e.tag){case 3:return e.effectTag|=1024,void Ut(e,r=On(e,r,i),i);case 2:if(t=r,n=e.stateNode,0==(64&e.effectTag)&&null!==n&&"function"==typeof n.componentDidCatch&&(null===Za||!Za.has(n)))return e.effectTag|=1024,void Ut(e,r=Mn(e,t,i),i)}e=e.return}while(null!==e)}function Rn(e){switch(e.tag){case 2:bt(e);var t=e.effectTag;return 1024&t?(e.effectTag=-1025&t|64,e):null;case 3:return $t(),wt(),1024&(t=e.effectTag)?(e.effectTag=-1025&t|64,e):null;case 5:return Qt(e),null;case 16:return 1024&(t=e.effectTag)?(e.effectTag=-1025&t|64,e):null;case 4:return $t(),null;case 13:return Zt(e),null;default:return null}}function Fn(){if(null!==Ua)for(var e=Ua.return;null!==e;){var t=e;switch(t.tag){case 2:bt(t);break;case 3:$t(),wt();break;case 5:Qt(t);break;case 4:$t();break;case 13:Zt(t)}e=e.return}Wa=null,Ba=0,Va=-1,Ha=!1,Ua=null,qa=!1}function jn(e){for(;;){var t=e.alternate,n=e.return,r=e.sibling;if(0==(512&e.effectTag)){t=Sn(t,e);var o=e;if(1073741823===Ba||1073741823!==o.expirationTime){var i=0;switch(o.tag){case 3:case 2:var a=o.updateQueue;null!==a&&(i=a.expirationTime)}for(a=o.child;null!==a;)0!==a.expirationTime&&(0===i||i>a.expirationTime)&&(i=a.expirationTime),a=a.sibling;o.expirationTime=i}if(null!==t)return t;if(null!==n&&0==(512&n.effectTag)&&(null===n.firstEffect&&(n.firstEffect=e.firstEffect),null!==e.lastEffect&&(null!==n.lastEffect&&(n.lastEffect.nextEffect=e.firstEffect),n.lastEffect=e.lastEffect),1<e.effectTag&&(null!==n.lastEffect?n.lastEffect.nextEffect=e:n.firstEffect=e,n.lastEffect=e)),null!==r)return r;if(null===n){qa=!0;break}e=n}else{if(null!==(e=Rn(e)))return e.effectTag&=511,e;if(null!==n&&(n.firstEffect=n.lastEffect=null,n.effectTag|=512),null!==r)return r;if(null===n)break;e=n}}return null}function Dn(e){var t=wn(e.alternate,e,Ba);return null===t&&(t=jn(e)),Po.current=null,t}function Ln(e,t,n){za&&r("243"),za=!0,(t!==Ba||e!==Wa||null===Ua)&&(Fn(),Ba=t,Va=-1,Ua=Ct((Wa=e).current,null,Ba),e.pendingCommitExpirationTime=0);var o=!1;for(Ha=!n||Ba<=ja;;){try{if(n)for(;null!==Ua&&!tr();)Ua=Dn(Ua);else for(;null!==Ua;)Ua=Dn(Ua)}catch(t){if(null===Ua)o=!0,nr(t);else{null===Ua&&r("271");var i=(n=Ua).return;if(null===i){o=!0,nr(t);break}In(e,i,n,t,0,Ba),Ua=jn(n)}}break}if(za=!1,o)return null;if(null===Ua){if(qa)return e.pendingCommitExpirationTime=t,e.current.alternate;Ha&&r("262"),0<=Va&&setTimeout(function(){var t=e.current.expirationTime;0!==t&&(0===e.remainingExpirationTime||e.remainingExpirationTime<t)&&Kn(e,t)},Va),function(e){null===eu&&r("246"),eu.remainingExpirationTime=e}(e.current.expirationTime)}return null}function An(e,t){var n;e:{for(za&&!Ka&&r("263"),n=e.return;null!==n;){switch(n.tag){case 2:var o=n.stateNode;if("function"==typeof n.type.getDerivedStateFromCatch||"function"==typeof o.componentDidCatch&&(null===Za||!Za.has(o))){zt(n,e=Mn(n,e=Kt(t,e),1),1),Wn(n,1),n=void 0;break e}break;case 3:zt(n,e=On(n,e=Kt(t,e),1),1),Wn(n,1),n=void 0;break e}n=n.return}3===e.tag&&(zt(e,n=On(e,n=Kt(t,e),1),1),Wn(e,1)),n=void 0}return n}function zn(){var e=2+25*(1+((Bn()-2+500)/25|0));return e<=La&&(e=La+1),La=e}function Un(e,t){return e=0!==Aa?Aa:za?Ka?1:Ba:1&t.mode?cu?2+10*(1+((e-2+15)/10|0)):2+25*(1+((e-2+500)/25|0)):1,cu&&(0===nu||e>nu)&&(nu=e),e}function Wn(e,t){for(;null!==e;){if((0===e.expirationTime||e.expirationTime>t)&&(e.expirationTime=t),null!==e.alternate&&(0===e.alternate.expirationTime||e.alternate.expirationTime>t)&&(e.alternate.expirationTime=t),null===e.return){if(3!==e.tag)break;var n=e.stateNode;!za&&0!==Ba&&t<Ba&&Fn();var o=n.current.expirationTime;za&&!Ka&&Wa===n||Kn(n,o),pu>fu&&r("185")}e=e.return}}function Bn(){return Da=aa()-Fa,ja=2+(Da/10|0)}function Vn(e){var t=Aa;Aa=2+25*(1+((Bn()-2+500)/25|0));try{return e()}finally{Aa=t}}function Hn(e,t,n,r,o){var i=Aa;Aa=1;try{return e(t,n,r,o)}finally{Aa=i}}function Gn(e){if(0!==$a){if(e>$a)return;null!==Qa&&la(Qa)}var t=aa()-Fa;$a=e,Qa=ua(Zn,{timeout:10*(e-2)-t})}function Kn(e,t){if(null===e.nextScheduledRoot)e.remainingExpirationTime=t,null===Xa?(Ja=Xa=e,e.nextScheduledRoot=e):(Xa=Xa.nextScheduledRoot=e).nextScheduledRoot=Ja;else{var n=e.remainingExpirationTime;(0===n||t<n)&&(e.remainingExpirationTime=t)}Ya||(uu?lu&&(eu=e,tu=1,Yn(e,1,!1)):1===t?Jn():Gn(t))}function qn(){var e=0,t=null;if(null!==Xa)for(var n=Xa,o=Ja;null!==o;){var i=o.remainingExpirationTime;if(0===i){if((null===n||null===Xa)&&r("244"),o===o.nextScheduledRoot){Ja=Xa=o.nextScheduledRoot=null;break}if(o===Ja)Ja=i=o.nextScheduledRoot,Xa.nextScheduledRoot=i,o.nextScheduledRoot=null;else{if(o===Xa){(Xa=n).nextScheduledRoot=Ja,o.nextScheduledRoot=null;break}n.nextScheduledRoot=o.nextScheduledRoot,o.nextScheduledRoot=null}o=n.nextScheduledRoot}else{if((0===e||i<e)&&(e=i,t=o),o===Xa)break;n=o,o=o.nextScheduledRoot}}null!==(n=eu)&&n===t&&1===e?pu++:pu=0,eu=t,tu=e}function Zn(e){Xn(0,!0,e)}function Jn(){Xn(1,!1,null)}function Xn(e,t,n){if(au=n,qn(),t)for(;null!==eu&&0!==tu&&(0===e||e>=tu)&&(!ru||Bn()>=tu);)Bn(),Yn(eu,tu,!ru),qn();else for(;null!==eu&&0!==tu&&(0===e||e>=tu);)Yn(eu,tu,!1),qn();null!==au&&($a=0,Qa=null),0!==tu&&Gn(tu),au=null,ru=!1,Qn()}function $n(e,t){Ya&&r("253"),eu=e,tu=t,Yn(e,t,!1),Jn(),Qn()}function Qn(){if(pu=0,null!==su){var e=su;su=null;for(var t=0;t<e.length;t++){var n=e[t];try{n._onComplete()}catch(e){ou||(ou=!0,iu=e)}}}if(ou)throw e=iu,iu=null,ou=!1,e}function Yn(e,t,n){Ya&&r("245"),Ya=!0,n?null!==(n=e.finishedWork)?er(e,n,t):null!==(n=Ln(e,t,!0))&&(tr()?e.finishedWork=n:er(e,n,t)):null!==(n=e.finishedWork)?er(e,n,t):null!==(n=Ln(e,t,!1))&&er(e,n,t),Ya=!1}function er(e,t,n){var o=e.firstBatch;if(null!==o&&o._expirationTime<=n&&(null===su?su=[o]:su.push(o),o._defer))return e.finishedWork=t,void(e.remainingExpirationTime=0);if(e.finishedWork=null,Ka=za=!0,(n=t.stateNode).current===t&&r("177"),0===(o=n.pendingCommitExpirationTime)&&r("261"),n.pendingCommitExpirationTime=0,Bn(),Po.current=null,1<t.effectTag)if(null!==t.lastEffect){t.lastEffect.nextEffect=t;var i=t.firstEffect}else i=t;else i=t.firstEffect;oa=vi;var a=Er();if(Ue(a)){if("selectionStart"in a)var u={start:a.selectionStart,end:a.selectionEnd};else e:{var l=window.getSelection&&window.getSelection();if(l&&0!==l.rangeCount){u=l.anchorNode;var c=l.anchorOffset,s=l.focusNode;l=l.focusOffset;try{u.nodeType,s.nodeType}catch(e){u=null;break e}var f=0,p=-1,d=-1,h=0,v=0,m=a,g=null;t:for(;;){for(var y;m!==u||0!==c&&3!==m.nodeType||(p=f+c),m!==s||0!==l&&3!==m.nodeType||(d=f+l),3===m.nodeType&&(f+=m.nodeValue.length),null!==(y=m.firstChild);)g=m,m=y;for(;;){if(m===a)break t;if(g===u&&++h===c&&(p=f),g===s&&++v===l&&(d=f),null!==(y=m.nextSibling))break;g=(m=g).parentNode}m=y}u=-1===p||-1===d?null:{start:p,end:d}}else u=null}u=u||{start:0,end:0}}else u=null;for(ia={focusedElem:a,selectionRange:u},Ie(!1),Ga=i;null!==Ga;){a=!1,u=void 0;try{for(;null!==Ga;){if(256&Ga.effectTag){var b=Ga.alternate;switch((c=Ga).tag){case 2:if(256&c.effectTag&&null!==b){var w=b.memoizedProps,x=b.memoizedState,S=c.stateNode;S.props=c.memoizedProps,S.state=c.memoizedState;var E=S.getSnapshotBeforeUpdate(w,x);S.__reactInternalSnapshotBeforeUpdate=E}break;case 3:case 5:case 6:case 4:break;default:r("163")}}Ga=Ga.nextEffect}}catch(e){a=!0,u=e}a&&(null===Ga&&r("178"),An(Ga,u),null!==Ga&&(Ga=Ga.nextEffect))}for(Ga=i;null!==Ga;){b=!1,w=void 0;try{for(;null!==Ga;){var P=Ga.effectTag;if(16&P&&$e(Ga.stateNode,""),128&P){var _=Ga.alternate;if(null!==_){var C=_.ref;null!==C&&("function"==typeof C?C(null):C.current=null)}}switch(14&P){case 2:Tn(Ga),Ga.effectTag&=-3;break;case 6:Tn(Ga),Ga.effectTag&=-3,Nn(Ga.alternate,Ga);break;case 4:Nn(Ga.alternate,Ga);break;case 8:kn(x=Ga),x.return=null,x.child=null,x.alternate&&(x.alternate.child=null,x.alternate.return=null)}Ga=Ga.nextEffect}}catch(e){b=!0,w=e}b&&(null===Ga&&r("178"),An(Ga,w),null!==Ga&&(Ga=Ga.nextEffect))}if(C=ia,_=Er(),P=C.focusedElem,b=C.selectionRange,_!==P&&_r(document.documentElement,P)){null!==b&&Ue(P)&&(_=b.start,void 0===(C=b.end)&&(C=_),"selectionStart"in P?(P.selectionStart=_,P.selectionEnd=Math.min(C,P.value.length)):window.getSelection&&(_=window.getSelection(),w=P[M()].length,C=Math.min(b.start,w),b=void 0===b.end?C:Math.min(b.end,w),!_.extend&&C>b&&(w=b,b=C,C=w),w=ze(P,C),x=ze(P,b),w&&x&&(1!==_.rangeCount||_.anchorNode!==w.node||_.anchorOffset!==w.offset||_.focusNode!==x.node||_.focusOffset!==x.offset)&&((S=document.createRange()).setStart(w.node,w.offset),_.removeAllRanges(),C>b?(_.addRange(S),_.extend(x.node,x.offset)):(S.setEnd(x.node,x.offset),_.addRange(S))))),_=[];for(C=P;C=C.parentNode;)1===C.nodeType&&_.push({element:C,left:C.scrollLeft,top:C.scrollTop});for("function"==typeof P.focus&&P.focus(),P=0;P<_.length;P++)(C=_[P]).element.scrollLeft=C.left,C.element.scrollTop=C.top}for(ia=null,Ie(oa),oa=null,n.current=t,Ga=i;null!==Ga;){i=!1,P=void 0;try{for(_=o;null!==Ga;){var T=Ga.effectTag;if(36&T){var k=Ga.alternate;switch(b=_,(C=Ga).tag){case 2:var N=C.stateNode;if(4&C.effectTag)if(null===k)N.props=C.memoizedProps,N.state=C.memoizedState,N.componentDidMount();else{var O=k.memoizedProps,I=k.memoizedState;N.props=C.memoizedProps,N.state=C.memoizedState,N.componentDidUpdate(O,I,N.__reactInternalSnapshotBeforeUpdate)}var R=C.updateQueue;null!==R&&(N.props=C.memoizedProps,N.state=C.memoizedState,Gt(C,R,N));break;case 3:var F=C.updateQueue;if(null!==F){if(w=null,null!==C.child)switch(C.child.tag){case 5:w=C.child.stateNode;break;case 2:w=C.child.stateNode}Gt(C,F,w)}break;case 5:var j=C.stateNode;null===k&&4&C.effectTag&&ct(C.type,C.memoizedProps)&&j.focus();break;case 6:case 4:case 15:case 16:break;default:r("163")}}if(128&T){C=void 0;var D=Ga.ref;if(null!==D){var L=Ga.stateNode;switch(Ga.tag){case 5:C=L;break;default:C=L}"function"==typeof D?D(C):D.current=C}}var A=Ga.nextEffect;Ga.nextEffect=null,Ga=A}}catch(e){i=!0,P=e}i&&(null===Ga&&r("178"),An(Ga,P),null!==Ga&&(Ga=Ga.nextEffect))}za=Ka=!1,Rt(t.stateNode),0===(t=n.current.expirationTime)&&(Za=null),e.remainingExpirationTime=t}function tr(){return!(null===au||au.timeRemaining()>du)&&(ru=!0)}function nr(e){null===eu&&r("246"),eu.remainingExpirationTime=0,ou||(ou=!0,iu=e)}function rr(e,t){var n=uu;uu=!0;try{return e(t)}finally{(uu=n)||Ya||Jn()}}function or(e,t){if(uu&&!lu){lu=!0;try{return e(t)}finally{lu=!1}}return e(t)}function ir(e,t){Ya&&r("187");var n=uu;uu=!0;try{return Hn(e,t)}finally{uu=n,Jn()}}function ar(e,t,n){if(cu)return e(t,n);uu||Ya||0===nu||(Xn(nu,!1,null),nu=0);var r=cu,o=uu;uu=cu=!0;try{return e(t,n)}finally{cu=r,(uu=o)||Ya||Jn()}}function ur(e){var t=uu;uu=!0;try{Hn(e)}finally{(uu=t)||Ya||Xn(1,!1,null)}}function lr(e,t,n,o,i){var a=t.current;if(n){var u;n=n._reactInternalFiber;e:{for(2===_e(n)&&2===n.tag||r("170"),u=n;3!==u.tag;){if(yt(u)){u=u.stateNode.__reactInternalMemoizedMergedChildContext;break e}(u=u.return)||r("171")}u=u.stateNode.context}n=yt(n)?St(n,u):u}else n=Cr;return null===t.context?t.context=n:t.pendingContext=n,t=i,(i=Lt(o)).payload={element:e},null!==(t=void 0===t?null:t)&&(i.callback=t),zt(a,i,o),Wn(a,o),o}function cr(e){var t=e._reactInternalFiber;return void 0===t&&("function"==typeof e.render?r("188"):r("268",Object.keys(e))),null===(e=ke(t))?null:e.stateNode}function sr(e,t,n,r){var o=t.current;return lr(e,t,n,o=Un(Bn(),o),r)}function fr(e){if(!(e=e.current).child)return null;switch(e.child.tag){case 5:default:return e.child.stateNode}}function pr(e){this._expirationTime=zn(),this._root=e,this._callbacks=this._next=null,this._hasChildren=this._didComplete=!1,this._children=null,this._defer=!0}function dr(){this._callbacks=null,this._didCommit=!1,this._onCommit=this._onCommit.bind(this)}function hr(e,t,n){this._internalRoot=Mt(e,t,n)}function vr(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function mr(e,t,n,o,i){vr(n)||r("200");var a=n._reactRootContainer;if(a){if("function"==typeof i){var u=i;i=function(){var e=fr(a._internalRoot);u.call(e)}}null!=e?a.legacy_renderSubtreeIntoContainer(e,t,i):a.render(t,i)}else{if(a=n._reactRootContainer=function(e,t){if(t||(t=!(!(t=e?9===e.nodeType?e.documentElement:e.firstChild:null)||1!==t.nodeType||!t.hasAttribute("data-reactroot"))),!t)for(var n;n=e.lastChild;)e.removeChild(n);return new hr(e,!1,t)}(n,o),"function"==typeof i){var l=i;i=function(){var e=fr(a._internalRoot);l.call(e)}}or(function(){null!=e?a.legacy_renderSubtreeIntoContainer(e,t,i):a.render(t,i)})}return fr(a._internalRoot)}function gr(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;return vr(t)||r("200"),function(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:To,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}}(e,t,null,n)}/** @license React v16.4.1
|
17 |
* react-dom.production.min.js
|
18 |
*
|
19 |
-
* Copyright (c)
|
20 |
*
|
21 |
* This source code is licensed under the MIT license found in the
|
22 |
* LICENSE file in the root directory of this source tree.
|
23 |
*/
|
24 |
-
var yr=n(140),br=n(5),wr=n(416),xr=n(352),Sr=n(142),Er=n(417),Pr=n(418),_r=n(419),Cr=n(353);br||r("227");var Tr={_caughtError:null,_hasCaughtError:!1,_rethrowError:null,_hasRethrowError:!1,invokeGuardedCallback:function(e,t,n,r,o,i,a,u,l){(function(e,t,n,r,o,i,a,u,l){this._hasCaughtError=!1,this._caughtError=null;var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(e){this._caughtError=e,this._hasCaughtError=!0}}).apply(Tr,arguments)},invokeGuardedCallbackAndCatchFirstError:function(e,t,n,r,o,i,a,u,l){if(Tr.invokeGuardedCallback.apply(this,arguments),Tr.hasCaughtError()){var c=Tr.clearCaughtError();Tr._hasRethrowError||(Tr._hasRethrowError=!0,Tr._rethrowError=c)}},rethrowCaughtError:function(){return function(){if(Tr._hasRethrowError){var e=Tr._rethrowError;throw Tr._rethrowError=null,Tr._hasRethrowError=!1,e}}.apply(Tr,arguments)},hasCaughtError:function(){return Tr._hasCaughtError},clearCaughtError:function(){if(Tr._hasCaughtError){var e=Tr._caughtError;return Tr._caughtError=null,Tr._hasCaughtError=!1,e}r("198")}},kr=null,Nr={},Or=[],Mr={},Ir={},Rr={},Fr={plugins:Or,eventNameDispatchConfigs:Mr,registrationNameModules:Ir,registrationNameDependencies:Rr,possibleRegistrationNames:null,injectEventPluginOrder:a,injectEventPluginsByName:u},jr=null,Dr=null,Lr=null,Ar=null,zr={injectEventPluginOrder:a,injectEventPluginsByName:u},Ur={injection:zr,getListener:h,runEventsInBatch:v,runExtractedEventsInBatch:m},Wr=Math.random().toString(36).slice(2),Br="__reactInternalInstance$"+Wr,Vr="__reactEventHandlers$"+Wr,Hr={precacheFiberNode:function(e,t){t[Br]=e},getClosestInstanceFromNode:g,getInstanceFromNode:function(e){return!(e=e[Br])||5!==e.tag&&6!==e.tag?null:e},getNodeFromInstance:y,getFiberCurrentPropsFromNode:b,updateFiberProps:function(e,t){e[Vr]=t}},Gr={accumulateTwoPhaseDispatches:T,accumulateTwoPhaseDispatchesSkipTarget:function(e){s(e,P)},accumulateEnterLeaveDispatches:k,accumulateDirectDispatches:function(e){s(e,C)}},Kr={animationend:N("Animation","AnimationEnd"),animationiteration:N("Animation","AnimationIteration"),animationstart:N("Animation","AnimationStart"),transitionend:N("Transition","TransitionEnd")},qr={},Zr={};wr.canUseDOM&&(Zr=document.createElement("div").style,"AnimationEvent"in window||(delete Kr.animationend.animation,delete Kr.animationiteration.animation,delete Kr.animationstart.animation),"TransitionEvent"in window||delete Kr.transitionend.transition);var Jr=O("animationend"),Xr=O("animationiteration"),$r=O("animationstart"),Qr=O("transitionend"),Yr="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),eo=null,to={_root:null,_startText:null,_fallbackText:null},no="dispatchConfig _targetInst nativeEvent isDefaultPrevented isPropagationStopped _dispatchListeners _dispatchInstances".split(" "),ro={type:null,target:null,currentTarget:Sr.thatReturnsNull,eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null};xr(F.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=Sr.thatReturnsTrue)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=Sr.thatReturnsTrue)},persist:function(){this.isPersistent=Sr.thatReturnsTrue},isPersistent:Sr.thatReturnsFalse,destructor:function(){var e,t=this.constructor.Interface;for(e in t)this[e]=null;for(t=0;t<no.length;t++)this[no[t]]=null}}),F.Interface=ro,F.extend=function(e){function t(){}function n(){return r.apply(this,arguments)}var r=this;t.prototype=r.prototype;var o=new t;return xr(o,n.prototype),n.prototype=o,n.prototype.constructor=n,n.Interface=xr({},r.Interface,e),n.extend=r.extend,L(n),n},L(F);var oo=F.extend({data:null}),io=F.extend({data:null}),ao=[9,13,27,32],uo=wr.canUseDOM&&"CompositionEvent"in window,lo=null;wr.canUseDOM&&"documentMode"in document&&(lo=document.documentMode);var co=wr.canUseDOM&&"TextEvent"in window&&!lo,so=wr.canUseDOM&&(!uo||lo&&8<lo&&11>=lo),fo=String.fromCharCode(32),po={beforeInput:{phasedRegistrationNames:{bubbled:"onBeforeInput",captured:"onBeforeInputCapture"},dependencies:["compositionend","keypress","textInput","paste"]},compositionEnd:{phasedRegistrationNames:{bubbled:"onCompositionEnd",captured:"onCompositionEndCapture"},dependencies:"blur compositionend keydown keypress keyup mousedown".split(" ")},compositionStart:{phasedRegistrationNames:{bubbled:"onCompositionStart",captured:"onCompositionStartCapture"},dependencies:"blur compositionstart keydown keypress keyup mousedown".split(" ")},compositionUpdate:{phasedRegistrationNames:{bubbled:"onCompositionUpdate",captured:"onCompositionUpdateCapture"},dependencies:"blur compositionupdate keydown keypress keyup mousedown".split(" ")}},ho=!1,vo=!1,mo={eventTypes:po,extractEvents:function(e,t,n,r){var o=void 0,i=void 0;if(uo)e:{switch(e){case"compositionstart":o=po.compositionStart;break e;case"compositionend":o=po.compositionEnd;break e;case"compositionupdate":o=po.compositionUpdate;break e}o=void 0}else vo?A(e,n)&&(o=po.compositionEnd):"keydown"===e&&229===n.keyCode&&(o=po.compositionStart);return o?(so&&(vo||o!==po.compositionStart?o===po.compositionEnd&&vo&&(i=I()):(to._root=r,to._startText=R(),vo=!0)),o=oo.getPooled(o,t,n,r),i?o.data=i:null!==(i=z(n))&&(o.data=i),T(o),i=o):i=null,(e=co?function(e,t){switch(e){case"compositionend":return z(t);case"keypress":return 32!==t.which?null:(ho=!0,fo);case"textInput":return(e=t.data)===fo&&ho?null:e;default:return null}}(e,n):function(e,t){if(vo)return"compositionend"===e||!uo&&A(e,t)?(e=I(),to._root=null,to._startText=null,to._fallbackText=null,vo=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return so?null:t.data;default:return null}}(e,n))?((t=io.getPooled(po.beforeInput,t,n,r)).data=e,T(t)):t=null,null===i?t:null===t?i:[i,t]}},go=null,yo={injectFiberControlledHostComponent:function(e){go=e}},bo=null,wo=null,xo={injection:yo,enqueueStateRestore:W,needsStateRestore:B,restoreStateIfNeeded:V},So=!1,Eo={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0},Po=br.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,_o="function"==typeof Symbol&&Symbol.for,Co=_o?Symbol.for("react.element"):60103,To=_o?Symbol.for("react.portal"):60106,ko=_o?Symbol.for("react.fragment"):60107,No=_o?Symbol.for("react.strict_mode"):60108,Oo=_o?Symbol.for("react.profiler"):60114,Mo=_o?Symbol.for("react.provider"):60109,Io=_o?Symbol.for("react.context"):60110,Ro=_o?Symbol.for("react.async_mode"):60111,Fo=_o?Symbol.for("react.forward_ref"):60112,jo=_o?Symbol.for("react.timeout"):60113,Do="function"==typeof Symbol&&Symbol.iterator,Lo=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Ao={},zo={},Uo={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Uo[e]=new re(e,0,!1,e,null)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Uo[t]=new re(t,1,!1,e[1],null)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){Uo[e]=new re(e,2,!1,e.toLowerCase(),null)}),["autoReverse","externalResourcesRequired","preserveAlpha"].forEach(function(e){Uo[e]=new re(e,2,!1,e,null)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Uo[e]=new re(e,3,!1,e.toLowerCase(),null)}),["checked","multiple","muted","selected"].forEach(function(e){Uo[e]=new re(e,3,!0,e.toLowerCase(),null)}),["capture","download"].forEach(function(e){Uo[e]=new re(e,4,!1,e.toLowerCase(),null)}),["cols","rows","size","span"].forEach(function(e){Uo[e]=new re(e,6,!1,e.toLowerCase(),null)}),["rowSpan","start"].forEach(function(e){Uo[e]=new re(e,5,!1,e.toLowerCase(),null)});var Wo=/[\-:]([a-z])/g;"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Wo,oe);Uo[t]=new re(t,1,!1,e,null)}),"xlink:actuate xlink:arcrole xlink:href xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Wo,oe);Uo[t]=new re(t,1,!1,e,"http://www.w3.org/1999/xlink")}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Wo,oe);Uo[t]=new re(t,1,!1,e,"http://www.w3.org/XML/1998/namespace")}),Uo.tabIndex=new re("tabIndex",1,!1,"tabindex",null);var Bo={change:{phasedRegistrationNames:{bubbled:"onChange",captured:"onChangeCapture"},dependencies:"blur change click focus input keydown keyup selectionchange".split(" ")}},Vo=null,Ho=null,Go=!1;wr.canUseDOM&&(Go=X("input")&&(!document.documentMode||9<document.documentMode));var Ko={eventTypes:Bo,_isInputEventSupported:Go,extractEvents:function(e,t,n,r){var o=t?y(t):window,i=void 0,a=void 0,u=o.nodeName&&o.nodeName.toLowerCase();if("select"===u||"input"===u&&"file"===o.type?i=me:Z(o)?Go?i=Se:(i=we,a=be):(u=o.nodeName)&&"input"===u.toLowerCase()&&("checkbox"===o.type||"radio"===o.type)&&(i=xe),i&&(i=i(e,t)))return de(i,n,r);a&&a(e,o,t),"blur"===e&&(e=o._wrapperState)&&e.controlled&&"number"===o.type&&fe(o,"number",o.value)}},qo=F.extend({view:null,detail:null}),Zo={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"},Jo=qo.extend({screenX:null,screenY:null,clientX:null,clientY:null,pageX:null,pageY:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,getModifierState:Pe,button:null,buttons:null,relatedTarget:function(e){return e.relatedTarget||(e.fromElement===e.srcElement?e.toElement:e.fromElement)}}),Xo=Jo.extend({pointerId:null,width:null,height:null,pressure:null,tiltX:null,tiltY:null,pointerType:null,isPrimary:null}),$o={mouseEnter:{registrationName:"onMouseEnter",dependencies:["mouseout","mouseover"]},mouseLeave:{registrationName:"onMouseLeave",dependencies:["mouseout","mouseover"]},pointerEnter:{registrationName:"onPointerEnter",dependencies:["pointerout","pointerover"]},pointerLeave:{registrationName:"onPointerLeave",dependencies:["pointerout","pointerover"]}},Qo={eventTypes:$o,extractEvents:function(e,t,n,r){var o="mouseover"===e||"pointerover"===e,i="mouseout"===e||"pointerout"===e;if(o&&(n.relatedTarget||n.fromElement)||!i&&!o)return null;if(o=r.window===r?r:(o=r.ownerDocument)?o.defaultView||o.parentWindow:window,i?(i=t,t=(t=n.relatedTarget||n.toElement)?g(t):null):i=null,i===t)return null;var a=void 0,u=void 0,l=void 0,c=void 0;return"mouseout"===e||"mouseover"===e?(a=Jo,u=$o.mouseLeave,l=$o.mouseEnter,c="mouse"):"pointerout"!==e&&"pointerover"!==e||(a=Xo,u=$o.pointerLeave,l=$o.pointerEnter,c="pointer"),e=null==i?o:y(i),o=null==t?o:y(t),(u=a.getPooled(u,i,n,r)).type=c+"leave",u.target=e,u.relatedTarget=o,(n=a.getPooled(l,t,n,r)).type=c+"enter",n.target=o,n.relatedTarget=e,k(u,n,i,t),[u,n]}},Yo=F.extend({animationName:null,elapsedTime:null,pseudoElement:null}),ei=F.extend({clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),ti=qo.extend({relatedTarget:null}),ni={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},ri={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},oi=qo.extend({key:function(e){if(e.key){var t=ni[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=Ne(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?ri[e.keyCode]||"Unidentified":""},location:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,repeat:null,locale:null,getModifierState:Pe,charCode:function(e){return"keypress"===e.type?Ne(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?Ne(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}}),ii=Jo.extend({dataTransfer:null}),ai=qo.extend({touches:null,targetTouches:null,changedTouches:null,altKey:null,metaKey:null,ctrlKey:null,shiftKey:null,getModifierState:Pe}),ui=F.extend({propertyName:null,elapsedTime:null,pseudoElement:null}),li=Jo.extend({deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:null,deltaMode:null}),ci=[["abort","abort"],[Jr,"animationEnd"],[Xr,"animationIteration"],[$r,"animationStart"],["canplay","canPlay"],["canplaythrough","canPlayThrough"],["drag","drag"],["dragenter","dragEnter"],["dragexit","dragExit"],["dragleave","dragLeave"],["dragover","dragOver"],["durationchange","durationChange"],["emptied","emptied"],["encrypted","encrypted"],["ended","ended"],["error","error"],["gotpointercapture","gotPointerCapture"],["load","load"],["loadeddata","loadedData"],["loadedmetadata","loadedMetadata"],["loadstart","loadStart"],["lostpointercapture","lostPointerCapture"],["mousemove","mouseMove"],["mouseout","mouseOut"],["mouseover","mouseOver"],["playing","playing"],["pointermove","pointerMove"],["pointerout","pointerOut"],["pointerover","pointerOver"],["progress","progress"],["scroll","scroll"],["seeking","seeking"],["stalled","stalled"],["suspend","suspend"],["timeupdate","timeUpdate"],["toggle","toggle"],["touchmove","touchMove"],[Qr,"transitionEnd"],["waiting","waiting"],["wheel","wheel"]],si={},fi={};[["blur","blur"],["cancel","cancel"],["click","click"],["close","close"],["contextmenu","contextMenu"],["copy","copy"],["cut","cut"],["dblclick","doubleClick"],["dragend","dragEnd"],["dragstart","dragStart"],["drop","drop"],["focus","focus"],["input","input"],["invalid","invalid"],["keydown","keyDown"],["keypress","keyPress"],["keyup","keyUp"],["mousedown","mouseDown"],["mouseup","mouseUp"],["paste","paste"],["pause","pause"],["play","play"],["pointercancel","pointerCancel"],["pointerdown","pointerDown"],["pointerup","pointerUp"],["ratechange","rateChange"],["reset","reset"],["seeked","seeked"],["submit","submit"],["touchcancel","touchCancel"],["touchend","touchEnd"],["touchstart","touchStart"],["volumechange","volumeChange"]].forEach(function(e){Oe(e,!0)}),ci.forEach(function(e){Oe(e,!1)});var pi={eventTypes:si,isInteractiveTopLevelEventType:function(e){return void 0!==(e=fi[e])&&!0===e.isInteractive},extractEvents:function(e,t,n,r){var o=fi[e];if(!o)return null;switch(e){case"keypress":if(0===Ne(n))return null;case"keydown":case"keyup":e=oi;break;case"blur":case"focus":e=ti;break;case"click":if(2===n.button)return null;case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":e=Jo;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":e=ii;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":e=ai;break;case Jr:case Xr:case $r:e=Yo;break;case Qr:e=ui;break;case"scroll":e=qo;break;case"wheel":e=li;break;case"copy":case"cut":case"paste":e=ei;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":e=Xo;break;default:e=F}return T(t=e.getPooled(o,t,n,r)),t}},di=pi.isInteractiveTopLevelEventType,hi=[],vi=!0,mi={get _enabled(){return vi},setEnabled:Ie,isEnabled:function(){return vi},trapBubbledEvent:Re,trapCapturedEvent:Fe,dispatchEvent:De},gi={},yi=0,bi="_reactListenersID"+(""+Math.random()).slice(2),wi=wr.canUseDOM&&"documentMode"in document&&11>=document.documentMode,xi={select:{phasedRegistrationNames:{bubbled:"onSelect",captured:"onSelectCapture"},dependencies:"blur contextmenu focus keydown keyup mousedown mouseup selectionchange".split(" ")}},Si=null,Ei=null,Pi=null,_i=!1,Ci={eventTypes:xi,extractEvents:function(e,t,n,r){var o,i=r.window===r?r.document:9===r.nodeType?r:r.ownerDocument;if(!(o=!i)){e:{i=Le(i),o=Rr.onSelect;for(var a=0;a<o.length;a++){var u=o[a];if(!i.hasOwnProperty(u)||!i[u]){i=!1;break e}}i=!0}o=!i}if(o)return null;switch(i=t?y(t):window,e){case"focus":(Z(i)||"true"===i.contentEditable)&&(Si=i,Ei=t,Pi=null);break;case"blur":Pi=Ei=Si=null;break;case"mousedown":_i=!0;break;case"contextmenu":case"mouseup":return _i=!1,We(n,r);case"selectionchange":if(wi)break;case"keydown":case"keyup":return We(n,r)}return null}};zr.injectEventPluginOrder("ResponderEventPlugin SimpleEventPlugin TapEventPlugin EnterLeaveEventPlugin ChangeEventPlugin SelectEventPlugin BeforeInputEventPlugin".split(" ")),jr=Hr.getFiberCurrentPropsFromNode,Dr=Hr.getInstanceFromNode,Lr=Hr.getNodeFromInstance,zr.injectEventPluginsByName({SimpleEventPlugin:pi,EnterLeaveEventPlugin:Qo,ChangeEventPlugin:Ko,SelectEventPlugin:Ci,BeforeInputEventPlugin:mo});var Ti="function"==typeof requestAnimationFrame?requestAnimationFrame:void 0,ki=Date,Ni=setTimeout,Oi=clearTimeout,Mi=void 0;if("object"==typeof performance&&"function"==typeof performance.now){var Ii=performance;Mi=function(){return Ii.now()}}else Mi=function(){return ki.now()};var Ri=void 0,Fi=void 0;if(wr.canUseDOM){var ji="function"==typeof Ti?Ti:function(){r("276")},Di=null,Li=null,Ai=-1,zi=!1,Ui=!1,Wi=0,Bi=33,Vi=33,Hi={didTimeout:!1,timeRemaining:function(){var e=Wi-Mi();return 0<e?e:0}},Gi=function(e,t){var n=e.scheduledCallback,r=!1;try{n(t),r=!0}finally{Fi(e),r||(zi=!0,window.postMessage(Ki,"*"))}},Ki="__reactIdleCallback$"+Math.random().toString(36).slice(2);window.addEventListener("message",function(e){if(e.source===window&&e.data===Ki&&(zi=!1,null!==Di)){if(null!==Di){var t=Mi();if(!(-1===Ai||Ai>t)){e=-1;for(var n=[],r=Di;null!==r;){var o=r.timeoutTime;-1!==o&&o<=t?n.push(r):-1!==o&&(-1===e||o<e)&&(e=o),r=r.next}if(0<n.length)for(Hi.didTimeout=!0,t=0,r=n.length;t<r;t++)Gi(n[t],Hi);Ai=e}}for(e=Mi();0<Wi-e&&null!==Di;)e=Di,Hi.didTimeout=!1,Gi(e,Hi),e=Mi();null===Di||Ui||(Ui=!0,ji(qi))}},!1);var qi=function(e){Ui=!1;var t=e-Wi+Vi;t<Vi&&Bi<Vi?(8>t&&(t=8),Vi=t<Bi?Bi:t):Bi=t,Wi=e+Vi,zi||(zi=!0,window.postMessage(Ki,"*"))};Ri=function(e,t){var n=-1;return null!=t&&"number"==typeof t.timeout&&(n=Mi()+t.timeout),(-1===Ai||-1!==n&&n<Ai)&&(Ai=n),e={scheduledCallback:e,timeoutTime:n,prev:null,next:null},null===Di?Di=e:null!==(t=e.prev=Li)&&(t.next=e),Li=e,Ui||(Ui=!0,ji(qi)),e},Fi=function(e){if(null!==e.prev||Di===e){var t=e.next,n=e.prev;e.next=null,e.prev=null,null!==t?null!==n?(n.next=t,t.prev=n):(t.prev=null,Di=t):null!==n?(n.next=null,Li=n):Li=Di=null}}}else{var Zi=new Map;Ri=function(e){var t={scheduledCallback:e,timeoutTime:0,next:null,prev:null},n=Ni(function(){e({timeRemaining:function(){return 1/0},didTimeout:!1})});return Zi.set(e,n),t},Fi=function(e){var t=Zi.get(e.scheduledCallback);Zi.delete(e),Oi(t)}}var Ji,Xi={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"},$i=void 0,Qi=(Ji=function(e,t){if(e.namespaceURI!==Xi.svg||"innerHTML"in e)e.innerHTML=t;else{for(($i=$i||document.createElement("div")).innerHTML="<svg>"+t+"</svg>",t=$i.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}},"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(e,t,n,r){MSApp.execUnsafeLocalFunction(function(){return Ji(e,t)})}:Ji),Yi={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},ea=["Webkit","ms","Moz","O"];Object.keys(Yi).forEach(function(e){ea.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Yi[t]=Yi[e]})});var ta=xr({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0}),na=Sr.thatReturns(""),ra={createElement:nt,createTextNode:rt,setInitialProperties:ot,diffProperties:it,updateProperties:at,diffHydratedProperties:ut,diffHydratedText:lt,warnForUnmatchedText:function(){},warnForDeletedHydratableElement:function(){},warnForDeletedHydratableText:function(){},warnForInsertedHydratedElement:function(){},warnForInsertedHydratedText:function(){},restoreControlledState:function(e,t,n){switch(t){case"input":if(ce(e,n),t=n.name,"radio"===n.type&&null!=t){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var o=n[t];if(o!==e&&o.form===e.form){var i=b(o);i||r("90"),Y(o),ce(o,i)}}}break;case"textarea":qe(e,n);break;case"select":null!=(t=n.value)&&Ve(e,!!n.multiple,t,!1)}}},oa=null,ia=null,aa=Mi,ua=Ri,la=Fi;new Set;var ca=[],sa=-1,fa=dt(Cr),pa=dt(!1),da=Cr,ha=null,va=null,ma=!1,ga=dt(null),ya=dt(null),ba=dt(0),wa={},xa=dt(wa),Sa=dt(wa),Ea=dt(wa),Pa={isMounted:function(e){return!!(e=e._reactInternalFiber)&&2===_e(e)},enqueueSetState:function(e,t,n){e=e._reactInternalFiber;var r=Bn(),o=Lt(r=Un(r,e));o.payload=t,void 0!==n&&null!==n&&(o.callback=n),zt(e,o,r),Wn(e,r)},enqueueReplaceState:function(e,t,n){e=e._reactInternalFiber;var r=Bn(),o=Lt(r=Un(r,e));o.tag=1,o.payload=t,void 0!==n&&null!==n&&(o.callback=n),zt(e,o,r),Wn(e,r)},enqueueForceUpdate:function(e,t){e=e._reactInternalFiber;var n=Bn(),r=Lt(n=Un(n,e));r.tag=2,void 0!==t&&null!==t&&(r.callback=t),zt(e,r,n),Wn(e,n)}},_a=Array.isArray,Ca=an(!0),Ta=an(!1),ka=null,Na=null,Oa=!1,Ma=void 0,Ia=void 0,Ra=void 0;Ma=function(){},Ia=function(e,t,n){(t.updateQueue=n)&&xn(t)},Ra=function(e,t,n,r){n!==r&&xn(t)};var Fa=aa(),ja=2,Da=Fa,La=0,Aa=0,za=!1,Ua=null,Wa=null,Ba=0,Va=-1,Ha=!1,Ga=null,Ka=!1,qa=!1,Za=null,Ja=null,Xa=null,$a=0,Qa=void 0,Ya=!1,eu=null,tu=0,nu=0,ru=!1,ou=!1,iu=null,au=null,uu=!1,lu=!1,cu=!1,su=null,fu=1e3,pu=0,du=1,hu=rr,vu=ar,mu=function(){Ya||0===nu||(Xn(nu,!1,null),nu=0)};yo.injectFiberControlledHostComponent(ra),pr.prototype.render=function(e){this._defer||r("250"),this._hasChildren=!0,this._children=e;var t=this._root._internalRoot,n=this._expirationTime,o=new dr;return lr(e,t,null,n,o._onCommit),o},pr.prototype.then=function(e){if(this._didComplete)e();else{var t=this._callbacks;null===t&&(t=this._callbacks=[]),t.push(e)}},pr.prototype.commit=function(){var e=this._root._internalRoot,t=e.firstBatch;if(this._defer&&null!==t||r("251"),this._hasChildren){var n=this._expirationTime;if(t!==this){this._hasChildren&&(n=this._expirationTime=t._expirationTime,this.render(this._children));for(var o=null,i=t;i!==this;)o=i,i=i._next;null===o&&r("251"),o._next=i._next,this._next=t,e.firstBatch=this}this._defer=!1,$n(e,n),t=this._next,this._next=null,null!==(t=e.firstBatch=t)&&t._hasChildren&&t.render(t._children)}else this._next=null,this._defer=!1},pr.prototype._onComplete=function(){if(!this._didComplete){this._didComplete=!0;var e=this._callbacks;if(null!==e)for(var t=0;t<e.length;t++)(0,e[t])()}},dr.prototype.then=function(e){if(this._didCommit)e();else{var t=this._callbacks;null===t&&(t=this._callbacks=[]),t.push(e)}},dr.prototype._onCommit=function(){if(!this._didCommit){this._didCommit=!0;var e=this._callbacks;if(null!==e)for(var t=0;t<e.length;t++){var n=e[t];"function"!=typeof n&&r("191",n),n()}}},hr.prototype.render=function(e,t){var n=this._internalRoot,r=new dr;return null!==(t=void 0===t?null:t)&&r.then(t),sr(e,n,null,r._onCommit),r},hr.prototype.unmount=function(e){var t=this._internalRoot,n=new dr;return null!==(e=void 0===e?null:e)&&n.then(e),sr(null,t,null,n._onCommit),n},hr.prototype.legacy_renderSubtreeIntoContainer=function(e,t,n){var r=this._internalRoot,o=new dr;return null!==(n=void 0===n?null:n)&&o.then(n),sr(t,r,e,o._onCommit),o},hr.prototype.createBatch=function(){var e=new pr(this),t=e._expirationTime,n=this._internalRoot,r=n.firstBatch;if(null===r)n.firstBatch=e,e._next=null;else{for(n=null;null!==r&&r._expirationTime<=t;)n=r,r=r._next;e._next=r,null!==n&&(n._next=e)}return e},H=hu,G=vu,K=mu;var gu={createPortal:gr,findDOMNode:function(e){return null==e?null:1===e.nodeType?e:cr(e)},hydrate:function(e,t,n){return mr(null,e,t,!0,n)},render:function(e,t,n){return mr(null,e,t,!1,n)},unstable_renderSubtreeIntoContainer:function(e,t,n,o){return(null==e||void 0===e._reactInternalFiber)&&r("38"),mr(e,t,n,!1,o)},unmountComponentAtNode:function(e){return vr(e)||r("40"),!!e._reactRootContainer&&(or(function(){mr(null,null,e,!1,function(){e._reactRootContainer=null})}),!0)},unstable_createPortal:function(){return gr.apply(void 0,arguments)},unstable_batchedUpdates:rr,unstable_deferredUpdates:Vn,unstable_interactiveUpdates:ar,flushSync:ir,unstable_flushControlled:ur,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{EventPluginHub:Ur,EventPluginRegistry:Fr,EventPropagators:Gr,ReactControlledComponent:xo,ReactDOMComponentTree:Hr,ReactDOMEventListener:mi},unstable_createRoot:function(e,t){return new hr(e,!0,null!=t&&!0===t.hydrate)}};!function(e){var t=e.findFiberByHostInstance;(function(e){if("undefined"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__)return!1;var t=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(t.isDisabled||!t.supportsFiber)return!0;try{var n=t.inject(e);ha=It(function(e){return t.onCommitFiberRoot(n,e)}),va=It(function(e){return t.onCommitFiberUnmount(n,e)})}catch(e){}})(xr({},e,{findHostInstanceByFiber:function(e){return null===(e=ke(e))?null:e.stateNode},findFiberByHostInstance:function(e){return t?t(e):null}}))}({findFiberByHostInstance:g,bundleType:0,version:"16.4.1",rendererPackageName:"react-dom"});var yu={default:gu},bu=yu&&gu||yu;e.exports=bu.default?bu.default:bu},function(e,t,n){"use strict";function r(e){for(var t=arguments.length-1,n="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=0;r<t;r++)n+="&args[]="+encodeURIComponent(arguments[r+1]);g(!1,"Minified React error #"+e+"; visit %s for the full message or use the non-minified dev environment for full errors and additional helpful warnings. ",n)}function o(e,t,n){this.props=e,this.context=t,this.refs=y,this.updater=n||M}function i(){}function a(e,t,n){this.props=e,this.context=t,this.refs=y,this.updater=n||M}function u(e,t,n){var r=void 0,o={},i=null,a=null;if(null!=t)for(r in void 0!==t.ref&&(a=t.ref),void 0!==t.key&&(i=""+t.key),t)F.call(t,r)&&!j.hasOwnProperty(r)&&(o[r]=t[r]);var u=arguments.length-2;if(1===u)o.children=n;else if(1<u){for(var l=Array(u),c=0;c<u;c++)l[c]=arguments[c+2];o.children=l}if(e&&e.defaultProps)for(r in u=e.defaultProps)void 0===o[r]&&(o[r]=u[r]);return{$$typeof:x,type:e,key:i,ref:a,props:o,_owner:R.current}}function l(e){return"object"==typeof e&&null!==e&&e.$$typeof===x}function c(e,t,n,r){if(L.length){var o=L.pop();return o.result=e,o.keyPrefix=t,o.func=n,o.context=r,o.count=0,o}return{result:e,keyPrefix:t,func:n,context:r,count:0}}function s(e){e.result=null,e.keyPrefix=null,e.func=null,e.context=null,e.count=0,10>L.length&&L.push(e)}function f(e,t,n,o){var i=typeof e;"undefined"
|
1 |
+
var WPRecipeMaker=WPRecipeMaker||{};WPRecipeMaker["admin-manage"]=function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=856)}([function(e,t,n){var r=n(3),o=n(20),i=n(12),a=n(13),u=n(21),l=function(e,t,n){var c,s,p,f,d=e&l.F,m=e&l.G,h=e&l.S,g=e&l.P,v=e&l.B,b=m?r:h?r[t]||(r[t]={}):(r[t]||{}).prototype,y=m?o:o[t]||(o[t]={}),w=y.prototype||(y.prototype={});m&&(n=t);for(c in n)p=((s=!d&&b&&void 0!==b[c])?b:n)[c],f=v&&s?u(p,r):g&&"function"==typeof p?u(Function.call,p):p,b&&a(b,c,p,e&l.U),y[c]!=p&&i(y,c,f),g&&w[c]!=p&&(w[c]=p)};r.core=o,l.F=1,l.G=2,l.S=4,l.P=8,l.B=16,l.W=32,l.U=64,l.R=128,e.exports=l},function(e,t,n){"use strict";e.exports=n(437)},function(e,t,n){var r=n(5);e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t,n){var r=n(52)("wks"),o=n(36),i=n(3).Symbol,a="function"==typeof i;(e.exports=function(e){return r[e]||(r[e]=a&&i[e]||(a?i:o)("Symbol."+e))}).store=r},function(e,t,n){var r=n(23),o=Math.min;e.exports=function(e){return e>0?o(r(e),9007199254740991):0}},function(e,t,n){e.exports=!n(4)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(e,t,n){var r=n(2),o=n(106),i=n(25),a=Object.defineProperty;t.f=n(8)?Object.defineProperty:function(e,t,n){if(r(e),t=i(t,!0),r(n),o)try{return a(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},function(e,t,n){var r=n(26);e.exports=function(e){return Object(r(e))}},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t,n){var r=n(9),o=n(35);e.exports=n(8)?function(e,t,n){return r.f(e,t,o(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t,n){var r=n(3),o=n(12),i=n(15),a=n(36)("src"),u=n(149),l=(""+u).split("toString");n(20).inspectSource=function(e){return u.call(e)},(e.exports=function(e,t,n,u){var c="function"==typeof n;c&&(i(n,"name")||o(n,"name",t)),e[t]!==n&&(c&&(i(n,a)||o(n,a,e[t]?""+e[t]:l.join(String(t)))),e===r?e[t]=n:u?e[t]?e[t]=n:o(e,t,n):(delete e[t],o(e,t,n)))})(Function.prototype,"toString",function(){return"function"==typeof this&&this[a]||u.call(this)})},function(e,t,n){var r=n(0),o=n(4),i=n(26),a=/"/g,u=function(e,t,n,r){var o=String(i(e)),u="<"+t;return""!==n&&(u+=" "+n+'="'+String(r).replace(a,""")+'"'),u+">"+o+"</"+t+">"};e.exports=function(e,t){var n={};n[e]=t(u),r(r.P+r.F*o(function(){var t=""[e]('"');return t!==t.toLowerCase()||t.split('"').length>3}),"String",n)}},function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t,n){var r=n(53),o=n(26);e.exports=function(e){return r(o(e))}},function(e,t,n){var r=n(54),o=n(35),i=n(16),a=n(25),u=n(15),l=n(106),c=Object.getOwnPropertyDescriptor;t.f=n(8)?c:function(e,t){if(e=i(e),t=a(t,!0),l)try{return c(e,t)}catch(e){}if(u(e,t))return o(!r.f.call(e,t),e[t])}},function(e,t,n){var r=n(15),o=n(10),i=n(77)("IE_PROTO"),a=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=o(e),r(e,i)?e[i]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?a:null}},function(e,t,n){e.exports=n(440)()},function(e,t){var n=e.exports={version:"2.6.5"};"number"==typeof __e&&(__e=n)},function(e,t,n){var r=n(11);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,o){return e.call(t,n,r,o)}}return function(){return e.apply(t,arguments)}}},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}},function(e,t,n){"use strict";var r=n(4);e.exports=function(e,t){return!!e&&r(function(){t?e.call(null,function(){},1):e.call(null)})}},function(e,t,n){var r=n(5);e.exports=function(e,t){if(!r(e))return e;var n,o;if(t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;if("function"==typeof(n=e.valueOf)&&!r(o=n.call(e)))return o;if(!t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;throw TypeError("Can't convert object to primitive value")}},function(e,t){e.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}},function(e,t,n){var r=n(0),o=n(20),i=n(4);e.exports=function(e,t){var n=(o.Object||{})[e]||Object[e],a={};a[e]=t(n),r(r.S+r.F*i(function(){n(1)}),"Object",a)}},function(e,t,n){var r=n(21),o=n(53),i=n(10),a=n(7),u=n(93);e.exports=function(e,t){var n=1==e,l=2==e,c=3==e,s=4==e,p=6==e,f=5==e||p,d=t||u;return function(t,u,m){for(var h,g,v=i(t),b=o(v),y=r(u,m,3),w=a(b.length),x=0,E=n?d(t,w):l?d(t,0):void 0;w>x;x++)if((f||x in b)&&(g=y(h=b[x],x,v),e))if(n)E[x]=g;else if(g)switch(e){case 3:return!0;case 5:return h;case 6:return x;case 2:E.push(h)}else if(s)return!1;return p?-1:c||s?s:E}}},function(e,t,n){"use strict";if(n(8)){var r=n(32),o=n(3),i=n(4),a=n(0),u=n(68),l=n(101),c=n(21),s=n(42),p=n(35),f=n(12),d=n(44),m=n(23),h=n(7),g=n(134),v=n(38),b=n(25),y=n(15),w=n(47),x=n(5),E=n(10),S=n(90),I=n(39),T=n(18),C=n(40).f,k=n(92),P=n(36),j=n(6),N=n(28),D=n(58),O=n(56),M=n(95),L=n(49),_=n(63),A=n(41),R=n(94),z=n(123),F=n(9),U=n(17),H=F.f,W=U.f,B=o.RangeError,q=o.TypeError,G=o.Uint8Array,V=Array.prototype,Z=l.ArrayBuffer,J=l.DataView,Y=N(0),X=N(2),Q=N(3),K=N(4),$=N(5),ee=N(6),te=D(!0),ne=D(!1),re=M.values,oe=M.keys,ie=M.entries,ae=V.lastIndexOf,ue=V.reduce,le=V.reduceRight,ce=V.join,se=V.sort,pe=V.slice,fe=V.toString,de=V.toLocaleString,me=j("iterator"),he=j("toStringTag"),ge=P("typed_constructor"),ve=P("def_constructor"),be=u.CONSTR,ye=u.TYPED,we=u.VIEW,xe=N(1,function(e,t){return Ce(O(e,e[ve]),t)}),Ee=i(function(){return 1===new G(new Uint16Array([1]).buffer)[0]}),Se=!!G&&!!G.prototype.set&&i(function(){new G(1).set({})}),Ie=function(e,t){var n=m(e);if(n<0||n%t)throw B("Wrong offset!");return n},Te=function(e){if(x(e)&&ye in e)return e;throw q(e+" is not a typed array!")},Ce=function(e,t){if(!(x(e)&&ge in e))throw q("It is not a typed array constructor!");return new e(t)},ke=function(e,t){return Pe(O(e,e[ve]),t)},Pe=function(e,t){for(var n=0,r=t.length,o=Ce(e,r);r>n;)o[n]=t[n++];return o},je=function(e,t,n){H(e,t,{get:function(){return this._d[n]}})},Ne=function(e){var t,n,r,o,i,a,u=E(e),l=arguments.length,s=l>1?arguments[1]:void 0,p=void 0!==s,f=k(u);if(void 0!=f&&!S(f)){for(a=f.call(u),r=[],t=0;!(i=a.next()).done;t++)r.push(i.value);u=r}for(p&&l>2&&(s=c(s,arguments[2],2)),t=0,n=h(u.length),o=Ce(this,n);n>t;t++)o[t]=p?s(u[t],t):u[t];return o},De=function(){for(var e=0,t=arguments.length,n=Ce(this,t);t>e;)n[e]=arguments[e++];return n},Oe=!!G&&i(function(){de.call(new G(1))}),Me=function(){return de.apply(Oe?pe.call(Te(this)):Te(this),arguments)},Le={copyWithin:function(e,t){return z.call(Te(this),e,t,arguments.length>2?arguments[2]:void 0)},every:function(e){return K(Te(this),e,arguments.length>1?arguments[1]:void 0)},fill:function(e){return R.apply(Te(this),arguments)},filter:function(e){return ke(this,X(Te(this),e,arguments.length>1?arguments[1]:void 0))},find:function(e){return $(Te(this),e,arguments.length>1?arguments[1]:void 0)},findIndex:function(e){return ee(Te(this),e,arguments.length>1?arguments[1]:void 0)},forEach:function(e){Y(Te(this),e,arguments.length>1?arguments[1]:void 0)},indexOf:function(e){return ne(Te(this),e,arguments.length>1?arguments[1]:void 0)},includes:function(e){return te(Te(this),e,arguments.length>1?arguments[1]:void 0)},join:function(e){return ce.apply(Te(this),arguments)},lastIndexOf:function(e){return ae.apply(Te(this),arguments)},map:function(e){return xe(Te(this),e,arguments.length>1?arguments[1]:void 0)},reduce:function(e){return ue.apply(Te(this),arguments)},reduceRight:function(e){return le.apply(Te(this),arguments)},reverse:function(){for(var e,t=Te(this).length,n=Math.floor(t/2),r=0;r<n;)e=this[r],this[r++]=this[--t],this[t]=e;return this},some:function(e){return Q(Te(this),e,arguments.length>1?arguments[1]:void 0)},sort:function(e){return se.call(Te(this),e)},subarray:function(e,t){var n=Te(this),r=n.length,o=v(e,r);return new(O(n,n[ve]))(n.buffer,n.byteOffset+o*n.BYTES_PER_ELEMENT,h((void 0===t?r:v(t,r))-o))}},_e=function(e,t){return ke(this,pe.call(Te(this),e,t))},Ae=function(e){Te(this);var t=Ie(arguments[1],1),n=this.length,r=E(e),o=h(r.length),i=0;if(o+t>n)throw B("Wrong length!");for(;i<o;)this[t+i]=r[i++]},Re={entries:function(){return ie.call(Te(this))},keys:function(){return oe.call(Te(this))},values:function(){return re.call(Te(this))}},ze=function(e,t){return x(e)&&e[ye]&&"symbol"!=typeof t&&t in e&&String(+t)==String(t)},Fe=function(e,t){return ze(e,t=b(t,!0))?p(2,e[t]):W(e,t)},Ue=function(e,t,n){return!(ze(e,t=b(t,!0))&&x(n)&&y(n,"value"))||y(n,"get")||y(n,"set")||n.configurable||y(n,"writable")&&!n.writable||y(n,"enumerable")&&!n.enumerable?H(e,t,n):(e[t]=n.value,e)};be||(U.f=Fe,F.f=Ue),a(a.S+a.F*!be,"Object",{getOwnPropertyDescriptor:Fe,defineProperty:Ue}),i(function(){fe.call({})})&&(fe=de=function(){return ce.call(this)});var He=d({},Le);d(He,Re),f(He,me,Re.values),d(He,{slice:_e,set:Ae,constructor:function(){},toString:fe,toLocaleString:Me}),je(He,"buffer","b"),je(He,"byteOffset","o"),je(He,"byteLength","l"),je(He,"length","e"),H(He,he,{get:function(){return this[ye]}}),e.exports=function(e,t,n,l){var c=e+((l=!!l)?"Clamped":"")+"Array",p="get"+e,d="set"+e,m=o[c],v=m||{},b=m&&T(m),y=!m||!u.ABV,E={},S=m&&m.prototype,k=function(e,n){H(e,n,{get:function(){return function(e,n){var r=e._d;return r.v[p](n*t+r.o,Ee)}(this,n)},set:function(e){return function(e,n,r){var o=e._d;l&&(r=(r=Math.round(r))<0?0:r>255?255:255&r),o.v[d](n*t+o.o,r,Ee)}(this,n,e)},enumerable:!0})};y?(m=n(function(e,n,r,o){s(e,m,c,"_d");var i,a,u,l,p=0,d=0;if(x(n)){if(!(n instanceof Z||"ArrayBuffer"==(l=w(n))||"SharedArrayBuffer"==l))return ye in n?Pe(m,n):Ne.call(m,n);i=n,d=Ie(r,t);var v=n.byteLength;if(void 0===o){if(v%t)throw B("Wrong length!");if((a=v-d)<0)throw B("Wrong length!")}else if((a=h(o)*t)+d>v)throw B("Wrong length!");u=a/t}else u=g(n),i=new Z(a=u*t);for(f(e,"_d",{b:i,o:d,l:a,e:u,v:new J(i)});p<u;)k(e,p++)}),S=m.prototype=I(He),f(S,"constructor",m)):i(function(){m(1)})&&i(function(){new m(-1)})&&_(function(e){new m,new m(null),new m(1.5),new m(e)},!0)||(m=n(function(e,n,r,o){var i;return s(e,m,c),x(n)?n instanceof Z||"ArrayBuffer"==(i=w(n))||"SharedArrayBuffer"==i?void 0!==o?new v(n,Ie(r,t),o):void 0!==r?new v(n,Ie(r,t)):new v(n):ye in n?Pe(m,n):Ne.call(m,n):new v(g(n))}),Y(b!==Function.prototype?C(v).concat(C(b)):C(v),function(e){e in m||f(m,e,v[e])}),m.prototype=S,r||(S.constructor=m));var P=S[me],j=!!P&&("values"==P.name||void 0==P.name),N=Re.values;f(m,ge,!0),f(S,ye,c),f(S,we,!0),f(S,ve,m),(l?new m(1)[he]==c:he in S)||H(S,he,{get:function(){return c}}),E[c]=m,a(a.G+a.W+a.F*(m!=v),E),a(a.S,c,{BYTES_PER_ELEMENT:t}),a(a.S+a.F*i(function(){v.of.call(m,1)}),c,{from:Ne,of:De}),"BYTES_PER_ELEMENT"in S||f(S,"BYTES_PER_ELEMENT",t),a(a.P,c,Le),A(c),a(a.P+a.F*Se,c,{set:Ae}),a(a.P+a.F*!j,c,Re),r||S.toString==fe||(S.toString=fe),a(a.P+a.F*i(function(){new m(1).slice()}),c,{slice:_e}),a(a.P+a.F*(i(function(){return[1,2].toLocaleString()!=new m([1,2]).toLocaleString()})||!i(function(){S.toLocaleString.call([1,2])})),c,{toLocaleString:Me}),L[c]=j?P:N,r||j||f(S,me,N)}}else e.exports=function(){}},function(e,t,n){var r=n(129),o=n(0),i=n(52)("metadata"),a=i.store||(i.store=new(n(132))),u=function(e,t,n){var o=a.get(e);if(!o){if(!n)return;a.set(e,o=new r)}var i=o.get(t);if(!i){if(!n)return;o.set(t,i=new r)}return i};e.exports={store:a,map:u,has:function(e,t,n){var r=u(t,n,!1);return void 0!==r&&r.has(e)},get:function(e,t,n){var r=u(t,n,!1);return void 0===r?void 0:r.get(e)},set:function(e,t,n,r){u(n,r,!0).set(e,t)},keys:function(e,t){var n=u(e,t,!1),r=[];return n&&n.forEach(function(e,t){r.push(t)}),r},key:function(e){return void 0===e||"symbol"==typeof e?e:String(e)},exp:function(e){o(o.S,"Reflect",e)}}},,function(e,t){e.exports=!1},function(e,t,n){var r=n(36)("meta"),o=n(5),i=n(15),a=n(9).f,u=0,l=Object.isExtensible||function(){return!0},c=!n(4)(function(){return l(Object.preventExtensions({}))}),s=function(e){a(e,r,{value:{i:"O"+ ++u,w:{}}})},p=e.exports={KEY:r,NEED:!1,fastKey:function(e,t){if(!o(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!i(e,r)){if(!l(e))return"F";if(!t)return"E";s(e)}return e[r].i},getWeak:function(e,t){if(!i(e,r)){if(!l(e))return!0;if(!t)return!1;s(e)}return e[r].w},onFreeze:function(e){return c&&p.NEED&&l(e)&&!i(e,r)&&s(e),e}}},function(e,t,n){var r=n(6)("unscopables"),o=Array.prototype;void 0==o[r]&&n(12)(o,r,{}),e.exports=function(e){o[r][e]=!0}},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t){var n=0,r=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++n+r).toString(36))}},function(e,t,n){var r=n(108),o=n(78);e.exports=Object.keys||function(e){return r(e,o)}},function(e,t,n){var r=n(23),o=Math.max,i=Math.min;e.exports=function(e,t){return(e=r(e))<0?o(e+t,0):i(e,t)}},function(e,t,n){var r=n(2),o=n(109),i=n(78),a=n(77)("IE_PROTO"),u=function(){},l=function(){var e,t=n(75)("iframe"),r=i.length;for(t.style.display="none",n(79).appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("<script>document.F=Object<\/script>"),e.close(),l=e.F;r--;)delete l.prototype[i[r]];return l()};e.exports=Object.create||function(e,t){var n;return null!==e?(u.prototype=r(e),n=new u,u.prototype=null,n[a]=e):n=l(),void 0===t?n:o(n,t)}},function(e,t,n){var r=n(108),o=n(78).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return r(e,o)}},function(e,t,n){"use strict";var r=n(3),o=n(9),i=n(8),a=n(6)("species");e.exports=function(e){var t=r[e];i&&t&&!t[a]&&o.f(t,a,{configurable:!0,get:function(){return this}})}},function(e,t){e.exports=function(e,t,n,r){if(!(e instanceof t)||void 0!==r&&r in e)throw TypeError(n+": incorrect invocation!");return e}},function(e,t,n){var r=n(21),o=n(121),i=n(90),a=n(2),u=n(7),l=n(92),c={},s={};(t=e.exports=function(e,t,n,p,f){var d,m,h,g,v=f?function(){return e}:l(e),b=r(n,p,t?2:1),y=0;if("function"!=typeof v)throw TypeError(e+" is not iterable!");if(i(v)){for(d=u(e.length);d>y;y++)if((g=t?b(a(m=e[y])[0],m[1]):b(e[y]))===c||g===s)return g}else for(h=v.call(e);!(m=h.next()).done;)if((g=o(h,b,m.value,t))===c||g===s)return g}).BREAK=c,t.RETURN=s},function(e,t,n){var r=n(13);e.exports=function(e,t,n){for(var o in t)r(e,o,t[o],n);return e}},function(e,t,n){var r=n(5);e.exports=function(e,t){if(!r(e)||e._t!==t)throw TypeError("Incompatible receiver, "+t+" required!");return e}},function(e,t,n){var r=n(9).f,o=n(15),i=n(6)("toStringTag");e.exports=function(e,t,n){e&&!o(e=n?e:e.prototype,i)&&r(e,i,{configurable:!0,value:t})}},function(e,t,n){var r=n(22),o=n(6)("toStringTag"),i="Arguments"==r(function(){return arguments}());e.exports=function(e){var t,n,a;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),o))?n:i?r(t):"Object"==(a=r(t))&&"function"==typeof t.callee?"Arguments":a}},function(e,t,n){var r=n(0),o=n(26),i=n(4),a=n(81),u="["+a+"]",l=RegExp("^"+u+u+"*"),c=RegExp(u+u+"*$"),s=function(e,t,n){var o={},u=i(function(){return!!a[e]()||"
"!="
"[e]()}),l=o[e]=u?t(p):a[e];n&&(o[n]=l),r(r.P+r.F*u,"String",o)},p=s.trim=function(e,t){return e=String(o(e)),1&t&&(e=e.replace(l,"")),2&t&&(e=e.replace(c,"")),e};e.exports=s},function(e,t){e.exports={}},function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";t.a=function(e){return arguments.length>1&&void 0!==arguments[1]&&arguments[1],wprm_admin_modal.translations.hasOwnProperty(e)?wprm_admin_modal.translations[e]:e}},function(e,t,n){var r=n(20),o=n(3),i=o["__core-js_shared__"]||(o["__core-js_shared__"]={});(e.exports=function(e,t){return i[e]||(i[e]=void 0!==t?t:{})})("versions",[]).push({version:r.version,mode:n(32)?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},function(e,t,n){var r=n(22);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==r(e)?e.split(""):Object(e)}},function(e,t){t.f={}.propertyIsEnumerable},function(e,t,n){"use strict";var r=n(2);e.exports=function(){var e=r(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t}},function(e,t,n){var r=n(2),o=n(11),i=n(6)("species");e.exports=function(e,t){var n,a=r(e).constructor;return void 0===a||void 0==(n=r(a)[i])?t:o(n)}},,function(e,t,n){var r=n(16),o=n(7),i=n(38);e.exports=function(e){return function(t,n,a){var u,l=r(t),c=o(l.length),s=i(a,c);if(e&&n!=n){for(;c>s;)if((u=l[s++])!=u)return!0}else for(;c>s;s++)if((e||s in l)&&l[s]===n)return e||s||0;return!e&&-1}}},function(e,t){t.f=Object.getOwnPropertySymbols},function(e,t,n){var r=n(22);e.exports=Array.isArray||function(e){return"Array"==r(e)}},function(e,t,n){var r=n(23),o=n(26);e.exports=function(e){return function(t,n){var i,a,u=String(o(t)),l=r(n),c=u.length;return l<0||l>=c?e?"":void 0:(i=u.charCodeAt(l))<55296||i>56319||l+1===c||(a=u.charCodeAt(l+1))<56320||a>57343?e?u.charAt(l):i:e?u.slice(l,l+2):a-56320+(i-55296<<10)+65536}}},function(e,t,n){var r=n(5),o=n(22),i=n(6)("match");e.exports=function(e){var t;return r(e)&&(void 0!==(t=e[i])?!!t:"RegExp"==o(e))}},function(e,t,n){var r=n(6)("iterator"),o=!1;try{var i=[7][r]();i.return=function(){o=!0},Array.from(i,function(){throw 2})}catch(e){}e.exports=function(e,t){if(!t&&!o)return!1;var n=!1;try{var i=[7],a=i[r]();a.next=function(){return{done:n=!0}},i[r]=function(){return a},e(i)}catch(e){}return n}},function(e,t,n){"use strict";var r=n(47),o=RegExp.prototype.exec;e.exports=function(e,t){var n=e.exec;if("function"==typeof n){var i=n.call(e,t);if("object"!=typeof i)throw new TypeError("RegExp exec method returned something other than an Object or null");return i}if("RegExp"!==r(e))throw new TypeError("RegExp#exec called on incompatible receiver");return o.call(e,t)}},function(e,t,n){"use strict";n(125);var r=n(13),o=n(12),i=n(4),a=n(26),u=n(6),l=n(96),c=u("species"),s=!i(function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}),p=function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var n="ab".split(e);return 2===n.length&&"a"===n[0]&&"b"===n[1]}();e.exports=function(e,t,n){var f=u(e),d=!i(function(){var t={};return t[f]=function(){return 7},7!=""[e](t)}),m=d?!i(function(){var t=!1,n=/a/;return n.exec=function(){return t=!0,null},"split"===e&&(n.constructor={},n.constructor[c]=function(){return n}),n[f](""),!t}):void 0;if(!d||!m||"replace"===e&&!s||"split"===e&&!p){var h=/./[f],g=n(a,f,""[e],function(e,t,n,r,o){return t.exec===l?d&&!o?{done:!0,value:h.call(t,n,r)}:{done:!0,value:e.call(n,t,r)}:{done:!1}}),v=g[0],b=g[1];r(String.prototype,e,v),o(RegExp.prototype,f,2==t?function(e,t){return b.call(e,this,t)}:function(e){return b.call(e,this)})}}},function(e,t,n){var r=n(3).navigator;e.exports=r&&r.userAgent||""},function(e,t,n){"use strict";var r=n(3),o=n(0),i=n(13),a=n(44),u=n(33),l=n(43),c=n(42),s=n(5),p=n(4),f=n(63),d=n(46),m=n(82);e.exports=function(e,t,n,h,g,v){var b=r[e],y=b,w=g?"set":"add",x=y&&y.prototype,E={},S=function(e){var t=x[e];i(x,e,"delete"==e?function(e){return!(v&&!s(e))&&t.call(this,0===e?0:e)}:"has"==e?function(e){return!(v&&!s(e))&&t.call(this,0===e?0:e)}:"get"==e?function(e){return v&&!s(e)?void 0:t.call(this,0===e?0:e)}:"add"==e?function(e){return t.call(this,0===e?0:e),this}:function(e,n){return t.call(this,0===e?0:e,n),this})};if("function"==typeof y&&(v||x.forEach&&!p(function(){(new y).entries().next()}))){var I=new y,T=I[w](v?{}:-0,1)!=I,C=p(function(){I.has(1)}),k=f(function(e){new y(e)}),P=!v&&p(function(){for(var e=new y,t=5;t--;)e[w](t,t);return!e.has(-0)});k||((y=t(function(t,n){c(t,y,e);var r=m(new b,t,y);return void 0!=n&&l(n,g,r[w],r),r})).prototype=x,x.constructor=y),(C||P)&&(S("delete"),S("has"),g&&S("get")),(P||T)&&S(w),v&&x.clear&&delete x.clear}else y=h.getConstructor(t,e,g,w),a(y.prototype,n),u.NEED=!0;return d(y,e),E[e]=y,o(o.G+o.W+o.F*(y!=b),E),v||h.setStrong(y,e,g),y}},function(e,t,n){for(var r,o=n(3),i=n(12),a=n(36),u=a("typed_array"),l=a("view"),c=!(!o.ArrayBuffer||!o.DataView),s=c,p=0,f="Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array".split(",");p<9;)(r=o[f[p++]])?(i(r.prototype,u,!0),i(r.prototype,l,!0)):s=!1;e.exports={ABV:c,CONSTR:s,TYPED:u,VIEW:l}},function(e,t,n){"use strict";e.exports=n(32)||!n(4)(function(){var e=Math.random();__defineSetter__.call(null,e,function(){}),delete n(3)[e]})},function(e,t,n){"use strict";var r=n(0);e.exports=function(e){r(r.S,e,{of:function(){for(var e=arguments.length,t=new Array(e);e--;)t[e]=arguments[e];return new this(t)}})}},function(e,t,n){"use strict";var r=n(0),o=n(11),i=n(21),a=n(43);e.exports=function(e){r(r.S,e,{from:function(e){var t,n,r,u,l=arguments[1];return o(this),(t=void 0!==l)&&o(l),void 0==e?new this:(n=[],t?(r=0,u=i(l,arguments[2],2),a(e,!1,function(e){n.push(u(e,r++))})):a(e,!1,n.push,n),new this(n))}})}},,function(e,t,n){"use strict";!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}(),e.exports=n(436)},,function(e,t,n){var r=n(5),o=n(3).document,i=r(o)&&r(o.createElement);e.exports=function(e){return i?o.createElement(e):{}}},function(e,t,n){var r=n(3),o=n(20),i=n(32),a=n(107),u=n(9).f;e.exports=function(e){var t=o.Symbol||(o.Symbol=i?{}:r.Symbol||{});"_"==e.charAt(0)||e in t||u(t,e,{value:a.f(e)})}},function(e,t,n){var r=n(52)("keys"),o=n(36);e.exports=function(e){return r[e]||(r[e]=o(e))}},function(e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(e,t,n){var r=n(3).document;e.exports=r&&r.documentElement},function(e,t,n){var r=n(5),o=n(2),i=function(e,t){if(o(e),!r(t)&&null!==t)throw TypeError(t+": can't set as prototype!")};e.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(e,t,r){try{(r=n(21)(Function.call,n(17).f(Object.prototype,"__proto__").set,2))(e,[]),t=!(e instanceof Array)}catch(e){t=!0}return function(e,n){return i(e,n),t?e.__proto__=n:r(e,n),e}}({},!1):void 0),check:i}},function(e,t){e.exports="\t\n\v\f\r \u2028\u2029\ufeff"},function(e,t,n){var r=n(5),o=n(80).set;e.exports=function(e,t,n){var i,a=t.constructor;return a!==n&&"function"==typeof a&&(i=a.prototype)!==n.prototype&&r(i)&&o&&o(e,i),e}},function(e,t,n){"use strict";var r=n(23),o=n(26);e.exports=function(e){var t=String(o(this)),n="",i=r(e);if(i<0||i==1/0)throw RangeError("Count can't be negative");for(;i>0;(i>>>=1)&&(t+=t))1&i&&(n+=t);return n}},function(e,t){e.exports=Math.sign||function(e){return 0==(e=+e)||e!=e?e:e<0?-1:1}},function(e,t){var n=Math.expm1;e.exports=!n||n(10)>22025.465794806718||n(10)<22025.465794806718||-2e-17!=n(-2e-17)?function(e){return 0==(e=+e)?e:e>-1e-6&&e<1e-6?e+e*e/2:Math.exp(e)-1}:n},function(e,t,n){"use strict";var r=n(32),o=n(0),i=n(13),a=n(12),u=n(49),l=n(87),c=n(46),s=n(18),p=n(6)("iterator"),f=!([].keys&&"next"in[].keys()),d=function(){return this};e.exports=function(e,t,n,m,h,g,v){l(n,t,m);var b,y,w,x=function(e){if(!f&&e in T)return T[e];switch(e){case"keys":case"values":return function(){return new n(this,e)}}return function(){return new n(this,e)}},E=t+" Iterator",S="values"==h,I=!1,T=e.prototype,C=T[p]||T["@@iterator"]||h&&T[h],k=C||x(h),P=h?S?x("entries"):k:void 0,j="Array"==t?T.entries||C:C;if(j&&(w=s(j.call(new e)))!==Object.prototype&&w.next&&(c(w,E,!0),r||"function"==typeof w[p]||a(w,p,d)),S&&C&&"values"!==C.name&&(I=!0,k=function(){return C.call(this)}),r&&!v||!f&&!I&&T[p]||a(T,p,k),u[t]=k,u[E]=d,h)if(b={values:S?k:x("values"),keys:g?k:x("keys"),entries:P},v)for(y in b)y in T||i(T,y,b[y]);else o(o.P+o.F*(f||I),t,b);return b}},function(e,t,n){"use strict";var r=n(39),o=n(35),i=n(46),a={};n(12)(a,n(6)("iterator"),function(){return this}),e.exports=function(e,t,n){e.prototype=r(a,{next:o(1,n)}),i(e,t+" Iterator")}},function(e,t,n){var r=n(62),o=n(26);e.exports=function(e,t,n){if(r(t))throw TypeError("String#"+n+" doesn't accept regex!");return String(o(e))}},function(e,t,n){var r=n(6)("match");e.exports=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[r]=!1,!"/./"[e](t)}catch(e){}}return!0}},function(e,t,n){var r=n(49),o=n(6)("iterator"),i=Array.prototype;e.exports=function(e){return void 0!==e&&(r.Array===e||i[o]===e)}},function(e,t,n){"use strict";var r=n(9),o=n(35);e.exports=function(e,t,n){t in e?r.f(e,t,o(0,n)):e[t]=n}},function(e,t,n){var r=n(47),o=n(6)("iterator"),i=n(49);e.exports=n(20).getIteratorMethod=function(e){if(void 0!=e)return e[o]||e["@@iterator"]||i[r(e)]}},function(e,t,n){var r=n(238);e.exports=function(e,t){return new(r(e))(t)}},function(e,t,n){"use strict";var r=n(10),o=n(38),i=n(7);e.exports=function(e){for(var t=r(this),n=i(t.length),a=arguments.length,u=o(a>1?arguments[1]:void 0,n),l=a>2?arguments[2]:void 0,c=void 0===l?n:o(l,n);c>u;)t[u++]=e;return t}},function(e,t,n){"use strict";var r=n(34),o=n(124),i=n(49),a=n(16);e.exports=n(86)(Array,"Array",function(e,t){this._t=a(e),this._i=0,this._k=t},function(){var e=this._t,t=this._k,n=this._i++;return!e||n>=e.length?(this._t=void 0,o(1)):"keys"==t?o(0,n):"values"==t?o(0,e[n]):o(0,[n,e[n]])},"values"),i.Arguments=i.Array,r("keys"),r("values"),r("entries")},function(e,t,n){"use strict";var r,o,i=n(55),a=RegExp.prototype.exec,u=String.prototype.replace,l=a,c=(r=/a/,o=/b*/g,a.call(r,"a"),a.call(o,"a"),0!==r.lastIndex||0!==o.lastIndex),s=void 0!==/()??/.exec("")[1];(c||s)&&(l=function(e){var t,n,r,o,l=this;return s&&(n=new RegExp("^"+l.source+"$(?!\\s)",i.call(l))),c&&(t=l.lastIndex),r=a.call(l,e),c&&r&&(l.lastIndex=l.global?r.index+r[0].length:t),s&&r&&r.length>1&&u.call(r[0],n,function(){for(o=1;o<arguments.length-2;o++)void 0===arguments[o]&&(r[o]=void 0)}),r}),e.exports=l},function(e,t,n){"use strict";var r=n(61)(!0);e.exports=function(e,t,n){return t+(n?r(e,t).length:1)}},function(e,t,n){var r,o,i,a=n(21),u=n(114),l=n(79),c=n(75),s=n(3),p=s.process,f=s.setImmediate,d=s.clearImmediate,m=s.MessageChannel,h=s.Dispatch,g=0,v={},b=function(){var e=+this;if(v.hasOwnProperty(e)){var t=v[e];delete v[e],t()}},y=function(e){b.call(e.data)};f&&d||(f=function(e){for(var t=[],n=1;arguments.length>n;)t.push(arguments[n++]);return v[++g]=function(){u("function"==typeof e?e:Function(e),t)},r(g),g},d=function(e){delete v[e]},"process"==n(22)(p)?r=function(e){p.nextTick(a(b,e,1))}:h&&h.now?r=function(e){h.now(a(b,e,1))}:m?(i=(o=new m).port2,o.port1.onmessage=y,r=a(i.postMessage,i,1)):s.addEventListener&&"function"==typeof postMessage&&!s.importScripts?(r=function(e){s.postMessage(e+"","*")},s.addEventListener("message",y,!1)):r="onreadystatechange"in c("script")?function(e){l.appendChild(c("script")).onreadystatechange=function(){l.removeChild(this),b.call(e)}}:function(e){setTimeout(a(b,e,1),0)}),e.exports={set:f,clear:d}},function(e,t,n){var r=n(3),o=n(98).set,i=r.MutationObserver||r.WebKitMutationObserver,a=r.process,u=r.Promise,l="process"==n(22)(a);e.exports=function(){var e,t,n,c=function(){var r,o;for(l&&(r=a.domain)&&r.exit();e;){o=e.fn,e=e.next;try{o()}catch(r){throw e?n():t=void 0,r}}t=void 0,r&&r.enter()};if(l)n=function(){a.nextTick(c)};else if(!i||r.navigator&&r.navigator.standalone)if(u&&u.resolve){var s=u.resolve(void 0);n=function(){s.then(c)}}else n=function(){o.call(r,c)};else{var p=!0,f=document.createTextNode("");new i(c).observe(f,{characterData:!0}),n=function(){f.data=p=!p}}return function(r){var o={fn:r,next:void 0};t&&(t.next=o),e||(e=o,n()),t=o}}},function(e,t,n){"use strict";var r=n(11);e.exports.f=function(e){return new function(e){var t,n;this.promise=new e(function(e,r){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=r}),this.resolve=r(t),this.reject=r(n)}(e)}},function(e,t,n){"use strict";function r(e,t,n){var r,o,i,a=new Array(n),u=8*n-t-1,l=(1<<u)-1,c=l>>1,s=23===t?z(2,-24)-z(2,-77):0,p=0,f=e<0||0===e&&1/e<0?1:0;for((e=R(e))!=e||e===_?(o=e!=e?1:0,r=l):(r=F(U(e)/H),e*(i=z(2,-r))<1&&(r--,i*=2),e+=r+c>=1?s/i:s*z(2,1-c),e*i>=2&&(r++,i/=2),r+c>=l?(o=0,r=l):r+c>=1?(o=(e*i-1)*z(2,t),r+=c):(o=e*z(2,c-1)*z(2,t),r=0));t>=8;a[p++]=255&o,o/=256,t-=8);for(r=r<<t|o,u+=t;u>0;a[p++]=255&r,r/=256,u-=8);return a[--p]|=128*f,a}function o(e,t,n){var r,o=8*n-t-1,i=(1<<o)-1,a=i>>1,u=o-7,l=n-1,c=e[l--],s=127&c;for(c>>=7;u>0;s=256*s+e[l],l--,u-=8);for(r=s&(1<<-u)-1,s>>=-u,u+=t;u>0;r=256*r+e[l],l--,u-=8);if(0===s)s=1-a;else{if(s===i)return r?NaN:c?-_:_;r+=z(2,t),s-=a}return(c?-1:1)*r*z(2,s-t)}function i(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]}function a(e){return[255&e]}function u(e){return[255&e,e>>8&255]}function l(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]}function c(e){return r(e,52,8)}function s(e){return r(e,23,4)}function p(e,t,n){C(e[j],t,{get:function(){return this[n]}})}function f(e,t,n,r){var o=I(+n);if(o+t>e[B])throw L(N);var i=e[W]._b,a=o+e[q],u=i.slice(a,a+t);return r?u:u.reverse()}function d(e,t,n,r,o,i){var a=I(+n);if(a+t>e[B])throw L(N);for(var u=e[W]._b,l=a+e[q],c=r(+o),s=0;s<t;s++)u[l+s]=c[i?s:t-s-1]}var m=n(3),h=n(8),g=n(32),v=n(68),b=n(12),y=n(44),w=n(4),x=n(42),E=n(23),S=n(7),I=n(134),T=n(40).f,C=n(9).f,k=n(94),P=n(46),j="prototype",N="Wrong index!",D=m.ArrayBuffer,O=m.DataView,M=m.Math,L=m.RangeError,_=m.Infinity,A=D,R=M.abs,z=M.pow,F=M.floor,U=M.log,H=M.LN2,W=h?"_b":"buffer",B=h?"_l":"byteLength",q=h?"_o":"byteOffset";if(v.ABV){if(!w(function(){D(1)})||!w(function(){new D(-1)})||w(function(){return new D,new D(1.5),new D(NaN),"ArrayBuffer"!=D.name})){for(var G,V=(D=function(e){return x(this,D),new A(I(e))})[j]=A[j],Z=T(A),J=0;Z.length>J;)(G=Z[J++])in D||b(D,G,A[G]);g||(V.constructor=D)}var Y=new O(new D(2)),X=O[j].setInt8;Y.setInt8(0,2147483648),Y.setInt8(1,2147483649),(Y.getInt8(0)||!Y.getInt8(1))&&y(O[j],{setInt8:function(e,t){X.call(this,e,t<<24>>24)},setUint8:function(e,t){X.call(this,e,t<<24>>24)}},!0)}else D=function(e){x(this,D,"ArrayBuffer");var t=I(e);this._b=k.call(new Array(t),0),this[B]=t},O=function(e,t,n){x(this,O,"DataView"),x(e,D,"DataView");var r=e[B],o=E(t);if(o<0||o>r)throw L("Wrong offset!");if(o+(n=void 0===n?r-o:S(n))>r)throw L("Wrong length!");this[W]=e,this[q]=o,this[B]=n},h&&(p(D,"byteLength","_l"),p(O,"buffer","_b"),p(O,"byteLength","_l"),p(O,"byteOffset","_o")),y(O[j],{getInt8:function(e){return f(this,1,e)[0]<<24>>24},getUint8:function(e){return f(this,1,e)[0]},getInt16:function(e){var t=f(this,2,e,arguments[1]);return(t[1]<<8|t[0])<<16>>16},getUint16:function(e){var t=f(this,2,e,arguments[1]);return t[1]<<8|t[0]},getInt32:function(e){return i(f(this,4,e,arguments[1]))},getUint32:function(e){return i(f(this,4,e,arguments[1]))>>>0},getFloat32:function(e){return o(f(this,4,e,arguments[1]),23,4)},getFloat64:function(e){return o(f(this,8,e,arguments[1]),52,8)},setInt8:function(e,t){d(this,1,e,a,t)},setUint8:function(e,t){d(this,1,e,a,t)},setInt16:function(e,t){d(this,2,e,u,t,arguments[2])},setUint16:function(e,t){d(this,2,e,u,t,arguments[2])},setInt32:function(e,t){d(this,4,e,l,t,arguments[2])},setUint32:function(e,t){d(this,4,e,l,t,arguments[2])},setFloat32:function(e,t){d(this,4,e,s,t,arguments[2])},setFloat64:function(e,t){d(this,8,e,c,t,arguments[2])}});P(D,"ArrayBuffer"),P(O,"DataView"),b(O[j],v.VIEW,!0),t.ArrayBuffer=D,t.DataView=O},,,,,function(e,t,n){e.exports=!n(8)&&!n(4)(function(){return 7!=Object.defineProperty(n(75)("div"),"a",{get:function(){return 7}}).a})},function(e,t,n){t.f=n(6)},function(e,t,n){var r=n(15),o=n(16),i=n(58)(!1),a=n(77)("IE_PROTO");e.exports=function(e,t){var n,u=o(e),l=0,c=[];for(n in u)n!=a&&r(u,n)&&c.push(n);for(;t.length>l;)r(u,n=t[l++])&&(~i(c,n)||c.push(n));return c}},function(e,t,n){var r=n(9),o=n(2),i=n(37);e.exports=n(8)?Object.defineProperties:function(e,t){o(e);for(var n,a=i(t),u=a.length,l=0;u>l;)r.f(e,n=a[l++],t[n]);return e}},function(e,t,n){var r=n(16),o=n(40).f,i={}.toString,a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function(e){return a&&"[object Window]"==i.call(e)?function(e){try{return o(e)}catch(e){return a.slice()}}(e):o(r(e))}},function(e,t,n){"use strict";var r=n(37),o=n(59),i=n(54),a=n(10),u=n(53),l=Object.assign;e.exports=!l||n(4)(function(){var e={},t={},n=Symbol(),r="abcdefghijklmnopqrst";return e[n]=7,r.split("").forEach(function(e){t[e]=e}),7!=l({},e)[n]||Object.keys(l({},t)).join("")!=r})?function(e,t){for(var n=a(e),l=arguments.length,c=1,s=o.f,p=i.f;l>c;)for(var f,d=u(arguments[c++]),m=s?r(d).concat(s(d)):r(d),h=m.length,g=0;h>g;)p.call(d,f=m[g++])&&(n[f]=d[f]);return n}:l},function(e,t){e.exports=Object.is||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}},function(e,t,n){"use strict";var r=n(11),o=n(5),i=n(114),a=[].slice,u={};e.exports=Function.bind||function(e){var t=r(this),n=a.call(arguments,1),l=function(){var r=n.concat(a.call(arguments));return this instanceof l?function(e,t,n){if(!(t in u)){for(var r=[],o=0;o<t;o++)r[o]="a["+o+"]";u[t]=Function("F,a","return new F("+r.join(",")+")")}return u[t](e,n)}(t,r.length,r):i(t,r,e)};return o(t.prototype)&&(l.prototype=t.prototype),l}},function(e,t){e.exports=function(e,t,n){var r=void 0===n;switch(t.length){case 0:return r?e():e.call(n);case 1:return r?e(t[0]):e.call(n,t[0]);case 2:return r?e(t[0],t[1]):e.call(n,t[0],t[1]);case 3:return r?e(t[0],t[1],t[2]):e.call(n,t[0],t[1],t[2]);case 4:return r?e(t[0],t[1],t[2],t[3]):e.call(n,t[0],t[1],t[2],t[3])}return e.apply(n,t)}},function(e,t,n){var r=n(3).parseInt,o=n(48).trim,i=n(81),a=/^[-+]?0[xX]/;e.exports=8!==r(i+"08")||22!==r(i+"0x16")?function(e,t){var n=o(String(e),3);return r(n,t>>>0||(a.test(n)?16:10))}:r},function(e,t,n){var r=n(3).parseFloat,o=n(48).trim;e.exports=1/r(n(81)+"-0")!=-1/0?function(e){var t=o(String(e),3),n=r(t);return 0===n&&"-"==t.charAt(0)?-0:n}:r},function(e,t,n){var r=n(22);e.exports=function(e,t){if("number"!=typeof e&&"Number"!=r(e))throw TypeError(t);return+e}},function(e,t,n){var r=n(5),o=Math.floor;e.exports=function(e){return!r(e)&&isFinite(e)&&o(e)===e}},function(e,t){e.exports=Math.log1p||function(e){return(e=+e)>-1e-8&&e<1e-8?e-e*e/2:Math.log(1+e)}},function(e,t,n){var r=n(84),o=Math.pow,i=o(2,-52),a=o(2,-23),u=o(2,127)*(2-a),l=o(2,-126);e.exports=Math.fround||function(e){var t,n,o=Math.abs(e),c=r(e);return o<l?c*(o/l/a+1/i-1/i)*l*a:(n=(t=(1+a/i)*o)-(t-o))>u||n!=n?c*(1/0):c*n}},function(e,t,n){var r=n(2);e.exports=function(e,t,n,o){try{return o?t(r(n)[0],n[1]):t(n)}catch(t){var i=e.return;throw void 0!==i&&r(i.call(e)),t}}},function(e,t,n){var r=n(11),o=n(10),i=n(53),a=n(7);e.exports=function(e,t,n,u,l){r(t);var c=o(e),s=i(c),p=a(c.length),f=l?p-1:0,d=l?-1:1;if(n<2)for(;;){if(f in s){u=s[f],f+=d;break}if(f+=d,l?f<0:p<=f)throw TypeError("Reduce of empty array with no initial value")}for(;l?f>=0:p>f;f+=d)f in s&&(u=t(u,s[f],f,c));return u}},function(e,t,n){"use strict";var r=n(10),o=n(38),i=n(7);e.exports=[].copyWithin||function(e,t){var n=r(this),a=i(n.length),u=o(e,a),l=o(t,a),c=arguments.length>2?arguments[2]:void 0,s=Math.min((void 0===c?a:o(c,a))-l,a-u),p=1;for(l<u&&u<l+s&&(p=-1,l+=s-1,u+=s-1);s-- >0;)l in n?n[u]=n[l]:delete n[u],u+=p,l+=p;return n}},function(e,t){e.exports=function(e,t){return{value:t,done:!!e}}},function(e,t,n){"use strict";var r=n(96);n(0)({target:"RegExp",proto:!0,forced:r!==/./.exec},{exec:r})},function(e,t,n){n(8)&&"g"!=/./g.flags&&n(9).f(RegExp.prototype,"flags",{configurable:!0,get:n(55)})},function(e,t){e.exports=function(e){try{return{e:!1,v:e()}}catch(e){return{e:!0,v:e}}}},function(e,t,n){var r=n(2),o=n(5),i=n(100);e.exports=function(e,t){if(r(e),o(t)&&t.constructor===e)return t;var n=i.f(e);return(0,n.resolve)(t),n.promise}},function(e,t,n){"use strict";var r=n(130),o=n(45);e.exports=n(67)("Map",function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}},{get:function(e){var t=r.getEntry(o(this,"Map"),e);return t&&t.v},set:function(e,t){return r.def(o(this,"Map"),0===e?0:e,t)}},r,!0)},function(e,t,n){"use strict";var r=n(9).f,o=n(39),i=n(44),a=n(21),u=n(42),l=n(43),c=n(86),s=n(124),p=n(41),f=n(8),d=n(33).fastKey,m=n(45),h=f?"_s":"size",g=function(e,t){var n,r=d(t);if("F"!==r)return e._i[r];for(n=e._f;n;n=n.n)if(n.k==t)return n};e.exports={getConstructor:function(e,t,n,c){var s=e(function(e,r){u(e,s,t,"_i"),e._t=t,e._i=o(null),e._f=void 0,e._l=void 0,e[h]=0,void 0!=r&&l(r,n,e[c],e)});return i(s.prototype,{clear:function(){for(var e=m(this,t),n=e._i,r=e._f;r;r=r.n)r.r=!0,r.p&&(r.p=r.p.n=void 0),delete n[r.i];e._f=e._l=void 0,e[h]=0},delete:function(e){var n=m(this,t),r=g(n,e);if(r){var o=r.n,i=r.p;delete n._i[r.i],r.r=!0,i&&(i.n=o),o&&(o.p=i),n._f==r&&(n._f=o),n._l==r&&(n._l=i),n[h]--}return!!r},forEach:function(e){m(this,t);for(var n,r=a(e,arguments.length>1?arguments[1]:void 0,3);n=n?n.n:this._f;)for(r(n.v,n.k,this);n&&n.r;)n=n.p},has:function(e){return!!g(m(this,t),e)}}),f&&r(s.prototype,"size",{get:function(){return m(this,t)[h]}}),s},def:function(e,t,n){var r,o,i=g(e,t);return i?i.v=n:(e._l=i={i:o=d(t,!0),k:t,v:n,p:r=e._l,n:void 0,r:!1},e._f||(e._f=i),r&&(r.n=i),e[h]++,"F"!==o&&(e._i[o]=i)),e},getEntry:g,setStrong:function(e,t,n){c(e,t,function(e,n){this._t=m(e,t),this._k=n,this._l=void 0},function(){for(var e=this._k,t=this._l;t&&t.r;)t=t.p;return this._t&&(this._l=t=t?t.n:this._t._f)?"keys"==e?s(0,t.k):"values"==e?s(0,t.v):s(0,[t.k,t.v]):(this._t=void 0,s(1))},n?"entries":"values",!n,!0),p(t)}}},function(e,t,n){"use strict";var r=n(130),o=n(45);e.exports=n(67)("Set",function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}},{add:function(e){return r.def(o(this,"Set"),e=0===e?0:e,e)}},r)},function(e,t,n){"use strict";var r,o=n(3),i=n(28)(0),a=n(13),u=n(33),l=n(111),c=n(133),s=n(5),p=n(45),f=n(45),d=!o.ActiveXObject&&"ActiveXObject"in o,m=u.getWeak,h=Object.isExtensible,g=c.ufstore,v=function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}},b={get:function(e){if(s(e)){var t=m(e);return!0===t?g(p(this,"WeakMap")).get(e):t?t[this._i]:void 0}},set:function(e,t){return c.def(p(this,"WeakMap"),e,t)}},y=e.exports=n(67)("WeakMap",v,b,c,!0,!0);f&&d&&(l((r=c.getConstructor(v,"WeakMap")).prototype,b),u.NEED=!0,i(["delete","has","get","set"],function(e){var t=y.prototype,n=t[e];a(t,e,function(t,o){if(s(t)&&!h(t)){this._f||(this._f=new r);var i=this._f[e](t,o);return"set"==e?this:i}return n.call(this,t,o)})}))},function(e,t,n){"use strict";var r=n(44),o=n(33).getWeak,i=n(2),a=n(5),u=n(42),l=n(43),c=n(28),s=n(15),p=n(45),f=c(5),d=c(6),m=0,h=function(e){return e._l||(e._l=new g)},g=function(){this.a=[]},v=function(e,t){return f(e.a,function(e){return e[0]===t})};g.prototype={get:function(e){var t=v(this,e);if(t)return t[1]},has:function(e){return!!v(this,e)},set:function(e,t){var n=v(this,e);n?n[1]=t:this.a.push([e,t])},delete:function(e){var t=d(this.a,function(t){return t[0]===e});return~t&&this.a.splice(t,1),!!~t}},e.exports={getConstructor:function(e,t,n,i){var c=e(function(e,r){u(e,c,t,"_i"),e._t=t,e._i=m++,e._l=void 0,void 0!=r&&l(r,n,e[i],e)});return r(c.prototype,{delete:function(e){if(!a(e))return!1;var n=o(e);return!0===n?h(p(this,t)).delete(e):n&&s(n,this._i)&&delete n[this._i]},has:function(e){if(!a(e))return!1;var n=o(e);return!0===n?h(p(this,t)).has(e):n&&s(n,this._i)}}),c},def:function(e,t,n){var r=o(i(t),!0);return!0===r?h(e).set(t,n):r[e._i]=n,e},ufstore:h}},function(e,t,n){var r=n(23),o=n(7);e.exports=function(e){if(void 0===e)return 0;var t=r(e),n=o(t);if(t!==n)throw RangeError("Wrong length!");return n}},function(e,t,n){var r=n(40),o=n(59),i=n(2),a=n(3).Reflect;e.exports=a&&a.ownKeys||function(e){var t=r.f(i(e)),n=o.f;return n?t.concat(n(e)):t}},function(e,t,n){"use strict";var r=n(60),o=n(5),i=n(7),a=n(21),u=n(6)("isConcatSpreadable");e.exports=function e(t,n,l,c,s,p,f,d){for(var m,h,g=s,v=0,b=!!f&&a(f,d,3);v<c;){if(v in l){if(m=b?b(l[v],v,n):l[v],h=!1,o(m)&&(h=void 0!==(h=m[u])?!!h:r(m)),h&&p>0)g=e(t,n,m,i(m.length),g,p-1)-1;else{if(g>=9007199254740991)throw TypeError();t[g]=m}g++}v++}return g}},function(e,t,n){var r=n(7),o=n(83),i=n(26);e.exports=function(e,t,n,a){var u=String(i(e)),l=u.length,c=void 0===n?" ":String(n),s=r(t);if(s<=l||""==c)return u;var p=s-l,f=o.call(c,Math.ceil(p/c.length));return f.length>p&&(f=f.slice(0,p)),a?f+u:u+f}},function(e,t,n){var r=n(37),o=n(16),i=n(54).f;e.exports=function(e){return function(t){for(var n,a=o(t),u=r(a),l=u.length,c=0,s=[];l>c;)i.call(a,n=u[c++])&&s.push(e?[n,a[n]]:a[n]);return s}}},function(e,t,n){var r=n(47),o=n(140);e.exports=function(e){return function(){if(r(this)!=e)throw TypeError(e+"#toJSON isn't generic");return o(this)}}},function(e,t,n){var r=n(43);e.exports=function(e,t){var n=[];return r(e,!1,n.push,n,t),n}},function(e,t){e.exports=Math.scale||function(e,t,n,r,o){return 0===arguments.length||e!=e||t!=t||n!=n||r!=r||o!=o?NaN:e===1/0||e===-1/0?e:(e-t)*(o-r)/(n-t)+r}},,,,function(e,t,n){"use strict";(function(e){function t(e,t,n){e[t]||Object[r](e,t,{writable:!0,configurable:!0,value:n})}if(n(147),n(344),n(345),e._babelPolyfill)throw new Error("only one instance of babel-polyfill is allowed");e._babelPolyfill=!0;var r="defineProperty";t(String.prototype,"padLeft","".padStart),t(String.prototype,"padRight","".padEnd),"pop,reverse,shift,keys,values,entries,indexOf,every,some,forEach,map,filter,find,findIndex,includes,join,slice,concat,push,splice,unshift,sort,lastIndexOf,reduce,reduceRight,copyWithin,fill".split(",").forEach(function(e){[][e]&&t(Array,e,Function.call.bind([][e]))})}).call(t,n(50))},function(e,t,n){"use strict";var r=n(1),o=n.n(r),i=n(409),a=n(639),u=(n.n(a),n(472)),l=n(643),c=n.n(l),s=n(644),p=n.n(s),f=n(645),d=n.n(f),m=n(646),h=n.n(m),g=n(647),v=n.n(g),b=n(648),y=n.n(b),w=n(649),x=n.n(w),E=n(650),S=n.n(E),I=n(651),T=n.n(I),C=n(652),k=n.n(C),P=n(653),j=n.n(P),N=n(654),D=n.n(N),O=n(655),M=n.n(O),L=n(656),_=n.n(L),A=n(657),R=n.n(A),z=n(658),F=n.n(z),U=n(659),H=n.n(U),W=n(660),B=n.n(W),q=n(661),G=n.n(q),V=n(662),Z=n.n(V),J=n(663),Y=n.n(J),X=n(664),Q=n.n(X),K=n(665),$=n.n(K),ee={adjustable:c.a,bold:p.a,clock:d.a,close:h.a,"checkbox-alternate":v.a,"checkbox-checked":y.a,"checkbox-empty":x.a,checkmark:S.a,duplicate:T.a,drag:k.a,eye:j.a,italic:D.a,link:M.a,merge:_.a,pencil:R.a,question:F.a,"star-empty":H.a,"star-full":B.a,subscript:G.a,superscript:Z.a,trash:Y.a,underline:Q.a,unlink:$.a};t.a=function(e){var t=!!ee.hasOwnProperty(e.type)&&ee[e.type];if(!t)return null;var n=e.className?"wprm-admin-icon "+e.className:"wprm-admin-icon";return o.a.createElement(u.a,{content:e.title},o.a.createElement("span",{className:n,onClick:e.onClick},o.a.createElement(i.a,{src:t})))}},function(e,t,n){n(148),n(151),n(152),n(153),n(154),n(155),n(156),n(157),n(158),n(159),n(160),n(161),n(162),n(163),n(164),n(165),n(166),n(167),n(168),n(169),n(170),n(171),n(172),n(173),n(174),n(175),n(176),n(177),n(178),n(179),n(180),n(181),n(182),n(183),n(184),n(185),n(186),n(187),n(188),n(189),n(190),n(191),n(192),n(193),n(194),n(195),n(196),n(197),n(198),n(199),n(200),n(201),n(202),n(203),n(204),n(205),n(206),n(207),n(208),n(209),n(210),n(211),n(212),n(213),n(214),n(215),n(216),n(217),n(218),n(219),n(220),n(221),n(222),n(223),n(224),n(225),n(226),n(228),n(229),n(231),n(232),n(233),n(234),n(235),n(236),n(237),n(239),n(240),n(241),n(242),n(243),n(244),n(245),n(246),n(247),n(248),n(249),n(250),n(251),n(95),n(252),n(125),n(253),n(126),n(254),n(255),n(256),n(257),n(258),n(129),n(131),n(132),n(259),n(260),n(261),n(262),n(263),n(264),n(265),n(266),n(267),n(268),n(269),n(270),n(271),n(272),n(273),n(274),n(275),n(276),n(277),n(278),n(279),n(280),n(281),n(282),n(283),n(284),n(285),n(286),n(287),n(288),n(289),n(290),n(291),n(292),n(293),n(294),n(295),n(296),n(297),n(298),n(299),n(300),n(301),n(302),n(303),n(304),n(305),n(306),n(307),n(308),n(309),n(310),n(311),n(312),n(313),n(314),n(315),n(316),n(317),n(318),n(319),n(320),n(321),n(322),n(323),n(324),n(325),n(326),n(327),n(328),n(329),n(330),n(331),n(332),n(333),n(334),n(335),n(336),n(337),n(338),n(339),n(340),n(341),n(342),n(343),e.exports=n(20)},function(e,t,n){"use strict";var r=n(3),o=n(15),i=n(8),a=n(0),u=n(13),l=n(33).KEY,c=n(4),s=n(52),p=n(46),f=n(36),d=n(6),m=n(107),h=n(76),g=n(150),v=n(60),b=n(2),y=n(5),w=n(16),x=n(25),E=n(35),S=n(39),I=n(110),T=n(17),C=n(9),k=n(37),P=T.f,j=C.f,N=I.f,D=r.Symbol,O=r.JSON,M=O&&O.stringify,L=d("_hidden"),_=d("toPrimitive"),A={}.propertyIsEnumerable,R=s("symbol-registry"),z=s("symbols"),F=s("op-symbols"),U=Object.prototype,H="function"==typeof D,W=r.QObject,B=!W||!W.prototype||!W.prototype.findChild,q=i&&c(function(){return 7!=S(j({},"a",{get:function(){return j(this,"a",{value:7}).a}})).a})?function(e,t,n){var r=P(U,t);r&&delete U[t],j(e,t,n),r&&e!==U&&j(U,t,r)}:j,G=function(e){var t=z[e]=S(D.prototype);return t._k=e,t},V=H&&"symbol"==typeof D.iterator?function(e){return"symbol"==typeof e}:function(e){return e instanceof D},Z=function(e,t,n){return e===U&&Z(F,t,n),b(e),t=x(t,!0),b(n),o(z,t)?(n.enumerable?(o(e,L)&&e[L][t]&&(e[L][t]=!1),n=S(n,{enumerable:E(0,!1)})):(o(e,L)||j(e,L,E(1,{})),e[L][t]=!0),q(e,t,n)):j(e,t,n)},J=function(e,t){b(e);for(var n,r=g(t=w(t)),o=0,i=r.length;i>o;)Z(e,n=r[o++],t[n]);return e},Y=function(e){var t=A.call(this,e=x(e,!0));return!(this===U&&o(z,e)&&!o(F,e))&&(!(t||!o(this,e)||!o(z,e)||o(this,L)&&this[L][e])||t)},X=function(e,t){if(e=w(e),t=x(t,!0),e!==U||!o(z,t)||o(F,t)){var n=P(e,t);return!n||!o(z,t)||o(e,L)&&e[L][t]||(n.enumerable=!0),n}},Q=function(e){for(var t,n=N(w(e)),r=[],i=0;n.length>i;)o(z,t=n[i++])||t==L||t==l||r.push(t);return r},K=function(e){for(var t,n=e===U,r=N(n?F:w(e)),i=[],a=0;r.length>a;)o(z,t=r[a++])&&(n?o(U,t):1)&&i.push(z[t]);return i};H||(u((D=function(){if(this instanceof D)throw TypeError("Symbol is not a constructor!");var e=f(arguments.length>0?arguments[0]:void 0),t=function(n){this===U&&t.call(F,n),o(this,L)&&o(this[L],e)&&(this[L][e]=!1),q(this,e,E(1,n))};return i&&B&&q(U,e,{configurable:!0,set:t}),G(e)}).prototype,"toString",function(){return this._k}),T.f=X,C.f=Z,n(40).f=I.f=Q,n(54).f=Y,n(59).f=K,i&&!n(32)&&u(U,"propertyIsEnumerable",Y,!0),m.f=function(e){return G(d(e))}),a(a.G+a.W+a.F*!H,{Symbol:D});for(var $="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),ee=0;$.length>ee;)d($[ee++]);for(var te=k(d.store),ne=0;te.length>ne;)h(te[ne++]);a(a.S+a.F*!H,"Symbol",{for:function(e){return o(R,e+="")?R[e]:R[e]=D(e)},keyFor:function(e){if(!V(e))throw TypeError(e+" is not a symbol!");for(var t in R)if(R[t]===e)return t},useSetter:function(){B=!0},useSimple:function(){B=!1}}),a(a.S+a.F*!H,"Object",{create:function(e,t){return void 0===t?S(e):J(S(e),t)},defineProperty:Z,defineProperties:J,getOwnPropertyDescriptor:X,getOwnPropertyNames:Q,getOwnPropertySymbols:K}),O&&a(a.S+a.F*(!H||c(function(){var e=D();return"[null]"!=M([e])||"{}"!=M({a:e})||"{}"!=M(Object(e))})),"JSON",{stringify:function(e){for(var t,n,r=[e],o=1;arguments.length>o;)r.push(arguments[o++]);if(n=t=r[1],(y(t)||void 0!==e)&&!V(e))return v(t)||(t=function(e,t){if("function"==typeof n&&(t=n.call(this,e,t)),!V(t))return t}),r[1]=t,M.apply(O,r)}}),D.prototype[_]||n(12)(D.prototype,_,D.prototype.valueOf),p(D,"Symbol"),p(Math,"Math",!0),p(r.JSON,"JSON",!0)},function(e,t,n){e.exports=n(52)("native-function-to-string",Function.toString)},function(e,t,n){var r=n(37),o=n(59),i=n(54);e.exports=function(e){var t=r(e),n=o.f;if(n)for(var a,u=n(e),l=i.f,c=0;u.length>c;)l.call(e,a=u[c++])&&t.push(a);return t}},function(e,t,n){var r=n(0);r(r.S,"Object",{create:n(39)})},function(e,t,n){var r=n(0);r(r.S+r.F*!n(8),"Object",{defineProperty:n(9).f})},function(e,t,n){var r=n(0);r(r.S+r.F*!n(8),"Object",{defineProperties:n(109)})},function(e,t,n){var r=n(16),o=n(17).f;n(27)("getOwnPropertyDescriptor",function(){return function(e,t){return o(r(e),t)}})},function(e,t,n){var r=n(10),o=n(18);n(27)("getPrototypeOf",function(){return function(e){return o(r(e))}})},function(e,t,n){var r=n(10),o=n(37);n(27)("keys",function(){return function(e){return o(r(e))}})},function(e,t,n){n(27)("getOwnPropertyNames",function(){return n(110).f})},function(e,t,n){var r=n(5),o=n(33).onFreeze;n(27)("freeze",function(e){return function(t){return e&&r(t)?e(o(t)):t}})},function(e,t,n){var r=n(5),o=n(33).onFreeze;n(27)("seal",function(e){return function(t){return e&&r(t)?e(o(t)):t}})},function(e,t,n){var r=n(5),o=n(33).onFreeze;n(27)("preventExtensions",function(e){return function(t){return e&&r(t)?e(o(t)):t}})},function(e,t,n){var r=n(5);n(27)("isFrozen",function(e){return function(t){return!r(t)||!!e&&e(t)}})},function(e,t,n){var r=n(5);n(27)("isSealed",function(e){return function(t){return!r(t)||!!e&&e(t)}})},function(e,t,n){var r=n(5);n(27)("isExtensible",function(e){return function(t){return!!r(t)&&(!e||e(t))}})},function(e,t,n){var r=n(0);r(r.S+r.F,"Object",{assign:n(111)})},function(e,t,n){var r=n(0);r(r.S,"Object",{is:n(112)})},function(e,t,n){var r=n(0);r(r.S,"Object",{setPrototypeOf:n(80).set})},function(e,t,n){"use strict";var r=n(47),o={};o[n(6)("toStringTag")]="z",o+""!="[object z]"&&n(13)(Object.prototype,"toString",function(){return"[object "+r(this)+"]"},!0)},function(e,t,n){var r=n(0);r(r.P,"Function",{bind:n(113)})},function(e,t,n){var r=n(9).f,o=Function.prototype,i=/^\s*function ([^ (]*)/;"name"in o||n(8)&&r(o,"name",{configurable:!0,get:function(){try{return(""+this).match(i)[1]}catch(e){return""}}})},function(e,t,n){"use strict";var r=n(5),o=n(18),i=n(6)("hasInstance"),a=Function.prototype;i in a||n(9).f(a,i,{value:function(e){if("function"!=typeof this||!r(e))return!1;if(!r(this.prototype))return e instanceof this;for(;e=o(e);)if(this.prototype===e)return!0;return!1}})},function(e,t,n){var r=n(0),o=n(115);r(r.G+r.F*(parseInt!=o),{parseInt:o})},function(e,t,n){var r=n(0),o=n(116);r(r.G+r.F*(parseFloat!=o),{parseFloat:o})},function(e,t,n){"use strict";var r=n(3),o=n(15),i=n(22),a=n(82),u=n(25),l=n(4),c=n(40).f,s=n(17).f,p=n(9).f,f=n(48).trim,d=r.Number,m=d,h=d.prototype,g="Number"==i(n(39)(h)),v="trim"in String.prototype,b=function(e){var t=u(e,!1);if("string"==typeof t&&t.length>2){var n,r,o,i=(t=v?t.trim():f(t,3)).charCodeAt(0);if(43===i||45===i){if(88===(n=t.charCodeAt(2))||120===n)return NaN}else if(48===i){switch(t.charCodeAt(1)){case 66:case 98:r=2,o=49;break;case 79:case 111:r=8,o=55;break;default:return+t}for(var a,l=t.slice(2),c=0,s=l.length;c<s;c++)if((a=l.charCodeAt(c))<48||a>o)return NaN;return parseInt(l,r)}}return+t};if(!d(" 0o1")||!d("0b1")||d("+0x1")){d=function(e){var t=arguments.length<1?0:e,n=this;return n instanceof d&&(g?l(function(){h.valueOf.call(n)}):"Number"!=i(n))?a(new m(b(t)),n,d):b(t)};for(var y,w=n(8)?c(m):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),x=0;w.length>x;x++)o(m,y=w[x])&&!o(d,y)&&p(d,y,s(m,y));d.prototype=h,h.constructor=d,n(13)(r,"Number",d)}},function(e,t,n){"use strict";var r=n(0),o=n(23),i=n(117),a=n(83),u=1..toFixed,l=Math.floor,c=[0,0,0,0,0,0],s="Number.toFixed: incorrect invocation!",p=function(e,t){for(var n=-1,r=t;++n<6;)r+=e*c[n],c[n]=r%1e7,r=l(r/1e7)},f=function(e){for(var t=6,n=0;--t>=0;)n+=c[t],c[t]=l(n/e),n=n%e*1e7},d=function(){for(var e=6,t="";--e>=0;)if(""!==t||0===e||0!==c[e]){var n=String(c[e]);t=""===t?n:t+a.call("0",7-n.length)+n}return t},m=function(e,t,n){return 0===t?n:t%2==1?m(e,t-1,n*e):m(e*e,t/2,n)};r(r.P+r.F*(!!u&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==(0xde0b6b3a7640080).toFixed(0))||!n(4)(function(){u.call({})})),"Number",{toFixed:function(e){var t,n,r,u,l=i(this,s),c=o(e),h="",g="0";if(c<0||c>20)throw RangeError(s);if(l!=l)return"NaN";if(l<=-1e21||l>=1e21)return String(l);if(l<0&&(h="-",l=-l),l>1e-21)if(n=(t=function(e){for(var t=0,n=e;n>=4096;)t+=12,n/=4096;for(;n>=2;)t+=1,n/=2;return t}(l*m(2,69,1))-69)<0?l*m(2,-t,1):l/m(2,t,1),n*=4503599627370496,(t=52-t)>0){for(p(0,n),r=c;r>=7;)p(1e7,0),r-=7;for(p(m(10,r,1),0),r=t-1;r>=23;)f(1<<23),r-=23;f(1<<r),p(1,1),f(2),g=d()}else p(0,n),p(1<<-t,0),g=d()+a.call("0",c);return g=c>0?h+((u=g.length)<=c?"0."+a.call("0",c-u)+g:g.slice(0,u-c)+"."+g.slice(u-c)):h+g}})},function(e,t,n){"use strict";var r=n(0),o=n(4),i=n(117),a=1..toPrecision;r(r.P+r.F*(o(function(){return"1"!==a.call(1,void 0)})||!o(function(){a.call({})})),"Number",{toPrecision:function(e){var t=i(this,"Number#toPrecision: incorrect invocation!");return void 0===e?a.call(t):a.call(t,e)}})},function(e,t,n){var r=n(0);r(r.S,"Number",{EPSILON:Math.pow(2,-52)})},function(e,t,n){var r=n(0),o=n(3).isFinite;r(r.S,"Number",{isFinite:function(e){return"number"==typeof e&&o(e)}})},function(e,t,n){var r=n(0);r(r.S,"Number",{isInteger:n(118)})},function(e,t,n){var r=n(0);r(r.S,"Number",{isNaN:function(e){return e!=e}})},function(e,t,n){var r=n(0),o=n(118),i=Math.abs;r(r.S,"Number",{isSafeInteger:function(e){return o(e)&&i(e)<=9007199254740991}})},function(e,t,n){var r=n(0);r(r.S,"Number",{MAX_SAFE_INTEGER:9007199254740991})},function(e,t,n){var r=n(0);r(r.S,"Number",{MIN_SAFE_INTEGER:-9007199254740991})},function(e,t,n){var r=n(0),o=n(116);r(r.S+r.F*(Number.parseFloat!=o),"Number",{parseFloat:o})},function(e,t,n){var r=n(0),o=n(115);r(r.S+r.F*(Number.parseInt!=o),"Number",{parseInt:o})},function(e,t,n){var r=n(0),o=n(119),i=Math.sqrt,a=Math.acosh;r(r.S+r.F*!(a&&710==Math.floor(a(Number.MAX_VALUE))&&a(1/0)==1/0),"Math",{acosh:function(e){return(e=+e)<1?NaN:e>94906265.62425156?Math.log(e)+Math.LN2:o(e-1+i(e-1)*i(e+1))}})},function(e,t,n){var r=n(0),o=Math.asinh;r(r.S+r.F*!(o&&1/o(0)>0),"Math",{asinh:function e(t){return isFinite(t=+t)&&0!=t?t<0?-e(-t):Math.log(t+Math.sqrt(t*t+1)):t}})},function(e,t,n){var r=n(0),o=Math.atanh;r(r.S+r.F*!(o&&1/o(-0)<0),"Math",{atanh:function(e){return 0==(e=+e)?e:Math.log((1+e)/(1-e))/2}})},function(e,t,n){var r=n(0),o=n(84);r(r.S,"Math",{cbrt:function(e){return o(e=+e)*Math.pow(Math.abs(e),1/3)}})},function(e,t,n){var r=n(0);r(r.S,"Math",{clz32:function(e){return(e>>>=0)?31-Math.floor(Math.log(e+.5)*Math.LOG2E):32}})},function(e,t,n){var r=n(0),o=Math.exp;r(r.S,"Math",{cosh:function(e){return(o(e=+e)+o(-e))/2}})},function(e,t,n){var r=n(0),o=n(85);r(r.S+r.F*(o!=Math.expm1),"Math",{expm1:o})},function(e,t,n){var r=n(0);r(r.S,"Math",{fround:n(120)})},function(e,t,n){var r=n(0),o=Math.abs;r(r.S,"Math",{hypot:function(e,t){for(var n,r,i=0,a=0,u=arguments.length,l=0;a<u;)l<(n=o(arguments[a++]))?(i=i*(r=l/n)*r+1,l=n):i+=n>0?(r=n/l)*r:n;return l===1/0?1/0:l*Math.sqrt(i)}})},function(e,t,n){var r=n(0),o=Math.imul;r(r.S+r.F*n(4)(function(){return-5!=o(4294967295,5)||2!=o.length}),"Math",{imul:function(e,t){var n=+e,r=+t,o=65535&n,i=65535&r;return 0|o*i+((65535&n>>>16)*i+o*(65535&r>>>16)<<16>>>0)}})},function(e,t,n){var r=n(0);r(r.S,"Math",{log10:function(e){return Math.log(e)*Math.LOG10E}})},function(e,t,n){var r=n(0);r(r.S,"Math",{log1p:n(119)})},function(e,t,n){var r=n(0);r(r.S,"Math",{log2:function(e){return Math.log(e)/Math.LN2}})},function(e,t,n){var r=n(0);r(r.S,"Math",{sign:n(84)})},function(e,t,n){var r=n(0),o=n(85),i=Math.exp;r(r.S+r.F*n(4)(function(){return-2e-17!=!Math.sinh(-2e-17)}),"Math",{sinh:function(e){return Math.abs(e=+e)<1?(o(e)-o(-e))/2:(i(e-1)-i(-e-1))*(Math.E/2)}})},function(e,t,n){var r=n(0),o=n(85),i=Math.exp;r(r.S,"Math",{tanh:function(e){var t=o(e=+e),n=o(-e);return t==1/0?1:n==1/0?-1:(t-n)/(i(e)+i(-e))}})},function(e,t,n){var r=n(0);r(r.S,"Math",{trunc:function(e){return(e>0?Math.floor:Math.ceil)(e)}})},function(e,t,n){var r=n(0),o=n(38),i=String.fromCharCode,a=String.fromCodePoint;r(r.S+r.F*(!!a&&1!=a.length),"String",{fromCodePoint:function(e){for(var t,n=[],r=arguments.length,a=0;r>a;){if(t=+arguments[a++],o(t,1114111)!==t)throw RangeError(t+" is not a valid code point");n.push(t<65536?i(t):i(55296+((t-=65536)>>10),t%1024+56320))}return n.join("")}})},function(e,t,n){var r=n(0),o=n(16),i=n(7);r(r.S,"String",{raw:function(e){for(var t=o(e.raw),n=i(t.length),r=arguments.length,a=[],u=0;n>u;)a.push(String(t[u++])),u<r&&a.push(String(arguments[u]));return a.join("")}})},function(e,t,n){"use strict";n(48)("trim",function(e){return function(){return e(this,3)}})},function(e,t,n){"use strict";var r=n(61)(!0);n(86)(String,"String",function(e){this._t=String(e),this._i=0},function(){var e,t=this._t,n=this._i;return n>=t.length?{value:void 0,done:!0}:(e=r(t,n),this._i+=e.length,{value:e,done:!1})})},function(e,t,n){"use strict";var r=n(0),o=n(61)(!1);r(r.P,"String",{codePointAt:function(e){return o(this,e)}})},function(e,t,n){"use strict";var r=n(0),o=n(7),i=n(88),a="".endsWith;r(r.P+r.F*n(89)("endsWith"),"String",{endsWith:function(e){var t=i(this,e,"endsWith"),n=arguments.length>1?arguments[1]:void 0,r=o(t.length),u=void 0===n?r:Math.min(o(n),r),l=String(e);return a?a.call(t,l,u):t.slice(u-l.length,u)===l}})},function(e,t,n){"use strict";var r=n(0),o=n(88);r(r.P+r.F*n(89)("includes"),"String",{includes:function(e){return!!~o(this,e,"includes").indexOf(e,arguments.length>1?arguments[1]:void 0)}})},function(e,t,n){var r=n(0);r(r.P,"String",{repeat:n(83)})},function(e,t,n){"use strict";var r=n(0),o=n(7),i=n(88),a="".startsWith;r(r.P+r.F*n(89)("startsWith"),"String",{startsWith:function(e){var t=i(this,e,"startsWith"),n=o(Math.min(arguments.length>1?arguments[1]:void 0,t.length)),r=String(e);return a?a.call(t,r,n):t.slice(n,n+r.length)===r}})},function(e,t,n){"use strict";n(14)("anchor",function(e){return function(t){return e(this,"a","name",t)}})},function(e,t,n){"use strict";n(14)("big",function(e){return function(){return e(this,"big","","")}})},function(e,t,n){"use strict";n(14)("blink",function(e){return function(){return e(this,"blink","","")}})},function(e,t,n){"use strict";n(14)("bold",function(e){return function(){return e(this,"b","","")}})},function(e,t,n){"use strict";n(14)("fixed",function(e){return function(){return e(this,"tt","","")}})},function(e,t,n){"use strict";n(14)("fontcolor",function(e){return function(t){return e(this,"font","color",t)}})},function(e,t,n){"use strict";n(14)("fontsize",function(e){return function(t){return e(this,"font","size",t)}})},function(e,t,n){"use strict";n(14)("italics",function(e){return function(){return e(this,"i","","")}})},function(e,t,n){"use strict";n(14)("link",function(e){return function(t){return e(this,"a","href",t)}})},function(e,t,n){"use strict";n(14)("small",function(e){return function(){return e(this,"small","","")}})},function(e,t,n){"use strict";n(14)("strike",function(e){return function(){return e(this,"strike","","")}})},function(e,t,n){"use strict";n(14)("sub",function(e){return function(){return e(this,"sub","","")}})},function(e,t,n){"use strict";n(14)("sup",function(e){return function(){return e(this,"sup","","")}})},function(e,t,n){var r=n(0);r(r.S,"Date",{now:function(){return(new Date).getTime()}})},function(e,t,n){"use strict";var r=n(0),o=n(10),i=n(25);r(r.P+r.F*n(4)(function(){return null!==new Date(NaN).toJSON()||1!==Date.prototype.toJSON.call({toISOString:function(){return 1}})}),"Date",{toJSON:function(e){var t=o(this),n=i(t);return"number"!=typeof n||isFinite(n)?t.toISOString():null}})},function(e,t,n){var r=n(0),o=n(227);r(r.P+r.F*(Date.prototype.toISOString!==o),"Date",{toISOString:o})},function(e,t,n){"use strict";var r=n(4),o=Date.prototype.getTime,i=Date.prototype.toISOString,a=function(e){return e>9?e:"0"+e};e.exports=r(function(){return"0385-07-25T07:06:39.999Z"!=i.call(new Date(-5e13-1))})||!r(function(){i.call(new Date(NaN))})?function(){if(!isFinite(o.call(this)))throw RangeError("Invalid time value");var e=this,t=e.getUTCFullYear(),n=e.getUTCMilliseconds(),r=t<0?"-":t>9999?"+":"";return r+("00000"+Math.abs(t)).slice(r?-6:-4)+"-"+a(e.getUTCMonth()+1)+"-"+a(e.getUTCDate())+"T"+a(e.getUTCHours())+":"+a(e.getUTCMinutes())+":"+a(e.getUTCSeconds())+"."+(n>99?n:"0"+a(n))+"Z"}:i},function(e,t,n){var r=Date.prototype,o=r.toString,i=r.getTime;new Date(NaN)+""!="Invalid Date"&&n(13)(r,"toString",function(){var e=i.call(this);return e==e?o.call(this):"Invalid Date"})},function(e,t,n){var r=n(6)("toPrimitive"),o=Date.prototype;r in o||n(12)(o,r,n(230))},function(e,t,n){"use strict";var r=n(2),o=n(25);e.exports=function(e){if("string"!==e&&"number"!==e&&"default"!==e)throw TypeError("Incorrect hint");return o(r(this),"number"!=e)}},function(e,t,n){var r=n(0);r(r.S,"Array",{isArray:n(60)})},function(e,t,n){"use strict";var r=n(21),o=n(0),i=n(10),a=n(121),u=n(90),l=n(7),c=n(91),s=n(92);o(o.S+o.F*!n(63)(function(e){Array.from(e)}),"Array",{from:function(e){var t,n,o,p,f=i(e),d="function"==typeof this?this:Array,m=arguments.length,h=m>1?arguments[1]:void 0,g=void 0!==h,v=0,b=s(f);if(g&&(h=r(h,m>2?arguments[2]:void 0,2)),void 0==b||d==Array&&u(b))for(n=new d(t=l(f.length));t>v;v++)c(n,v,g?h(f[v],v):f[v]);else for(p=b.call(f),n=new d;!(o=p.next()).done;v++)c(n,v,g?a(p,h,[o.value,v],!0):o.value);return n.length=v,n}})},function(e,t,n){"use strict";var r=n(0),o=n(91);r(r.S+r.F*n(4)(function(){function e(){}return!(Array.of.call(e)instanceof e)}),"Array",{of:function(){for(var e=0,t=arguments.length,n=new("function"==typeof this?this:Array)(t);t>e;)o(n,e,arguments[e++]);return n.length=t,n}})},function(e,t,n){"use strict";var r=n(0),o=n(16),i=[].join;r(r.P+r.F*(n(53)!=Object||!n(24)(i)),"Array",{join:function(e){return i.call(o(this),void 0===e?",":e)}})},function(e,t,n){"use strict";var r=n(0),o=n(79),i=n(22),a=n(38),u=n(7),l=[].slice;r(r.P+r.F*n(4)(function(){o&&l.call(o)}),"Array",{slice:function(e,t){var n=u(this.length),r=i(this);if(t=void 0===t?n:t,"Array"==r)return l.call(this,e,t);for(var o=a(e,n),c=a(t,n),s=u(c-o),p=new Array(s),f=0;f<s;f++)p[f]="String"==r?this.charAt(o+f):this[o+f];return p}})},function(e,t,n){"use strict";var r=n(0),o=n(11),i=n(10),a=n(4),u=[].sort,l=[1,2,3];r(r.P+r.F*(a(function(){l.sort(void 0)})||!a(function(){l.sort(null)})||!n(24)(u)),"Array",{sort:function(e){return void 0===e?u.call(i(this)):u.call(i(this),o(e))}})},function(e,t,n){"use strict";var r=n(0),o=n(28)(0),i=n(24)([].forEach,!0);r(r.P+r.F*!i,"Array",{forEach:function(e){return o(this,e,arguments[1])}})},function(e,t,n){var r=n(5),o=n(60),i=n(6)("species");e.exports=function(e){var t;return o(e)&&("function"!=typeof(t=e.constructor)||t!==Array&&!o(t.prototype)||(t=void 0),r(t)&&null===(t=t[i])&&(t=void 0)),void 0===t?Array:t}},function(e,t,n){"use strict";var r=n(0),o=n(28)(1);r(r.P+r.F*!n(24)([].map,!0),"Array",{map:function(e){return o(this,e,arguments[1])}})},function(e,t,n){"use strict";var r=n(0),o=n(28)(2);r(r.P+r.F*!n(24)([].filter,!0),"Array",{filter:function(e){return o(this,e,arguments[1])}})},function(e,t,n){"use strict";var r=n(0),o=n(28)(3);r(r.P+r.F*!n(24)([].some,!0),"Array",{some:function(e){return o(this,e,arguments[1])}})},function(e,t,n){"use strict";var r=n(0),o=n(28)(4);r(r.P+r.F*!n(24)([].every,!0),"Array",{every:function(e){return o(this,e,arguments[1])}})},function(e,t,n){"use strict";var r=n(0),o=n(122);r(r.P+r.F*!n(24)([].reduce,!0),"Array",{reduce:function(e){return o(this,e,arguments.length,arguments[1],!1)}})},function(e,t,n){"use strict";var r=n(0),o=n(122);r(r.P+r.F*!n(24)([].reduceRight,!0),"Array",{reduceRight:function(e){return o(this,e,arguments.length,arguments[1],!0)}})},function(e,t,n){"use strict";var r=n(0),o=n(58)(!1),i=[].indexOf,a=!!i&&1/[1].indexOf(1,-0)<0;r(r.P+r.F*(a||!n(24)(i)),"Array",{indexOf:function(e){return a?i.apply(this,arguments)||0:o(this,e,arguments[1])}})},function(e,t,n){"use strict";var r=n(0),o=n(16),i=n(23),a=n(7),u=[].lastIndexOf,l=!!u&&1/[1].lastIndexOf(1,-0)<0;r(r.P+r.F*(l||!n(24)(u)),"Array",{lastIndexOf:function(e){if(l)return u.apply(this,arguments)||0;var t=o(this),n=a(t.length),r=n-1;for(arguments.length>1&&(r=Math.min(r,i(arguments[1]))),r<0&&(r=n+r);r>=0;r--)if(r in t&&t[r]===e)return r||0;return-1}})},function(e,t,n){var r=n(0);r(r.P,"Array",{copyWithin:n(123)}),n(34)("copyWithin")},function(e,t,n){var r=n(0);r(r.P,"Array",{fill:n(94)}),n(34)("fill")},function(e,t,n){"use strict";var r=n(0),o=n(28)(5),i=!0;"find"in[]&&Array(1).find(function(){i=!1}),r(r.P+r.F*i,"Array",{find:function(e){return o(this,e,arguments.length>1?arguments[1]:void 0)}}),n(34)("find")},function(e,t,n){"use strict";var r=n(0),o=n(28)(6),i="findIndex",a=!0;i in[]&&Array(1)[i](function(){a=!1}),r(r.P+r.F*a,"Array",{findIndex:function(e){return o(this,e,arguments.length>1?arguments[1]:void 0)}}),n(34)(i)},function(e,t,n){n(41)("Array")},function(e,t,n){var r=n(3),o=n(82),i=n(9).f,a=n(40).f,u=n(62),l=n(55),c=r.RegExp,s=c,p=c.prototype,f=/a/g,d=/a/g,m=new c(f)!==f;if(n(8)&&(!m||n(4)(function(){return d[n(6)("match")]=!1,c(f)!=f||c(d)==d||"/a/i"!=c(f,"i")}))){c=function(e,t){var n=this instanceof c,r=u(e),i=void 0===t;return!n&&r&&e.constructor===c&&i?e:o(m?new s(r&&!i?e.source:e,t):s((r=e instanceof c)?e.source:e,r&&i?l.call(e):t),n?this:p,c)};for(var h=a(s),g=0;h.length>g;)!function(e){e in c||i(c,e,{configurable:!0,get:function(){return s[e]},set:function(t){s[e]=t}})}(h[g++]);p.constructor=c,c.prototype=p,n(13)(r,"RegExp",c)}n(41)("RegExp")},function(e,t,n){"use strict";n(126);var r=n(2),o=n(55),i=n(8),a=/./.toString,u=function(e){n(13)(RegExp.prototype,"toString",e,!0)};n(4)(function(){return"/a/b"!=a.call({source:"a",flags:"b"})})?u(function(){var e=r(this);return"/".concat(e.source,"/","flags"in e?e.flags:!i&&e instanceof RegExp?o.call(e):void 0)}):"toString"!=a.name&&u(function(){return a.call(this)})},function(e,t,n){"use strict";var r=n(2),o=n(7),i=n(97),a=n(64);n(65)("match",1,function(e,t,n,u){return[function(n){var r=e(this),o=void 0==n?void 0:n[t];return void 0!==o?o.call(n,r):new RegExp(n)[t](String(r))},function(e){var t=u(n,e,this);if(t.done)return t.value;var l=r(e),c=String(this);if(!l.global)return a(l,c);var s=l.unicode;l.lastIndex=0;for(var p,f=[],d=0;null!==(p=a(l,c));){var m=String(p[0]);f[d]=m,""===m&&(l.lastIndex=i(c,o(l.lastIndex),s)),d++}return 0===d?null:f}]})},function(e,t,n){"use strict";var r=n(2),o=n(10),i=n(7),a=n(23),u=n(97),l=n(64),c=Math.max,s=Math.min,p=Math.floor,f=/\$([$&`']|\d\d?|<[^>]*>)/g,d=/\$([$&`']|\d\d?)/g;n(65)("replace",2,function(e,t,n,m){function h(e,t,r,i,a,u){var l=r+e.length,c=i.length,s=d;return void 0!==a&&(a=o(a),s=f),n.call(u,s,function(n,o){var u;switch(o.charAt(0)){case"$":return"$";case"&":return e;case"`":return t.slice(0,r);case"'":return t.slice(l);case"<":u=a[o.slice(1,-1)];break;default:var s=+o;if(0===s)return n;if(s>c){var f=p(s/10);return 0===f?n:f<=c?void 0===i[f-1]?o.charAt(1):i[f-1]+o.charAt(1):n}u=i[s-1]}return void 0===u?"":u})}return[function(r,o){var i=e(this),a=void 0==r?void 0:r[t];return void 0!==a?a.call(r,i,o):n.call(String(i),r,o)},function(e,t){var o=m(n,e,this,t);if(o.done)return o.value;var p=r(e),f=String(this),d="function"==typeof t;d||(t=String(t));var g=p.global;if(g){var v=p.unicode;p.lastIndex=0}for(var b=[];;){var y=l(p,f);if(null===y)break;if(b.push(y),!g)break;""===String(y[0])&&(p.lastIndex=u(f,i(p.lastIndex),v))}for(var w,x="",E=0,S=0;S<b.length;S++){y=b[S];for(var I=String(y[0]),T=c(s(a(y.index),f.length),0),C=[],k=1;k<y.length;k++)C.push(void 0===(w=y[k])?w:String(w));var P=y.groups;if(d){var j=[I].concat(C,T,f);void 0!==P&&j.push(P);var N=String(t.apply(void 0,j))}else N=h(I,f,T,C,P,t);T>=E&&(x+=f.slice(E,T)+N,E=T+I.length)}return x+f.slice(E)}]})},function(e,t,n){"use strict";var r=n(2),o=n(112),i=n(64);n(65)("search",1,function(e,t,n,a){return[function(n){var r=e(this),o=void 0==n?void 0:n[t];return void 0!==o?o.call(n,r):new RegExp(n)[t](String(r))},function(e){var t=a(n,e,this);if(t.done)return t.value;var u=r(e),l=String(this),c=u.lastIndex;o(c,0)||(u.lastIndex=0);var s=i(u,l);return o(u.lastIndex,c)||(u.lastIndex=c),null===s?-1:s.index}]})},function(e,t,n){"use strict";var r=n(62),o=n(2),i=n(56),a=n(97),u=n(7),l=n(64),c=n(96),s=n(4),p=Math.min,f=[].push,d=!s(function(){RegExp(4294967295,"y")});n(65)("split",2,function(e,t,n,s){var m;return m="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(e,t){var o=String(this);if(void 0===e&&0===t)return[];if(!r(e))return n.call(o,e,t);for(var i,a,u,l=[],s=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),p=0,d=void 0===t?4294967295:t>>>0,m=new RegExp(e.source,s+"g");(i=c.call(m,o))&&!((a=m.lastIndex)>p&&(l.push(o.slice(p,i.index)),i.length>1&&i.index<o.length&&f.apply(l,i.slice(1)),u=i[0].length,p=a,l.length>=d));)m.lastIndex===i.index&&m.lastIndex++;return p===o.length?!u&&m.test("")||l.push(""):l.push(o.slice(p)),l.length>d?l.slice(0,d):l}:"0".split(void 0,0).length?function(e,t){return void 0===e&&0===t?[]:n.call(this,e,t)}:n,[function(n,r){var o=e(this),i=void 0==n?void 0:n[t];return void 0!==i?i.call(n,o,r):m.call(String(o),n,r)},function(e,t){var r=s(m,e,this,t,m!==n);if(r.done)return r.value;var c=o(e),f=String(this),h=i(c,RegExp),g=c.unicode,v=(c.ignoreCase?"i":"")+(c.multiline?"m":"")+(c.unicode?"u":"")+(d?"y":"g"),b=new h(d?c:"^(?:"+c.source+")",v),y=void 0===t?4294967295:t>>>0;if(0===y)return[];if(0===f.length)return null===l(b,f)?[f]:[];for(var w=0,x=0,E=[];x<f.length;){b.lastIndex=d?x:0;var S,I=l(b,d?f:f.slice(x));if(null===I||(S=p(u(b.lastIndex+(d?0:x)),f.length))===w)x=a(f,x,g);else{if(E.push(f.slice(w,x)),E.length===y)return E;for(var T=1;T<=I.length-1;T++)if(E.push(I[T]),E.length===y)return E;x=w=S}}return E.push(f.slice(w)),E}]})},function(e,t,n){"use strict";var r,o,i,a,u=n(32),l=n(3),c=n(21),s=n(47),p=n(0),f=n(5),d=n(11),m=n(42),h=n(43),g=n(56),v=n(98).set,b=n(99)(),y=n(100),w=n(127),x=n(66),E=n(128),S=l.TypeError,I=l.process,T=I&&I.versions,C=T&&T.v8||"",k=l.Promise,P="process"==s(I),j=function(){},N=o=y.f,D=!!function(){try{var e=k.resolve(1),t=(e.constructor={})[n(6)("species")]=function(e){e(j,j)};return(P||"function"==typeof PromiseRejectionEvent)&&e.then(j)instanceof t&&0!==C.indexOf("6.6")&&-1===x.indexOf("Chrome/66")}catch(e){}}(),O=function(e){var t;return!(!f(e)||"function"!=typeof(t=e.then))&&t},M=function(e,t){if(!e._n){e._n=!0;var n=e._c;b(function(){for(var r=e._v,o=1==e._s,i=0;n.length>i;)!function(t){var n,i,a,u=o?t.ok:t.fail,l=t.resolve,c=t.reject,s=t.domain;try{u?(o||(2==e._h&&A(e),e._h=1),!0===u?n=r:(s&&s.enter(),n=u(r),s&&(s.exit(),a=!0)),n===t.promise?c(S("Promise-chain cycle")):(i=O(n))?i.call(n,l,c):l(n)):c(r)}catch(e){s&&!a&&s.exit(),c(e)}}(n[i++]);e._c=[],e._n=!1,t&&!e._h&&L(e)})}},L=function(e){v.call(l,function(){var t,n,r,o=e._v,i=_(e);if(i&&(t=w(function(){P?I.emit("unhandledRejection",o,e):(n=l.onunhandledrejection)?n({promise:e,reason:o}):(r=l.console)&&r.error&&r.error("Unhandled promise rejection",o)}),e._h=P||_(e)?2:1),e._a=void 0,i&&t.e)throw t.v})},_=function(e){return 1!==e._h&&0===(e._a||e._c).length},A=function(e){v.call(l,function(){var t;P?I.emit("rejectionHandled",e):(t=l.onrejectionhandled)&&t({promise:e,reason:e._v})})},R=function(e){var t=this;t._d||(t._d=!0,(t=t._w||t)._v=e,t._s=2,t._a||(t._a=t._c.slice()),M(t,!0))},z=function(e){var t,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===e)throw S("Promise can't be resolved itself");(t=O(e))?b(function(){var r={_w:n,_d:!1};try{t.call(e,c(z,r,1),c(R,r,1))}catch(e){R.call(r,e)}}):(n._v=e,n._s=1,M(n,!1))}catch(e){R.call({_w:n,_d:!1},e)}}};D||(k=function(e){m(this,k,"Promise","_h"),d(e),r.call(this);try{e(c(z,this,1),c(R,this,1))}catch(e){R.call(this,e)}},(r=function(e){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=n(44)(k.prototype,{then:function(e,t){var n=N(g(this,k));return n.ok="function"!=typeof e||e,n.fail="function"==typeof t&&t,n.domain=P?I.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&M(this,!1),n.promise},catch:function(e){return this.then(void 0,e)}}),i=function(){var e=new r;this.promise=e,this.resolve=c(z,e,1),this.reject=c(R,e,1)},y.f=N=function(e){return e===k||e===a?new i(e):o(e)}),p(p.G+p.W+p.F*!D,{Promise:k}),n(46)(k,"Promise"),n(41)("Promise"),a=n(20).Promise,p(p.S+p.F*!D,"Promise",{reject:function(e){var t=N(this);return(0,t.reject)(e),t.promise}}),p(p.S+p.F*(u||!D),"Promise",{resolve:function(e){return E(u&&this===a?k:this,e)}}),p(p.S+p.F*!(D&&n(63)(function(e){k.all(e).catch(j)})),"Promise",{all:function(e){var t=this,n=N(t),r=n.resolve,o=n.reject,i=w(function(){var n=[],i=0,a=1;h(e,!1,function(e){var u=i++,l=!1;n.push(void 0),a++,t.resolve(e).then(function(e){l||(l=!0,n[u]=e,--a||r(n))},o)}),--a||r(n)});return i.e&&o(i.v),n.promise},race:function(e){var t=this,n=N(t),r=n.reject,o=w(function(){h(e,!1,function(e){t.resolve(e).then(n.resolve,r)})});return o.e&&r(o.v),n.promise}})},function(e,t,n){"use strict";var r=n(133),o=n(45);n(67)("WeakSet",function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}},{add:function(e){return r.def(o(this,"WeakSet"),e,!0)}},r,!1,!0)},function(e,t,n){"use strict";var r=n(0),o=n(68),i=n(101),a=n(2),u=n(38),l=n(7),c=n(5),s=n(3).ArrayBuffer,p=n(56),f=i.ArrayBuffer,d=i.DataView,m=o.ABV&&s.isView,h=f.prototype.slice,g=o.VIEW;r(r.G+r.W+r.F*(s!==f),{ArrayBuffer:f}),r(r.S+r.F*!o.CONSTR,"ArrayBuffer",{isView:function(e){return m&&m(e)||c(e)&&g in e}}),r(r.P+r.U+r.F*n(4)(function(){return!new f(2).slice(1,void 0).byteLength}),"ArrayBuffer",{slice:function(e,t){if(void 0!==h&&void 0===t)return h.call(a(this),e);for(var n=a(this).byteLength,r=u(e,n),o=u(void 0===t?n:t,n),i=new(p(this,f))(l(o-r)),c=new d(this),s=new d(i),m=0;r<o;)s.setUint8(m++,c.getUint8(r++));return i}}),n(41)("ArrayBuffer")},function(e,t,n){var r=n(0);r(r.G+r.W+r.F*!n(68).ABV,{DataView:n(101).DataView})},function(e,t,n){n(29)("Int8",1,function(e){return function(t,n,r){return e(this,t,n,r)}})},function(e,t,n){n(29)("Uint8",1,function(e){return function(t,n,r){return e(this,t,n,r)}})},function(e,t,n){n(29)("Uint8",1,function(e){return function(t,n,r){return e(this,t,n,r)}},!0)},function(e,t,n){n(29)("Int16",2,function(e){return function(t,n,r){return e(this,t,n,r)}})},function(e,t,n){n(29)("Uint16",2,function(e){return function(t,n,r){return e(this,t,n,r)}})},function(e,t,n){n(29)("Int32",4,function(e){return function(t,n,r){return e(this,t,n,r)}})},function(e,t,n){n(29)("Uint32",4,function(e){return function(t,n,r){return e(this,t,n,r)}})},function(e,t,n){n(29)("Float32",4,function(e){return function(t,n,r){return e(this,t,n,r)}})},function(e,t,n){n(29)("Float64",8,function(e){return function(t,n,r){return e(this,t,n,r)}})},function(e,t,n){var r=n(0),o=n(11),i=n(2),a=(n(3).Reflect||{}).apply,u=Function.apply;r(r.S+r.F*!n(4)(function(){a(function(){})}),"Reflect",{apply:function(e,t,n){var r=o(e),l=i(n);return a?a(r,t,l):u.call(r,t,l)}})},function(e,t,n){var r=n(0),o=n(39),i=n(11),a=n(2),u=n(5),l=n(4),c=n(113),s=(n(3).Reflect||{}).construct,p=l(function(){function e(){}return!(s(function(){},[],e)instanceof e)}),f=!l(function(){s(function(){})});r(r.S+r.F*(p||f),"Reflect",{construct:function(e,t){i(e),a(t);var n=arguments.length<3?e:i(arguments[2]);if(f&&!p)return s(e,t,n);if(e==n){switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3])}var r=[null];return r.push.apply(r,t),new(c.apply(e,r))}var l=n.prototype,d=o(u(l)?l:Object.prototype),m=Function.apply.call(e,d,t);return u(m)?m:d}})},function(e,t,n){var r=n(9),o=n(0),i=n(2),a=n(25);o(o.S+o.F*n(4)(function(){Reflect.defineProperty(r.f({},1,{value:1}),1,{value:2})}),"Reflect",{defineProperty:function(e,t,n){i(e),t=a(t,!0),i(n);try{return r.f(e,t,n),!0}catch(e){return!1}}})},function(e,t,n){var r=n(0),o=n(17).f,i=n(2);r(r.S,"Reflect",{deleteProperty:function(e,t){var n=o(i(e),t);return!(n&&!n.configurable)&&delete e[t]}})},function(e,t,n){"use strict";var r=n(0),o=n(2),i=function(e){this._t=o(e),this._i=0;var t,n=this._k=[];for(t in e)n.push(t)};n(87)(i,"Object",function(){var e,t=this._k;do{if(this._i>=t.length)return{value:void 0,done:!0}}while(!((e=t[this._i++])in this._t));return{value:e,done:!1}}),r(r.S,"Reflect",{enumerate:function(e){return new i(e)}})},function(e,t,n){var r=n(17),o=n(18),i=n(15),a=n(0),u=n(5),l=n(2);a(a.S,"Reflect",{get:function e(t,n){var a,c,s=arguments.length<3?t:arguments[2];return l(t)===s?t[n]:(a=r.f(t,n))?i(a,"value")?a.value:void 0!==a.get?a.get.call(s):void 0:u(c=o(t))?e(c,n,s):void 0}})},function(e,t,n){var r=n(17),o=n(0),i=n(2);o(o.S,"Reflect",{getOwnPropertyDescriptor:function(e,t){return r.f(i(e),t)}})},function(e,t,n){var r=n(0),o=n(18),i=n(2);r(r.S,"Reflect",{getPrototypeOf:function(e){return o(i(e))}})},function(e,t,n){var r=n(0);r(r.S,"Reflect",{has:function(e,t){return t in e}})},function(e,t,n){var r=n(0),o=n(2),i=Object.isExtensible;r(r.S,"Reflect",{isExtensible:function(e){return o(e),!i||i(e)}})},function(e,t,n){var r=n(0);r(r.S,"Reflect",{ownKeys:n(135)})},function(e,t,n){var r=n(0),o=n(2),i=Object.preventExtensions;r(r.S,"Reflect",{preventExtensions:function(e){o(e);try{return i&&i(e),!0}catch(e){return!1}}})},function(e,t,n){var r=n(9),o=n(17),i=n(18),a=n(15),u=n(0),l=n(35),c=n(2),s=n(5);u(u.S,"Reflect",{set:function e(t,n,u){var p,f,d=arguments.length<4?t:arguments[3],m=o.f(c(t),n);if(!m){if(s(f=i(t)))return e(f,n,u,d);m=l(0)}if(a(m,"value")){if(!1===m.writable||!s(d))return!1;if(p=o.f(d,n)){if(p.get||p.set||!1===p.writable)return!1;p.value=u,r.f(d,n,p)}else r.f(d,n,l(0,u));return!0}return void 0!==m.set&&(m.set.call(d,u),!0)}})},function(e,t,n){var r=n(0),o=n(80);o&&r(r.S,"Reflect",{setPrototypeOf:function(e,t){o.check(e,t);try{return o.set(e,t),!0}catch(e){return!1}}})},function(e,t,n){"use strict";var r=n(0),o=n(58)(!0);r(r.P,"Array",{includes:function(e){return o(this,e,arguments.length>1?arguments[1]:void 0)}}),n(34)("includes")},function(e,t,n){"use strict";var r=n(0),o=n(136),i=n(10),a=n(7),u=n(11),l=n(93);r(r.P,"Array",{flatMap:function(e){var t,n,r=i(this);return u(e),t=a(r.length),n=l(r,0),o(n,r,r,t,0,1,e,arguments[1]),n}}),n(34)("flatMap")},function(e,t,n){"use strict";var r=n(0),o=n(136),i=n(10),a=n(7),u=n(23),l=n(93);r(r.P,"Array",{flatten:function(){var e=arguments[0],t=i(this),n=a(t.length),r=l(t,0);return o(r,t,t,n,0,void 0===e?1:u(e)),r}}),n(34)("flatten")},function(e,t,n){"use strict";var r=n(0),o=n(61)(!0);r(r.P,"String",{at:function(e){return o(this,e)}})},function(e,t,n){"use strict";var r=n(0),o=n(137),i=n(66),a=/Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(i);r(r.P+r.F*a,"String",{padStart:function(e){return o(this,e,arguments.length>1?arguments[1]:void 0,!0)}})},function(e,t,n){"use strict";var r=n(0),o=n(137),i=n(66),a=/Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(i);r(r.P+r.F*a,"String",{padEnd:function(e){return o(this,e,arguments.length>1?arguments[1]:void 0,!1)}})},function(e,t,n){"use strict";n(48)("trimLeft",function(e){return function(){return e(this,1)}},"trimStart")},function(e,t,n){"use strict";n(48)("trimRight",function(e){return function(){return e(this,2)}},"trimEnd")},function(e,t,n){"use strict";var r=n(0),o=n(26),i=n(7),a=n(62),u=n(55),l=RegExp.prototype,c=function(e,t){this._r=e,this._s=t};n(87)(c,"RegExp String",function(){var e=this._r.exec(this._s);return{value:e,done:null===e}}),r(r.P,"String",{matchAll:function(e){if(o(this),!a(e))throw TypeError(e+" is not a regexp!");var t=String(this),n="flags"in l?String(e.flags):u.call(e),r=new RegExp(e.source,~n.indexOf("g")?n:"g"+n);return r.lastIndex=i(e.lastIndex),new c(r,t)}})},function(e,t,n){n(76)("asyncIterator")},function(e,t,n){n(76)("observable")},function(e,t,n){var r=n(0),o=n(135),i=n(16),a=n(17),u=n(91);r(r.S,"Object",{getOwnPropertyDescriptors:function(e){for(var t,n,r=i(e),l=a.f,c=o(r),s={},p=0;c.length>p;)void 0!==(n=l(r,t=c[p++]))&&u(s,t,n);return s}})},function(e,t,n){var r=n(0),o=n(138)(!1);r(r.S,"Object",{values:function(e){return o(e)}})},function(e,t,n){var r=n(0),o=n(138)(!0);r(r.S,"Object",{entries:function(e){return o(e)}})},function(e,t,n){"use strict";var r=n(0),o=n(10),i=n(11),a=n(9);n(8)&&r(r.P+n(69),"Object",{__defineGetter__:function(e,t){a.f(o(this),e,{get:i(t),enumerable:!0,configurable:!0})}})},function(e,t,n){"use strict";var r=n(0),o=n(10),i=n(11),a=n(9);n(8)&&r(r.P+n(69),"Object",{__defineSetter__:function(e,t){a.f(o(this),e,{set:i(t),enumerable:!0,configurable:!0})}})},function(e,t,n){"use strict";var r=n(0),o=n(10),i=n(25),a=n(18),u=n(17).f;n(8)&&r(r.P+n(69),"Object",{__lookupGetter__:function(e){var t,n=o(this),r=i(e,!0);do{if(t=u(n,r))return t.get}while(n=a(n))}})},function(e,t,n){"use strict";var r=n(0),o=n(10),i=n(25),a=n(18),u=n(17).f;n(8)&&r(r.P+n(69),"Object",{__lookupSetter__:function(e){var t,n=o(this),r=i(e,!0);do{if(t=u(n,r))return t.set}while(n=a(n))}})},function(e,t,n){var r=n(0);r(r.P+r.R,"Map",{toJSON:n(139)("Map")})},function(e,t,n){var r=n(0);r(r.P+r.R,"Set",{toJSON:n(139)("Set")})},function(e,t,n){n(70)("Map")},function(e,t,n){n(70)("Set")},function(e,t,n){n(70)("WeakMap")},function(e,t,n){n(70)("WeakSet")},function(e,t,n){n(71)("Map")},function(e,t,n){n(71)("Set")},function(e,t,n){n(71)("WeakMap")},function(e,t,n){n(71)("WeakSet")},function(e,t,n){var r=n(0);r(r.G,{global:n(3)})},function(e,t,n){var r=n(0);r(r.S,"System",{global:n(3)})},function(e,t,n){var r=n(0),o=n(22);r(r.S,"Error",{isError:function(e){return"Error"===o(e)}})},function(e,t,n){var r=n(0);r(r.S,"Math",{clamp:function(e,t,n){return Math.min(n,Math.max(t,e))}})},function(e,t,n){var r=n(0);r(r.S,"Math",{DEG_PER_RAD:Math.PI/180})},function(e,t,n){var r=n(0),o=180/Math.PI;r(r.S,"Math",{degrees:function(e){return e*o}})},function(e,t,n){var r=n(0),o=n(141),i=n(120);r(r.S,"Math",{fscale:function(e,t,n,r,a){return i(o(e,t,n,r,a))}})},function(e,t,n){var r=n(0);r(r.S,"Math",{iaddh:function(e,t,n,r){var o=e>>>0,i=n>>>0;return(t>>>0)+(r>>>0)+((o&i|(o|i)&~(o+i>>>0))>>>31)|0}})},function(e,t,n){var r=n(0);r(r.S,"Math",{isubh:function(e,t,n,r){var o=e>>>0,i=n>>>0;return(t>>>0)-(r>>>0)-((~o&i|~(o^i)&o-i>>>0)>>>31)|0}})},function(e,t,n){var r=n(0);r(r.S,"Math",{imulh:function(e,t){var n=+e,r=+t,o=65535&n,i=65535&r,a=n>>16,u=r>>16,l=(a*i>>>0)+(o*i>>>16);return a*u+(l>>16)+((o*u>>>0)+(65535&l)>>16)}})},function(e,t,n){var r=n(0);r(r.S,"Math",{RAD_PER_DEG:180/Math.PI})},function(e,t,n){var r=n(0),o=Math.PI/180;r(r.S,"Math",{radians:function(e){return e*o}})},function(e,t,n){var r=n(0);r(r.S,"Math",{scale:n(141)})},function(e,t,n){var r=n(0);r(r.S,"Math",{umulh:function(e,t){var n=+e,r=+t,o=65535&n,i=65535&r,a=n>>>16,u=r>>>16,l=(a*i>>>0)+(o*i>>>16);return a*u+(l>>>16)+((o*u>>>0)+(65535&l)>>>16)}})},function(e,t,n){var r=n(0);r(r.S,"Math",{signbit:function(e){return(e=+e)!=e?e:0==e?1/e==1/0:e>0}})},function(e,t,n){"use strict";var r=n(0),o=n(20),i=n(3),a=n(56),u=n(128);r(r.P+r.R,"Promise",{finally:function(e){var t=a(this,o.Promise||i.Promise),n="function"==typeof e;return this.then(n?function(n){return u(t,e()).then(function(){return n})}:e,n?function(n){return u(t,e()).then(function(){throw n})}:e)}})},function(e,t,n){"use strict";var r=n(0),o=n(100),i=n(127);r(r.S,"Promise",{try:function(e){var t=o.f(this),n=i(e);return(n.e?t.reject:t.resolve)(n.v),t.promise}})},function(e,t,n){var r=n(30),o=n(2),i=r.key,a=r.set;r.exp({defineMetadata:function(e,t,n,r){a(e,t,o(n),i(r))}})},function(e,t,n){var r=n(30),o=n(2),i=r.key,a=r.map,u=r.store;r.exp({deleteMetadata:function(e,t){var n=arguments.length<3?void 0:i(arguments[2]),r=a(o(t),n,!1);if(void 0===r||!r.delete(e))return!1;if(r.size)return!0;var l=u.get(t);return l.delete(n),!!l.size||u.delete(t)}})},function(e,t,n){var r=n(30),o=n(2),i=n(18),a=r.has,u=r.get,l=r.key,c=function(e,t,n){if(a(e,t,n))return u(e,t,n);var r=i(t);return null!==r?c(e,r,n):void 0};r.exp({getMetadata:function(e,t){return c(e,o(t),arguments.length<3?void 0:l(arguments[2]))}})},function(e,t,n){var r=n(131),o=n(140),i=n(30),a=n(2),u=n(18),l=i.keys,c=i.key,s=function(e,t){var n=l(e,t),i=u(e);if(null===i)return n;var a=s(i,t);return a.length?n.length?o(new r(n.concat(a))):a:n};i.exp({getMetadataKeys:function(e){return s(a(e),arguments.length<2?void 0:c(arguments[1]))}})},function(e,t,n){var r=n(30),o=n(2),i=r.get,a=r.key;r.exp({getOwnMetadata:function(e,t){return i(e,o(t),arguments.length<3?void 0:a(arguments[2]))}})},function(e,t,n){var r=n(30),o=n(2),i=r.keys,a=r.key;r.exp({getOwnMetadataKeys:function(e){return i(o(e),arguments.length<2?void 0:a(arguments[1]))}})},function(e,t,n){var r=n(30),o=n(2),i=n(18),a=r.has,u=r.key,l=function(e,t,n){if(a(e,t,n))return!0;var r=i(t);return null!==r&&l(e,r,n)};r.exp({hasMetadata:function(e,t){return l(e,o(t),arguments.length<3?void 0:u(arguments[2]))}})},function(e,t,n){var r=n(30),o=n(2),i=r.has,a=r.key;r.exp({hasOwnMetadata:function(e,t){return i(e,o(t),arguments.length<3?void 0:a(arguments[2]))}})},function(e,t,n){var r=n(30),o=n(2),i=n(11),a=r.key,u=r.set;r.exp({metadata:function(e,t){return function(n,r){u(e,t,(void 0!==r?o:i)(n),a(r))}}})},function(e,t,n){var r=n(0),o=n(99)(),i=n(3).process,a="process"==n(22)(i);r(r.G,{asap:function(e){var t=a&&i.domain;o(t?t.bind(e):e)}})},function(e,t,n){"use strict";var r=n(0),o=n(3),i=n(20),a=n(99)(),u=n(6)("observable"),l=n(11),c=n(2),s=n(42),p=n(44),f=n(12),d=n(43),m=d.RETURN,h=function(e){return null==e?void 0:l(e)},g=function(e){var t=e._c;t&&(e._c=void 0,t())},v=function(e){return void 0===e._o},b=function(e){v(e)||(e._o=void 0,g(e))},y=function(e,t){c(e),this._c=void 0,this._o=e,e=new w(this);try{var n=t(e),r=n;null!=n&&("function"==typeof n.unsubscribe?n=function(){r.unsubscribe()}:l(n),this._c=n)}catch(t){return void e.error(t)}v(this)&&g(this)};y.prototype=p({},{unsubscribe:function(){b(this)}});var w=function(e){this._s=e};w.prototype=p({},{next:function(e){var t=this._s;if(!v(t)){var n=t._o;try{var r=h(n.next);if(r)return r.call(n,e)}catch(e){try{b(t)}finally{throw e}}}},error:function(e){var t=this._s;if(v(t))throw e;var n=t._o;t._o=void 0;try{var r=h(n.error);if(!r)throw e;e=r.call(n,e)}catch(e){try{g(t)}finally{throw e}}return g(t),e},complete:function(e){var t=this._s;if(!v(t)){var n=t._o;t._o=void 0;try{var r=h(n.complete);e=r?r.call(n,e):void 0}catch(e){try{g(t)}finally{throw e}}return g(t),e}}});var x=function(e){s(this,x,"Observable","_f")._f=l(e)};p(x.prototype,{subscribe:function(e){return new y(e,this._f)},forEach:function(e){var t=this;return new(i.Promise||o.Promise)(function(n,r){l(e);var o=t.subscribe({next:function(t){try{return e(t)}catch(e){r(e),o.unsubscribe()}},error:r,complete:n})})}}),p(x,{from:function(e){var t="function"==typeof this?this:x,n=h(c(e)[u]);if(n){var r=c(n.call(e));return r.constructor===t?r:new t(function(e){return r.subscribe(e)})}return new t(function(t){var n=!1;return a(function(){if(!n){try{if(d(e,!1,function(e){if(t.next(e),n)return m})===m)return}catch(e){if(n)throw e;return void t.error(e)}t.complete()}}),function(){n=!0}})},of:function(){for(var e=0,t=arguments.length,n=new Array(t);e<t;)n[e]=arguments[e++];return new("function"==typeof this?this:x)(function(e){var t=!1;return a(function(){if(!t){for(var r=0;r<n.length;++r)if(e.next(n[r]),t)return;e.complete()}}),function(){t=!0}})}}),f(x.prototype,u,function(){return this}),r(r.G,{Observable:x}),n(41)("Observable")},function(e,t,n){var r=n(3),o=n(0),i=n(66),a=[].slice,u=/MSIE .\./.test(i),l=function(e){return function(t,n){var r=arguments.length>2,o=!!r&&a.call(arguments,2);return e(r?function(){("function"==typeof t?t:Function(t)).apply(this,o)}:t,n)}};o(o.G+o.B+o.F*u,{setTimeout:l(r.setTimeout),setInterval:l(r.setInterval)})},function(e,t,n){var r=n(0),o=n(98);r(r.G+r.B,{setImmediate:o.set,clearImmediate:o.clear})},function(e,t,n){for(var r=n(95),o=n(37),i=n(13),a=n(3),u=n(12),l=n(49),c=n(6),s=c("iterator"),p=c("toStringTag"),f=l.Array,d={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},m=o(d),h=0;h<m.length;h++){var g,v=m[h],b=d[v],y=a[v],w=y&&y.prototype;if(w&&(w[s]||u(w,s,f),w[p]||u(w,p,v),l[v]=f,b))for(g in r)w[g]||i(w,g,r[g],!0)}},function(e,t,n){(function(t){!function(t){"use strict";function n(e,t,n,i){var a=t&&t.prototype instanceof o?t:o,u=Object.create(a.prototype),l=new f(i||[]);return u._invoke=function(e,t,n){var o=I;return function(i,a){if(o===C)throw new Error("Generator is already running");if(o===k){if("throw"===i)throw a;return m()}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var l=c(u,n);if(l){if(l===P)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===I)throw o=k,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=C;var s=r(e,t,n);if("normal"===s.type){if(o=n.done?k:T,s.arg===P)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(o=k,n.method="throw",n.arg=s.arg)}}}(e,n,l),u}function r(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}function o(){}function i(){}function a(){}function u(e){["next","throw","return"].forEach(function(t){e[t]=function(e){return this._invoke(t,e)}})}function l(e){function n(t,o,i,a){var u=r(e[t],e,o);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==typeof c&&v.call(c,"__await")?Promise.resolve(c.__await).then(function(e){n("next",e,i,a)},function(e){n("throw",e,i,a)}):Promise.resolve(c).then(function(e){l.value=e,i(l)},a)}a(u.arg)}"object"==typeof t.process&&t.process.domain&&(n=t.process.domain.bind(n));var o;this._invoke=function(e,t){function r(){return new Promise(function(r,o){n(e,t,r,o)})}return o=o?o.then(r,r):r()}}function c(e,t){var n=e.iterator[t.method];if(n===h){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=h,c(e,t),"throw"===t.method))return P;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return P}var o=r(n,e.iterator,t.arg);if("throw"===o.type)return t.method="throw",t.arg=o.arg,t.delegate=null,P;var i=o.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=h),t.delegate=null,P):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,P)}function s(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function p(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function f(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(s,this),this.reset(!0)}function d(e){if(e){var t=e[y];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,r=function t(){for(;++n<e.length;)if(v.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=h,t.done=!0,t};return r.next=r}}return{next:m}}function m(){return{value:h,done:!0}}var h,g=Object.prototype,v=g.hasOwnProperty,b="function"==typeof Symbol?Symbol:{},y=b.iterator||"@@iterator",w=b.asyncIterator||"@@asyncIterator",x=b.toStringTag||"@@toStringTag",E="object"==typeof e,S=t.regeneratorRuntime;if(S)E&&(e.exports=S);else{(S=t.regeneratorRuntime=E?e.exports:{}).wrap=n;var I="suspendedStart",T="suspendedYield",C="executing",k="completed",P={},j={};j[y]=function(){return this};var N=Object.getPrototypeOf,D=N&&N(N(d([])));D&&D!==g&&v.call(D,y)&&(j=D);var O=a.prototype=o.prototype=Object.create(j);i.prototype=O.constructor=a,a.constructor=i,a[x]=i.displayName="GeneratorFunction",S.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===i||"GeneratorFunction"===(t.displayName||t.name))},S.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,a):(e.__proto__=a,x in e||(e[x]="GeneratorFunction")),e.prototype=Object.create(O),e},S.awrap=function(e){return{__await:e}},u(l.prototype),l.prototype[w]=function(){return this},S.AsyncIterator=l,S.async=function(e,t,r,o){var i=new l(n(e,t,r,o));return S.isGeneratorFunction(t)?i:i.next().then(function(e){return e.done?e.value:i.next()})},u(O),O[x]="Generator",O[y]=function(){return this},O.toString=function(){return"[object Generator]"},S.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},S.values=d,f.prototype={constructor:f,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=h,this.done=!1,this.delegate=null,this.method="next",this.arg=h,this.tryEntries.forEach(p),!e)for(var t in this)"t"===t.charAt(0)&&v.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=h)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){function t(t,r){return i.type="throw",i.arg=e,n.next=t,r&&(n.method="next",n.arg=h),!!r}if(this.done)throw e;for(var n=this,r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r],i=o.completion;if("root"===o.tryLoc)return t("end");if(o.tryLoc<=this.prev){var a=v.call(o,"catchLoc"),u=v.call(o,"finallyLoc");if(a&&u){if(this.prev<o.catchLoc)return t(o.catchLoc,!0);if(this.prev<o.finallyLoc)return t(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return t(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return t(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&v.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,P):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),P},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),p(n),P}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;p(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:d(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=h),P}}}}("object"==typeof t?t:"object"==typeof window?window:"object"==typeof self?self:this)}).call(t,n(50))},function(e,t,n){n(346),e.exports=n(20).RegExp.escape},function(e,t,n){var r=n(0),o=n(347)(/[\\^$*+?.()|[\]{}]/g,"\\$&");r(r.S,"RegExp",{escape:function(e){return o(e)}})},function(e,t){e.exports=function(e,t){var n=t===Object(t)?function(e){return t[e]}:t;return function(t){return String(t).replace(e,n)}}},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},,,,,,,function(e,t,n){"use strict";/*
|
2 |
object-assign
|
3 |
(c) Sindre Sorhus
|
4 |
@license MIT
|
5 |
*/
|
6 |
+
var r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,a,u=function(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),l=1;l<arguments.length;l++){for(var c in n=Object(arguments[l]))o.call(n,c)&&(u[c]=n[c]);if(r){a=r(n);for(var s=0;s<a.length;s++)i.call(n,a[s])&&(u[a[s]]=n[a[s]])}}return u}},function(e,t){e.exports=function(){for(var e={},t=0;t<arguments.length;t++){var n=arguments[t];for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r])}return e}},,,,,,,,,,,,,function(e,t,n){"use strict";e.exports=function(e,t,n,r,o,i,a,u){if(!e){var l;if(void 0===t)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,o,i,a,u],s=0;(l=new Error(t.replace(/%s/g,function(){return c[s++]}))).name="Invariant Violation"}throw l.framesToPop=1,l}}},function(e,t,n){"use strict";function r(e){this.request=e.request,this.xhr=e.xhr,this.headers=e.headers||{},this.status=e.status||0,this.text=e.text,this.body=e.body,this.contentType=e.contentType,this.isHttpError=e.status>=400}var o=n(371),i=n(372);r.prototype.header=o.prototype.header,r.fromRequest=function(e){return new r(i(e))},e.exports=r},function(e,t,n){"use strict";function r(e){var t="string"==typeof e?{url:e}:e||{};this.method=t.method?t.method.toUpperCase():"GET",this.url=t.url,this.headers=t.headers||{},this.body=t.body,this.timeout=t.timeout||0,this.errorOn404=null==t.errorOn404||t.errorOn404,this.onload=t.onload,this.onerror=t.onerror}r.prototype.abort=function(){if(!this.aborted)return this.aborted=!0,this.xhr.abort(),this},r.prototype.header=function(e,t){var n;for(n in this.headers)if(this.headers.hasOwnProperty(n)&&e.toLowerCase()===n.toLowerCase()){if(1===arguments.length)return this.headers[n];delete this.headers[n];break}if(null!=t)return this.headers[e]=t,t},e.exports=r},function(e,t,n){"use strict";var r=n(356);e.exports=function(e){var t=e.xhr,n={request:e,xhr:t};try{var o,i,a,u={};if(t.getAllResponseHeaders)for(o=t.getAllResponseHeaders().split("\n"),i=0;i<o.length;i++)(a=o[i].match(/\s*([^\s]+):\s+([^\s]+)/))&&(u[a[1]]=a[2]);n=r(n,{status:t.status,contentType:t.contentType||t.getResponseHeader&&t.getResponseHeader("Content-Type"),headers:u,text:t.responseText,body:t.response||t.responseText})}catch(e){}return n}},function(e,t,n){"use strict";e.exports=function(e){var t,n=!1;return function(){return n||(n=!0,t=e.apply(this,arguments)),t}}},,,,,,,,,,,,,,,,,,function(e,t,n){var r;/*!
|
7 |
Copyright (c) 2017 Jed Watson.
|
8 |
Licensed under the MIT License (MIT), see
|
9 |
http://jedwatson.github.io/classnames
|
13 |
Licensed under the MIT License (MIT), see
|
14 |
http://jedwatson.github.io/classnames
|
15 |
*/
|
16 |
+
!function(){"use strict";function n(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var i=typeof r;if("string"===i||"number"===i)e.push(r);else if(Array.isArray(r)&&r.length){var a=n.apply(null,r);a&&e.push(a)}else if("object"===i)for(var u in r)o.call(r,u)&&r[u]&&e.push(u)}}return e.join(" ")}var o={}.hasOwnProperty;void 0!==e&&e.exports?(n.default=n,e.exports=n):void 0===(r=function(){return n}.apply(t,[]))||(e.exports=r)}()},,,,,,,function(e,t,n){(function(e,r){var o;/*! https://mths.be/he v1.2.0 by @mathias | MIT license */!function(i){var a="object"==typeof t&&t,u=("object"==typeof e&&e&&e.exports,"object"==typeof r&&r);var l=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,c=/[\x01-\x7F]/g,s=/[\x01-\t\x0B\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,p=/<\u20D2|=\u20E5|>\u20D2|\u205F\u200A|\u219D\u0338|\u2202\u0338|\u2220\u20D2|\u2229\uFE00|\u222A\uFE00|\u223C\u20D2|\u223D\u0331|\u223E\u0333|\u2242\u0338|\u224B\u0338|\u224D\u20D2|\u224E\u0338|\u224F\u0338|\u2250\u0338|\u2261\u20E5|\u2264\u20D2|\u2265\u20D2|\u2266\u0338|\u2267\u0338|\u2268\uFE00|\u2269\uFE00|\u226A\u0338|\u226A\u20D2|\u226B\u0338|\u226B\u20D2|\u227F\u0338|\u2282\u20D2|\u2283\u20D2|\u228A\uFE00|\u228B\uFE00|\u228F\u0338|\u2290\u0338|\u2293\uFE00|\u2294\uFE00|\u22B4\u20D2|\u22B5\u20D2|\u22D8\u0338|\u22D9\u0338|\u22DA\uFE00|\u22DB\uFE00|\u22F5\u0338|\u22F9\u0338|\u2933\u0338|\u29CF\u0338|\u29D0\u0338|\u2A6D\u0338|\u2A70\u0338|\u2A7D\u0338|\u2A7E\u0338|\u2AA1\u0338|\u2AA2\u0338|\u2AAC\uFE00|\u2AAD\uFE00|\u2AAF\u0338|\u2AB0\u0338|\u2AC5\u0338|\u2AC6\u0338|\u2ACB\uFE00|\u2ACC\uFE00|\u2AFD\u20E5|[\xA0-\u0113\u0116-\u0122\u0124-\u012B\u012E-\u014D\u0150-\u017E\u0192\u01B5\u01F5\u0237\u02C6\u02C7\u02D8-\u02DD\u0311\u0391-\u03A1\u03A3-\u03A9\u03B1-\u03C9\u03D1\u03D2\u03D5\u03D6\u03DC\u03DD\u03F0\u03F1\u03F5\u03F6\u0401-\u040C\u040E-\u044F\u0451-\u045C\u045E\u045F\u2002-\u2005\u2007-\u2010\u2013-\u2016\u2018-\u201A\u201C-\u201E\u2020-\u2022\u2025\u2026\u2030-\u2035\u2039\u203A\u203E\u2041\u2043\u2044\u204F\u2057\u205F-\u2063\u20AC\u20DB\u20DC\u2102\u2105\u210A-\u2113\u2115-\u211E\u2122\u2124\u2127-\u2129\u212C\u212D\u212F-\u2131\u2133-\u2138\u2145-\u2148\u2153-\u215E\u2190-\u219B\u219D-\u21A7\u21A9-\u21AE\u21B0-\u21B3\u21B5-\u21B7\u21BA-\u21DB\u21DD\u21E4\u21E5\u21F5\u21FD-\u2205\u2207-\u2209\u220B\u220C\u220F-\u2214\u2216-\u2218\u221A\u221D-\u2238\u223A-\u2257\u2259\u225A\u225C\u225F-\u2262\u2264-\u228B\u228D-\u229B\u229D-\u22A5\u22A7-\u22B0\u22B2-\u22BB\u22BD-\u22DB\u22DE-\u22E3\u22E6-\u22F7\u22F9-\u22FE\u2305\u2306\u2308-\u2310\u2312\u2313\u2315\u2316\u231C-\u231F\u2322\u2323\u232D\u232E\u2336\u233D\u233F\u237C\u23B0\u23B1\u23B4-\u23B6\u23DC-\u23DF\u23E2\u23E7\u2423\u24C8\u2500\u2502\u250C\u2510\u2514\u2518\u251C\u2524\u252C\u2534\u253C\u2550-\u256C\u2580\u2584\u2588\u2591-\u2593\u25A1\u25AA\u25AB\u25AD\u25AE\u25B1\u25B3-\u25B5\u25B8\u25B9\u25BD-\u25BF\u25C2\u25C3\u25CA\u25CB\u25EC\u25EF\u25F8-\u25FC\u2605\u2606\u260E\u2640\u2642\u2660\u2663\u2665\u2666\u266A\u266D-\u266F\u2713\u2717\u2720\u2736\u2758\u2772\u2773\u27C8\u27C9\u27E6-\u27ED\u27F5-\u27FA\u27FC\u27FF\u2902-\u2905\u290C-\u2913\u2916\u2919-\u2920\u2923-\u292A\u2933\u2935-\u2939\u293C\u293D\u2945\u2948-\u294B\u294E-\u2976\u2978\u2979\u297B-\u297F\u2985\u2986\u298B-\u2996\u299A\u299C\u299D\u29A4-\u29B7\u29B9\u29BB\u29BC\u29BE-\u29C5\u29C9\u29CD-\u29D0\u29DC-\u29DE\u29E3-\u29E5\u29EB\u29F4\u29F6\u2A00-\u2A02\u2A04\u2A06\u2A0C\u2A0D\u2A10-\u2A17\u2A22-\u2A27\u2A29\u2A2A\u2A2D-\u2A31\u2A33-\u2A3C\u2A3F\u2A40\u2A42-\u2A4D\u2A50\u2A53-\u2A58\u2A5A-\u2A5D\u2A5F\u2A66\u2A6A\u2A6D-\u2A75\u2A77-\u2A9A\u2A9D-\u2AA2\u2AA4-\u2AB0\u2AB3-\u2AC8\u2ACB\u2ACC\u2ACF-\u2ADB\u2AE4\u2AE6-\u2AE9\u2AEB-\u2AF3\u2AFD\uFB00-\uFB04]|\uD835[\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDD6B]/g,f={"":"shy","":"zwnj","":"zwj","":"lrm","":"ic","":"it","":"af","":"rlm","":"ZeroWidthSpace","":"NoBreak","̑":"DownBreve","⃛":"tdot","⃜":"DotDot","\t":"Tab","\n":"NewLine"," ":"puncsp"," ":"MediumSpace"," ":"thinsp"," ":"hairsp"," ":"emsp13"," ":"ensp"," ":"emsp14"," ":"emsp"," ":"numsp"," ":"nbsp"," ":"ThickSpace","‾":"oline",_:"lowbar","‐":"dash","–":"ndash","—":"mdash","―":"horbar",",":"comma",";":"semi","⁏":"bsemi",":":"colon","⩴":"Colone","!":"excl","¡":"iexcl","?":"quest","¿":"iquest",".":"period","‥":"nldr","…":"mldr","·":"middot","'":"apos","‘":"lsquo","’":"rsquo","‚":"sbquo","‹":"lsaquo","›":"rsaquo",'"':"quot","“":"ldquo","”":"rdquo","„":"bdquo","«":"laquo","»":"raquo","(":"lpar",")":"rpar","[":"lsqb","]":"rsqb","{":"lcub","}":"rcub","⌈":"lceil","⌉":"rceil","⌊":"lfloor","⌋":"rfloor","⦅":"lopar","⦆":"ropar","⦋":"lbrke","⦌":"rbrke","⦍":"lbrkslu","⦎":"rbrksld","⦏":"lbrksld","⦐":"rbrkslu","⦑":"langd","⦒":"rangd","⦓":"lparlt","⦔":"rpargt","⦕":"gtlPar","⦖":"ltrPar","⟦":"lobrk","⟧":"robrk","⟨":"lang","⟩":"rang","⟪":"Lang","⟫":"Rang","⟬":"loang","⟭":"roang","❲":"lbbrk","❳":"rbbrk","‖":"Vert","§":"sect","¶":"para","@":"commat","*":"ast","/":"sol",undefined:null,"&":"amp","#":"num","%":"percnt","‰":"permil","‱":"pertenk","†":"dagger","‡":"Dagger","•":"bull","⁃":"hybull","′":"prime","″":"Prime","‴":"tprime","⁗":"qprime","‵":"bprime","⁁":"caret","`":"grave","´":"acute","˜":"tilde","^":"Hat","¯":"macr","˘":"breve","˙":"dot","¨":"die","˚":"ring","˝":"dblac","¸":"cedil","˛":"ogon","ˆ":"circ","ˇ":"caron","°":"deg","©":"copy","®":"reg","℗":"copysr","℘":"wp","℞":"rx","℧":"mho","℩":"iiota","←":"larr","↚":"nlarr","→":"rarr","↛":"nrarr","↑":"uarr","↓":"darr","↔":"harr","↮":"nharr","↕":"varr","↖":"nwarr","↗":"nearr","↘":"searr","↙":"swarr","↝":"rarrw","↝̸":"nrarrw","↞":"Larr","↟":"Uarr","↠":"Rarr","↡":"Darr","↢":"larrtl","↣":"rarrtl","↤":"mapstoleft","↥":"mapstoup","↦":"map","↧":"mapstodown","↩":"larrhk","↪":"rarrhk","↫":"larrlp","↬":"rarrlp","↭":"harrw","↰":"lsh","↱":"rsh","↲":"ldsh","↳":"rdsh","↵":"crarr","↶":"cularr","↷":"curarr","↺":"olarr","↻":"orarr","↼":"lharu","↽":"lhard","↾":"uharr","↿":"uharl","⇀":"rharu","⇁":"rhard","⇂":"dharr","⇃":"dharl","⇄":"rlarr","⇅":"udarr","⇆":"lrarr","⇇":"llarr","⇈":"uuarr","⇉":"rrarr","⇊":"ddarr","⇋":"lrhar","⇌":"rlhar","⇐":"lArr","⇍":"nlArr","⇑":"uArr","⇒":"rArr","⇏":"nrArr","⇓":"dArr","⇔":"iff","⇎":"nhArr","⇕":"vArr","⇖":"nwArr","⇗":"neArr","⇘":"seArr","⇙":"swArr","⇚":"lAarr","⇛":"rAarr","⇝":"zigrarr","⇤":"larrb","⇥":"rarrb","⇵":"duarr","⇽":"loarr","⇾":"roarr","⇿":"hoarr","∀":"forall","∁":"comp","∂":"part","∂̸":"npart","∃":"exist","∄":"nexist","∅":"empty","∇":"Del","∈":"in","∉":"notin","∋":"ni","∌":"notni","϶":"bepsi","∏":"prod","∐":"coprod","∑":"sum","+":"plus","±":"pm","÷":"div","×":"times","<":"lt","≮":"nlt","<⃒":"nvlt","=":"equals","≠":"ne","=⃥":"bne","⩵":"Equal",">":"gt","≯":"ngt",">⃒":"nvgt","¬":"not","|":"vert","¦":"brvbar","−":"minus","∓":"mp","∔":"plusdo","⁄":"frasl","∖":"setmn","∗":"lowast","∘":"compfn","√":"Sqrt","∝":"prop","∞":"infin","∟":"angrt","∠":"ang","∠⃒":"nang","∡":"angmsd","∢":"angsph","∣":"mid","∤":"nmid","∥":"par","∦":"npar","∧":"and","∨":"or","∩":"cap","∩︀":"caps","∪":"cup","∪︀":"cups","∫":"int","∬":"Int","∭":"tint","⨌":"qint","∮":"oint","∯":"Conint","∰":"Cconint","∱":"cwint","∲":"cwconint","∳":"awconint","∴":"there4","∵":"becaus","∶":"ratio","∷":"Colon","∸":"minusd","∺":"mDDot","∻":"homtht","∼":"sim","≁":"nsim","∼⃒":"nvsim","∽":"bsim","∽̱":"race","∾":"ac","∾̳":"acE","∿":"acd","≀":"wr","≂":"esim","≂̸":"nesim","≃":"sime","≄":"nsime","≅":"cong","≇":"ncong","≆":"simne","≈":"ap","≉":"nap","≊":"ape","≋":"apid","≋̸":"napid","≌":"bcong","≍":"CupCap","≭":"NotCupCap","≍⃒":"nvap","≎":"bump","≎̸":"nbump","≏":"bumpe","≏̸":"nbumpe","≐":"doteq","≐̸":"nedot","≑":"eDot","≒":"efDot","≓":"erDot","≔":"colone","≕":"ecolon","≖":"ecir","≗":"cire","≙":"wedgeq","≚":"veeeq","≜":"trie","≟":"equest","≡":"equiv","≢":"nequiv","≡⃥":"bnequiv","≤":"le","≰":"nle","≤⃒":"nvle","≥":"ge","≱":"nge","≥⃒":"nvge","≦":"lE","≦̸":"nlE","≧":"gE","≧̸":"ngE","≨︀":"lvnE","≨":"lnE","≩":"gnE","≩︀":"gvnE","≪":"ll","≪̸":"nLtv","≪⃒":"nLt","≫":"gg","≫̸":"nGtv","≫⃒":"nGt","≬":"twixt","≲":"lsim","≴":"nlsim","≳":"gsim","≵":"ngsim","≶":"lg","≸":"ntlg","≷":"gl","≹":"ntgl","≺":"pr","⊀":"npr","≻":"sc","⊁":"nsc","≼":"prcue","⋠":"nprcue","≽":"sccue","⋡":"nsccue","≾":"prsim","≿":"scsim","≿̸":"NotSucceedsTilde","⊂":"sub","⊄":"nsub","⊂⃒":"vnsub","⊃":"sup","⊅":"nsup","⊃⃒":"vnsup","⊆":"sube","⊈":"nsube","⊇":"supe","⊉":"nsupe","⊊︀":"vsubne","⊊":"subne","⊋︀":"vsupne","⊋":"supne","⊍":"cupdot","⊎":"uplus","⊏":"sqsub","⊏̸":"NotSquareSubset","⊐":"sqsup","⊐̸":"NotSquareSuperset","⊑":"sqsube","⋢":"nsqsube","⊒":"sqsupe","⋣":"nsqsupe","⊓":"sqcap","⊓︀":"sqcaps","⊔":"sqcup","⊔︀":"sqcups","⊕":"oplus","⊖":"ominus","⊗":"otimes","⊘":"osol","⊙":"odot","⊚":"ocir","⊛":"oast","⊝":"odash","⊞":"plusb","⊟":"minusb","⊠":"timesb","⊡":"sdotb","⊢":"vdash","⊬":"nvdash","⊣":"dashv","⊤":"top","⊥":"bot","⊧":"models","⊨":"vDash","⊭":"nvDash","⊩":"Vdash","⊮":"nVdash","⊪":"Vvdash","⊫":"VDash","⊯":"nVDash","⊰":"prurel","⊲":"vltri","⋪":"nltri","⊳":"vrtri","⋫":"nrtri","⊴":"ltrie","⋬":"nltrie","⊴⃒":"nvltrie","⊵":"rtrie","⋭":"nrtrie","⊵⃒":"nvrtrie","⊶":"origof","⊷":"imof","⊸":"mumap","⊹":"hercon","⊺":"intcal","⊻":"veebar","⊽":"barvee","⊾":"angrtvb","⊿":"lrtri","⋀":"Wedge","⋁":"Vee","⋂":"xcap","⋃":"xcup","⋄":"diam","⋅":"sdot","⋆":"Star","⋇":"divonx","⋈":"bowtie","⋉":"ltimes","⋊":"rtimes","⋋":"lthree","⋌":"rthree","⋍":"bsime","⋎":"cuvee","⋏":"cuwed","⋐":"Sub","⋑":"Sup","⋒":"Cap","⋓":"Cup","⋔":"fork","⋕":"epar","⋖":"ltdot","⋗":"gtdot","⋘":"Ll","⋘̸":"nLl","⋙":"Gg","⋙̸":"nGg","⋚︀":"lesg","⋚":"leg","⋛":"gel","⋛︀":"gesl","⋞":"cuepr","⋟":"cuesc","⋦":"lnsim","⋧":"gnsim","⋨":"prnsim","⋩":"scnsim","⋮":"vellip","⋯":"ctdot","⋰":"utdot","⋱":"dtdot","⋲":"disin","⋳":"isinsv","⋴":"isins","⋵":"isindot","⋵̸":"notindot","⋶":"notinvc","⋷":"notinvb","⋹":"isinE","⋹̸":"notinE","⋺":"nisd","⋻":"xnis","⋼":"nis","⋽":"notnivc","⋾":"notnivb","⌅":"barwed","⌆":"Barwed","⌌":"drcrop","⌍":"dlcrop","⌎":"urcrop","⌏":"ulcrop","⌐":"bnot","⌒":"profline","⌓":"profsurf","⌕":"telrec","⌖":"target","⌜":"ulcorn","⌝":"urcorn","⌞":"dlcorn","⌟":"drcorn","⌢":"frown","⌣":"smile","⌭":"cylcty","⌮":"profalar","⌶":"topbot","⌽":"ovbar","⌿":"solbar","⍼":"angzarr","⎰":"lmoust","⎱":"rmoust","⎴":"tbrk","⎵":"bbrk","⎶":"bbrktbrk","⏜":"OverParenthesis","⏝":"UnderParenthesis","⏞":"OverBrace","⏟":"UnderBrace","⏢":"trpezium","⏧":"elinters","␣":"blank","─":"boxh","│":"boxv","┌":"boxdr","┐":"boxdl","└":"boxur","┘":"boxul","├":"boxvr","┤":"boxvl","┬":"boxhd","┴":"boxhu","┼":"boxvh","═":"boxH","║":"boxV","╒":"boxdR","╓":"boxDr","╔":"boxDR","╕":"boxdL","╖":"boxDl","╗":"boxDL","╘":"boxuR","╙":"boxUr","╚":"boxUR","╛":"boxuL","╜":"boxUl","╝":"boxUL","╞":"boxvR","╟":"boxVr","╠":"boxVR","╡":"boxvL","╢":"boxVl","╣":"boxVL","╤":"boxHd","╥":"boxhD","╦":"boxHD","╧":"boxHu","╨":"boxhU","╩":"boxHU","╪":"boxvH","╫":"boxVh","╬":"boxVH","▀":"uhblk","▄":"lhblk","█":"block","░":"blk14","▒":"blk12","▓":"blk34","□":"squ","▪":"squf","▫":"EmptyVerySmallSquare","▭":"rect","▮":"marker","▱":"fltns","△":"xutri","▴":"utrif","▵":"utri","▸":"rtrif","▹":"rtri","▽":"xdtri","▾":"dtrif","▿":"dtri","◂":"ltrif","◃":"ltri","◊":"loz","○":"cir","◬":"tridot","◯":"xcirc","◸":"ultri","◹":"urtri","◺":"lltri","◻":"EmptySmallSquare","◼":"FilledSmallSquare","★":"starf","☆":"star","☎":"phone","♀":"female","♂":"male","♠":"spades","♣":"clubs","♥":"hearts","♦":"diams","♪":"sung","✓":"check","✗":"cross","✠":"malt","✶":"sext","❘":"VerticalSeparator","⟈":"bsolhsub","⟉":"suphsol","⟵":"xlarr","⟶":"xrarr","⟷":"xharr","⟸":"xlArr","⟹":"xrArr","⟺":"xhArr","⟼":"xmap","⟿":"dzigrarr","⤂":"nvlArr","⤃":"nvrArr","⤄":"nvHarr","⤅":"Map","⤌":"lbarr","⤍":"rbarr","⤎":"lBarr","⤏":"rBarr","⤐":"RBarr","⤑":"DDotrahd","⤒":"UpArrowBar","⤓":"DownArrowBar","⤖":"Rarrtl","⤙":"latail","⤚":"ratail","⤛":"lAtail","⤜":"rAtail","⤝":"larrfs","⤞":"rarrfs","⤟":"larrbfs","⤠":"rarrbfs","⤣":"nwarhk","⤤":"nearhk","⤥":"searhk","⤦":"swarhk","⤧":"nwnear","⤨":"toea","⤩":"tosa","⤪":"swnwar","⤳":"rarrc","⤳̸":"nrarrc","⤵":"cudarrr","⤶":"ldca","⤷":"rdca","⤸":"cudarrl","⤹":"larrpl","⤼":"curarrm","⤽":"cularrp","⥅":"rarrpl","⥈":"harrcir","⥉":"Uarrocir","⥊":"lurdshar","⥋":"ldrushar","⥎":"LeftRightVector","⥏":"RightUpDownVector","⥐":"DownLeftRightVector","⥑":"LeftUpDownVector","⥒":"LeftVectorBar","⥓":"RightVectorBar","⥔":"RightUpVectorBar","⥕":"RightDownVectorBar","⥖":"DownLeftVectorBar","⥗":"DownRightVectorBar","⥘":"LeftUpVectorBar","⥙":"LeftDownVectorBar","⥚":"LeftTeeVector","⥛":"RightTeeVector","⥜":"RightUpTeeVector","⥝":"RightDownTeeVector","⥞":"DownLeftTeeVector","⥟":"DownRightTeeVector","⥠":"LeftUpTeeVector","⥡":"LeftDownTeeVector","⥢":"lHar","⥣":"uHar","⥤":"rHar","⥥":"dHar","⥦":"luruhar","⥧":"ldrdhar","⥨":"ruluhar","⥩":"rdldhar","⥪":"lharul","⥫":"llhard","⥬":"rharul","⥭":"lrhard","⥮":"udhar","⥯":"duhar","⥰":"RoundImplies","⥱":"erarr","⥲":"simrarr","⥳":"larrsim","⥴":"rarrsim","⥵":"rarrap","⥶":"ltlarr","⥸":"gtrarr","⥹":"subrarr","⥻":"suplarr","⥼":"lfisht","⥽":"rfisht","⥾":"ufisht","⥿":"dfisht","⦚":"vzigzag","⦜":"vangrt","⦝":"angrtvbd","⦤":"ange","⦥":"range","⦦":"dwangle","⦧":"uwangle","⦨":"angmsdaa","⦩":"angmsdab","⦪":"angmsdac","⦫":"angmsdad","⦬":"angmsdae","⦭":"angmsdaf","⦮":"angmsdag","⦯":"angmsdah","⦰":"bemptyv","⦱":"demptyv","⦲":"cemptyv","⦳":"raemptyv","⦴":"laemptyv","⦵":"ohbar","⦶":"omid","⦷":"opar","⦹":"operp","⦻":"olcross","⦼":"odsold","⦾":"olcir","⦿":"ofcir","⧀":"olt","⧁":"ogt","⧂":"cirscir","⧃":"cirE","⧄":"solb","⧅":"bsolb","⧉":"boxbox","⧍":"trisb","⧎":"rtriltri","⧏":"LeftTriangleBar","⧏̸":"NotLeftTriangleBar","⧐":"RightTriangleBar","⧐̸":"NotRightTriangleBar","⧜":"iinfin","⧝":"infintie","⧞":"nvinfin","⧣":"eparsl","⧤":"smeparsl","⧥":"eqvparsl","⧫":"lozf","⧴":"RuleDelayed","⧶":"dsol","⨀":"xodot","⨁":"xoplus","⨂":"xotime","⨄":"xuplus","⨆":"xsqcup","⨍":"fpartint","⨐":"cirfnint","⨑":"awint","⨒":"rppolint","⨓":"scpolint","⨔":"npolint","⨕":"pointint","⨖":"quatint","⨗":"intlarhk","⨢":"pluscir","⨣":"plusacir","⨤":"simplus","⨥":"plusdu","⨦":"plussim","⨧":"plustwo","⨩":"mcomma","⨪":"minusdu","⨭":"loplus","⨮":"roplus","⨯":"Cross","⨰":"timesd","⨱":"timesbar","⨳":"smashp","⨴":"lotimes","⨵":"rotimes","⨶":"otimesas","⨷":"Otimes","⨸":"odiv","⨹":"triplus","⨺":"triminus","⨻":"tritime","⨼":"iprod","⨿":"amalg","⩀":"capdot","⩂":"ncup","⩃":"ncap","⩄":"capand","⩅":"cupor","⩆":"cupcap","⩇":"capcup","⩈":"cupbrcap","⩉":"capbrcup","⩊":"cupcup","⩋":"capcap","⩌":"ccups","⩍":"ccaps","⩐":"ccupssm","⩓":"And","⩔":"Or","⩕":"andand","⩖":"oror","⩗":"orslope","⩘":"andslope","⩚":"andv","⩛":"orv","⩜":"andd","⩝":"ord","⩟":"wedbar","⩦":"sdote","⩪":"simdot","⩭":"congdot","⩭̸":"ncongdot","⩮":"easter","⩯":"apacir","⩰":"apE","⩰̸":"napE","⩱":"eplus","⩲":"pluse","⩳":"Esim","⩷":"eDDot","⩸":"equivDD","⩹":"ltcir","⩺":"gtcir","⩻":"ltquest","⩼":"gtquest","⩽":"les","⩽̸":"nles","⩾":"ges","⩾̸":"nges","⩿":"lesdot","⪀":"gesdot","⪁":"lesdoto","⪂":"gesdoto","⪃":"lesdotor","⪄":"gesdotol","⪅":"lap","⪆":"gap","⪇":"lne","⪈":"gne","⪉":"lnap","⪊":"gnap","⪋":"lEg","⪌":"gEl","⪍":"lsime","⪎":"gsime","⪏":"lsimg","⪐":"gsiml","⪑":"lgE","⪒":"glE","⪓":"lesges","⪔":"gesles","⪕":"els","⪖":"egs","⪗":"elsdot","⪘":"egsdot","⪙":"el","⪚":"eg","⪝":"siml","⪞":"simg","⪟":"simlE","⪠":"simgE","⪡":"LessLess","⪡̸":"NotNestedLessLess","⪢":"GreaterGreater","⪢̸":"NotNestedGreaterGreater","⪤":"glj","⪥":"gla","⪦":"ltcc","⪧":"gtcc","⪨":"lescc","⪩":"gescc","⪪":"smt","⪫":"lat","⪬":"smte","⪬︀":"smtes","⪭":"late","⪭︀":"lates","⪮":"bumpE","⪯":"pre","⪯̸":"npre","⪰":"sce","⪰̸":"nsce","⪳":"prE","⪴":"scE","⪵":"prnE","⪶":"scnE","⪷":"prap","⪸":"scap","⪹":"prnap","⪺":"scnap","⪻":"Pr","⪼":"Sc","⪽":"subdot","⪾":"supdot","⪿":"subplus","⫀":"supplus","⫁":"submult","⫂":"supmult","⫃":"subedot","⫄":"supedot","⫅":"subE","⫅̸":"nsubE","⫆":"supE","⫆̸":"nsupE","⫇":"subsim","⫈":"supsim","⫋︀":"vsubnE","⫋":"subnE","⫌︀":"vsupnE","⫌":"supnE","⫏":"csub","⫐":"csup","⫑":"csube","⫒":"csupe","⫓":"subsup","⫔":"supsub","⫕":"subsub","⫖":"supsup","⫗":"suphsub","⫘":"supdsub","⫙":"forkv","⫚":"topfork","⫛":"mlcp","⫤":"Dashv","⫦":"Vdashl","⫧":"Barv","⫨":"vBar","⫩":"vBarv","⫫":"Vbar","⫬":"Not","⫭":"bNot","⫮":"rnmid","⫯":"cirmid","⫰":"midcir","⫱":"topcir","⫲":"nhpar","⫳":"parsim","⫽":"parsl","⫽⃥":"nparsl","♭":"flat","♮":"natur","♯":"sharp","¤":"curren","¢":"cent",$:"dollar","£":"pound","¥":"yen","€":"euro","¹":"sup1","½":"half","⅓":"frac13","¼":"frac14","⅕":"frac15","⅙":"frac16","⅛":"frac18","²":"sup2","⅔":"frac23","⅖":"frac25","³":"sup3","¾":"frac34","⅗":"frac35","⅜":"frac38","⅘":"frac45","⅚":"frac56","⅝":"frac58","⅞":"frac78","𝒶":"ascr","𝕒":"aopf","𝔞":"afr","𝔸":"Aopf","𝔄":"Afr","𝒜":"Ascr","ª":"ordf","á":"aacute","Á":"Aacute","à":"agrave","À":"Agrave","ă":"abreve","Ă":"Abreve","â":"acirc","Â":"Acirc","å":"aring","Å":"angst","ä":"auml","Ä":"Auml","ã":"atilde","Ã":"Atilde","ą":"aogon","Ą":"Aogon","ā":"amacr","Ā":"Amacr","æ":"aelig","Æ":"AElig","𝒷":"bscr","𝕓":"bopf","𝔟":"bfr","𝔹":"Bopf","ℬ":"Bscr","𝔅":"Bfr","𝔠":"cfr","𝒸":"cscr","𝕔":"copf","ℭ":"Cfr","𝒞":"Cscr","ℂ":"Copf","ć":"cacute","Ć":"Cacute","ĉ":"ccirc","Ĉ":"Ccirc","č":"ccaron","Č":"Ccaron","ċ":"cdot","Ċ":"Cdot","ç":"ccedil","Ç":"Ccedil","℅":"incare","𝔡":"dfr","ⅆ":"dd","𝕕":"dopf","𝒹":"dscr","𝒟":"Dscr","𝔇":"Dfr","ⅅ":"DD","𝔻":"Dopf","ď":"dcaron","Ď":"Dcaron","đ":"dstrok","Đ":"Dstrok","ð":"eth","Ð":"ETH","ⅇ":"ee","ℯ":"escr","𝔢":"efr","𝕖":"eopf","ℰ":"Escr","𝔈":"Efr","𝔼":"Eopf","é":"eacute","É":"Eacute","è":"egrave","È":"Egrave","ê":"ecirc","Ê":"Ecirc","ě":"ecaron","Ě":"Ecaron","ë":"euml","Ë":"Euml","ė":"edot","Ė":"Edot","ę":"eogon","Ę":"Eogon","ē":"emacr","Ē":"Emacr","𝔣":"ffr","𝕗":"fopf","𝒻":"fscr","𝔉":"Ffr","𝔽":"Fopf","ℱ":"Fscr","ff":"fflig","ffi":"ffilig","ffl":"ffllig","fi":"filig",fj:"fjlig","fl":"fllig","ƒ":"fnof","ℊ":"gscr","𝕘":"gopf","𝔤":"gfr","𝒢":"Gscr","𝔾":"Gopf","𝔊":"Gfr","ǵ":"gacute","ğ":"gbreve","Ğ":"Gbreve","ĝ":"gcirc","Ĝ":"Gcirc","ġ":"gdot","Ġ":"Gdot","Ģ":"Gcedil","𝔥":"hfr","ℎ":"planckh","𝒽":"hscr","𝕙":"hopf","ℋ":"Hscr","ℌ":"Hfr","ℍ":"Hopf","ĥ":"hcirc","Ĥ":"Hcirc","ℏ":"hbar","ħ":"hstrok","Ħ":"Hstrok","𝕚":"iopf","𝔦":"ifr","𝒾":"iscr","ⅈ":"ii","𝕀":"Iopf","ℐ":"Iscr","ℑ":"Im","í":"iacute","Í":"Iacute","ì":"igrave","Ì":"Igrave","î":"icirc","Î":"Icirc","ï":"iuml","Ï":"Iuml","ĩ":"itilde","Ĩ":"Itilde","İ":"Idot","į":"iogon","Į":"Iogon","ī":"imacr","Ī":"Imacr","ij":"ijlig","IJ":"IJlig","ı":"imath","𝒿":"jscr","𝕛":"jopf","𝔧":"jfr","𝒥":"Jscr","𝔍":"Jfr","𝕁":"Jopf","ĵ":"jcirc","Ĵ":"Jcirc","ȷ":"jmath","𝕜":"kopf","𝓀":"kscr","𝔨":"kfr","𝒦":"Kscr","𝕂":"Kopf","𝔎":"Kfr","ķ":"kcedil","Ķ":"Kcedil","𝔩":"lfr","𝓁":"lscr","ℓ":"ell","𝕝":"lopf","ℒ":"Lscr","𝔏":"Lfr","𝕃":"Lopf","ĺ":"lacute","Ĺ":"Lacute","ľ":"lcaron","Ľ":"Lcaron","ļ":"lcedil","Ļ":"Lcedil","ł":"lstrok","Ł":"Lstrok","ŀ":"lmidot","Ŀ":"Lmidot","𝔪":"mfr","𝕞":"mopf","𝓂":"mscr","𝔐":"Mfr","𝕄":"Mopf","ℳ":"Mscr","𝔫":"nfr","𝕟":"nopf","𝓃":"nscr","ℕ":"Nopf","𝒩":"Nscr","𝔑":"Nfr","ń":"nacute","Ń":"Nacute","ň":"ncaron","Ň":"Ncaron","ñ":"ntilde","Ñ":"Ntilde","ņ":"ncedil","Ņ":"Ncedil","№":"numero","ŋ":"eng","Ŋ":"ENG","𝕠":"oopf","𝔬":"ofr","ℴ":"oscr","𝒪":"Oscr","𝔒":"Ofr","𝕆":"Oopf","º":"ordm","ó":"oacute","Ó":"Oacute","ò":"ograve","Ò":"Ograve","ô":"ocirc","Ô":"Ocirc","ö":"ouml","Ö":"Ouml","ő":"odblac","Ő":"Odblac","õ":"otilde","Õ":"Otilde","ø":"oslash","Ø":"Oslash","ō":"omacr","Ō":"Omacr","œ":"oelig","Œ":"OElig","𝔭":"pfr","𝓅":"pscr","𝕡":"popf","ℙ":"Popf","𝔓":"Pfr","𝒫":"Pscr","𝕢":"qopf","𝔮":"qfr","𝓆":"qscr","𝒬":"Qscr","𝔔":"Qfr","ℚ":"Qopf","ĸ":"kgreen","𝔯":"rfr","𝕣":"ropf","𝓇":"rscr","ℛ":"Rscr","ℜ":"Re","ℝ":"Ropf","ŕ":"racute","Ŕ":"Racute","ř":"rcaron","Ř":"Rcaron","ŗ":"rcedil","Ŗ":"Rcedil","𝕤":"sopf","𝓈":"sscr","𝔰":"sfr","𝕊":"Sopf","𝔖":"Sfr","𝒮":"Sscr","Ⓢ":"oS","ś":"sacute","Ś":"Sacute","ŝ":"scirc","Ŝ":"Scirc","š":"scaron","Š":"Scaron","ş":"scedil","Ş":"Scedil","ß":"szlig","𝔱":"tfr","𝓉":"tscr","𝕥":"topf","𝒯":"Tscr","𝔗":"Tfr","𝕋":"Topf","ť":"tcaron","Ť":"Tcaron","ţ":"tcedil","Ţ":"Tcedil","™":"trade","ŧ":"tstrok","Ŧ":"Tstrok","𝓊":"uscr","𝕦":"uopf","𝔲":"ufr","𝕌":"Uopf","𝔘":"Ufr","𝒰":"Uscr","ú":"uacute","Ú":"Uacute","ù":"ugrave","Ù":"Ugrave","ŭ":"ubreve","Ŭ":"Ubreve","û":"ucirc","Û":"Ucirc","ů":"uring","Ů":"Uring","ü":"uuml","Ü":"Uuml","ű":"udblac","Ű":"Udblac","ũ":"utilde","Ũ":"Utilde","ų":"uogon","Ų":"Uogon","ū":"umacr","Ū":"Umacr","𝔳":"vfr","𝕧":"vopf","𝓋":"vscr","𝔙":"Vfr","𝕍":"Vopf","𝒱":"Vscr","𝕨":"wopf","𝓌":"wscr","𝔴":"wfr","𝒲":"Wscr","𝕎":"Wopf","𝔚":"Wfr","ŵ":"wcirc","Ŵ":"Wcirc","𝔵":"xfr","𝓍":"xscr","𝕩":"xopf","𝕏":"Xopf","𝔛":"Xfr","𝒳":"Xscr","𝔶":"yfr","𝓎":"yscr","𝕪":"yopf","𝒴":"Yscr","𝔜":"Yfr","𝕐":"Yopf","ý":"yacute","Ý":"Yacute","ŷ":"ycirc","Ŷ":"Ycirc","ÿ":"yuml","Ÿ":"Yuml","𝓏":"zscr","𝔷":"zfr","𝕫":"zopf","ℨ":"Zfr","ℤ":"Zopf","𝒵":"Zscr","ź":"zacute","Ź":"Zacute","ž":"zcaron","Ž":"Zcaron","ż":"zdot","Ż":"Zdot","Ƶ":"imped","þ":"thorn","Þ":"THORN","ʼn":"napos","α":"alpha","Α":"Alpha","β":"beta","Β":"Beta","γ":"gamma","Γ":"Gamma","δ":"delta","Δ":"Delta","ε":"epsi","ϵ":"epsiv","Ε":"Epsilon","ϝ":"gammad","Ϝ":"Gammad","ζ":"zeta","Ζ":"Zeta","η":"eta","Η":"Eta","θ":"theta","ϑ":"thetav","Θ":"Theta","ι":"iota","Ι":"Iota","κ":"kappa","ϰ":"kappav","Κ":"Kappa","λ":"lambda","Λ":"Lambda","μ":"mu","µ":"micro","Μ":"Mu","ν":"nu","Ν":"Nu","ξ":"xi","Ξ":"Xi","ο":"omicron","Ο":"Omicron","π":"pi","ϖ":"piv","Π":"Pi","ρ":"rho","ϱ":"rhov","Ρ":"Rho","σ":"sigma","Σ":"Sigma","ς":"sigmaf","τ":"tau","Τ":"Tau","υ":"upsi","Υ":"Upsilon","ϒ":"Upsi","φ":"phi","ϕ":"phiv","Φ":"Phi","χ":"chi","Χ":"Chi","ψ":"psi","Ψ":"Psi","ω":"omega","Ω":"ohm","а":"acy","А":"Acy","б":"bcy","Б":"Bcy","в":"vcy","В":"Vcy","г":"gcy","Г":"Gcy","ѓ":"gjcy","Ѓ":"GJcy","д":"dcy","Д":"Dcy","ђ":"djcy","Ђ":"DJcy","е":"iecy","Е":"IEcy","ё":"iocy","Ё":"IOcy","є":"jukcy","Є":"Jukcy","ж":"zhcy","Ж":"ZHcy","з":"zcy","З":"Zcy","ѕ":"dscy","Ѕ":"DScy","и":"icy","И":"Icy","і":"iukcy","І":"Iukcy","ї":"yicy","Ї":"YIcy","й":"jcy","Й":"Jcy","ј":"jsercy","Ј":"Jsercy","к":"kcy","К":"Kcy","ќ":"kjcy","Ќ":"KJcy","л":"lcy","Л":"Lcy","љ":"ljcy","Љ":"LJcy","м":"mcy","М":"Mcy","н":"ncy","Н":"Ncy","њ":"njcy","Њ":"NJcy","о":"ocy","О":"Ocy","п":"pcy","П":"Pcy","р":"rcy","Р":"Rcy","с":"scy","С":"Scy","т":"tcy","Т":"Tcy","ћ":"tshcy","Ћ":"TSHcy","у":"ucy","У":"Ucy","ў":"ubrcy","Ў":"Ubrcy","ф":"fcy","Ф":"Fcy","х":"khcy","Х":"KHcy","ц":"tscy","Ц":"TScy","ч":"chcy","Ч":"CHcy","џ":"dzcy","Џ":"DZcy","ш":"shcy","Ш":"SHcy","щ":"shchcy","Щ":"SHCHcy","ъ":"hardcy","Ъ":"HARDcy","ы":"ycy","Ы":"Ycy","ь":"softcy","Ь":"SOFTcy","э":"ecy","Э":"Ecy","ю":"yucy","Ю":"YUcy","я":"yacy","Я":"YAcy","ℵ":"aleph","ℶ":"beth","ℷ":"gimel","ℸ":"daleth"},d=/["&'<>`]/g,m={'"':""","&":"&","'":"'","<":"<",">":">","`":"`"},h=/&#(?:[xX][^a-fA-F0-9]|[^0-9xX])/,g=/[\0-\x08\x0B\x0E-\x1F\x7F-\x9F\uFDD0-\uFDEF\uFFFE\uFFFF]|[\uD83F\uD87F\uD8BF\uD8FF\uD93F\uD97F\uD9BF\uD9FF\uDA3F\uDA7F\uDABF\uDAFF\uDB3F\uDB7F\uDBBF\uDBFF][\uDFFE\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,v=/&(CounterClockwiseContourIntegral|DoubleLongLeftRightArrow|ClockwiseContourIntegral|NotNestedGreaterGreater|NotSquareSupersetEqual|DiacriticalDoubleAcute|NotRightTriangleEqual|NotSucceedsSlantEqual|NotPrecedesSlantEqual|CloseCurlyDoubleQuote|NegativeVeryThinSpace|DoubleContourIntegral|FilledVerySmallSquare|CapitalDifferentialD|OpenCurlyDoubleQuote|EmptyVerySmallSquare|NestedGreaterGreater|DoubleLongRightArrow|NotLeftTriangleEqual|NotGreaterSlantEqual|ReverseUpEquilibrium|DoubleLeftRightArrow|NotSquareSubsetEqual|NotDoubleVerticalBar|RightArrowLeftArrow|NotGreaterFullEqual|NotRightTriangleBar|SquareSupersetEqual|DownLeftRightVector|DoubleLongLeftArrow|leftrightsquigarrow|LeftArrowRightArrow|NegativeMediumSpace|blacktriangleright|RightDownVectorBar|PrecedesSlantEqual|RightDoubleBracket|SucceedsSlantEqual|NotLeftTriangleBar|RightTriangleEqual|SquareIntersection|RightDownTeeVector|ReverseEquilibrium|NegativeThickSpace|longleftrightarrow|Longleftrightarrow|LongLeftRightArrow|DownRightTeeVector|DownRightVectorBar|GreaterSlantEqual|SquareSubsetEqual|LeftDownVectorBar|LeftDoubleBracket|VerticalSeparator|rightleftharpoons|NotGreaterGreater|NotSquareSuperset|blacktriangleleft|blacktriangledown|NegativeThinSpace|LeftDownTeeVector|NotLessSlantEqual|leftrightharpoons|DoubleUpDownArrow|DoubleVerticalBar|LeftTriangleEqual|FilledSmallSquare|twoheadrightarrow|NotNestedLessLess|DownLeftTeeVector|DownLeftVectorBar|RightAngleBracket|NotTildeFullEqual|NotReverseElement|RightUpDownVector|DiacriticalTilde|NotSucceedsTilde|circlearrowright|NotPrecedesEqual|rightharpoondown|DoubleRightArrow|NotSucceedsEqual|NonBreakingSpace|NotRightTriangle|LessEqualGreater|RightUpTeeVector|LeftAngleBracket|GreaterFullEqual|DownArrowUpArrow|RightUpVectorBar|twoheadleftarrow|GreaterEqualLess|downharpoonright|RightTriangleBar|ntrianglerighteq|NotSupersetEqual|LeftUpDownVector|DiacriticalAcute|rightrightarrows|vartriangleright|UpArrowDownArrow|DiacriticalGrave|UnderParenthesis|EmptySmallSquare|LeftUpVectorBar|leftrightarrows|DownRightVector|downharpoonleft|trianglerighteq|ShortRightArrow|OverParenthesis|DoubleLeftArrow|DoubleDownArrow|NotSquareSubset|bigtriangledown|ntrianglelefteq|UpperRightArrow|curvearrowright|vartriangleleft|NotLeftTriangle|nleftrightarrow|LowerRightArrow|NotHumpDownHump|NotGreaterTilde|rightthreetimes|LeftUpTeeVector|NotGreaterEqual|straightepsilon|LeftTriangleBar|rightsquigarrow|ContourIntegral|rightleftarrows|CloseCurlyQuote|RightDownVector|LeftRightVector|nLeftrightarrow|leftharpoondown|circlearrowleft|SquareSuperset|OpenCurlyQuote|hookrightarrow|HorizontalLine|DiacriticalDot|NotLessGreater|ntriangleright|DoubleRightTee|InvisibleComma|InvisibleTimes|LowerLeftArrow|DownLeftVector|NotSubsetEqual|curvearrowleft|trianglelefteq|NotVerticalBar|TildeFullEqual|downdownarrows|NotGreaterLess|RightTeeVector|ZeroWidthSpace|looparrowright|LongRightArrow|doublebarwedge|ShortLeftArrow|ShortDownArrow|RightVectorBar|GreaterGreater|ReverseElement|rightharpoonup|LessSlantEqual|leftthreetimes|upharpoonright|rightarrowtail|LeftDownVector|Longrightarrow|NestedLessLess|UpperLeftArrow|nshortparallel|leftleftarrows|leftrightarrow|Leftrightarrow|LeftRightArrow|longrightarrow|upharpoonleft|RightArrowBar|ApplyFunction|LeftTeeVector|leftarrowtail|NotEqualTilde|varsubsetneqq|varsupsetneqq|RightTeeArrow|SucceedsEqual|SucceedsTilde|LeftVectorBar|SupersetEqual|hookleftarrow|DifferentialD|VerticalTilde|VeryThinSpace|blacktriangle|bigtriangleup|LessFullEqual|divideontimes|leftharpoonup|UpEquilibrium|ntriangleleft|RightTriangle|measuredangle|shortparallel|longleftarrow|Longleftarrow|LongLeftArrow|DoubleLeftTee|Poincareplane|PrecedesEqual|triangleright|DoubleUpArrow|RightUpVector|fallingdotseq|looparrowleft|PrecedesTilde|NotTildeEqual|NotTildeTilde|smallsetminus|Proportional|triangleleft|triangledown|UnderBracket|NotHumpEqual|exponentiale|ExponentialE|NotLessTilde|HilbertSpace|RightCeiling|blacklozenge|varsupsetneq|HumpDownHump|GreaterEqual|VerticalLine|LeftTeeArrow|NotLessEqual|DownTeeArrow|LeftTriangle|varsubsetneq|Intersection|NotCongruent|DownArrowBar|LeftUpVector|LeftArrowBar|risingdotseq|GreaterTilde|RoundImplies|SquareSubset|ShortUpArrow|NotSuperset|quaternions|precnapprox|backepsilon|preccurlyeq|OverBracket|blacksquare|MediumSpace|VerticalBar|circledcirc|circleddash|CircleMinus|CircleTimes|LessGreater|curlyeqprec|curlyeqsucc|diamondsuit|UpDownArrow|Updownarrow|RuleDelayed|Rrightarrow|updownarrow|RightVector|nRightarrow|nrightarrow|eqslantless|LeftCeiling|Equilibrium|SmallCircle|expectation|NotSucceeds|thickapprox|GreaterLess|SquareUnion|NotPrecedes|NotLessLess|straightphi|succnapprox|succcurlyeq|SubsetEqual|sqsupseteq|Proportion|Laplacetrf|ImaginaryI|supsetneqq|NotGreater|gtreqqless|NotElement|ThickSpace|TildeEqual|TildeTilde|Fouriertrf|rmoustache|EqualTilde|eqslantgtr|UnderBrace|LeftVector|UpArrowBar|nLeftarrow|nsubseteqq|subsetneqq|nsupseteqq|nleftarrow|succapprox|lessapprox|UpTeeArrow|upuparrows|curlywedge|lesseqqgtr|varepsilon|varnothing|RightFloor|complement|CirclePlus|sqsubseteq|Lleftarrow|circledast|RightArrow|Rightarrow|rightarrow|lmoustache|Bernoullis|precapprox|mapstoleft|mapstodown|longmapsto|dotsquare|downarrow|DoubleDot|nsubseteq|supsetneq|leftarrow|nsupseteq|subsetneq|ThinSpace|ngeqslant|subseteqq|HumpEqual|NotSubset|triangleq|NotCupCap|lesseqgtr|heartsuit|TripleDot|Leftarrow|Coproduct|Congruent|varpropto|complexes|gvertneqq|LeftArrow|LessTilde|supseteqq|MinusPlus|CircleDot|nleqslant|NotExists|gtreqless|nparallel|UnionPlus|LeftFloor|checkmark|CenterDot|centerdot|Mellintrf|gtrapprox|bigotimes|OverBrace|spadesuit|therefore|pitchfork|rationals|PlusMinus|Backslash|Therefore|DownBreve|backsimeq|backprime|DownArrow|nshortmid|Downarrow|lvertneqq|eqvparsl|imagline|imagpart|infintie|integers|Integral|intercal|LessLess|Uarrocir|intlarhk|sqsupset|angmsdaf|sqsubset|llcorner|vartheta|cupbrcap|lnapprox|Superset|SuchThat|succnsim|succneqq|angmsdag|biguplus|curlyvee|trpezium|Succeeds|NotTilde|bigwedge|angmsdah|angrtvbd|triminus|cwconint|fpartint|lrcorner|smeparsl|subseteq|urcorner|lurdshar|laemptyv|DDotrahd|approxeq|ldrushar|awconint|mapstoup|backcong|shortmid|triangle|geqslant|gesdotol|timesbar|circledR|circledS|setminus|multimap|naturals|scpolint|ncongdot|RightTee|boxminus|gnapprox|boxtimes|andslope|thicksim|angmsdaa|varsigma|cirfnint|rtriltri|angmsdab|rppolint|angmsdac|barwedge|drbkarow|clubsuit|thetasym|bsolhsub|capbrcup|dzigrarr|doteqdot|DotEqual|dotminus|UnderBar|NotEqual|realpart|otimesas|ulcorner|hksearow|hkswarow|parallel|PartialD|elinters|emptyset|plusacir|bbrktbrk|angmsdad|pointint|bigoplus|angmsdae|Precedes|bigsqcup|varkappa|notindot|supseteq|precneqq|precnsim|profalar|profline|profsurf|leqslant|lesdotor|raemptyv|subplus|notnivb|notnivc|subrarr|zigrarr|vzigzag|submult|subedot|Element|between|cirscir|larrbfs|larrsim|lotimes|lbrksld|lbrkslu|lozenge|ldrdhar|dbkarow|bigcirc|epsilon|simrarr|simplus|ltquest|Epsilon|luruhar|gtquest|maltese|npolint|eqcolon|npreceq|bigodot|ddagger|gtrless|bnequiv|harrcir|ddotseq|equivDD|backsim|demptyv|nsqsube|nsqsupe|Upsilon|nsubset|upsilon|minusdu|nsucceq|swarrow|nsupset|coloneq|searrow|boxplus|napprox|natural|asympeq|alefsym|congdot|nearrow|bigstar|diamond|supplus|tritime|LeftTee|nvinfin|triplus|NewLine|nvltrie|nvrtrie|nwarrow|nexists|Diamond|ruluhar|Implies|supmult|angzarr|suplarr|suphsub|questeq|because|digamma|Because|olcross|bemptyv|omicron|Omicron|rotimes|NoBreak|intprod|angrtvb|orderof|uwangle|suphsol|lesdoto|orslope|DownTee|realine|cudarrl|rdldhar|OverBar|supedot|lessdot|supdsub|topfork|succsim|rbrkslu|rbrksld|pertenk|cudarrr|isindot|planckh|lessgtr|pluscir|gesdoto|plussim|plustwo|lesssim|cularrp|rarrsim|Cayleys|notinva|notinvb|notinvc|UpArrow|Uparrow|uparrow|NotLess|dwangle|precsim|Product|curarrm|Cconint|dotplus|rarrbfs|ccupssm|Cedilla|cemptyv|notniva|quatint|frac35|frac38|frac45|frac56|frac58|frac78|tridot|xoplus|gacute|gammad|Gammad|lfisht|lfloor|bigcup|sqsupe|gbreve|Gbreve|lharul|sqsube|sqcups|Gcedil|apacir|llhard|lmidot|Lmidot|lmoust|andand|sqcaps|approx|Abreve|spades|circeq|tprime|divide|topcir|Assign|topbot|gesdot|divonx|xuplus|timesd|gesles|atilde|solbar|SOFTcy|loplus|timesb|lowast|lowbar|dlcorn|dlcrop|softcy|dollar|lparlt|thksim|lrhard|Atilde|lsaquo|smashp|bigvee|thinsp|wreath|bkarow|lsquor|lstrok|Lstrok|lthree|ltimes|ltlarr|DotDot|simdot|ltrPar|weierp|xsqcup|angmsd|sigmav|sigmaf|zeetrf|Zcaron|zcaron|mapsto|vsupne|thetav|cirmid|marker|mcomma|Zacute|vsubnE|there4|gtlPar|vsubne|bottom|gtrarr|SHCHcy|shchcy|midast|midcir|middot|minusb|minusd|gtrdot|bowtie|sfrown|mnplus|models|colone|seswar|Colone|mstpos|searhk|gtrsim|nacute|Nacute|boxbox|telrec|hairsp|Tcedil|nbumpe|scnsim|ncaron|Ncaron|ncedil|Ncedil|hamilt|Scedil|nearhk|hardcy|HARDcy|tcedil|Tcaron|commat|nequiv|nesear|tcaron|target|hearts|nexist|varrho|scedil|Scaron|scaron|hellip|Sacute|sacute|hercon|swnwar|compfn|rtimes|rthree|rsquor|rsaquo|zacute|wedgeq|homtht|barvee|barwed|Barwed|rpargt|horbar|conint|swarhk|roplus|nltrie|hslash|hstrok|Hstrok|rmoust|Conint|bprime|hybull|hyphen|iacute|Iacute|supsup|supsub|supsim|varphi|coprod|brvbar|agrave|Supset|supset|igrave|Igrave|notinE|Agrave|iiiint|iinfin|copysr|wedbar|Verbar|vangrt|becaus|incare|verbar|inodot|bullet|drcorn|intcal|drcrop|cularr|vellip|Utilde|bumpeq|cupcap|dstrok|Dstrok|CupCap|cupcup|cupdot|eacute|Eacute|supdot|iquest|easter|ecaron|Ecaron|ecolon|isinsv|utilde|itilde|Itilde|curarr|succeq|Bumpeq|cacute|ulcrop|nparsl|Cacute|nprcue|egrave|Egrave|nrarrc|nrarrw|subsup|subsub|nrtrie|jsercy|nsccue|Jsercy|kappav|kcedil|Kcedil|subsim|ulcorn|nsimeq|egsdot|veebar|kgreen|capand|elsdot|Subset|subset|curren|aacute|lacute|Lacute|emptyv|ntilde|Ntilde|lagran|lambda|Lambda|capcap|Ugrave|langle|subdot|emsp13|numero|emsp14|nvdash|nvDash|nVdash|nVDash|ugrave|ufisht|nvHarr|larrfs|nvlArr|larrhk|larrlp|larrpl|nvrArr|Udblac|nwarhk|larrtl|nwnear|oacute|Oacute|latail|lAtail|sstarf|lbrace|odblac|Odblac|lbrack|udblac|odsold|eparsl|lcaron|Lcaron|ograve|Ograve|lcedil|Lcedil|Aacute|ssmile|ssetmn|squarf|ldquor|capcup|ominus|cylcty|rharul|eqcirc|dagger|rfloor|rfisht|Dagger|daleth|equals|origof|capdot|equest|dcaron|Dcaron|rdquor|oslash|Oslash|otilde|Otilde|otimes|Otimes|urcrop|Ubreve|ubreve|Yacute|Uacute|uacute|Rcedil|rcedil|urcorn|parsim|Rcaron|Vdashl|rcaron|Tstrok|percnt|period|permil|Exists|yacute|rbrack|rbrace|phmmat|ccaron|Ccaron|planck|ccedil|plankv|tstrok|female|plusdo|plusdu|ffilig|plusmn|ffllig|Ccedil|rAtail|dfisht|bernou|ratail|Rarrtl|rarrtl|angsph|rarrpl|rarrlp|rarrhk|xwedge|xotime|forall|ForAll|Vvdash|vsupnE|preceq|bigcap|frac12|frac13|frac14|primes|rarrfs|prnsim|frac15|Square|frac16|square|lesdot|frac18|frac23|propto|prurel|rarrap|rangle|puncsp|frac25|Racute|qprime|racute|lesges|frac34|abreve|AElig|eqsim|utdot|setmn|urtri|Equal|Uring|seArr|uring|searr|dashv|Dashv|mumap|nabla|iogon|Iogon|sdote|sdotb|scsim|napid|napos|equiv|natur|Acirc|dblac|erarr|nbump|iprod|erDot|ucirc|awint|esdot|angrt|ncong|isinE|scnap|Scirc|scirc|ndash|isins|Ubrcy|nearr|neArr|isinv|nedot|ubrcy|acute|Ycirc|iukcy|Iukcy|xutri|nesim|caret|jcirc|Jcirc|caron|twixt|ddarr|sccue|exist|jmath|sbquo|ngeqq|angst|ccaps|lceil|ngsim|UpTee|delta|Delta|rtrif|nharr|nhArr|nhpar|rtrie|jukcy|Jukcy|kappa|rsquo|Kappa|nlarr|nlArr|TSHcy|rrarr|aogon|Aogon|fflig|xrarr|tshcy|ccirc|nleqq|filig|upsih|nless|dharl|nlsim|fjlig|ropar|nltri|dharr|robrk|roarr|fllig|fltns|roang|rnmid|subnE|subne|lAarr|trisb|Ccirc|acirc|ccups|blank|VDash|forkv|Vdash|langd|cedil|blk12|blk14|laquo|strns|diams|notin|vDash|larrb|blk34|block|disin|uplus|vdash|vBarv|aelig|starf|Wedge|check|xrArr|lates|lbarr|lBarr|notni|lbbrk|bcong|frasl|lbrke|frown|vrtri|vprop|vnsup|gamma|Gamma|wedge|xodot|bdquo|srarr|doteq|ldquo|boxdl|boxdL|gcirc|Gcirc|boxDl|boxDL|boxdr|boxdR|boxDr|TRADE|trade|rlhar|boxDR|vnsub|npart|vltri|rlarr|boxhd|boxhD|nprec|gescc|nrarr|nrArr|boxHd|boxHD|boxhu|boxhU|nrtri|boxHu|clubs|boxHU|times|colon|Colon|gimel|xlArr|Tilde|nsime|tilde|nsmid|nspar|THORN|thorn|xlarr|nsube|nsubE|thkap|xhArr|comma|nsucc|boxul|boxuL|nsupe|nsupE|gneqq|gnsim|boxUl|boxUL|grave|boxur|boxuR|boxUr|boxUR|lescc|angle|bepsi|boxvh|varpi|boxvH|numsp|Theta|gsime|gsiml|theta|boxVh|boxVH|boxvl|gtcir|gtdot|boxvL|boxVl|boxVL|crarr|cross|Cross|nvsim|boxvr|nwarr|nwArr|sqsup|dtdot|Uogon|lhard|lharu|dtrif|ocirc|Ocirc|lhblk|duarr|odash|sqsub|Hacek|sqcup|llarr|duhar|oelig|OElig|ofcir|boxvR|uogon|lltri|boxVr|csube|uuarr|ohbar|csupe|ctdot|olarr|olcir|harrw|oline|sqcap|omacr|Omacr|omega|Omega|boxVR|aleph|lneqq|lnsim|loang|loarr|rharu|lobrk|hcirc|operp|oplus|rhard|Hcirc|orarr|Union|order|ecirc|Ecirc|cuepr|szlig|cuesc|breve|reals|eDDot|Breve|hoarr|lopar|utrif|rdquo|Umacr|umacr|efDot|swArr|ultri|alpha|rceil|ovbar|swarr|Wcirc|wcirc|smtes|smile|bsemi|lrarr|aring|parsl|lrhar|bsime|uhblk|lrtri|cupor|Aring|uharr|uharl|slarr|rbrke|bsolb|lsime|rbbrk|RBarr|lsimg|phone|rBarr|rbarr|icirc|lsquo|Icirc|emacr|Emacr|ratio|simne|plusb|simlE|simgE|simeq|pluse|ltcir|ltdot|empty|xharr|xdtri|iexcl|Alpha|ltrie|rarrw|pound|ltrif|xcirc|bumpe|prcue|bumpE|asymp|amacr|cuvee|Sigma|sigma|iiint|udhar|iiota|ijlig|IJlig|supnE|imacr|Imacr|prime|Prime|image|prnap|eogon|Eogon|rarrc|mdash|mDDot|cuwed|imath|supne|imped|Amacr|udarr|prsim|micro|rarrb|cwint|raquo|infin|eplus|range|rangd|Ucirc|radic|minus|amalg|veeeq|rAarr|epsiv|ycirc|quest|sharp|quot|zwnj|Qscr|race|qscr|Qopf|qopf|qint|rang|Rang|Zscr|zscr|Zopf|zopf|rarr|rArr|Rarr|Pscr|pscr|prop|prod|prnE|prec|ZHcy|zhcy|prap|Zeta|zeta|Popf|popf|Zdot|plus|zdot|Yuml|yuml|phiv|YUcy|yucy|Yscr|yscr|perp|Yopf|yopf|part|para|YIcy|Ouml|rcub|yicy|YAcy|rdca|ouml|osol|Oscr|rdsh|yacy|real|oscr|xvee|andd|rect|andv|Xscr|oror|ordm|ordf|xscr|ange|aopf|Aopf|rHar|Xopf|opar|Oopf|xopf|xnis|rhov|oopf|omid|xmap|oint|apid|apos|ogon|ascr|Ascr|odot|odiv|xcup|xcap|ocir|oast|nvlt|nvle|nvgt|nvge|nvap|Wscr|wscr|auml|ntlg|ntgl|nsup|nsub|nsim|Nscr|nscr|nsce|Wopf|ring|npre|wopf|npar|Auml|Barv|bbrk|Nopf|nopf|nmid|nLtv|beta|ropf|Ropf|Beta|beth|nles|rpar|nleq|bnot|bNot|nldr|NJcy|rscr|Rscr|Vscr|vscr|rsqb|njcy|bopf|nisd|Bopf|rtri|Vopf|nGtv|ngtr|vopf|boxh|boxH|boxv|nges|ngeq|boxV|bscr|scap|Bscr|bsim|Vert|vert|bsol|bull|bump|caps|cdot|ncup|scnE|ncap|nbsp|napE|Cdot|cent|sdot|Vbar|nang|vBar|chcy|Mscr|mscr|sect|semi|CHcy|Mopf|mopf|sext|circ|cire|mldr|mlcp|cirE|comp|shcy|SHcy|vArr|varr|cong|copf|Copf|copy|COPY|malt|male|macr|lvnE|cscr|ltri|sime|ltcc|simg|Cscr|siml|csub|Uuml|lsqb|lsim|uuml|csup|Lscr|lscr|utri|smid|lpar|cups|smte|lozf|darr|Lopf|Uscr|solb|lopf|sopf|Sopf|lneq|uscr|spar|dArr|lnap|Darr|dash|Sqrt|LJcy|ljcy|lHar|dHar|Upsi|upsi|diam|lesg|djcy|DJcy|leqq|dopf|Dopf|dscr|Dscr|dscy|ldsh|ldca|squf|DScy|sscr|Sscr|dsol|lcub|late|star|Star|Uopf|Larr|lArr|larr|uopf|dtri|dzcy|sube|subE|Lang|lang|Kscr|kscr|Kopf|kopf|KJcy|kjcy|KHcy|khcy|DZcy|ecir|edot|eDot|Jscr|jscr|succ|Jopf|jopf|Edot|uHar|emsp|ensp|Iuml|iuml|eopf|isin|Iscr|iscr|Eopf|epar|sung|epsi|escr|sup1|sup2|sup3|Iota|iota|supe|supE|Iopf|iopf|IOcy|iocy|Escr|esim|Esim|imof|Uarr|QUOT|uArr|uarr|euml|IEcy|iecy|Idot|Euml|euro|excl|Hscr|hscr|Hopf|hopf|TScy|tscy|Tscr|hbar|tscr|flat|tbrk|fnof|hArr|harr|half|fopf|Fopf|tdot|gvnE|fork|trie|gtcc|fscr|Fscr|gdot|gsim|Gscr|gscr|Gopf|gopf|gneq|Gdot|tosa|gnap|Topf|topf|geqq|toea|GJcy|gjcy|tint|gesl|mid|Sfr|ggg|top|ges|gla|glE|glj|geq|gne|gEl|gel|gnE|Gcy|gcy|gap|Tfr|tfr|Tcy|tcy|Hat|Tau|Ffr|tau|Tab|hfr|Hfr|ffr|Fcy|fcy|icy|Icy|iff|ETH|eth|ifr|Ifr|Eta|eta|int|Int|Sup|sup|ucy|Ucy|Sum|sum|jcy|ENG|ufr|Ufr|eng|Jcy|jfr|els|ell|egs|Efr|efr|Jfr|uml|kcy|Kcy|Ecy|ecy|kfr|Kfr|lap|Sub|sub|lat|lcy|Lcy|leg|Dot|dot|lEg|leq|les|squ|div|die|lfr|Lfr|lgE|Dfr|dfr|Del|deg|Dcy|dcy|lne|lnE|sol|loz|smt|Cup|lrm|cup|lsh|Lsh|sim|shy|map|Map|mcy|Mcy|mfr|Mfr|mho|gfr|Gfr|sfr|cir|Chi|chi|nap|Cfr|vcy|Vcy|cfr|Scy|scy|ncy|Ncy|vee|Vee|Cap|cap|nfr|scE|sce|Nfr|nge|ngE|nGg|vfr|Vfr|ngt|bot|nGt|nis|niv|Rsh|rsh|nle|nlE|bne|Bfr|bfr|nLl|nlt|nLt|Bcy|bcy|not|Not|rlm|wfr|Wfr|npr|nsc|num|ocy|ast|Ocy|ofr|xfr|Xfr|Ofr|ogt|ohm|apE|olt|Rho|ape|rho|Rfr|rfr|ord|REG|ang|reg|orv|And|and|AMP|Rcy|amp|Afr|ycy|Ycy|yen|yfr|Yfr|rcy|par|pcy|Pcy|pfr|Pfr|phi|Phi|afr|Acy|acy|zcy|Zcy|piv|acE|acd|zfr|Zfr|pre|prE|psi|Psi|qfr|Qfr|zwj|Or|ge|Gg|gt|gg|el|oS|lt|Lt|LT|Re|lg|gl|eg|ne|Im|it|le|DD|wp|wr|nu|Nu|dd|lE|Sc|sc|pi|Pi|ee|af|ll|Ll|rx|gE|xi|pm|Xi|ic|pr|Pr|in|ni|mp|mu|ac|Mu|or|ap|Gt|GT|ii);|&(Aacute|Agrave|Atilde|Ccedil|Eacute|Egrave|Iacute|Igrave|Ntilde|Oacute|Ograve|Oslash|Otilde|Uacute|Ugrave|Yacute|aacute|agrave|atilde|brvbar|ccedil|curren|divide|eacute|egrave|frac12|frac14|frac34|iacute|igrave|iquest|middot|ntilde|oacute|ograve|oslash|otilde|plusmn|uacute|ugrave|yacute|AElig|Acirc|Aring|Ecirc|Icirc|Ocirc|THORN|Ucirc|acirc|acute|aelig|aring|cedil|ecirc|icirc|iexcl|laquo|micro|ocirc|pound|raquo|szlig|thorn|times|ucirc|Auml|COPY|Euml|Iuml|Ouml|QUOT|Uuml|auml|cent|copy|euml|iuml|macr|nbsp|ordf|ordm|ouml|para|quot|sect|sup1|sup2|sup3|uuml|yuml|AMP|ETH|REG|amp|deg|eth|not|reg|shy|uml|yen|GT|LT|gt|lt)(?!;)([=a-zA-Z0-9]?)|&#([0-9]+)(;?)|&#[xX]([a-fA-F0-9]+)(;?)|&([0-9a-zA-Z]+)/g,b={aacute:"á",Aacute:"Á",abreve:"ă",Abreve:"Ă",ac:"∾",acd:"∿",acE:"∾̳",acirc:"â",Acirc:"Â",acute:"´",acy:"а",Acy:"А",aelig:"æ",AElig:"Æ",af:"",afr:"𝔞",Afr:"𝔄",agrave:"à",Agrave:"À",alefsym:"ℵ",aleph:"ℵ",alpha:"α",Alpha:"Α",amacr:"ā",Amacr:"Ā",amalg:"⨿",amp:"&",AMP:"&",and:"∧",And:"⩓",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",aogon:"ą",Aogon:"Ą",aopf:"𝕒",Aopf:"𝔸",ap:"≈",apacir:"⩯",ape:"≊",apE:"⩰",apid:"≋",apos:"'",ApplyFunction:"",approx:"≈",approxeq:"≊",aring:"å",Aring:"Å",ascr:"𝒶",Ascr:"𝒜",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",atilde:"ã",Atilde:"Ã",auml:"ä",Auml:"Ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",barwed:"⌅",Barwed:"⌆",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",bcy:"б",Bcy:"Б",bdquo:"„",becaus:"∵",because:"∵",Because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",beta:"β",Beta:"Β",beth:"ℶ",between:"≬",bfr:"𝔟",Bfr:"𝔅",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bnot:"⌐",bNot:"⫭",bopf:"𝕓",Bopf:"𝔹",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxdl:"┐",boxdL:"╕",boxDl:"╖",boxDL:"╗",boxdr:"┌",boxdR:"╒",boxDr:"╓",boxDR:"╔",boxh:"─",boxH:"═",boxhd:"┬",boxhD:"╥",boxHd:"╤",boxHD:"╦",boxhu:"┴",boxhU:"╨",boxHu:"╧",boxHU:"╩",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxul:"┘",boxuL:"╛",boxUl:"╜",boxUL:"╝",boxur:"└",boxuR:"╘",boxUr:"╙",boxUR:"╚",boxv:"│",boxV:"║",boxvh:"┼",boxvH:"╪",boxVh:"╫",boxVH:"╬",boxvl:"┤",boxvL:"╡",boxVl:"╢",boxVL:"╣",boxvr:"├",boxvR:"╞",boxVr:"╟",boxVR:"╠",bprime:"‵",breve:"˘",Breve:"˘",brvbar:"¦",bscr:"𝒷",Bscr:"ℬ",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpe:"≏",bumpE:"⪮",bumpeq:"≏",Bumpeq:"≎",cacute:"ć",Cacute:"Ć",cap:"∩",Cap:"⋒",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",ccaron:"č",Ccaron:"Č",ccedil:"ç",Ccedil:"Ç",ccirc:"ĉ",Ccirc:"Ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",cdot:"ċ",Cdot:"Ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",centerdot:"·",CenterDot:"·",cfr:"𝔠",Cfr:"ℭ",chcy:"ч",CHcy:"Ч",check:"✓",checkmark:"✓",chi:"χ",Chi:"Χ",cir:"○",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cire:"≗",cirE:"⧃",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",colon:":",Colon:"∷",colone:"≔",Colone:"⩴",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",conint:"∮",Conint:"∯",ContourIntegral:"∮",copf:"𝕔",Copf:"ℂ",coprod:"∐",Coproduct:"∐",copy:"©",COPY:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",cross:"✗",Cross:"⨯",cscr:"𝒸",Cscr:"𝒞",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",cup:"∪",Cup:"⋓",cupbrcap:"⩈",cupcap:"⩆",CupCap:"≍",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",dagger:"†",Dagger:"‡",daleth:"ℸ",darr:"↓",dArr:"⇓",Darr:"↡",dash:"‐",dashv:"⊣",Dashv:"⫤",dbkarow:"⤏",dblac:"˝",dcaron:"ď",Dcaron:"Ď",dcy:"д",Dcy:"Д",dd:"ⅆ",DD:"ⅅ",ddagger:"‡",ddarr:"⇊",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",delta:"δ",Delta:"Δ",demptyv:"⦱",dfisht:"⥿",dfr:"𝔡",Dfr:"𝔇",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",diamond:"⋄",Diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",djcy:"ђ",DJcy:"Ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",dopf:"𝕕",Dopf:"𝔻",dot:"˙",Dot:"¨",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",downarrow:"↓",Downarrow:"⇓",DownArrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",dscr:"𝒹",Dscr:"𝒟",dscy:"ѕ",DScy:"Ѕ",dsol:"⧶",dstrok:"đ",Dstrok:"Đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",dzcy:"џ",DZcy:"Џ",dzigrarr:"⟿",eacute:"é",Eacute:"É",easter:"⩮",ecaron:"ě",Ecaron:"Ě",ecir:"≖",ecirc:"ê",Ecirc:"Ê",ecolon:"≕",ecy:"э",Ecy:"Э",eDDot:"⩷",edot:"ė",eDot:"≑",Edot:"Ė",ee:"ⅇ",efDot:"≒",efr:"𝔢",Efr:"𝔈",eg:"⪚",egrave:"è",Egrave:"È",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",emacr:"ē",Emacr:"Ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp:" ",emsp13:" ",emsp14:" ",eng:"ŋ",ENG:"Ŋ",ensp:" ",eogon:"ę",Eogon:"Ę",eopf:"𝕖",Eopf:"𝔼",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",epsilon:"ε",Epsilon:"Ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",escr:"ℯ",Escr:"ℰ",esdot:"≐",esim:"≂",Esim:"⩳",eta:"η",Eta:"Η",eth:"ð",ETH:"Ð",euml:"ë",Euml:"Ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",exponentiale:"ⅇ",ExponentialE:"ⅇ",fallingdotseq:"≒",fcy:"ф",Fcy:"Ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",ffr:"𝔣",Ffr:"𝔉",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",fopf:"𝕗",Fopf:"𝔽",forall:"∀",ForAll:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",fscr:"𝒻",Fscr:"ℱ",gacute:"ǵ",gamma:"γ",Gamma:"Γ",gammad:"ϝ",Gammad:"Ϝ",gap:"⪆",gbreve:"ğ",Gbreve:"Ğ",Gcedil:"Ģ",gcirc:"ĝ",Gcirc:"Ĝ",gcy:"г",Gcy:"Г",gdot:"ġ",Gdot:"Ġ",ge:"≥",gE:"≧",gel:"⋛",gEl:"⪌",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",gfr:"𝔤",Gfr:"𝔊",gg:"≫",Gg:"⋙",ggg:"⋙",gimel:"ℷ",gjcy:"ѓ",GJcy:"Ѓ",gl:"≷",gla:"⪥",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gne:"⪈",gnE:"≩",gneq:"⪈",gneqq:"≩",gnsim:"⋧",gopf:"𝕘",Gopf:"𝔾",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",gscr:"ℊ",Gscr:"𝒢",gsim:"≳",gsime:"⪎",gsiml:"⪐",gt:">",Gt:"≫",GT:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",hardcy:"ъ",HARDcy:"Ъ",harr:"↔",hArr:"⇔",harrcir:"⥈",harrw:"↭",Hat:"^",hbar:"ℏ",hcirc:"ĥ",Hcirc:"Ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",hfr:"𝔥",Hfr:"ℌ",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",hopf:"𝕙",Hopf:"ℍ",horbar:"―",HorizontalLine:"─",hscr:"𝒽",Hscr:"ℋ",hslash:"ℏ",hstrok:"ħ",Hstrok:"Ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",iacute:"í",Iacute:"Í",ic:"",icirc:"î",Icirc:"Î",icy:"и",Icy:"И",Idot:"İ",iecy:"е",IEcy:"Е",iexcl:"¡",iff:"⇔",ifr:"𝔦",Ifr:"ℑ",igrave:"ì",Igrave:"Ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",ijlig:"ij",IJlig:"IJ",Im:"ℑ",imacr:"ī",Imacr:"Ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",Implies:"⇒",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",int:"∫",Int:"∬",intcal:"⊺",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"",InvisibleTimes:"",iocy:"ё",IOcy:"Ё",iogon:"į",Iogon:"Į",iopf:"𝕚",Iopf:"𝕀",iota:"ι",Iota:"Ι",iprod:"⨼",iquest:"¿",iscr:"𝒾",Iscr:"ℐ",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"",itilde:"ĩ",Itilde:"Ĩ",iukcy:"і",Iukcy:"І",iuml:"ï",Iuml:"Ï",jcirc:"ĵ",Jcirc:"Ĵ",jcy:"й",Jcy:"Й",jfr:"𝔧",Jfr:"𝔍",jmath:"ȷ",jopf:"𝕛",Jopf:"𝕁",jscr:"𝒿",Jscr:"𝒥",jsercy:"ј",Jsercy:"Ј",jukcy:"є",Jukcy:"Є",kappa:"κ",Kappa:"Κ",kappav:"ϰ",kcedil:"ķ",Kcedil:"Ķ",kcy:"к",Kcy:"К",kfr:"𝔨",Kfr:"𝔎",kgreen:"ĸ",khcy:"х",KHcy:"Х",kjcy:"ќ",KJcy:"Ќ",kopf:"𝕜",Kopf:"𝕂",kscr:"𝓀",Kscr:"𝒦",lAarr:"⇚",lacute:"ĺ",Lacute:"Ĺ",laemptyv:"⦴",lagran:"ℒ",lambda:"λ",Lambda:"Λ",lang:"⟨",Lang:"⟪",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",larr:"←",lArr:"⇐",Larr:"↞",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",latail:"⤙",lAtail:"⤛",late:"⪭",lates:"⪭︀",lbarr:"⤌",lBarr:"⤎",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",lcaron:"ľ",Lcaron:"Ľ",lcedil:"ļ",Lcedil:"Ļ",lceil:"⌈",lcub:"{",lcy:"л",Lcy:"Л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",le:"≤",lE:"≦",LeftAngleBracket:"⟨",leftarrow:"←",Leftarrow:"⇐",LeftArrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",leftrightarrow:"↔",Leftrightarrow:"⇔",LeftRightArrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",leg:"⋚",lEg:"⪋",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",lfr:"𝔩",Lfr:"𝔏",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",ljcy:"љ",LJcy:"Љ",ll:"≪",Ll:"⋘",llarr:"⇇",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",lmidot:"ŀ",Lmidot:"Ŀ",lmoust:"⎰",lmoustache:"⎰",lnap:"⪉",lnapprox:"⪉",lne:"⪇",lnE:"≨",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",longleftarrow:"⟵",Longleftarrow:"⟸",LongLeftArrow:"⟵",longleftrightarrow:"⟷",Longleftrightarrow:"⟺",LongLeftRightArrow:"⟷",longmapsto:"⟼",longrightarrow:"⟶",Longrightarrow:"⟹",LongRightArrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",lopf:"𝕝",Lopf:"𝕃",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"",lrtri:"⊿",lsaquo:"‹",lscr:"𝓁",Lscr:"ℒ",lsh:"↰",Lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",lstrok:"ł",Lstrok:"Ł",lt:"<",Lt:"≪",LT:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",map:"↦",Map:"⤅",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",mcy:"м",Mcy:"М",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",mfr:"𝔪",Mfr:"𝔐",mho:"℧",micro:"µ",mid:"∣",midast:"*",midcir:"⫰",middot:"·",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",mopf:"𝕞",Mopf:"𝕄",mp:"∓",mscr:"𝓂",Mscr:"ℳ",mstpos:"∾",mu:"μ",Mu:"Μ",multimap:"⊸",mumap:"⊸",nabla:"∇",nacute:"ń",Nacute:"Ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",ncaron:"ň",Ncaron:"Ň",ncedil:"ņ",Ncedil:"Ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",ncy:"н",Ncy:"Н",ndash:"–",ne:"≠",nearhk:"⤤",nearr:"↗",neArr:"⇗",nearrow:"↗",nedot:"≐̸",NegativeMediumSpace:"",NegativeThickSpace:"",NegativeThinSpace:"",NegativeVeryThinSpace:"",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:"\n",nexist:"∄",nexists:"∄",nfr:"𝔫",Nfr:"𝔑",nge:"≱",ngE:"≧̸",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",ngt:"≯",nGt:"≫⃒",ngtr:"≯",nGtv:"≫̸",nharr:"↮",nhArr:"⇎",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",njcy:"њ",NJcy:"Њ",nlarr:"↚",nlArr:"⇍",nldr:"‥",nle:"≰",nlE:"≦̸",nleftarrow:"↚",nLeftarrow:"⇍",nleftrightarrow:"↮",nLeftrightarrow:"⇎",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nlt:"≮",nLt:"≪⃒",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"",NonBreakingSpace:" ",nopf:"𝕟",Nopf:"ℕ",not:"¬",Not:"⫬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrarr:"↛",nrArr:"⇏",nrarrc:"⤳̸",nrarrw:"↝̸",nrightarrow:"↛",nRightarrow:"⇏",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",nscr:"𝓃",Nscr:"𝒩",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsube:"⊈",nsubE:"⫅̸",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupe:"⊉",nsupE:"⫆̸",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",ntilde:"ñ",Ntilde:"Ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",nu:"ν",Nu:"Ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nvdash:"⊬",nvDash:"⊭",nVdash:"⊮",nVDash:"⊯",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwarr:"↖",nwArr:"⇖",nwarrow:"↖",nwnear:"⤧",oacute:"ó",Oacute:"Ó",oast:"⊛",ocir:"⊚",ocirc:"ô",Ocirc:"Ô",ocy:"о",Ocy:"О",odash:"⊝",odblac:"ő",Odblac:"Ő",odiv:"⨸",odot:"⊙",odsold:"⦼",oelig:"œ",OElig:"Œ",ofcir:"⦿",ofr:"𝔬",Ofr:"𝔒",ogon:"˛",ograve:"ò",Ograve:"Ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",omacr:"ō",Omacr:"Ō",omega:"ω",Omega:"Ω",omicron:"ο",Omicron:"Ο",omid:"⦶",ominus:"⊖",oopf:"𝕠",Oopf:"𝕆",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",or:"∨",Or:"⩔",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",oscr:"ℴ",Oscr:"𝒪",oslash:"ø",Oslash:"Ø",osol:"⊘",otilde:"õ",Otilde:"Õ",otimes:"⊗",Otimes:"⨷",otimesas:"⨶",ouml:"ö",Ouml:"Ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",pcy:"п",Pcy:"П",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",pfr:"𝔭",Pfr:"𝔓",phi:"φ",Phi:"Φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",pi:"π",Pi:"Π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",popf:"𝕡",Popf:"ℙ",pound:"£",pr:"≺",Pr:"⪻",prap:"⪷",prcue:"≼",pre:"⪯",prE:"⪳",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",prime:"′",Prime:"″",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportion:"∷",Proportional:"∝",propto:"∝",prsim:"≾",prurel:"⊰",pscr:"𝓅",Pscr:"𝒫",psi:"ψ",Psi:"Ψ",puncsp:" ",qfr:"𝔮",Qfr:"𝔔",qint:"⨌",qopf:"𝕢",Qopf:"ℚ",qprime:"⁗",qscr:"𝓆",Qscr:"𝒬",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",quot:'"',QUOT:'"',rAarr:"⇛",race:"∽̱",racute:"ŕ",Racute:"Ŕ",radic:"√",raemptyv:"⦳",rang:"⟩",Rang:"⟫",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",rarr:"→",rArr:"⇒",Rarr:"↠",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",rarrtl:"↣",Rarrtl:"⤖",rarrw:"↝",ratail:"⤚",rAtail:"⤜",ratio:"∶",rationals:"ℚ",rbarr:"⤍",rBarr:"⤏",RBarr:"⤐",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",rcaron:"ř",Rcaron:"Ř",rcedil:"ŗ",Rcedil:"Ŗ",rceil:"⌉",rcub:"}",rcy:"р",Rcy:"Р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",Re:"ℜ",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",reg:"®",REG:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",rfr:"𝔯",Rfr:"ℜ",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",rho:"ρ",Rho:"Ρ",rhov:"ϱ",RightAngleBracket:"⟩",rightarrow:"→",Rightarrow:"⇒",RightArrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",ropf:"𝕣",Ropf:"ℝ",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",rscr:"𝓇",Rscr:"ℛ",rsh:"↱",Rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",sacute:"ś",Sacute:"Ś",sbquo:"‚",sc:"≻",Sc:"⪼",scap:"⪸",scaron:"š",Scaron:"Š",sccue:"≽",sce:"⪰",scE:"⪴",scedil:"ş",Scedil:"Ş",scirc:"ŝ",Scirc:"Ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",scy:"с",Scy:"С",sdot:"⋅",sdotb:"⊡",sdote:"⩦",searhk:"⤥",searr:"↘",seArr:"⇘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",sfr:"𝔰",Sfr:"𝔖",sfrown:"⌢",sharp:"♯",shchcy:"щ",SHCHcy:"Щ",shcy:"ш",SHcy:"Ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"",sigma:"σ",Sigma:"Σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",softcy:"ь",SOFTcy:"Ь",sol:"/",solb:"⧄",solbar:"⌿",sopf:"𝕤",Sopf:"𝕊",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",square:"□",Square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squf:"▪",srarr:"→",sscr:"𝓈",Sscr:"𝒮",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",star:"☆",Star:"⋆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",sub:"⊂",Sub:"⋐",subdot:"⪽",sube:"⊆",subE:"⫅",subedot:"⫃",submult:"⫁",subne:"⊊",subnE:"⫋",subplus:"⪿",subrarr:"⥹",subset:"⊂",Subset:"⋐",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",sum:"∑",Sum:"∑",sung:"♪",sup:"⊃",Sup:"⋑",sup1:"¹",sup2:"²",sup3:"³",supdot:"⪾",supdsub:"⫘",supe:"⊇",supE:"⫆",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supne:"⊋",supnE:"⫌",supplus:"⫀",supset:"⊃",Supset:"⋑",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swarr:"↙",swArr:"⇙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:"\t",target:"⌖",tau:"τ",Tau:"Τ",tbrk:"⎴",tcaron:"ť",Tcaron:"Ť",tcedil:"ţ",Tcedil:"Ţ",tcy:"т",Tcy:"Т",tdot:"⃛",telrec:"⌕",tfr:"𝔱",Tfr:"𝔗",there4:"∴",therefore:"∴",Therefore:"∴",theta:"θ",Theta:"Θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:" ",thinsp:" ",ThinSpace:" ",thkap:"≈",thksim:"∼",thorn:"þ",THORN:"Þ",tilde:"˜",Tilde:"∼",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",topf:"𝕥",Topf:"𝕋",topfork:"⫚",tosa:"⤩",tprime:"‴",trade:"™",TRADE:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",tscr:"𝓉",Tscr:"𝒯",tscy:"ц",TScy:"Ц",tshcy:"ћ",TSHcy:"Ћ",tstrok:"ŧ",Tstrok:"Ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",uacute:"ú",Uacute:"Ú",uarr:"↑",uArr:"⇑",Uarr:"↟",Uarrocir:"⥉",ubrcy:"ў",Ubrcy:"Ў",ubreve:"ŭ",Ubreve:"Ŭ",ucirc:"û",Ucirc:"Û",ucy:"у",Ucy:"У",udarr:"⇅",udblac:"ű",Udblac:"Ű",udhar:"⥮",ufisht:"⥾",ufr:"𝔲",Ufr:"𝔘",ugrave:"ù",Ugrave:"Ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",umacr:"ū",Umacr:"Ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",uogon:"ų",Uogon:"Ų",uopf:"𝕦",Uopf:"𝕌",uparrow:"↑",Uparrow:"⇑",UpArrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",updownarrow:"↕",Updownarrow:"⇕",UpDownArrow:"↕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",upsi:"υ",Upsi:"ϒ",upsih:"ϒ",upsilon:"υ",Upsilon:"Υ",UpTee:"⊥",UpTeeArrow:"↥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",uring:"ů",Uring:"Ů",urtri:"◹",uscr:"𝓊",Uscr:"𝒰",utdot:"⋰",utilde:"ũ",Utilde:"Ũ",utri:"▵",utrif:"▴",uuarr:"⇈",uuml:"ü",Uuml:"Ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",varr:"↕",vArr:"⇕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",vBar:"⫨",Vbar:"⫫",vBarv:"⫩",vcy:"в",Vcy:"В",vdash:"⊢",vDash:"⊨",Vdash:"⊩",VDash:"⊫",Vdashl:"⫦",vee:"∨",Vee:"⋁",veebar:"⊻",veeeq:"≚",vellip:"⋮",verbar:"|",Verbar:"‖",vert:"|",Vert:"‖",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",vfr:"𝔳",Vfr:"𝔙",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",vopf:"𝕧",Vopf:"𝕍",vprop:"∝",vrtri:"⊳",vscr:"𝓋",Vscr:"𝒱",vsubne:"⊊︀",vsubnE:"⫋︀",vsupne:"⊋︀",vsupnE:"⫌︀",Vvdash:"⊪",vzigzag:"⦚",wcirc:"ŵ",Wcirc:"Ŵ",wedbar:"⩟",wedge:"∧",Wedge:"⋀",wedgeq:"≙",weierp:"℘",wfr:"𝔴",Wfr:"𝔚",wopf:"𝕨",Wopf:"𝕎",wp:"℘",wr:"≀",wreath:"≀",wscr:"𝓌",Wscr:"𝒲",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",xfr:"𝔵",Xfr:"𝔛",xharr:"⟷",xhArr:"⟺",xi:"ξ",Xi:"Ξ",xlarr:"⟵",xlArr:"⟸",xmap:"⟼",xnis:"⋻",xodot:"⨀",xopf:"𝕩",Xopf:"𝕏",xoplus:"⨁",xotime:"⨂",xrarr:"⟶",xrArr:"⟹",xscr:"𝓍",Xscr:"𝒳",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",yacute:"ý",Yacute:"Ý",yacy:"я",YAcy:"Я",ycirc:"ŷ",Ycirc:"Ŷ",ycy:"ы",Ycy:"Ы",yen:"¥",yfr:"𝔶",Yfr:"𝔜",yicy:"ї",YIcy:"Ї",yopf:"𝕪",Yopf:"𝕐",yscr:"𝓎",Yscr:"𝒴",yucy:"ю",YUcy:"Ю",yuml:"ÿ",Yuml:"Ÿ",zacute:"ź",Zacute:"Ź",zcaron:"ž",Zcaron:"Ž",zcy:"з",Zcy:"З",zdot:"ż",Zdot:"Ż",zeetrf:"ℨ",ZeroWidthSpace:"",zeta:"ζ",Zeta:"Ζ",zfr:"𝔷",Zfr:"ℨ",zhcy:"ж",ZHcy:"Ж",zigrarr:"⇝",zopf:"𝕫",Zopf:"ℤ",zscr:"𝓏",Zscr:"𝒵",zwj:"",zwnj:""},y={aacute:"á",Aacute:"Á",acirc:"â",Acirc:"Â",acute:"´",aelig:"æ",AElig:"Æ",agrave:"à",Agrave:"À",amp:"&",AMP:"&",aring:"å",Aring:"Å",atilde:"ã",Atilde:"Ã",auml:"ä",Auml:"Ä",brvbar:"¦",ccedil:"ç",Ccedil:"Ç",cedil:"¸",cent:"¢",copy:"©",COPY:"©",curren:"¤",deg:"°",divide:"÷",eacute:"é",Eacute:"É",ecirc:"ê",Ecirc:"Ê",egrave:"è",Egrave:"È",eth:"ð",ETH:"Ð",euml:"ë",Euml:"Ë",frac12:"½",frac14:"¼",frac34:"¾",gt:">",GT:">",iacute:"í",Iacute:"Í",icirc:"î",Icirc:"Î",iexcl:"¡",igrave:"ì",Igrave:"Ì",iquest:"¿",iuml:"ï",Iuml:"Ï",laquo:"«",lt:"<",LT:"<",macr:"¯",micro:"µ",middot:"·",nbsp:" ",not:"¬",ntilde:"ñ",Ntilde:"Ñ",oacute:"ó",Oacute:"Ó",ocirc:"ô",Ocirc:"Ô",ograve:"ò",Ograve:"Ò",ordf:"ª",ordm:"º",oslash:"ø",Oslash:"Ø",otilde:"õ",Otilde:"Õ",ouml:"ö",Ouml:"Ö",para:"¶",plusmn:"±",pound:"£",quot:'"',QUOT:'"',raquo:"»",reg:"®",REG:"®",sect:"§",shy:"",sup1:"¹",sup2:"²",sup3:"³",szlig:"ß",thorn:"þ",THORN:"Þ",times:"×",uacute:"ú",Uacute:"Ú",ucirc:"û",Ucirc:"Û",ugrave:"ù",Ugrave:"Ù",uml:"¨",uuml:"ü",Uuml:"Ü",yacute:"ý",Yacute:"Ý",yen:"¥",yuml:"ÿ"},w={0:"�",128:"€",130:"‚",131:"ƒ",132:"„",133:"…",134:"†",135:"‡",136:"ˆ",137:"‰",138:"Š",139:"‹",140:"Œ",142:"Ž",145:"‘",146:"’",147:"“",148:"”",149:"•",150:"–",151:"—",152:"˜",153:"™",154:"š",155:"›",156:"œ",158:"ž",159:"Ÿ"},x=[1,2,3,4,5,6,7,8,11,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,64976,64977,64978,64979,64980,64981,64982,64983,64984,64985,64986,64987,64988,64989,64990,64991,64992,64993,64994,64995,64996,64997,64998,64999,65e3,65001,65002,65003,65004,65005,65006,65007,65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111],E=String.fromCharCode,S={}.hasOwnProperty,I=function(e,t){return S.call(e,t)},T=function(e,t){if(!e)return t;var n,r={};for(n in t)r[n]=I(e,n)?e[n]:t[n];return r},C=function(e,t){var n="";return e>=55296&&e<=57343||e>1114111?(t&&j("character reference outside the permissible Unicode range"),"�"):I(w,e)?(t&&j("disallowed character reference"),w[e]):(t&&function(e,t){for(var n=-1,r=e.length;++n<r;)if(e[n]==t)return!0;return!1}(x,e)&&j("disallowed character reference"),e>65535&&(n+=E((e-=65536)>>>10&1023|55296),e=56320|1023&e),n+=E(e))},k=function(e){return"&#x"+e.toString(16).toUpperCase()+";"},P=function(e){return"&#"+e+";"},j=function(e){throw Error("Parse error: "+e)},N=function(e,t){(t=T(t,N.options)).strict&&g.test(e)&&j("forbidden code point");var n=t.encodeEverything,r=t.useNamedReferences,o=t.allowUnsafeSymbols,i=t.decimal?P:k,a=function(e){return i(e.charCodeAt(0))};return n?(e=e.replace(c,function(e){return r&&I(f,e)?"&"+f[e]+";":a(e)}),r&&(e=e.replace(/>\u20D2/g,">⃒").replace(/<\u20D2/g,"<⃒").replace(/fj/g,"fj")),r&&(e=e.replace(p,function(e){return"&"+f[e]+";"}))):r?(o||(e=e.replace(d,function(e){return"&"+f[e]+";"})),e=(e=e.replace(/>\u20D2/g,">⃒").replace(/<\u20D2/g,"<⃒")).replace(p,function(e){return"&"+f[e]+";"})):o||(e=e.replace(d,a)),e.replace(l,function(e){var t=e.charCodeAt(0),n=e.charCodeAt(1);return i(1024*(t-55296)+n-56320+65536)}).replace(s,a)};N.options={allowUnsafeSymbols:!1,encodeEverything:!1,strict:!1,useNamedReferences:!1,decimal:!1};var D=function(e,t){var n=(t=T(t,D.options)).strict;return n&&h.test(e)&&j("malformed character reference"),e.replace(v,function(e,r,o,i,a,u,l,c,s){var p,f,d,m,h,g;return r?b[h=r]:o?(h=o,(g=i)&&t.isAttributeValue?(n&&"="==g&&j("`&` did not start a character reference"),e):(n&&j("named character reference was not terminated by a semicolon"),y[h]+(g||""))):a?(d=a,f=u,n&&!f&&j("character reference was not terminated by a semicolon"),p=parseInt(d,10),C(p,n)):l?(m=l,f=c,n&&!f&&j("character reference was not terminated by a semicolon"),p=parseInt(m,16),C(p,n)):(n&&j("named character reference was not terminated by a semicolon"),e)})};D.options={isAttributeValue:!1,strict:!1};var O={version:"1.2.0",encode:N,decode:D,escape:function(e){return e.replace(d,function(e){return m[e]})},unescape:D};void 0===(o=function(){return O}.call(t,n,t,e))||(e.exports=o)}()}).call(t,n(348)(e),n(50))},,,,,,,,,,,function(e,t,n){"use strict";var r=n(1),o=n.n(r),i=n(19),a=n.n(i),u=n(443),l=n.n(u),c=n(448),s=n.n(c),p=n(450),f=function(){return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{!r&&u.return&&u.return()}finally{if(o)throw i}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),d=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),m=l.a.use(s.a),h={PENDING:"pending",LOADING:"loading",LOADED:"loaded",FAILED:"failed",UNSUPPORTED:"unsupported"},g={},v={},b=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.handleLoad=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=n.props,i=o.onLoad,a=o.src;e?n.fail(e):n.isActive&&n.setState({loadedText:t.text,status:h.LOADED},function(){i(a,r)})},n.state={status:h.PENDING},n.isActive=!1,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,o.a.PureComponent),d(t,[{key:"componentWillMount",value:function(){this.isActive=!0}},{key:"componentDidMount",value:function(){var e=this.state.status,t=this.props,n=t.src,r=t.supportTest;if(e===h.PENDING){if(r())return n?void this.startLoad():void this.fail(Object(p.a)("Missing source"));this.fail(Object(p.e)())}}},{key:"componentDidUpdate",value:function(e){var t=this.props.src;if(e.src!==t){if(t)return void this.startLoad();this.fail(Object(p.a)("Missing source"))}}},{key:"componentWillUnmount",value:function(){this.isActive=!1}},{key:"getFile",value:function(e){var t=this,n=this.props,r=n.cacheGetRequests,o=n.src;if(r){if(v[o]){var i=f(v[o],2),a=i[0],u=i[1];e(a,u,!0)}g[o]||(g[o]=[],m.get(o,function(e,n){g[o].forEach(function(r){var i=t.props.src;v[o]=[e,n],o===i&&r(e,n)})})),g[o].push(e)}else m.get(o,function(n,r){var i=t.props.src;o===i&&e(n,r)})}},{key:"fail",value:function(e){var t=this.props.onError,n=e.isUnsupportedBrowserError?h.UNSUPPORTED:h.FAILED;this.isActive&&this.setState({status:n},function(){"function"==typeof t&&t(e)})}},{key:"startLoad",value:function(){this.isActive&&this.setState({status:h.LOADING},this.load)}},{key:"load",value:function(){var e=this.props.src.match(/data:image\/svg[^,]*?(;base64)?,(.*)/);return e?this.handleLoad(null,{text:e[1]?atob(e[2]):decodeURIComponent(e[2])}):this.getFile(this.handleLoad)}},{key:"getClassName",value:function(){var e=this.state.status,t=this.props.className,n="isvg "+e;return t&&(n+=" "+t),n}},{key:"processSVG",value:function(e){var t=this.props,n=t.uniquifyIDs,r=t.uniqueHash,o=t.baseURL,i=t.processSVG,a=e;return i&&(a=i(a)),n?Object(p.d)(a,r||Object(p.c)(),o):a}},{key:"renderContents",value:function(){var e=this.state.status,t=this.props,n=t.children,r=t.preloader;switch(e){case h.UNSUPPORTED:case h.FAILED:return n;default:return r}}},{key:"render",value:function(){var e=this.state.loadedText,t=this.props,n=t.style,r=t.wrapper,o=void 0,i=void 0;return e?i={__html:this.processSVG(e)}:o=this.renderContents(),r({style:n,className:this.getClassName(),dangerouslySetInnerHTML:i},o)}}]),t}();b.propTypes={baseURL:a.a.string,cacheGetRequests:a.a.bool,children:a.a.node,className:a.a.string,onError:a.a.func,onLoad:a.a.func,preloader:a.a.node,processSVG:a.a.func,src:a.a.string.isRequired,style:a.a.object,supportTest:a.a.func,uniqueHash:a.a.string,uniquifyIDs:a.a.bool,wrapper:a.a.func},b.defaultProps={baseURL:"",cacheGetRequests:!1,onLoad:function(){},supportTest:p.b,uniquifyIDs:!0,wrapper:o.a.createFactory("span")},t.a=b},,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";function r(e){for(var t=arguments.length-1,n="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=0;r<t;r++)n+="&args[]="+encodeURIComponent(arguments[r+1]);!function(e,t,n,r,o,i,a,u){if(!e){if(e=void 0,void 0===t)e=Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[n,void 0,void 0,void 0,void 0,void 0],c=0;(e=Error(t.replace(/%s/g,function(){return l[c++]}))).name="Invariant Violation"}throw e.framesToPop=1,e}}(!1,"Minified React error #"+e+"; visit %s for the full message or use the non-minified dev environment for full errors and additional helpful warnings. ",n)}function o(e,t,n,r,o,i,a,u,l){Ar=!1,Rr=null,function(e,t,n,r,o,i,a,u,l){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(e){this.onError(e)}}.apply(Ur,arguments)}function i(){if(Hr)for(var e in Wr){var t=Wr[e],n=Hr.indexOf(e);if(-1<n||r("96",e),!Br[n])for(var o in t.extractEvents||r("97",e),Br[n]=t,n=t.eventTypes){var i=void 0,u=n[o],l=t,c=o;qr.hasOwnProperty(c)&&r("99",c),qr[c]=u;var s=u.phasedRegistrationNames;if(s){for(i in s)s.hasOwnProperty(i)&&a(s[i],l,c);i=!0}else u.registrationName?(a(u.registrationName,l,c),i=!0):i=!1;i||r("98",o,e)}}}function a(e,t,n){Gr[e]&&r("100",e),Gr[e]=t,Vr[e]=t.eventTypes[n].dependencies}function u(e,t,n){var i=e.type||"unknown-event";e.currentTarget=Yr(n),function(e,t,n,i,a,u,l,c,s){if(o.apply(this,arguments),Ar){if(Ar){var p=Rr;Ar=!1,Rr=null}else r("198"),p=void 0;zr||(zr=!0,Fr=p)}}(i,t,void 0,e),e.currentTarget=null}function l(e,t){return null==t&&r("30"),null==e?t:Array.isArray(e)?Array.isArray(t)?(e.push.apply(e,t),e):(e.push(t),e):Array.isArray(t)?[e].concat(t):[e,t]}function c(e,t,n){Array.isArray(e)?e.forEach(t,n):e&&t.call(n,e)}function s(e){if(e){var t=e._dispatchListeners,n=e._dispatchInstances;if(Array.isArray(t))for(var r=0;r<t.length&&!e.isPropagationStopped();r++)u(e,t[r],n[r]);else t&&u(e,t,n);e._dispatchListeners=null,e._dispatchInstances=null,e.isPersistent()||e.constructor.release(e)}}function p(e,t){var n=e.stateNode;if(!n)return null;var o=Zr(n);if(!o)return null;n=o[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":(o=!o.disabled)||(o=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!o;break e;default:e=!1}return e?null:(n&&"function"!=typeof n&&r("231",t,typeof n),n)}function f(e){if(null!==e&&(Xr=l(Xr,e)),e=Xr,Xr=null,e&&(c(e,s),Xr&&r("95"),zr))throw e=Fr,zr=!1,Fr=null,e}function d(e){if(e[$r])return e[$r];for(;!e[$r];){if(!e.parentNode)return null;e=e.parentNode}return 5===(e=e[$r]).tag||6===e.tag?e:null}function m(e){return!(e=e[$r])||5!==e.tag&&6!==e.tag?null:e}function h(e){if(5===e.tag||6===e.tag)return e.stateNode;r("33")}function g(e){return e[eo]||null}function v(e){do{e=e.return}while(e&&5!==e.tag);return e||null}function b(e,t,n){(t=p(e,n.dispatchConfig.phasedRegistrationNames[t]))&&(n._dispatchListeners=l(n._dispatchListeners,t),n._dispatchInstances=l(n._dispatchInstances,e))}function y(e){if(e&&e.dispatchConfig.phasedRegistrationNames){for(var t=e._targetInst,n=[];t;)n.push(t),t=v(t);for(t=n.length;0<t--;)b(n[t],"captured",e);for(t=0;t<n.length;t++)b(n[t],"bubbled",e)}}function w(e,t,n){e&&n&&n.dispatchConfig.registrationName&&(t=p(e,n.dispatchConfig.registrationName))&&(n._dispatchListeners=l(n._dispatchListeners,t),n._dispatchInstances=l(n._dispatchInstances,e))}function x(e){e&&e.dispatchConfig.registrationName&&w(e._targetInst,null,e)}function E(e){c(e,y)}function S(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}function I(e){if(ro[e])return ro[e];if(!no[e])return e;var t,n=no[e];for(t in n)if(n.hasOwnProperty(t)&&t in oo)return ro[e]=n[t];return e}function T(){if(fo)return fo;var e,t,n=po,r=n.length,o="value"in so?so.value:so.textContent,i=o.length;for(e=0;e<r&&n[e]===o[e];e++);var a=r-e;for(t=1;t<=a&&n[r-t]===o[i-t];t++);return fo=o.slice(e,1<t?1-t:void 0)}function C(){return!0}function k(){return!1}function P(e,t,n,r){for(var o in this.dispatchConfig=e,this._targetInst=t,this.nativeEvent=n,e=this.constructor.Interface)e.hasOwnProperty(o)&&((t=e[o])?this[o]=t(n):"target"===o?this.target=r:this[o]=n[o]);return this.isDefaultPrevented=(null!=n.defaultPrevented?n.defaultPrevented:!1===n.returnValue)?C:k,this.isPropagationStopped=k,this}function j(e,t,n,r){if(this.eventPool.length){var o=this.eventPool.pop();return this.call(o,e,t,n,r),o}return new this(e,t,n,r)}function N(e){e instanceof this||r("279"),e.destructor(),10>this.eventPool.length&&this.eventPool.push(e)}function D(e){e.eventPool=[],e.getPooled=j,e.release=N}function O(e,t){switch(e){case"keyup":return-1!==go.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"blur":return!0;default:return!1}}function M(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}function L(e){if(e=Jr(e)){"function"!=typeof Co&&r("280");var t=Zr(e.stateNode);Co(e.stateNode,e.type,t)}}function _(e){ko?Po?Po.push(e):Po=[e]:ko=e}function A(){if(ko){var e=ko,t=Po;if(Po=ko=null,L(e),t)for(e=0;e<t.length;e++)L(t[e])}}function R(e,t){return e(t)}function z(e,t,n){return e(t,n)}function F(){}function U(e,t){if(jo)return e(t);jo=!0;try{return R(e,t)}finally{jo=!1,(null!==ko||null!==Po)&&(F(),A())}}function H(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!No[e.type]:"textarea"===t}function W(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}function B(e){if(!to)return!1;var t=(e="on"+e)in document;return t||((t=document.createElement("div")).setAttribute(e,"return;"),t="function"==typeof t[e]),t}function q(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function G(e){e._valueTracker||(e._valueTracker=function(e){var t=q(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&void 0!==n&&"function"==typeof n.get&&"function"==typeof n.set){var o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(e){r=""+e,i.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function V(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=q(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function Z(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=Vo&&e[Vo]||e["@@iterator"])?e:null}function J(e){if(null==e)return null;if("function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case Ho:return"ConcurrentMode";case Ao:return"Fragment";case _o:return"Portal";case zo:return"Profiler";case Ro:return"StrictMode";case Bo:return"Suspense"}if("object"==typeof e)switch(e.$$typeof){case Uo:return"Context.Consumer";case Fo:return"Context.Provider";case Wo:var t=e.render;return t=t.displayName||t.name||"",e.displayName||(""!==t?"ForwardRef("+t+")":"ForwardRef");case qo:return J(e.type);case Go:if(e=1===e._status?e._result:null)return J(e)}return null}function Y(e){var t="";do{e:switch(e.tag){case 3:case 4:case 6:case 7:case 10:case 9:var n="";break e;default:var r=e._debugOwner,o=e._debugSource,i=J(e.type);n=null,r&&(n=J(r.type)),r=i,i="",o?i=" (at "+o.fileName.replace(Oo,"")+":"+o.lineNumber+")":n&&(i=" (created by "+n+")"),n="\n in "+(r||"Unknown")+i}t+=n,e=e.return}while(e);return t}function X(e,t,n,r,o){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t}function Q(e){return e[1].toUpperCase()}function K(e,t,n,r){var o=Qo.hasOwnProperty(t)?Qo[t]:null;(null!==o?0===o.type:!r&&(2<t.length&&("o"===t[0]||"O"===t[0])&&("n"===t[1]||"N"===t[1])))||(function(e,t,n,r){if(null===t||void 0===t||function(e,t,n,r){if(null!==n&&0===n.type)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return!r&&(null!==n?!n.acceptsBooleans:"data-"!==(e=e.toLowerCase().slice(0,5))&&"aria-"!==e);default:return!1}}(e,t,n,r))return!0;if(r)return!1;if(null!==n)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}(t,n,o,r)&&(n=null),r||null===o?function(e){return!!Jo.call(Xo,e)||!Jo.call(Yo,e)&&(Zo.test(e)?Xo[e]=!0:(Yo[e]=!0,!1))}(t)&&(null===n?e.removeAttribute(t):e.setAttribute(t,""+n)):o.mustUseProperty?e[o.propertyName]=null===n?3!==o.type&&"":n:(t=o.attributeName,r=o.attributeNamespace,null===n?e.removeAttribute(t):(n=3===(o=o.type)||4===o&&!0===n?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}function $(e){switch(typeof e){case"boolean":case"number":case"object":case"string":case"undefined":return e;default:return""}}function ee(e,t){var n=t.checked;return Lr({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=n?n:e._wrapperState.initialChecked})}function te(e,t){var n=null==t.defaultValue?"":t.defaultValue,r=null!=t.checked?t.checked:t.defaultChecked;n=$(null!=t.value?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function ne(e,t){null!=(t=t.checked)&&K(e,"checked",t,!1)}function re(e,t){ne(e,t);var n=$(t.value),r=t.type;if(null!=n)"number"===r?(0===n&&""===e.value||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if("submit"===r||"reset"===r)return void e.removeAttribute("value");t.hasOwnProperty("value")?ie(e,t.type,n):t.hasOwnProperty("defaultValue")&&ie(e,t.type,$(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function oe(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!("submit"!==r&&"reset"!==r||void 0!==t.value&&null!==t.value))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}""!==(n=e.name)&&(e.name=""),e.defaultChecked=!e.defaultChecked,e.defaultChecked=!!e._wrapperState.initialChecked,""!==n&&(e.name=n)}function ie(e,t,n){"number"===t&&e.ownerDocument.activeElement===e||(null==n?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}function ae(e,t,n){return(e=P.getPooled($o.change,e,t,n)).type="change",_(n),E(e),e}function ue(e){f(e)}function le(e){if(V(h(e)))return e}function ce(e,t){if("change"===e)return t}function se(){ei&&(ei.detachEvent("onpropertychange",pe),ti=ei=null)}function pe(e){"value"===e.propertyName&&le(ti)&&U(ue,e=ae(ti,e,W(e)))}function fe(e,t,n){"focus"===e?(se(),ti=n,(ei=t).attachEvent("onpropertychange",pe)):"blur"===e&&se()}function de(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return le(ti)}function me(e,t){if("click"===e)return le(t)}function he(e,t){if("input"===e||"change"===e)return le(t)}function ge(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=ii[e])&&!!t[e]}function ve(){return ge}function be(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t}function ye(e,t){if(be(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++)if(!mi.call(t,n[r])||!be(e[n[r]],t[n[r]]))return!1;return!0}function we(e){var t=e;if(e.alternate)for(;t.return;)t=t.return;else{if(0!=(2&t.effectTag))return 1;for(;t.return;)if(0!=(2&(t=t.return).effectTag))return 1}return 3===t.tag?2:3}function xe(e){2!==we(e)&&r("188")}function Ee(e){if(!(e=function(e){var t=e.alternate;if(!t)return 3===(t=we(e))&&r("188"),1===t?null:e;for(var n=e,o=t;;){var i=n.return,a=i?i.alternate:null;if(!i||!a)break;if(i.child===a.child){for(var u=i.child;u;){if(u===n)return xe(i),e;if(u===o)return xe(i),t;u=u.sibling}r("188")}if(n.return!==o.return)n=i,o=a;else{u=!1;for(var l=i.child;l;){if(l===n){u=!0,n=i,o=a;break}if(l===o){u=!0,o=i,n=a;break}l=l.sibling}if(!u){for(l=a.child;l;){if(l===n){u=!0,n=a,o=i;break}if(l===o){u=!0,o=a,n=i;break}l=l.sibling}u||r("189")}}n.alternate!==o&&r("190")}return 3!==n.tag&&r("188"),n.stateNode.current===n?e:t}(e)))return null;for(var t=e;;){if(5===t.tag||6===t.tag)return t;if(t.child)t.child.return=t,t=t.child;else{if(t===e)break;for(;!t.sibling;){if(!t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}}return null}function Se(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}function Ie(e,t){var n=e[0],r="on"+((e=e[1])[0].toUpperCase()+e.slice(1));t={phasedRegistrationNames:{bubbled:r,captured:r+"Capture"},dependencies:[n],isInteractive:t},Ci[e]=t,ki[n]=t}function Te(e){var t=e.targetInst,n=t;do{if(!n){e.ancestors.push(n);break}var r;for(r=n;r.return;)r=r.return;if(!(r=3!==r.tag?null:r.stateNode.containerInfo))break;e.ancestors.push(n),n=d(r)}while(n);for(n=0;n<e.ancestors.length;n++){t=e.ancestors[n];var o=W(e.nativeEvent);r=e.topLevelType;for(var i=e.nativeEvent,a=null,u=0;u<Br.length;u++){var c=Br[u];c&&(c=c.extractEvents(r,t,i,o))&&(a=l(a,c))}f(a)}}function Ce(e,t){if(!t)return null;var n=(ji(e)?Pe:je).bind(null,e);t.addEventListener(e,n,!1)}function ke(e,t){if(!t)return null;var n=(ji(e)?Pe:je).bind(null,e);t.addEventListener(e,n,!0)}function Pe(e,t){z(je,e,t)}function je(e,t){if(Di){var n=W(t);if(null===(n=d(n))||"number"!=typeof n.tag||2===we(n)||(n=null),Ni.length){var r=Ni.pop();r.topLevelType=e,r.nativeEvent=t,r.targetInst=n,e=r}else e={topLevelType:e,nativeEvent:t,targetInst:n,ancestors:[]};try{U(Te,e)}finally{e.topLevelType=null,e.nativeEvent=null,e.targetInst=null,e.ancestors.length=0,10>Ni.length&&Ni.push(e)}}}function Ne(e){return Object.prototype.hasOwnProperty.call(e,Li)||(e[Li]=Mi++,Oi[e[Li]]={}),Oi[e[Li]]}function De(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}function Oe(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Me(e,t){var n,r=Oe(e);for(e=0;r;){if(3===r.nodeType){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Oe(r)}}function Le(){for(var e=window,t=De();t instanceof e.HTMLIFrameElement;){try{e=t.contentDocument.defaultView}catch(e){break}t=De(e.document)}return t}function _e(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}function Ae(e){var t=Le(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&function e(t,n){return!(!t||!n)&&(t===n||(!t||3!==t.nodeType)&&(n&&3===n.nodeType?e(t,n.parentNode):"contains"in t?t.contains(n):!!t.compareDocumentPosition&&!!(16&t.compareDocumentPosition(n))))}(n.ownerDocument.documentElement,n)){if(null!==r&&_e(n))if(t=r.start,void 0===(e=r.end)&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if((e=(t=n.ownerDocument||document)&&t.defaultView||window).getSelection){e=e.getSelection();var o=n.textContent.length,i=Math.min(r.start,o);r=void 0===r.end?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=Me(n,i);var a=Me(n,r);o&&a&&(1!==e.rangeCount||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&((t=t.createRange()).setStart(o.node,o.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}for(t=[],e=n;e=e.parentNode;)1===e.nodeType&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for("function"==typeof n.focus&&n.focus(),n=0;n<t.length;n++)(e=t[n]).element.scrollLeft=e.left,e.element.scrollTop=e.top}}function Re(e,t){var n=t.window===t?t.document:9===t.nodeType?t:t.ownerDocument;return Ui||null==Ri||Ri!==De(n)?null:(n="selectionStart"in(n=Ri)&&_e(n)?{start:n.selectionStart,end:n.selectionEnd}:{anchorNode:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset},Fi&&ye(Fi,n)?null:(Fi=n,(e=P.getPooled(Ai.select,zi,e,t)).type="select",e.target=Ri,E(e),e))}function ze(e,t){return e=Lr({children:void 0},t),(t=function(e){var t="";return Mr.Children.forEach(e,function(e){null!=e&&(t+=e)}),t}(t.children))&&(e.children=t),e}function Fe(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o<n.length;o++)t["$"+n[o]]=!0;for(n=0;n<e.length;n++)o=t.hasOwnProperty("$"+e[n].value),e[n].selected!==o&&(e[n].selected=o),o&&r&&(e[n].defaultSelected=!0)}else{for(n=""+$(n),t=null,o=0;o<e.length;o++){if(e[o].value===n)return e[o].selected=!0,void(r&&(e[o].defaultSelected=!0));null!==t||e[o].disabled||(t=e[o])}null!==t&&(t.selected=!0)}}function Ue(e,t){return null!=t.dangerouslySetInnerHTML&&r("91"),Lr({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function He(e,t){var n=t.value;null==n&&(n=t.defaultValue,null!=(t=t.children)&&(null!=n&&r("92"),Array.isArray(t)&&(1>=t.length||r("93"),t=t[0]),n=t),null==n&&(n="")),e._wrapperState={initialValue:$(n)}}function We(e,t){var n=$(t.value),r=$(t.defaultValue);null!=n&&((n=""+n)!==e.value&&(e.value=n),null==t.defaultValue&&e.defaultValue!==n&&(e.defaultValue=n)),null!=r&&(e.defaultValue=""+r)}function Be(e){var t=e.textContent;t===e._wrapperState.initialValue&&(e.value=t)}function qe(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Ge(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?qe(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}function Ve(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}function Ze(e,t,n){return null==t||"boolean"==typeof t||""===t?"":n||"number"!=typeof t||0===t||Vi.hasOwnProperty(e)&&Vi[e]?(""+t).trim():t+"px"}function Je(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=0===n.indexOf("--"),o=Ze(n,t[n],r);"float"===n&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}function Ye(e,t){t&&(Ji[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML)&&r("137",e,""),null!=t.dangerouslySetInnerHTML&&(null!=t.children&&r("60"),"object"==typeof t.dangerouslySetInnerHTML&&"__html"in t.dangerouslySetInnerHTML||r("61")),null!=t.style&&"object"!=typeof t.style&&r("62",""))}function Xe(e,t){if(-1===e.indexOf("-"))return"string"==typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}function Qe(e,t){var n=Ne(e=9===e.nodeType||11===e.nodeType?e:e.ownerDocument);t=Vr[t];for(var r=0;r<t.length;r++){var o=t[r];if(!n.hasOwnProperty(o)||!n[o]){switch(o){case"scroll":ke("scroll",e);break;case"focus":case"blur":ke("focus",e),ke("blur",e),n.blur=!0,n.focus=!0;break;case"cancel":case"close":B(o)&&ke(o,e);break;case"invalid":case"submit":case"reset":break;default:-1===co.indexOf(o)&&Ce(o,e)}n[o]=!0}}}function Ke(){}function $e(e,t){switch(e){case"button":case"input":case"select":case"textarea":return!!t.autoFocus}return!1}function et(e,t){return"textarea"===e||"option"===e||"noscript"===e||"string"==typeof t.children||"number"==typeof t.children||"object"==typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}function tt(e){for(e=e.nextSibling;e&&1!==e.nodeType&&3!==e.nodeType;)e=e.nextSibling;return e}function nt(e){for(e=e.firstChild;e&&1!==e.nodeType&&3!==e.nodeType;)e=e.nextSibling;return e}function rt(e){0>na||(e.current=ta[na],ta[na]=null,na--)}function ot(e,t){ta[++na]=e.current,e.current=t}function it(e,t){var n=e.type.contextTypes;if(!n)return ra;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o,i={};for(o in n)i[o]=t[o];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function at(e){return null!==(e=e.childContextTypes)&&void 0!==e}function ut(e){rt(ia),rt(oa)}function lt(e){rt(ia),rt(oa)}function ct(e,t,n){oa.current!==ra&&r("168"),ot(oa,t),ot(ia,n)}function st(e,t,n){var o=e.stateNode;if(e=t.childContextTypes,"function"!=typeof o.getChildContext)return n;for(var i in o=o.getChildContext())i in e||r("108",J(t)||"Unknown",i);return Lr({},n,o)}function pt(e){var t=e.stateNode;return t=t&&t.__reactInternalMemoizedMergedChildContext||ra,aa=oa.current,ot(oa,t),ot(ia,ia.current),!0}function ft(e,t,n){var o=e.stateNode;o||r("169"),n?(t=st(e,t,aa),o.__reactInternalMemoizedMergedChildContext=t,rt(ia),rt(oa),ot(oa,t)):rt(ia),ot(ia,n)}function dt(e){return function(t){try{return e(t)}catch(e){}}}function mt(e,t,n,r){return new function(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.contextDependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.effectTag=0,this.lastEffect=this.firstEffect=this.nextEffect=null,this.childExpirationTime=this.expirationTime=0,this.alternate=null}(e,t,n,r)}function ht(e){return!(!(e=e.prototype)||!e.isReactComponent)}function gt(e,t){var n=e.alternate;return null===n?((n=mt(e.tag,t,e.key,e.mode)).elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.effectTag=0,n.nextEffect=null,n.firstEffect=null,n.lastEffect=null),n.childExpirationTime=e.childExpirationTime,n.expirationTime=e.expirationTime,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,n.contextDependencies=e.contextDependencies,n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function vt(e,t,n,o,i,a){var u=2;if(o=e,"function"==typeof e)ht(e)&&(u=1);else if("string"==typeof e)u=5;else e:switch(e){case Ao:return bt(n.children,i,a,t);case Ho:return yt(n,3|i,a,t);case Ro:return yt(n,2|i,a,t);case zo:return(e=mt(12,n,t,4|i)).elementType=zo,e.type=zo,e.expirationTime=a,e;case Bo:return(e=mt(13,n,t,i)).elementType=Bo,e.type=Bo,e.expirationTime=a,e;default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case Fo:u=10;break e;case Uo:u=9;break e;case Wo:u=11;break e;case qo:u=14;break e;case Go:u=16,o=null;break e}r("130",null==e?e:typeof e,"")}return(t=mt(u,n,t,i)).elementType=e,t.type=o,t.expirationTime=a,t}function bt(e,t,n,r){return(e=mt(7,e,r,t)).expirationTime=n,e}function yt(e,t,n,r){return e=mt(8,e,r,t),t=0==(1&t)?Ro:Ho,e.elementType=t,e.type=t,e.expirationTime=n,e}function wt(e,t,n){return(e=mt(6,e,null,t)).expirationTime=n,e}function xt(e,t,n){return(t=mt(4,null!==e.children?e.children:[],e.key,t)).expirationTime=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Et(e,t){e.didError=!1;var n=e.earliestPendingTime;0===n?e.earliestPendingTime=e.latestPendingTime=t:n<t?e.earliestPendingTime=t:e.latestPendingTime>t&&(e.latestPendingTime=t),Tt(t,e)}function St(e,t){e.didError=!1,e.latestPingedTime>=t&&(e.latestPingedTime=0);var n=e.earliestPendingTime,r=e.latestPendingTime;n===t?e.earliestPendingTime=r===t?e.latestPendingTime=0:r:r===t&&(e.latestPendingTime=n),n=e.earliestSuspendedTime,r=e.latestSuspendedTime,0===n?e.earliestSuspendedTime=e.latestSuspendedTime=t:n<t?e.earliestSuspendedTime=t:r>t&&(e.latestSuspendedTime=t),Tt(t,e)}function It(e,t){var n=e.earliestPendingTime;return e=e.earliestSuspendedTime,n>t&&(t=n),e>t&&(t=e),t}function Tt(e,t){var n=t.earliestSuspendedTime,r=t.latestSuspendedTime,o=t.earliestPendingTime,i=t.latestPingedTime;0===(o=0!==o?o:i)&&(0===e||r<e)&&(o=r),0!==(e=o)&&n>e&&(e=n),t.nextExpirationTimeToWorkOn=o,t.expirationTime=e}function Ct(e,t){if(e&&e.defaultProps)for(var n in t=Lr({},t),e=e.defaultProps)void 0===t[n]&&(t[n]=e[n]);return t}function kt(e,t,n,r){n=null===(n=n(r,t=e.memoizedState))||void 0===n?t:Lr({},t,n),e.memoizedState=n,null!==(r=e.updateQueue)&&0===e.expirationTime&&(r.baseState=n)}function Pt(e,t,n,r,o,i,a){return"function"==typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(r,i,a):!t.prototype||!t.prototype.isPureReactComponent||(!ye(n,r)||!ye(o,i))}function jt(e,t,n){var r=!1,o=ra,i=t.contextType;return"object"==typeof i&&null!==i?i=En(i):(o=at(t)?aa:oa.current,i=(r=null!==(r=t.contextTypes)&&void 0!==r)?it(e,o):ra),t=new t(n,i),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=sa,e.stateNode=t,t._reactInternalFiber=e,r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=i),t}function Nt(e,t,n,r){e=t.state,"function"==typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,r),"function"==typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&sa.enqueueReplaceState(t,t.state,null)}function Dt(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs=ca;var i=t.contextType;"object"==typeof i&&null!==i?o.context=En(i):(i=at(t)?aa:oa.current,o.context=it(e,i)),null!==(i=e.updateQueue)&&(Dn(e,i,n,o,r),o.state=e.memoizedState),"function"==typeof(i=t.getDerivedStateFromProps)&&(kt(e,t,i,n),o.state=e.memoizedState),"function"==typeof t.getDerivedStateFromProps||"function"==typeof o.getSnapshotBeforeUpdate||"function"!=typeof o.UNSAFE_componentWillMount&&"function"!=typeof o.componentWillMount||(t=o.state,"function"==typeof o.componentWillMount&&o.componentWillMount(),"function"==typeof o.UNSAFE_componentWillMount&&o.UNSAFE_componentWillMount(),t!==o.state&&sa.enqueueReplaceState(o,o.state,null),null!==(i=e.updateQueue)&&(Dn(e,i,n,o,r),o.state=e.memoizedState)),"function"==typeof o.componentDidMount&&(e.effectTag|=4)}function Ot(e,t,n){if(null!==(e=n.ref)&&"function"!=typeof e&&"object"!=typeof e){if(n._owner){var o=void 0;(n=n._owner)&&(1!==n.tag&&r("309"),o=n.stateNode),o||r("147",e);var i=""+e;return null!==t&&null!==t.ref&&"function"==typeof t.ref&&t.ref._stringRef===i?t.ref:((t=function(e){var t=o.refs;t===ca&&(t=o.refs={}),null===e?delete t[i]:t[i]=e})._stringRef=i,t)}"string"!=typeof e&&r("284"),n._owner||r("290",e)}return e}function Mt(e,t){"textarea"!==e.type&&r("31","[object Object]"===Object.prototype.toString.call(t)?"object with keys {"+Object.keys(t).join(", ")+"}":t,"")}function Lt(e){function t(t,n){if(e){var r=t.lastEffect;null!==r?(r.nextEffect=n,t.lastEffect=n):t.firstEffect=t.lastEffect=n,n.nextEffect=null,n.effectTag=8}}function n(n,r){if(!e)return null;for(;null!==r;)t(n,r),r=r.sibling;return null}function o(e,t){for(e=new Map;null!==t;)null!==t.key?e.set(t.key,t):e.set(t.index,t),t=t.sibling;return e}function i(e,t,n){return(e=gt(e,t)).index=0,e.sibling=null,e}function a(t,n,r){return t.index=r,e?null!==(r=t.alternate)?(r=r.index)<n?(t.effectTag=2,n):r:(t.effectTag=2,n):n}function u(t){return e&&null===t.alternate&&(t.effectTag=2),t}function l(e,t,n,r){return null===t||6!==t.tag?((t=wt(n,e.mode,r)).return=e,t):((t=i(t,n)).return=e,t)}function c(e,t,n,r){return null!==t&&t.elementType===n.type?((r=i(t,n.props)).ref=Ot(e,t,n),r.return=e,r):((r=vt(n.type,n.key,n.props,null,e.mode,r)).ref=Ot(e,t,n),r.return=e,r)}function s(e,t,n,r){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?((t=xt(n,e.mode,r)).return=e,t):((t=i(t,n.children||[])).return=e,t)}function p(e,t,n,r,o){return null===t||7!==t.tag?((t=bt(n,e.mode,r,o)).return=e,t):((t=i(t,n)).return=e,t)}function f(e,t,n){if("string"==typeof t||"number"==typeof t)return(t=wt(""+t,e.mode,n)).return=e,t;if("object"==typeof t&&null!==t){switch(t.$$typeof){case Lo:return(n=vt(t.type,t.key,t.props,null,e.mode,n)).ref=Ot(e,null,t),n.return=e,n;case _o:return(t=xt(t,e.mode,n)).return=e,t}if(pa(t)||Z(t))return(t=bt(t,e.mode,n,null)).return=e,t;Mt(e,t)}return null}function d(e,t,n,r){var o=null!==t?t.key:null;if("string"==typeof n||"number"==typeof n)return null!==o?null:l(e,t,""+n,r);if("object"==typeof n&&null!==n){switch(n.$$typeof){case Lo:return n.key===o?n.type===Ao?p(e,t,n.props.children,r,o):c(e,t,n,r):null;case _o:return n.key===o?s(e,t,n,r):null}if(pa(n)||Z(n))return null!==o?null:p(e,t,n,r,null);Mt(e,n)}return null}function m(e,t,n,r,o){if("string"==typeof r||"number"==typeof r)return l(t,e=e.get(n)||null,""+r,o);if("object"==typeof r&&null!==r){switch(r.$$typeof){case Lo:return e=e.get(null===r.key?n:r.key)||null,r.type===Ao?p(t,e,r.props.children,o,r.key):c(t,e,r,o);case _o:return s(t,e=e.get(null===r.key?n:r.key)||null,r,o)}if(pa(r)||Z(r))return p(t,e=e.get(n)||null,r,o,null);Mt(t,r)}return null}function h(r,i,u,l){for(var c=null,s=null,p=i,h=i=0,g=null;null!==p&&h<u.length;h++){p.index>h?(g=p,p=null):g=p.sibling;var v=d(r,p,u[h],l);if(null===v){null===p&&(p=g);break}e&&p&&null===v.alternate&&t(r,p),i=a(v,i,h),null===s?c=v:s.sibling=v,s=v,p=g}if(h===u.length)return n(r,p),c;if(null===p){for(;h<u.length;h++)(p=f(r,u[h],l))&&(i=a(p,i,h),null===s?c=p:s.sibling=p,s=p);return c}for(p=o(r,p);h<u.length;h++)(g=m(p,r,h,u[h],l))&&(e&&null!==g.alternate&&p.delete(null===g.key?h:g.key),i=a(g,i,h),null===s?c=g:s.sibling=g,s=g);return e&&p.forEach(function(e){return t(r,e)}),c}function g(i,u,l,c){var s=Z(l);"function"!=typeof s&&r("150"),null==(l=s.call(l))&&r("151");for(var p=s=null,h=u,g=u=0,v=null,b=l.next();null!==h&&!b.done;g++,b=l.next()){h.index>g?(v=h,h=null):v=h.sibling;var y=d(i,h,b.value,c);if(null===y){h||(h=v);break}e&&h&&null===y.alternate&&t(i,h),u=a(y,u,g),null===p?s=y:p.sibling=y,p=y,h=v}if(b.done)return n(i,h),s;if(null===h){for(;!b.done;g++,b=l.next())null!==(b=f(i,b.value,c))&&(u=a(b,u,g),null===p?s=b:p.sibling=b,p=b);return s}for(h=o(i,h);!b.done;g++,b=l.next())null!==(b=m(h,i,g,b.value,c))&&(e&&null!==b.alternate&&h.delete(null===b.key?g:b.key),u=a(b,u,g),null===p?s=b:p.sibling=b,p=b);return e&&h.forEach(function(e){return t(i,e)}),s}return function(e,o,a,l){var c="object"==typeof a&&null!==a&&a.type===Ao&&null===a.key;c&&(a=a.props.children);var s="object"==typeof a&&null!==a;if(s)switch(a.$$typeof){case Lo:e:{for(s=a.key,c=o;null!==c;){if(c.key===s){if(7===c.tag?a.type===Ao:c.elementType===a.type){n(e,c.sibling),(o=i(c,a.type===Ao?a.props.children:a.props)).ref=Ot(e,c,a),o.return=e,e=o;break e}n(e,c);break}t(e,c),c=c.sibling}a.type===Ao?((o=bt(a.props.children,e.mode,l,a.key)).return=e,e=o):((l=vt(a.type,a.key,a.props,null,e.mode,l)).ref=Ot(e,o,a),l.return=e,e=l)}return u(e);case _o:e:{for(c=a.key;null!==o;){if(o.key===c){if(4===o.tag&&o.stateNode.containerInfo===a.containerInfo&&o.stateNode.implementation===a.implementation){n(e,o.sibling),(o=i(o,a.children||[])).return=e,e=o;break e}n(e,o);break}t(e,o),o=o.sibling}(o=xt(a,e.mode,l)).return=e,e=o}return u(e)}if("string"==typeof a||"number"==typeof a)return a=""+a,null!==o&&6===o.tag?(n(e,o.sibling),(o=i(o,a)).return=e,e=o):(n(e,o),(o=wt(a,e.mode,l)).return=e,e=o),u(e);if(pa(a))return h(e,o,a,l);if(Z(a))return g(e,o,a,l);if(s&&Mt(e,a),void 0===a&&!c)switch(e.tag){case 1:case 0:r("152",(l=e.type).displayName||l.name||"Component")}return n(e,o)}}function _t(e){return e===ma&&r("174"),e}function At(e,t){ot(va,t),ot(ga,e),ot(ha,ma);var n=t.nodeType;switch(n){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Ge(null,"");break;default:t=Ge(t=(n=8===n?t.parentNode:t).namespaceURI||null,n=n.tagName)}rt(ha),ot(ha,t)}function Rt(e){rt(ha),rt(ga),rt(va)}function zt(e){_t(va.current);var t=_t(ha.current),n=Ge(t,e.type);t!==n&&(ot(ga,e),ot(ha,n))}function Ft(e){ga.current===e&&(rt(ha),rt(ga))}function Ut(){r("307")}function Ht(e,t){if(null===t)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!be(e[n],t[n]))return!1;return!0}function Wt(e,t,n,o,i,a){if(ka=a,Pa=t,Na=null!==e?e.memoizedState:null,Ca.current=null===Na?Ha:Wa,t=n(o,i),Ra){do{Ra=!1,Fa+=1,Na=null!==e?e.memoizedState:null,Ma=Da,_a=Oa=ja=null,Ca.current=Wa,t=n(o,i)}while(Ra);za=null,Fa=0}return Ca.current=Ua,(e=Pa).memoizedState=Da,e.expirationTime=La,e.updateQueue=_a,e.effectTag|=Aa,e=null!==ja&&null!==ja.next,ka=0,Ma=Oa=Da=Na=ja=Pa=null,La=0,_a=null,Aa=0,e&&r("300"),t}function Bt(){Ca.current=Ua,ka=0,Ma=Oa=Da=Na=ja=Pa=null,La=0,_a=null,Aa=0,Ra=!1,za=null,Fa=0}function qt(){var e={memoizedState:null,baseState:null,queue:null,baseUpdate:null,next:null};return null===Oa?Da=Oa=e:Oa=Oa.next=e,Oa}function Gt(){if(null!==Ma)Ma=(Oa=Ma).next,Na=null!==(ja=Na)?ja.next:null;else{null===Na&&r("310");var e={memoizedState:(ja=Na).memoizedState,baseState:ja.baseState,queue:ja.queue,baseUpdate:ja.baseUpdate,next:null};Oa=null===Oa?Da=e:Oa.next=e,Na=ja.next}return Oa}function Vt(e,t){return"function"==typeof t?t(e):t}function Zt(e){var t=Gt(),n=t.queue;if(null===n&&r("311"),0<Fa){var o=n.dispatch;if(null!==za){var i=za.get(n);if(void 0!==i){za.delete(n);var a=t.memoizedState;do{a=e(a,i.action),i=i.next}while(null!==i);return be(a,t.memoizedState)||(Za=!0),t.memoizedState=a,t.baseUpdate===n.last&&(t.baseState=a),n.eagerReducer=e,n.eagerState=a,[a,o]}}return[t.memoizedState,o]}o=n.last;var u=t.baseUpdate;if(a=t.baseState,null!==u?(null!==o&&(o.next=null),o=u.next):o=null!==o?o.next:null,null!==o){var l=i=null,c=o,s=!1;do{var p=c.expirationTime;p<ka?(s||(s=!0,l=u,i=a),p>La&&(La=p)):a=c.eagerReducer===e?c.eagerState:e(a,c.action),u=c,c=c.next}while(null!==c&&c!==o);s||(l=u,i=a),be(a,t.memoizedState)||(Za=!0),t.memoizedState=a,t.baseUpdate=l,t.baseState=i,n.eagerReducer=e,n.eagerState=a}return[t.memoizedState,n.dispatch]}function Jt(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},null===_a?(_a={lastEffect:null}).lastEffect=e.next=e:null===(t=_a.lastEffect)?_a.lastEffect=e.next=e:(n=t.next,t.next=e,e.next=n,_a.lastEffect=e),e}function Yt(e,t,n,r){var o=qt();Aa|=e,o.memoizedState=Jt(t,n,void 0,void 0===r?null:r)}function Xt(e,t,n,r){var o=Gt();r=void 0===r?null:r;var i=void 0;if(null!==ja){var a=ja.memoizedState;if(i=a.destroy,null!==r&&Ht(r,a.deps))return void Jt(ba,n,i,r)}Aa|=e,o.memoizedState=Jt(t,n,i,r)}function Qt(e,t){return"function"==typeof t?(e=e(),t(e),function(){t(null)}):null!==t&&void 0!==t?(e=e(),t.current=e,function(){t.current=null}):void 0}function Kt(){}function $t(e,t,n){25>Fa||r("301");var o=e.alternate;if(e===Pa||null!==o&&o===Pa)if(Ra=!0,e={expirationTime:ka,action:n,eagerReducer:null,eagerState:null,next:null},null===za&&(za=new Map),void 0===(n=za.get(t)))za.set(t,e);else{for(t=n;null!==t.next;)t=t.next;t.next=e}else{Qn();var i=pr(),a={expirationTime:i=rr(i,e),action:n,eagerReducer:null,eagerState:null,next:null},u=t.last;if(null===u)a.next=a;else{var l=u.next;null!==l&&(a.next=l),u.next=a}if(t.last=a,0===e.expirationTime&&(null===o||0===o.expirationTime)&&null!==(o=t.eagerReducer))try{var c=t.eagerState,s=o(c,n);if(a.eagerReducer=o,a.eagerState=s,be(s,c))return}catch(e){}ar(e,i)}}function en(e,t){var n=mt(5,null,null,0);n.elementType="DELETED",n.type="DELETED",n.stateNode=t,n.return=e,n.effectTag=8,null!==e.lastEffect?(e.lastEffect.nextEffect=n,e.lastEffect=n):e.firstEffect=e.lastEffect=n}function tn(e,t){switch(e.tag){case 5:var n=e.type;return null!==(t=1!==t.nodeType||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t)&&(e.stateNode=t,!0);case 6:return null!==(t=""===e.pendingProps||3!==t.nodeType?null:t)&&(e.stateNode=t,!0);case 13:default:return!1}}function nn(e){if(Ga){var t=qa;if(t){var n=t;if(!tn(e,t)){if(!(t=tt(n))||!tn(e,t))return e.effectTag|=2,Ga=!1,void(Ba=e);en(Ba,n)}Ba=e,qa=nt(t)}else e.effectTag|=2,Ga=!1,Ba=e}}function rn(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&18!==e.tag;)e=e.return;Ba=e}function on(e){if(e!==Ba)return!1;if(!Ga)return rn(e),Ga=!0,!1;var t=e.type;if(5!==e.tag||"head"!==t&&"body"!==t&&!et(t,e.memoizedProps))for(t=qa;t;)en(e,t),t=tt(t);return rn(e),qa=Ba?tt(e.stateNode):null,!0}function an(){qa=Ba=null,Ga=!1}function un(e,t,n,r){t.child=null===e?da(t,null,n,r):fa(t,e.child,n,r)}function ln(e,t,n,r,o){n=n.render;var i=t.ref;return xn(t,o),r=Wt(e,t,n,r,i,o),null===e||Za?(t.effectTag|=1,un(e,t,r,o),t.child):(t.updateQueue=e.updateQueue,t.effectTag&=-517,e.expirationTime<=o&&(e.expirationTime=0),vn(e,t,o))}function cn(e,t,n,r,o,i){if(null===e){var a=n.type;return"function"!=typeof a||ht(a)||void 0!==a.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=vt(n.type,null,r,null,t.mode,i)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=a,sn(e,t,a,r,o,i))}return a=e.child,o<i&&(o=a.memoizedProps,(n=null!==(n=n.compare)?n:ye)(o,r)&&e.ref===t.ref)?vn(e,t,i):(t.effectTag|=1,(e=gt(a,r)).ref=t.ref,e.return=t,t.child=e)}function sn(e,t,n,r,o,i){return null!==e&&ye(e.memoizedProps,r)&&e.ref===t.ref&&(Za=!1,o<i)?vn(e,t,i):fn(e,t,n,r,i)}function pn(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.effectTag|=128)}function fn(e,t,n,r,o){var i=at(n)?aa:oa.current;return i=it(t,i),xn(t,o),n=Wt(e,t,n,r,i,o),null===e||Za?(t.effectTag|=1,un(e,t,n,o),t.child):(t.updateQueue=e.updateQueue,t.effectTag&=-517,e.expirationTime<=o&&(e.expirationTime=0),vn(e,t,o))}function dn(e,t,n,r,o){if(at(n)){var i=!0;pt(t)}else i=!1;if(xn(t,o),null===t.stateNode)null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),jt(t,n,r),Dt(t,n,r,o),r=!0;else if(null===e){var a=t.stateNode,u=t.memoizedProps;a.props=u;var l=a.context,c=n.contextType;c="object"==typeof c&&null!==c?En(c):it(t,c=at(n)?aa:oa.current);var s=n.getDerivedStateFromProps,p="function"==typeof s||"function"==typeof a.getSnapshotBeforeUpdate;p||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(u!==r||l!==c)&&Nt(t,a,r,c),nu=!1;var f=t.memoizedState;l=a.state=f;var d=t.updateQueue;null!==d&&(Dn(t,d,r,a,o),l=t.memoizedState),u!==r||f!==l||ia.current||nu?("function"==typeof s&&(kt(t,n,s,r),l=t.memoizedState),(u=nu||Pt(t,n,u,r,f,l,c))?(p||"function"!=typeof a.UNSAFE_componentWillMount&&"function"!=typeof a.componentWillMount||("function"==typeof a.componentWillMount&&a.componentWillMount(),"function"==typeof a.UNSAFE_componentWillMount&&a.UNSAFE_componentWillMount()),"function"==typeof a.componentDidMount&&(t.effectTag|=4)):("function"==typeof a.componentDidMount&&(t.effectTag|=4),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=c,r=u):("function"==typeof a.componentDidMount&&(t.effectTag|=4),r=!1)}else a=t.stateNode,u=t.memoizedProps,a.props=t.type===t.elementType?u:Ct(t.type,u),l=a.context,c="object"==typeof(c=n.contextType)&&null!==c?En(c):it(t,c=at(n)?aa:oa.current),(p="function"==typeof(s=n.getDerivedStateFromProps)||"function"==typeof a.getSnapshotBeforeUpdate)||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(u!==r||l!==c)&&Nt(t,a,r,c),nu=!1,l=t.memoizedState,f=a.state=l,null!==(d=t.updateQueue)&&(Dn(t,d,r,a,o),f=t.memoizedState),u!==r||l!==f||ia.current||nu?("function"==typeof s&&(kt(t,n,s,r),f=t.memoizedState),(s=nu||Pt(t,n,u,r,l,f,c))?(p||"function"!=typeof a.UNSAFE_componentWillUpdate&&"function"!=typeof a.componentWillUpdate||("function"==typeof a.componentWillUpdate&&a.componentWillUpdate(r,f,c),"function"==typeof a.UNSAFE_componentWillUpdate&&a.UNSAFE_componentWillUpdate(r,f,c)),"function"==typeof a.componentDidUpdate&&(t.effectTag|=4),"function"==typeof a.getSnapshotBeforeUpdate&&(t.effectTag|=256)):("function"!=typeof a.componentDidUpdate||u===e.memoizedProps&&l===e.memoizedState||(t.effectTag|=4),"function"!=typeof a.getSnapshotBeforeUpdate||u===e.memoizedProps&&l===e.memoizedState||(t.effectTag|=256),t.memoizedProps=r,t.memoizedState=f),a.props=r,a.state=f,a.context=c,r=s):("function"!=typeof a.componentDidUpdate||u===e.memoizedProps&&l===e.memoizedState||(t.effectTag|=4),"function"!=typeof a.getSnapshotBeforeUpdate||u===e.memoizedProps&&l===e.memoizedState||(t.effectTag|=256),r=!1);return mn(e,t,n,r,i,o)}function mn(e,t,n,r,o,i){pn(e,t);var a=0!=(64&t.effectTag);if(!r&&!a)return o&&ft(t,n,!1),vn(e,t,i);r=t.stateNode,Va.current=t;var u=a&&"function"!=typeof n.getDerivedStateFromError?null:r.render();return t.effectTag|=1,null!==e&&a?(t.child=fa(t,e.child,null,i),t.child=fa(t,null,u,i)):un(e,t,u,i),t.memoizedState=r.state,o&&ft(t,n,!0),t.child}function hn(e){var t=e.stateNode;t.pendingContext?ct(0,t.pendingContext,t.pendingContext!==t.context):t.context&&ct(0,t.context,!1),At(e,t.containerInfo)}function gn(e,t,n){var r=t.mode,o=t.pendingProps,i=t.memoizedState;if(0==(64&t.effectTag)){i=null;var a=!1}else i={timedOutAt:null!==i?i.timedOutAt:0},a=!0,t.effectTag&=-65;if(null===e)if(a){var u=o.fallback;e=bt(null,r,0,null),0==(1&t.mode)&&(e.child=null!==t.memoizedState?t.child.child:t.child),r=bt(u,r,n,null),e.sibling=r,(n=e).return=r.return=t}else n=r=da(t,null,o.children,n);else null!==e.memoizedState?(u=(r=e.child).sibling,a?(n=o.fallback,o=gt(r,r.pendingProps),0==(1&t.mode)&&(a=null!==t.memoizedState?t.child.child:t.child)!==r.child&&(o.child=a),r=o.sibling=gt(u,n,u.expirationTime),n=o,o.childExpirationTime=0,n.return=r.return=t):n=r=fa(t,r.child,o.children,n)):(u=e.child,a?(a=o.fallback,(o=bt(null,r,0,null)).child=u,0==(1&t.mode)&&(o.child=null!==t.memoizedState?t.child.child:t.child),(r=o.sibling=bt(a,r,n,null)).effectTag|=2,n=o,o.childExpirationTime=0,n.return=r.return=t):r=n=fa(t,u,o.children,n)),t.stateNode=e.stateNode;return t.memoizedState=i,t.child=n,r}function vn(e,t,n){if(null!==e&&(t.contextDependencies=e.contextDependencies),t.childExpirationTime<n)return null;if(null!==e&&t.child!==e.child&&r("153"),null!==t.child){for(n=gt(e=t.child,e.pendingProps,e.expirationTime),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=gt(e,e.pendingProps,e.expirationTime)).return=t;n.sibling=null}return t.child}function bn(e,t,n){var o=t.expirationTime;if(null!==e){if(e.memoizedProps!==t.pendingProps||ia.current)Za=!0;else if(o<n){switch(Za=!1,t.tag){case 3:hn(t),an();break;case 5:zt(t);break;case 1:at(t.type)&&pt(t);break;case 4:At(t,t.stateNode.containerInfo);break;case 10:yn(t,t.memoizedProps.value);break;case 13:if(null!==t.memoizedState)return 0!==(o=t.child.childExpirationTime)&&o>=n?gn(e,t,n):null!==(t=vn(e,t,n))?t.sibling:null}return vn(e,t,n)}}else Za=!1;switch(t.expirationTime=0,t.tag){case 2:o=t.elementType,null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),e=t.pendingProps;var i=it(t,oa.current);if(xn(t,n),i=Wt(null,t,o,e,i,n),t.effectTag|=1,"object"==typeof i&&null!==i&&"function"==typeof i.render&&void 0===i.$$typeof){if(t.tag=1,Bt(),at(o)){var a=!0;pt(t)}else a=!1;t.memoizedState=null!==i.state&&void 0!==i.state?i.state:null;var u=o.getDerivedStateFromProps;"function"==typeof u&&kt(t,o,u,e),i.updater=sa,t.stateNode=i,i._reactInternalFiber=t,Dt(t,o,e,n),t=mn(null,t,o,!0,a,n)}else t.tag=0,un(null,t,i,n),t=t.child;return t;case 16:switch(i=t.elementType,null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),a=t.pendingProps,e=function(e){var t=e._result;switch(e._status){case 1:return t;case 2:case 0:throw t;default:switch(e._status=0,(t=(t=e._ctor)()).then(function(t){0===e._status&&(t=t.default,e._status=1,e._result=t)},function(t){0===e._status&&(e._status=2,e._result=t)}),e._status){case 1:return e._result;case 2:throw e._result}throw e._result=t,t}}(i),t.type=e,i=t.tag=function(e){if("function"==typeof e)return ht(e)?1:0;if(void 0!==e&&null!==e){if((e=e.$$typeof)===Wo)return 11;if(e===qo)return 14}return 2}(e),a=Ct(e,a),u=void 0,i){case 0:u=fn(null,t,e,a,n);break;case 1:u=dn(null,t,e,a,n);break;case 11:u=ln(null,t,e,a,n);break;case 14:u=cn(null,t,e,Ct(e.type,a),o,n);break;default:r("306",e,"")}return u;case 0:return o=t.type,i=t.pendingProps,fn(e,t,o,i=t.elementType===o?i:Ct(o,i),n);case 1:return o=t.type,i=t.pendingProps,dn(e,t,o,i=t.elementType===o?i:Ct(o,i),n);case 3:return hn(t),null===(o=t.updateQueue)&&r("282"),i=null!==(i=t.memoizedState)?i.element:null,Dn(t,o,t.pendingProps,null,n),(o=t.memoizedState.element)===i?(an(),t=vn(e,t,n)):(i=t.stateNode,(i=(null===e||null===e.child)&&i.hydrate)&&(qa=nt(t.stateNode.containerInfo),Ba=t,i=Ga=!0),i?(t.effectTag|=2,t.child=da(t,null,o,n)):(un(e,t,o,n),an()),t=t.child),t;case 5:return zt(t),null===e&&nn(t),o=t.type,i=t.pendingProps,a=null!==e?e.memoizedProps:null,u=i.children,et(o,i)?u=null:null!==a&&et(o,a)&&(t.effectTag|=16),pn(e,t),1!==n&&1&t.mode&&i.hidden?(t.expirationTime=t.childExpirationTime=1,t=null):(un(e,t,u,n),t=t.child),t;case 6:return null===e&&nn(t),null;case 13:return gn(e,t,n);case 4:return At(t,t.stateNode.containerInfo),o=t.pendingProps,null===e?t.child=fa(t,null,o,n):un(e,t,o,n),t.child;case 11:return o=t.type,i=t.pendingProps,ln(e,t,o,i=t.elementType===o?i:Ct(o,i),n);case 7:return un(e,t,t.pendingProps,n),t.child;case 8:case 12:return un(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(o=t.type._context,i=t.pendingProps,u=t.memoizedProps,yn(t,a=i.value),null!==u){var l=u.value;if(0==(a=be(l,a)?0:0|("function"==typeof o._calculateChangedBits?o._calculateChangedBits(l,a):1073741823))){if(u.children===i.children&&!ia.current){t=vn(e,t,n);break e}}else for(null!==(l=t.child)&&(l.return=t);null!==l;){var c=l.contextDependencies;if(null!==c){u=l.child;for(var s=c.first;null!==s;){if(s.context===o&&0!=(s.observedBits&a)){1===l.tag&&((s=Tn(n)).tag=eu,kn(l,s)),l.expirationTime<n&&(l.expirationTime=n),null!==(s=l.alternate)&&s.expirationTime<n&&(s.expirationTime=n),s=n;for(var p=l.return;null!==p;){var f=p.alternate;if(p.childExpirationTime<s)p.childExpirationTime=s,null!==f&&f.childExpirationTime<s&&(f.childExpirationTime=s);else{if(!(null!==f&&f.childExpirationTime<s))break;f.childExpirationTime=s}p=p.return}c.expirationTime<n&&(c.expirationTime=n);break}s=s.next}}else u=10===l.tag&&l.type===t.type?null:l.child;if(null!==u)u.return=l;else for(u=l;null!==u;){if(u===t){u=null;break}if(null!==(l=u.sibling)){l.return=u.return,u=l;break}u=u.return}l=u}}un(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,o=(a=t.pendingProps).children,xn(t,n),o=o(i=En(i,a.unstable_observedBits)),t.effectTag|=1,un(e,t,o,n),t.child;case 14:return a=Ct(i=t.type,t.pendingProps),cn(e,t,i,a=Ct(i.type,a),o,n);case 15:return sn(e,t,t.type,t.pendingProps,o,n);case 17:return o=t.type,i=t.pendingProps,i=t.elementType===o?i:Ct(o,i),null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),t.tag=1,at(o)?(e=!0,pt(t)):e=!1,xn(t,n),jt(t,o,i),Dt(t,o,i,n),mn(null,t,o,!0,e,n)}r("156")}function yn(e,t){var n=e.type._context;ot(Ja,n._currentValue),n._currentValue=t}function wn(e){var t=Ja.current;rt(Ja),e.type._context._currentValue=t}function xn(e,t){Ya=e,Qa=Xa=null;var n=e.contextDependencies;null!==n&&n.expirationTime>=t&&(Za=!0),e.contextDependencies=null}function En(e,t){return Qa!==e&&!1!==t&&0!==t&&("number"==typeof t&&1073741823!==t||(Qa=e,t=1073741823),t={context:e,observedBits:t,next:null},null===Xa?(null===Ya&&r("308"),Xa=t,Ya.contextDependencies={first:t,expirationTime:0}):Xa=Xa.next=t),e._currentValue}function Sn(e){return{baseState:e,firstUpdate:null,lastUpdate:null,firstCapturedUpdate:null,lastCapturedUpdate:null,firstEffect:null,lastEffect:null,firstCapturedEffect:null,lastCapturedEffect:null}}function In(e){return{baseState:e.baseState,firstUpdate:e.firstUpdate,lastUpdate:e.lastUpdate,firstCapturedUpdate:null,lastCapturedUpdate:null,firstEffect:null,lastEffect:null,firstCapturedEffect:null,lastCapturedEffect:null}}function Tn(e){return{expirationTime:e,tag:Ka,payload:null,callback:null,next:null,nextEffect:null}}function Cn(e,t){null===e.lastUpdate?e.firstUpdate=e.lastUpdate=t:(e.lastUpdate.next=t,e.lastUpdate=t)}function kn(e,t){var n=e.alternate;if(null===n){var r=e.updateQueue,o=null;null===r&&(r=e.updateQueue=Sn(e.memoizedState))}else r=e.updateQueue,o=n.updateQueue,null===r?null===o?(r=e.updateQueue=Sn(e.memoizedState),o=n.updateQueue=Sn(n.memoizedState)):r=e.updateQueue=In(o):null===o&&(o=n.updateQueue=In(r));null===o||r===o?Cn(r,t):null===r.lastUpdate||null===o.lastUpdate?(Cn(r,t),Cn(o,t)):(Cn(r,t),o.lastUpdate=t)}function Pn(e,t){var n=e.updateQueue;null===(n=null===n?e.updateQueue=Sn(e.memoizedState):jn(e,n)).lastCapturedUpdate?n.firstCapturedUpdate=n.lastCapturedUpdate=t:(n.lastCapturedUpdate.next=t,n.lastCapturedUpdate=t)}function jn(e,t){var n=e.alternate;return null!==n&&t===n.updateQueue&&(t=e.updateQueue=In(t)),t}function Nn(e,t,n,r,o,i){switch(n.tag){case $a:return"function"==typeof(e=n.payload)?e.call(i,r,o):e;case tu:e.effectTag=-2049&e.effectTag|64;case Ka:if(null===(o="function"==typeof(e=n.payload)?e.call(i,r,o):e)||void 0===o)break;return Lr({},r,o);case eu:nu=!0}return r}function Dn(e,t,n,r,o){nu=!1;for(var i=(t=jn(e,t)).baseState,a=null,u=0,l=t.firstUpdate,c=i;null!==l;){var s=l.expirationTime;s<o?(null===a&&(a=l,i=c),u<s&&(u=s)):(c=Nn(e,0,l,c,n,r),null!==l.callback&&(e.effectTag|=32,l.nextEffect=null,null===t.lastEffect?t.firstEffect=t.lastEffect=l:(t.lastEffect.nextEffect=l,t.lastEffect=l))),l=l.next}for(s=null,l=t.firstCapturedUpdate;null!==l;){var p=l.expirationTime;p<o?(null===s&&(s=l,null===a&&(i=c)),u<p&&(u=p)):(c=Nn(e,0,l,c,n,r),null!==l.callback&&(e.effectTag|=32,l.nextEffect=null,null===t.lastCapturedEffect?t.firstCapturedEffect=t.lastCapturedEffect=l:(t.lastCapturedEffect.nextEffect=l,t.lastCapturedEffect=l))),l=l.next}null===a&&(t.lastUpdate=null),null===s?t.lastCapturedUpdate=null:e.effectTag|=32,null===a&&null===s&&(i=c),t.baseState=i,t.firstUpdate=a,t.firstCapturedUpdate=s,e.expirationTime=u,e.memoizedState=c}function On(e,t,n){null!==t.firstCapturedUpdate&&(null!==t.lastUpdate&&(t.lastUpdate.next=t.firstCapturedUpdate,t.lastUpdate=t.lastCapturedUpdate),t.firstCapturedUpdate=t.lastCapturedUpdate=null),Mn(t.firstEffect,n),t.firstEffect=t.lastEffect=null,Mn(t.firstCapturedEffect,n),t.firstCapturedEffect=t.lastCapturedEffect=null}function Mn(e,t){for(;null!==e;){var n=e.callback;if(null!==n){e.callback=null;var o=t;"function"!=typeof n&&r("191",n),n.call(o)}e=e.nextEffect}}function Ln(e,t){return{value:e,source:t,stack:Y(t)}}function _n(e){e.effectTag|=4}function An(e,t){var n=t.source,r=t.stack;null===r&&null!==n&&(r=Y(n)),null!==n&&J(n.type),t=t.value,null!==e&&1===e.tag&&J(e.type);try{console.error(t)}catch(e){setTimeout(function(){throw e})}}function Rn(e){var t=e.ref;if(null!==t)if("function"==typeof t)try{t(null)}catch(t){nr(e,t)}else t.current=null}function zn(e,t,n){if(null!==(n=null!==(n=n.updateQueue)?n.lastEffect:null)){var r=n=n.next;do{if((r.tag&e)!==ba){var o=r.destroy;r.destroy=void 0,void 0!==o&&o()}(r.tag&t)!==ba&&(o=r.create,r.destroy=o()),r=r.next}while(r!==n)}}function Fn(e){switch("function"==typeof la&&la(e),e.tag){case 0:case 11:case 14:case 15:var t=e.updateQueue;if(null!==t&&null!==(t=t.lastEffect)){var n=t=t.next;do{var r=n.destroy;if(void 0!==r){var o=e;try{r()}catch(e){nr(o,e)}}n=n.next}while(n!==t)}break;case 1:if(Rn(e),"function"==typeof(t=e.stateNode).componentWillUnmount)try{t.props=e.memoizedProps,t.state=e.memoizedState,t.componentWillUnmount()}catch(t){nr(e,t)}break;case 5:Rn(e);break;case 4:Wn(e)}}function Un(e){return 5===e.tag||3===e.tag||4===e.tag}function Hn(e){e:{for(var t=e.return;null!==t;){if(Un(t)){var n=t;break e}t=t.return}r("160"),n=void 0}var o=t=void 0;switch(n.tag){case 5:t=n.stateNode,o=!1;break;case 3:case 4:t=n.stateNode.containerInfo,o=!0;break;default:r("161")}16&n.effectTag&&(Ve(t,""),n.effectTag&=-17);e:t:for(n=e;;){for(;null===n.sibling;){if(null===n.return||Un(n.return)){n=null;break e}n=n.return}for(n.sibling.return=n.return,n=n.sibling;5!==n.tag&&6!==n.tag&&18!==n.tag;){if(2&n.effectTag)continue t;if(null===n.child||4===n.tag)continue t;n.child.return=n,n=n.child}if(!(2&n.effectTag)){n=n.stateNode;break e}}for(var i=e;;){if(5===i.tag||6===i.tag)if(n)if(o){var a=t,u=i.stateNode,l=n;8===a.nodeType?a.parentNode.insertBefore(u,l):a.insertBefore(u,l)}else t.insertBefore(i.stateNode,n);else o?(u=t,l=i.stateNode,8===u.nodeType?(a=u.parentNode).insertBefore(l,u):(a=u).appendChild(l),null!==(u=u._reactRootContainer)&&void 0!==u||null!==a.onclick||(a.onclick=Ke)):t.appendChild(i.stateNode);else if(4!==i.tag&&null!==i.child){i.child.return=i,i=i.child;continue}if(i===e)break;for(;null===i.sibling;){if(null===i.return||i.return===e)return;i=i.return}i.sibling.return=i.return,i=i.sibling}}function Wn(e){for(var t=e,n=!1,o=void 0,i=void 0;;){if(!n){n=t.return;e:for(;;){switch(null===n&&r("160"),n.tag){case 5:o=n.stateNode,i=!1;break e;case 3:case 4:o=n.stateNode.containerInfo,i=!0;break e}n=n.return}n=!0}if(5===t.tag||6===t.tag){e:for(var a=t,u=a;;)if(Fn(u),null!==u.child&&4!==u.tag)u.child.return=u,u=u.child;else{if(u===a)break;for(;null===u.sibling;){if(null===u.return||u.return===a)break e;u=u.return}u.sibling.return=u.return,u=u.sibling}i?(a=o,u=t.stateNode,8===a.nodeType?a.parentNode.removeChild(u):a.removeChild(u)):o.removeChild(t.stateNode)}else if(4===t.tag){if(null!==t.child){o=t.stateNode.containerInfo,i=!0,t.child.return=t,t=t.child;continue}}else if(Fn(t),null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return;4===(t=t.return).tag&&(n=!1)}t.sibling.return=t.return,t=t.sibling}}function Bn(e,t){switch(t.tag){case 0:case 11:case 14:case 15:zn(wa,xa,t);break;case 1:break;case 5:var n=t.stateNode;if(null!=n){var o=t.memoizedProps;e=null!==e?e.memoizedProps:o;var i=t.type,a=t.updateQueue;t.updateQueue=null,null!==a&&function(e,t,n,r,o){e[eo]=o,"input"===n&&"radio"===o.type&&null!=o.name&&ne(e,o),Xe(n,r),r=Xe(n,o);for(var i=0;i<t.length;i+=2){var a=t[i],u=t[i+1];"style"===a?Je(e,u):"dangerouslySetInnerHTML"===a?Gi(e,u):"children"===a?Ve(e,u):K(e,a,u,r)}switch(n){case"input":re(e,o);break;case"textarea":We(e,o);break;case"select":t=e._wrapperState.wasMultiple,e._wrapperState.wasMultiple=!!o.multiple,null!=(n=o.value)?Fe(e,!!o.multiple,n,!1):t!==!!o.multiple&&(null!=o.defaultValue?Fe(e,!!o.multiple,o.defaultValue,!0):Fe(e,!!o.multiple,o.multiple?[]:"",!1))}}(n,a,i,e,o)}break;case 6:null===t.stateNode&&r("162"),t.stateNode.nodeValue=t.memoizedProps;break;case 3:case 12:break;case 13:if(n=t.memoizedState,o=void 0,e=t,null===n?o=!1:(o=!0,e=t.child,0===n.timedOutAt&&(n.timedOutAt=pr())),null!==e&&function(e,t){for(var n=e;;){if(5===n.tag){var r=n.stateNode;if(t)r.style.display="none";else{r=n.stateNode;var o=n.memoizedProps.style;o=void 0!==o&&null!==o&&o.hasOwnProperty("display")?o.display:null,r.style.display=Ze("display",o)}}else if(6===n.tag)n.stateNode.nodeValue=t?"":n.memoizedProps;else{if(13===n.tag&&null!==n.memoizedState){(r=n.child.sibling).return=n,n=r;continue}if(null!==n.child){n.child.return=n,n=n.child;continue}}if(n===e)break;for(;null===n.sibling;){if(null===n.return||n.return===e)return;n=n.return}n.sibling.return=n.return,n=n.sibling}}(e,o),null!==(n=t.updateQueue)){t.updateQueue=null;var u=t.stateNode;null===u&&(u=t.stateNode=new uu),n.forEach(function(e){var n=function(e,t){var n=e.stateNode;null!==n&&n.delete(t),t=rr(t=pr(),e),null!==(e=ir(e,t))&&(Et(e,t),0!==(t=e.expirationTime)&&fr(e,t))}.bind(null,t,e);u.has(e)||(u.add(e),e.then(n,n))})}break;case 17:break;default:r("163")}}function qn(e,t,n){(n=Tn(n)).tag=tu,n.payload={element:null};var r=t.value;return n.callback=function(){wr(r),An(e,t)},n}function Gn(e,t,n){(n=Tn(n)).tag=tu;var r=e.type.getDerivedStateFromError;if("function"==typeof r){var o=t.value;n.payload=function(){return r(o)}}var i=e.stateNode;return null!==i&&"function"==typeof i.componentDidCatch&&(n.callback=function(){"function"!=typeof r&&(null===Su?Su=new Set([this]):Su.add(this));var n=t.value,o=t.stack;An(e,t),this.componentDidCatch(n,{componentStack:null!==o?o:""})}),n}function Vn(e){switch(e.tag){case 1:at(e.type)&&ut();var t=e.effectTag;return 2048&t?(e.effectTag=-2049&t|64,e):null;case 3:return Rt(),lt(),0!=(64&(t=e.effectTag))&&r("285"),e.effectTag=-2049&t|64,e;case 5:return Ft(e),null;case 13:return 2048&(t=e.effectTag)?(e.effectTag=-2049&t|64,e):null;case 18:return null;case 4:return Rt(),null;case 10:return wn(e),null;default:return null}}function Zn(){if(null!==du)for(var e=du.return;null!==e;){var t=e;switch(t.tag){case 1:var n=t.type.childContextTypes;null!==n&&void 0!==n&&ut();break;case 3:Rt(),lt();break;case 5:Ft(t);break;case 4:Rt();break;case 10:wn(t)}e=e.return}mu=null,hu=0,gu=-1,vu=!1,du=null}function Jn(){for(;null!==bu;){var e=bu.effectTag;if(16&e&&Ve(bu.stateNode,""),128&e){var t=bu.alternate;null!==t&&null!==(t=t.ref)&&("function"==typeof t?t(null):t.current=null)}switch(14&e){case 2:Hn(bu),bu.effectTag&=-3;break;case 6:Hn(bu),bu.effectTag&=-3,Bn(bu.alternate,bu);break;case 4:Bn(bu.alternate,bu);break;case 8:Wn(e=bu),e.return=null,e.child=null,e.memoizedState=null,e.updateQueue=null,null!==(e=e.alternate)&&(e.return=null,e.child=null,e.memoizedState=null,e.updateQueue=null)}bu=bu.nextEffect}}function Yn(){for(;null!==bu;){if(256&bu.effectTag)e:{var e=bu.alternate,t=bu;switch(t.tag){case 0:case 11:case 15:zn(ya,ba,t);break e;case 1:if(256&t.effectTag&&null!==e){var n=e.memoizedProps,o=e.memoizedState;t=(e=t.stateNode).getSnapshotBeforeUpdate(t.elementType===t.type?n:Ct(t.type,n),o),e.__reactInternalSnapshotBeforeUpdate=t}break e;case 3:case 5:case 6:case 4:case 17:break e;default:r("163")}}bu=bu.nextEffect}}function Xn(e,t){for(;null!==bu;){var n=bu.effectTag;if(36&n){var o=bu.alternate,i=bu,a=t;switch(i.tag){case 0:case 11:case 15:zn(Ea,Sa,i);break;case 1:var u=i.stateNode;if(4&i.effectTag)if(null===o)u.componentDidMount();else{var l=i.elementType===i.type?o.memoizedProps:Ct(i.type,o.memoizedProps);u.componentDidUpdate(l,o.memoizedState,u.__reactInternalSnapshotBeforeUpdate)}null!==(o=i.updateQueue)&&On(0,o,u);break;case 3:if(null!==(o=i.updateQueue)){if(u=null,null!==i.child)switch(i.child.tag){case 5:u=i.child.stateNode;break;case 1:u=i.child.stateNode}On(0,o,u)}break;case 5:a=i.stateNode,null===o&&4&i.effectTag&&$e(i.type,i.memoizedProps)&&a.focus();break;case 6:case 4:case 12:case 13:case 17:break;default:r("163")}}128&n&&null!==(i=bu.ref)&&(a=bu.stateNode,"function"==typeof i?i(a):i.current=a),512&n&&(wu=e),bu=bu.nextEffect}}function Qn(){null!==xu&&ea(xu),null!==Eu&&Eu()}function Kn(e,t){yu=fu=!0,e.current===t&&r("177");var n=e.pendingCommitExpirationTime;0===n&&r("261"),e.pendingCommitExpirationTime=0;var o=t.expirationTime,i=t.childExpirationTime;for((function(e,t){if(e.didError=!1,0===t)e.earliestPendingTime=0,e.latestPendingTime=0,e.earliestSuspendedTime=0,e.latestSuspendedTime=0,e.latestPingedTime=0;else{t<e.latestPingedTime&&(e.latestPingedTime=0);var n=e.latestPendingTime;0!==n&&(n>t?e.earliestPendingTime=e.latestPendingTime=0:e.earliestPendingTime>t&&(e.earliestPendingTime=e.latestPendingTime)),0===(n=e.earliestSuspendedTime)?Et(e,t):t<e.latestSuspendedTime?(e.earliestSuspendedTime=0,e.latestSuspendedTime=0,e.latestPingedTime=0,Et(e,t)):t>n&&Et(e,t)}Tt(0,e)}(e,i>o?i:o),su.current=null,o=void 0,1<t.effectTag?null!==t.lastEffect?(t.lastEffect.nextEffect=t,o=t.firstEffect):o=t:o=t.firstEffect,Yi=Di,Xi=function(){var e=Le();if(_e(e)){if("selectionStart"in e)var t={start:e.selectionStart,end:e.selectionEnd};else e:{var n=(t=(t=e.ownerDocument)&&t.defaultView||window).getSelection&&t.getSelection();if(n&&0!==n.rangeCount){t=n.anchorNode;var r=n.anchorOffset,o=n.focusNode;n=n.focusOffset;try{t.nodeType,o.nodeType}catch(e){t=null;break e}var i=0,a=-1,u=-1,l=0,c=0,s=e,p=null;t:for(;;){for(var f;s!==t||0!==r&&3!==s.nodeType||(a=i+r),s!==o||0!==n&&3!==s.nodeType||(u=i+n),3===s.nodeType&&(i+=s.nodeValue.length),null!==(f=s.firstChild);)p=s,s=f;for(;;){if(s===e)break t;if(p===t&&++l===r&&(a=i),p===o&&++c===n&&(u=i),null!==(f=s.nextSibling))break;p=(s=p).parentNode}s=f}t=-1===a||-1===u?null:{start:a,end:u}}else t=null}t=t||{start:0,end:0}}else t=null;return{focusedElem:e,selectionRange:t}}(),Di=!1,bu=o);null!==bu;){i=!1;var a=void 0;try{Yn()}catch(e){i=!0,a=e}i&&(null===bu&&r("178"),nr(bu,a),null!==bu&&(bu=bu.nextEffect))}for(bu=o;null!==bu;){i=!1,a=void 0;try{Jn()}catch(e){i=!0,a=e}i&&(null===bu&&r("178"),nr(bu,a),null!==bu&&(bu=bu.nextEffect))}for(Ae(Xi),Xi=null,Di=!!Yi,Yi=null,e.current=t,bu=o;null!==bu;){i=!1,a=void 0;try{Xn(e,n)}catch(e){i=!0,a=e}i&&(null===bu&&r("178"),nr(bu,a),null!==bu&&(bu=bu.nextEffect))}if(null!==o&&null!==wu){var u=function(e,t){Eu=xu=wu=null;var n=Pu;Pu=!0;do{if(512&t.effectTag){var r=!1,o=void 0;try{var i=t;zn(Ta,ba,i),zn(ba,Ia,i)}catch(e){r=!0,o=e}r&&nr(t,o)}t=t.nextEffect}while(null!==t);Pu=n,0!==(n=e.expirationTime)&&fr(e,n),Lu||Pu||gr(1073741823,!1)}.bind(null,e,o);xu=_r.unstable_runWithPriority(_r.unstable_NormalPriority,function(){return $i(u)}),Eu=u}fu=yu=!1,"function"==typeof ua&&ua(t.stateNode),n=t.expirationTime,0===(t=(t=t.childExpirationTime)>n?t:n)&&(Su=null),function(e,t){e.expirationTime=t,e.finishedWork=null}(e,t)}function $n(e){for(;;){var t=e.alternate,n=e.return,o=e.sibling;if(0==(1024&e.effectTag)){du=e;e:{var i=t,a=hu,u=(t=e).pendingProps;switch(t.tag){case 2:case 16:break;case 15:case 0:break;case 1:at(t.type)&&ut();break;case 3:Rt(),lt(),(u=t.stateNode).pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(null===i||null===i.child)&&(on(t),t.effectTag&=-3),ou(t);break;case 5:Ft(t);var l=_t(va.current);if(a=t.type,null!==i&&null!=t.stateNode)iu(i,t,a,u,l),i.ref!==t.ref&&(t.effectTag|=128);else if(u){var c=_t(ha.current);if(on(t)){i=(u=t).stateNode;var s=u.type,p=u.memoizedProps,f=l;switch(i[$r]=u,i[eo]=p,a=void 0,l=s){case"iframe":case"object":Ce("load",i);break;case"video":case"audio":for(s=0;s<co.length;s++)Ce(co[s],i);break;case"source":Ce("error",i);break;case"img":case"image":case"link":Ce("error",i),Ce("load",i);break;case"form":Ce("reset",i),Ce("submit",i);break;case"details":Ce("toggle",i);break;case"input":te(i,p),Ce("invalid",i),Qe(f,"onChange");break;case"select":i._wrapperState={wasMultiple:!!p.multiple},Ce("invalid",i),Qe(f,"onChange");break;case"textarea":He(i,p),Ce("invalid",i),Qe(f,"onChange")}for(a in Ye(l,p),s=null,p)p.hasOwnProperty(a)&&(c=p[a],"children"===a?"string"==typeof c?i.textContent!==c&&(s=["children",c]):"number"==typeof c&&i.textContent!==""+c&&(s=["children",""+c]):Gr.hasOwnProperty(a)&&null!=c&&Qe(f,a));switch(l){case"input":G(i),oe(i,p,!0);break;case"textarea":G(i),Be(i);break;case"select":case"option":break;default:"function"==typeof p.onClick&&(i.onclick=Ke)}a=s,u.updateQueue=a,(u=null!==a)&&_n(t)}else{p=t,i=a,f=u,s=9===l.nodeType?l:l.ownerDocument,c===Bi.html&&(c=qe(i)),c===Bi.html?"script"===i?((i=s.createElement("div")).innerHTML="<script><\/script>",s=i.removeChild(i.firstChild)):"string"==typeof f.is?s=s.createElement(i,{is:f.is}):(s=s.createElement(i),"select"===i&&f.multiple&&(s.multiple=!0)):s=s.createElementNS(c,i),(i=s)[$r]=p,i[eo]=u,ru(i,t,!1,!1),f=i;var d=l,m=Xe(s=a,p=u);switch(s){case"iframe":case"object":Ce("load",f),l=p;break;case"video":case"audio":for(l=0;l<co.length;l++)Ce(co[l],f);l=p;break;case"source":Ce("error",f),l=p;break;case"img":case"image":case"link":Ce("error",f),Ce("load",f),l=p;break;case"form":Ce("reset",f),Ce("submit",f),l=p;break;case"details":Ce("toggle",f),l=p;break;case"input":te(f,p),l=ee(f,p),Ce("invalid",f),Qe(d,"onChange");break;case"option":l=ze(f,p);break;case"select":f._wrapperState={wasMultiple:!!p.multiple},l=Lr({},p,{value:void 0}),Ce("invalid",f),Qe(d,"onChange");break;case"textarea":He(f,p),l=Ue(f,p),Ce("invalid",f),Qe(d,"onChange");break;default:l=p}Ye(s,l),c=void 0;var h=s,g=f,v=l;for(c in v)if(v.hasOwnProperty(c)){var b=v[c];"style"===c?Je(g,b):"dangerouslySetInnerHTML"===c?null!=(b=b?b.__html:void 0)&&Gi(g,b):"children"===c?"string"==typeof b?("textarea"!==h||""!==b)&&Ve(g,b):"number"==typeof b&&Ve(g,""+b):"suppressContentEditableWarning"!==c&&"suppressHydrationWarning"!==c&&"autoFocus"!==c&&(Gr.hasOwnProperty(c)?null!=b&&Qe(d,c):null!=b&&K(g,c,b,m))}switch(s){case"input":G(f),oe(f,p,!1);break;case"textarea":G(f),Be(f);break;case"option":null!=p.value&&f.setAttribute("value",""+$(p.value));break;case"select":(l=f).multiple=!!p.multiple,null!=(f=p.value)?Fe(l,!!p.multiple,f,!1):null!=p.defaultValue&&Fe(l,!!p.multiple,p.defaultValue,!0);break;default:"function"==typeof l.onClick&&(f.onclick=Ke)}(u=$e(a,u))&&_n(t),t.stateNode=i}null!==t.ref&&(t.effectTag|=128)}else null===t.stateNode&&r("166");break;case 6:i&&null!=t.stateNode?au(i,t,i.memoizedProps,u):("string"!=typeof u&&null===t.stateNode&&r("166"),i=_t(va.current),_t(ha.current),on(t)?(a=(u=t).stateNode,i=u.memoizedProps,a[$r]=u,(u=a.nodeValue!==i)&&_n(t)):(a=t,(u=(9===i.nodeType?i:i.ownerDocument).createTextNode(u))[$r]=t,a.stateNode=u));break;case 11:break;case 13:if(u=t.memoizedState,0!=(64&t.effectTag)){t.expirationTime=a,du=t;break e}u=null!==u,a=null!==i&&null!==i.memoizedState,null!==i&&!u&&a&&null!==(i=i.child.sibling)&&(null!==(l=t.firstEffect)?(t.firstEffect=i,i.nextEffect=l):(t.firstEffect=t.lastEffect=i,i.nextEffect=null),i.effectTag=8),(u||a)&&(t.effectTag|=4);break;case 7:case 8:case 12:break;case 4:Rt(),ou(t);break;case 10:wn(t);break;case 9:case 14:break;case 17:at(t.type)&&ut();break;case 18:break;default:r("156")}du=null}if(t=e,1===hu||1!==t.childExpirationTime){for(u=0,a=t.child;null!==a;)i=a.expirationTime,l=a.childExpirationTime,i>u&&(u=i),l>u&&(u=l),a=a.sibling;t.childExpirationTime=u}if(null!==du)return du;null!==n&&0==(1024&n.effectTag)&&(null===n.firstEffect&&(n.firstEffect=e.firstEffect),null!==e.lastEffect&&(null!==n.lastEffect&&(n.lastEffect.nextEffect=e.firstEffect),n.lastEffect=e.lastEffect),1<e.effectTag&&(null!==n.lastEffect?n.lastEffect.nextEffect=e:n.firstEffect=e,n.lastEffect=e))}else{if(null!==(e=Vn(e)))return e.effectTag&=1023,e;null!==n&&(n.firstEffect=n.lastEffect=null,n.effectTag|=1024)}if(null!==o)return o;if(null===n)break;e=n}return null}function er(e){var t=bn(e.alternate,e,hu);return e.memoizedProps=e.pendingProps,null===t&&(t=$n(e)),su.current=null,t}function tr(e,t){fu&&r("243"),Qn(),fu=!0;var n=cu.current;cu.current=Ua;var o=e.nextExpirationTimeToWorkOn;o===hu&&e===mu&&null!==du||(Zn(),hu=o,du=gt((mu=e).current,null),e.pendingCommitExpirationTime=0);for(var i=!1;;){try{if(t)for(;null!==du&&!mr();)du=er(du);else for(;null!==du;)du=er(du)}catch(t){if(Qa=Xa=Ya=null,Bt(),null===du)i=!0,wr(t);else{null===du&&r("271");var a=du,u=a.return;if(null!==u){e:{var l=e,c=u,s=a,p=t;if(u=hu,s.effectTag|=1024,s.firstEffect=s.lastEffect=null,null!==p&&"object"==typeof p&&"function"==typeof p.then){var f=p;p=c;var d=-1,m=-1;do{if(13===p.tag){var h=p.alternate;if(null!==h&&null!==(h=h.memoizedState)){m=10*(1073741822-h.timedOutAt);break}"number"==typeof(h=p.pendingProps.maxDuration)&&(0>=h?d=0:(-1===d||h<d)&&(d=h))}p=p.return}while(null!==p);p=c;do{if((h=13===p.tag)&&(h=void 0!==p.memoizedProps.fallback&&null===p.memoizedState),h){if(null===(c=p.updateQueue)?((c=new Set).add(f),p.updateQueue=c):c.add(f),0==(1&p.mode)){p.effectTag|=64,s.effectTag&=-1957,1===s.tag&&(null===s.alternate?s.tag=17:((u=Tn(1073741823)).tag=eu,kn(s,u))),s.expirationTime=1073741823;break e}c=u;var g=(s=l).pingCache;null===g?(g=s.pingCache=new lu,h=new Set,g.set(f,h)):void 0===(h=g.get(f))&&(h=new Set,g.set(f,h)),h.has(c)||(h.add(c),s=or.bind(null,s,f,c),f.then(s,s)),-1===d?l=1073741823:(-1===m&&(m=10*(1073741822-It(l,u))-5e3),l=m+d),0<=l&&gu<l&&(gu=l),p.effectTag|=2048,p.expirationTime=u;break e}p=p.return}while(null!==p);p=Error((J(s.type)||"A React component")+" suspended while rendering, but no fallback UI was specified.\n\nAdd a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display."+Y(s))}vu=!0,p=Ln(p,s),l=c;do{switch(l.tag){case 3:l.effectTag|=2048,l.expirationTime=u,Pn(l,u=qn(l,p,u));break e;case 1:if(d=p,m=l.type,s=l.stateNode,0==(64&l.effectTag)&&("function"==typeof m.getDerivedStateFromError||null!==s&&"function"==typeof s.componentDidCatch&&(null===Su||!Su.has(s)))){l.effectTag|=2048,l.expirationTime=u,Pn(l,u=Gn(l,d,u));break e}}l=l.return}while(null!==l)}du=$n(a);continue}i=!0,wr(t)}}break}if(fu=!1,cu.current=n,Qa=Xa=Ya=null,Bt(),i)mu=null,e.finishedWork=null;else if(null!==du)e.finishedWork=null;else{if(null===(n=e.current.alternate)&&r("281"),mu=null,vu){if(i=e.latestPendingTime,a=e.latestSuspendedTime,u=e.latestPingedTime,0!==i&&i<o||0!==a&&a<o||0!==u&&u<o)return St(e,o),void sr(e,n,o,e.expirationTime,-1);if(!e.didError&&t)return e.didError=!0,o=e.nextExpirationTimeToWorkOn=o,t=e.expirationTime=1073741823,void sr(e,n,o,t,-1)}t&&-1!==gu?(St(e,o),(t=10*(1073741822-It(e,o)))<gu&&(gu=t),t=10*(1073741822-pr()),t=gu-t,sr(e,n,o,e.expirationTime,0>t?0:t)):(e.pendingCommitExpirationTime=o,e.finishedWork=n)}}function nr(e,t){for(var n=e.return;null!==n;){switch(n.tag){case 1:var r=n.stateNode;if("function"==typeof n.type.getDerivedStateFromError||"function"==typeof r.componentDidCatch&&(null===Su||!Su.has(r)))return kn(n,e=Gn(n,e=Ln(t,e),1073741823)),void ar(n,1073741823);break;case 3:return kn(n,e=qn(n,e=Ln(t,e),1073741823)),void ar(n,1073741823)}n=n.return}3===e.tag&&(kn(e,n=qn(e,n=Ln(t,e),1073741823)),ar(e,1073741823))}function rr(e,t){var n=_r.unstable_getCurrentPriorityLevel(),o=void 0;if(0==(1&t.mode))o=1073741823;else if(fu&&!yu)o=hu;else{switch(n){case _r.unstable_ImmediatePriority:o=1073741823;break;case _r.unstable_UserBlockingPriority:o=1073741822-10*(1+((1073741822-e+15)/10|0));break;case _r.unstable_NormalPriority:o=1073741822-25*(1+((1073741822-e+500)/25|0));break;case _r.unstable_LowPriority:case _r.unstable_IdlePriority:o=1;break;default:r("313")}null!==mu&&o===hu&&--o}return n===_r.unstable_UserBlockingPriority&&(0===Du||o<Du)&&(Du=o),o}function or(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),null!==mu&&hu===n?mu=null:(t=e.earliestSuspendedTime,r=e.latestSuspendedTime,0!==t&&n<=t&&n>=r&&(e.didError=!1,(0===(t=e.latestPingedTime)||t>n)&&(e.latestPingedTime=n),Tt(n,e),0!==(n=e.expirationTime)&&fr(e,n)))}function ir(e,t){e.expirationTime<t&&(e.expirationTime=t);var n=e.alternate;null!==n&&n.expirationTime<t&&(n.expirationTime=t);var r=e.return,o=null;if(null===r&&3===e.tag)o=e.stateNode;else for(;null!==r;){if(n=r.alternate,r.childExpirationTime<t&&(r.childExpirationTime=t),null!==n&&n.childExpirationTime<t&&(n.childExpirationTime=t),null===r.return&&3===r.tag){o=r.stateNode;break}r=r.return}return o}function ar(e,t){null!==(e=ir(e,t))&&(!fu&&0!==hu&&t>hu&&Zn(),Et(e,t),fu&&!yu&&mu===e||fr(e,e.expirationTime),Hu>Uu&&(Hu=0,r("185")))}function ur(e,t,n,r,o){return _r.unstable_runWithPriority(_r.unstable_ImmediatePriority,function(){return e(t,n,r,o)})}function lr(){zu=1073741822-((_r.unstable_now()-Ru)/10|0)}function cr(e,t){if(0!==Cu){if(t<Cu)return;null!==ku&&_r.unstable_cancelCallback(ku)}Cu=t,e=_r.unstable_now()-Ru,ku=_r.unstable_scheduleCallback(hr,{timeout:10*(1073741822-t)-e})}function sr(e,t,n,r,o){e.expirationTime=r,0!==o||mr()?0<o&&(e.timeoutHandle=Qi(function(e,t,n){e.pendingCommitExpirationTime=n,e.finishedWork=t,lr(),Fu=zu,vr(e,n)}.bind(null,e,t,n),o)):(e.pendingCommitExpirationTime=n,e.finishedWork=t)}function pr(){return Pu?Fu:(dr(),(0===Nu||1===Nu)&&(lr(),Fu=zu),Fu)}function fr(e,t){null===e.nextScheduledRoot?(e.expirationTime=t,null===Tu?(Iu=Tu=e,e.nextScheduledRoot=e):(Tu=Tu.nextScheduledRoot=e).nextScheduledRoot=Iu):t>e.expirationTime&&(e.expirationTime=t),Pu||(Lu?_u&&(ju=e,Nu=1073741823,br(e,1073741823,!1)):1073741823===t?gr(1073741823,!1):cr(e,t))}function dr(){var e=0,t=null;if(null!==Tu)for(var n=Tu,o=Iu;null!==o;){var i=o.expirationTime;if(0===i){if((null===n||null===Tu)&&r("244"),o===o.nextScheduledRoot){Iu=Tu=o.nextScheduledRoot=null;break}if(o===Iu)Iu=i=o.nextScheduledRoot,Tu.nextScheduledRoot=i,o.nextScheduledRoot=null;else{if(o===Tu){(Tu=n).nextScheduledRoot=Iu,o.nextScheduledRoot=null;break}n.nextScheduledRoot=o.nextScheduledRoot,o.nextScheduledRoot=null}o=n.nextScheduledRoot}else{if(i>e&&(e=i,t=o),o===Tu)break;if(1073741823===e)break;n=o,o=o.nextScheduledRoot}}ju=t,Nu=e}function mr(){return!!Bu||!!_r.unstable_shouldYield()&&(Bu=!0)}function hr(){try{if(!mr()&&null!==Iu){lr();var e=Iu;do{var t=e.expirationTime;0!==t&&zu<=t&&(e.nextExpirationTimeToWorkOn=zu),e=e.nextScheduledRoot}while(e!==Iu)}gr(0,!0)}finally{Bu=!1}}function gr(e,t){if(dr(),t)for(lr(),Fu=zu;null!==ju&&0!==Nu&&e<=Nu&&!(Bu&&zu>Nu);)br(ju,Nu,zu>Nu),dr(),lr(),Fu=zu;else for(;null!==ju&&0!==Nu&&e<=Nu;)br(ju,Nu,!1),dr();if(t&&(Cu=0,ku=null),0!==Nu&&cr(ju,Nu),Hu=0,Wu=null,null!==Au)for(e=Au,Au=null,t=0;t<e.length;t++){var n=e[t];try{n._onComplete()}catch(e){Ou||(Ou=!0,Mu=e)}}if(Ou)throw e=Mu,Mu=null,Ou=!1,e}function vr(e,t){Pu&&r("253"),ju=e,Nu=t,br(e,t,!1),gr(1073741823,!1)}function br(e,t,n){if(Pu&&r("245"),Pu=!0,n){var o=e.finishedWork;null!==o?yr(e,o,t):(e.finishedWork=null,-1!==(o=e.timeoutHandle)&&(e.timeoutHandle=-1,Ki(o)),tr(e,n),null!==(o=e.finishedWork)&&(mr()?e.finishedWork=o:yr(e,o,t)))}else null!==(o=e.finishedWork)?yr(e,o,t):(e.finishedWork=null,-1!==(o=e.timeoutHandle)&&(e.timeoutHandle=-1,Ki(o)),tr(e,n),null!==(o=e.finishedWork)&&yr(e,o,t));Pu=!1}function yr(e,t,n){var r=e.firstBatch;if(null!==r&&r._expirationTime>=n&&(null===Au?Au=[r]:Au.push(r),r._defer))return e.finishedWork=t,void(e.expirationTime=0);e.finishedWork=null,e===Wu?Hu++:(Wu=e,Hu=0),_r.unstable_runWithPriority(_r.unstable_ImmediatePriority,function(){Kn(e,t)})}function wr(e){null===ju&&r("246"),ju.expirationTime=0,Ou||(Ou=!0,Mu=e)}function xr(e,t){var n=Lu;Lu=!0;try{return e(t)}finally{(Lu=n)||Pu||gr(1073741823,!1)}}function Er(e,t){if(Lu&&!_u){_u=!0;try{return e(t)}finally{_u=!1}}return e(t)}function Sr(e,t,n){Lu||Pu||0===Du||(gr(Du,!1),Du=0);var r=Lu;Lu=!0;try{return _r.unstable_runWithPriority(_r.unstable_UserBlockingPriority,function(){return e(t,n)})}finally{(Lu=r)||Pu||gr(1073741823,!1)}}function Ir(e,t,n,o,i){var a=t.current;e:if(n){n=n._reactInternalFiber;t:{2===we(n)&&1===n.tag||r("170");var u=n;do{switch(u.tag){case 3:u=u.stateNode.context;break t;case 1:if(at(u.type)){u=u.stateNode.__reactInternalMemoizedMergedChildContext;break t}}u=u.return}while(null!==u);r("171"),u=void 0}if(1===n.tag){var l=n.type;if(at(l)){n=st(n,l,u);break e}}n=u}else n=ra;return null===t.context?t.context=n:t.pendingContext=n,t=i,(i=Tn(o)).payload={element:e},null!==(t=void 0===t?null:t)&&(i.callback=t),Qn(),kn(a,i),ar(a,o),o}function Tr(e,t,n,r){var o=t.current;return Ir(e,t,n,o=rr(pr(),o),r)}function Cr(e){if(!(e=e.current).child)return null;switch(e.child.tag){case 5:default:return e.child.stateNode}}function kr(e){var t=1073741822-25*(1+((1073741822-pr()+500)/25|0));t>=pu&&(t=pu-1),this._expirationTime=pu=t,this._root=e,this._callbacks=this._next=null,this._hasChildren=this._didComplete=!1,this._children=null,this._defer=!0}function Pr(){this._callbacks=null,this._didCommit=!1,this._onCommit=this._onCommit.bind(this)}function jr(e,t,n){e={current:t=mt(3,null,null,t?3:0),containerInfo:e,pendingChildren:null,pingCache:null,earliestPendingTime:0,latestPendingTime:0,earliestSuspendedTime:0,latestSuspendedTime:0,latestPingedTime:0,didError:!1,pendingCommitExpirationTime:0,finishedWork:null,timeoutHandle:-1,context:null,pendingContext:null,hydrate:n,nextExpirationTimeToWorkOn:0,expirationTime:0,firstBatch:null,nextScheduledRoot:null},this._internalRoot=t.stateNode=e}function Nr(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function Dr(e,t,n,r,o){var i=n._reactRootContainer;if(i){if("function"==typeof o){var a=o;o=function(){var e=Cr(i._internalRoot);a.call(e)}}null!=e?i.legacy_renderSubtreeIntoContainer(e,t,o):i.render(t,o)}else{if(i=n._reactRootContainer=function(e,t){if(t||(t=!(!(t=e?9===e.nodeType?e.documentElement:e.firstChild:null)||1!==t.nodeType||!t.hasAttribute("data-reactroot"))),!t)for(var n;n=e.lastChild;)e.removeChild(n);return new jr(e,!1,t)}(n,r),"function"==typeof o){var u=o;o=function(){var e=Cr(i._internalRoot);u.call(e)}}Er(function(){null!=e?i.legacy_renderSubtreeIntoContainer(e,t,o):i.render(t,o)})}return Cr(i._internalRoot)}function Or(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;return Nr(t)||r("200"),function(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:_o,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}}(e,t,null,n)}/** @license React v16.8.4
|
17 |
* react-dom.production.min.js
|
18 |
*
|
19 |
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
20 |
*
|
21 |
* This source code is licensed under the MIT license found in the
|
22 |
* LICENSE file in the root directory of this source tree.
|
23 |
*/
|
|