Version Description
Download this release
Release Info
Developer | cgastrell |
Plugin | Crowdsignal Forms |
Version | 1.2.0 |
Comparing to | |
See all releases |
Code changes from version 1.1.1 to 1.2.0
- README.TXT +52 -35
- build/editor.asset.php +1 -1
- build/editor.css +1 -1
- build/editor.js +522 -19
- build/poll.asset.php +1 -1
- build/poll.css +1 -1
- build/poll.js +15 -3
- build/vote.asset.php +1 -0
- build/vote.css +1 -0
- build/vote.js +1023 -0
- changelog.txt +51 -0
- crowdsignal-forms.php +2 -2
- includes/admin/admin-styles.css +36 -2
- includes/admin/class-crowdsignal-forms-notice-icon.php +61 -0
- includes/admin/class-crowdsignal-forms-settings.php +6 -2
- includes/admin/class-crowdsignal-forms-setup.php +18 -1
- includes/admin/views/html-admin-setup-header.php +25 -5
- includes/admin/views/html-admin-setup-step-2.php +9 -1
- includes/class-crowdsignal-forms.php +19 -0
- includes/frontend/blocks/class-crowdsignal-forms-poll-block.php +9 -62
- includes/frontend/blocks/class-crowdsignal-forms-vote-block.php +145 -0
- includes/frontend/blocks/class-crowdsignal-forms-vote-item-block.php +100 -0
- includes/frontend/class-crowdsignal-forms-block.php +84 -4
- includes/frontend/class-crowdsignal-forms-blocks.php +2 -0
- includes/models/class-poll-settings.php +3 -3
- includes/models/class-poll.php +70 -2
- includes/synchronization/class-comment-sync-entity.php +4 -1
- includes/synchronization/class-poll-block-synchronizer.php +22 -2
- includes/synchronization/class-post-sync-entity.php +4 -1
- languages/crowdsignal-forms.pot +18 -21
README.TXT
CHANGED
@@ -4,7 +4,7 @@ Tags: polls, forms, surveys, gutenberg, block
|
|
4 |
Requires at least: 5.0
|
5 |
Requires PHP: 5.6.20
|
6 |
Tested up to: 5.4.2
|
7 |
-
Stable tag: 1.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -66,44 +66,61 @@ Compare our [simple and affordable plans](https://crowdsignal.com/pricing/) or t
|
|
66 |
4. Use the poll block inside of other blocks
|
67 |
|
68 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
69 |
= 1.1.1 =
|
70 |
* Don't Request User Code on Save if there is nothing to save
|
71 |
* Skip the setup screen if a user code is saved
|
72 |
|
73 |
-
= 1.1.0 =
|
74 |
-
* Implement a poll width setting
|
75 |
-
* fix method used when updating poll ids in post meta
|
76 |
-
* Fix archiving of poll blocks in comments
|
77 |
-
* Address the comments from the p2tenberg compatibility pr
|
78 |
-
* P2tenberg: Get The Edit Bar To Display in p2tenberg
|
79 |
-
* keep button placeholder on focus of button answers for a less jarring editing experience
|
80 |
-
* P2tenberg compatibility
|
81 |
-
* Change radio/checkbox fill colour to text colour
|
82 |
-
* Add release preparation script
|
83 |
-
* Add Button Answer Type (with actual buttons)
|
84 |
-
* Add a link for crowdsignal.com In Sidebar for an Unpublished Poll
|
85 |
-
* remove ios styling from submit button
|
86 |
-
* Move asset definitions to the `block` class to simplify adding new blocks
|
87 |
-
* update branches that travis will build
|
88 |
-
* Add wp-editor dependency
|
89 |
-
|
90 |
-
= 1.0 =
|
91 |
-
* Update default sidebar status
|
92 |
-
* Increase Default Poll Margins
|
93 |
-
* Test suite for admin hooks
|
94 |
-
* Copy text reviews
|
95 |
-
* Added support for loading curated list of google fonts
|
96 |
-
* Normalize "thanks you" message
|
97 |
-
* Fix display of "thank you" message (custom and default) on dark backgrounds
|
98 |
-
* Add Separate Question and Body Font Family fallbacks
|
99 |
-
* Fix styles on wp-admin not honoring margins
|
100 |
-
* Fix submit button styling for themes with very specific selectors (ex TwentyNineteen theme)
|
101 |
-
* Add Unverified Account Check
|
102 |
-
* Code cleanup
|
103 |
-
* Update translations
|
104 |
-
|
105 |
-
= 0.9 =
|
106 |
-
* Initial release
|
107 |
|
108 |
== Upgrade Notice ==
|
109 |
|
4 |
Requires at least: 5.0
|
5 |
Requires PHP: 5.6.20
|
6 |
Tested up to: 5.4.2
|
7 |
+
Stable tag: 1.2.0
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
66 |
4. Use the poll block inside of other blocks
|
67 |
|
68 |
== Changelog ==
|
69 |
+
= 1.2.0 =
|
70 |
+
* Add next-version-number placeholder for docblocks (#307)
|
71 |
+
* Show current account info on API key selection screen (#317)
|
72 |
+
* Vote Block: Handle User Colour On Hover (#312)
|
73 |
+
* refactor common code for poll based blocks (#311)
|
74 |
+
* set mappings for missing meta values (#309)
|
75 |
+
* Set a visible closed state (#301)
|
76 |
+
* Set a numbered default title (#304)
|
77 |
+
* Set vote count font to standard font, not based on theme (#300)
|
78 |
+
* Add checkmark icon to size dropdown so it is obvious what state you are in (#298)
|
79 |
+
* Fix empty brand link height (#294)
|
80 |
+
* conditionally call results endpoint if results are hidden (#293)
|
81 |
+
* leave focus on parent when vote block is inserted (#299)
|
82 |
+
* make styles a little more specific to overcome hostile themes (#297)
|
83 |
+
* allow gutenberg hover colour to work with custom toolbar icons (#296)
|
84 |
+
* refactor how up/down icons are decided on to cleanup addition of `className` property (#295)
|
85 |
+
* prevent icon height from changing when vote count is hidden (#291)
|
86 |
+
* Refactor Poll duplicate checker, add to vote block (#290)
|
87 |
+
* Update Vote block classnames to match Poll classname pattern (#289)
|
88 |
+
* only parse child elements that match the blocks we support (#288)
|
89 |
+
* Update the vote icons (#286)
|
90 |
+
* Auto detect theme colours (#285)
|
91 |
+
* Vote Item custom colours options (#283)
|
92 |
+
* refactored toolbar to use Toolbar instead of ToolbarButton for backwards compatibility (#281)
|
93 |
+
* Fixes for PropTypes on VoteItem (#280)
|
94 |
+
* Add a hideResults setting for the vote block (#279)
|
95 |
+
* Display Crowdsignal branding after voting (#276)
|
96 |
+
* Add toolbar button to change border size and radius (#273)
|
97 |
+
* Add voting animations (#274)
|
98 |
+
* Format large vote count numbers (#272)
|
99 |
+
* Add ability to change voting block size (#269)
|
100 |
+
* Fix indention of lines
|
101 |
+
* Cleaning up code, copying, and adding variables.
|
102 |
+
* Fix linting errors and remove unused constants
|
103 |
+
* Add "Open/Close" status to sidebar for vote block
|
104 |
+
* Add/show results on vote component (#259)
|
105 |
+
* Fix Default Title not syncing to platform (#253)
|
106 |
+
* Enable voting on the vote block (#251)
|
107 |
+
* Build The Public Vote Component (#249)
|
108 |
+
* Create poll model from vote block (#250)
|
109 |
+
* Consolidate Custom Mutation Observers Into Library Function (#244)
|
110 |
+
* Use Connect Placeholder For All Blocks (#247)
|
111 |
+
* change Block interface into abstract class, move common helpers there. (#243)
|
112 |
+
* Vote sidebar (#245)
|
113 |
+
* Add Crowdsignal block category to house all blocks within the plugin (#246)
|
114 |
+
* Vote block placeholders (#238)
|
115 |
+
* Update admin notices style (#305)
|
116 |
+
* Check API key is not empty before attempting to update connection settings
|
117 |
+
* Adding a slight opacity change when hovering a button that has a custom bg color set. (#303)
|
118 |
+
* Update/security fixes (#302)
|
119 |
+
|
120 |
= 1.1.1 =
|
121 |
* Don't Request User Code on Save if there is nothing to save
|
122 |
* Skip the setup screen if a user code is saved
|
123 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
124 |
|
125 |
== Upgrade Notice ==
|
126 |
|
build/editor.asset.php
CHANGED
@@ -1 +1 @@
|
|
1 |
-
<?php return array('dependencies' => array('lodash', 'react', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-polyfill'), 'version' => '
|
1 |
+
<?php return array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-polyfill'), 'version' => 'ed29a78de92f8e4b7144145980c1af20');
|
build/editor.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
#editor .editor-styles-wrapper .crowdsignal-forms-poll{margin-left:0;margin-right:0}#editor .editor-styles-wrapper .block-editor-block-list__block[data-type="crowdsignal-forms/poll"][data-align="full"] .crowdsignal-forms-poll{border-left-width:0;border-right-width:0}@media screen and (min-width: 660px){#editor .editor-styles-wrapper .block-editor-block-list__block[data-type="crowdsignal-forms/poll"][data-align="wide"] .crowdsignal-forms-poll__content,#editor .editor-styles-wrapper .block-editor-block-list__block[data-type="crowdsignal-forms/poll"][data-align="full"] .crowdsignal-forms-poll__content{padding:80px}}#editor .editor-styles-wrapper .crowdsignal-forms-poll__answer{cursor:text}#editor .editor-styles-wrapper .crowdsignal-forms-poll__answer:hover,#editor .editor-styles-wrapper .crowdsignal-forms-poll__answer.is-focused{color:inherit}#editor .editor-styles-wrapper .wp-block-button .crowdsignal-forms-poll__submit-button.wp-block-button__link{cursor:text}.crowdsignal-forms-poll__resize-wrapper{margin-left:auto;margin-right:auto}.crowdsignal-forms__redirect-url input[type="text"]{width:100%}.crowdsignal-forms__redirect-url__suggestions{width:260px}.crowdsignal-forms__row{display:flex;flex-direction:row}.crowdsignal-forms__row .crowdsignal-forms__small-text-input input[type="text"]{width:40px}.crowdsignal-forms__row .crowdsignal-forms__small-text-input input[type="number"]{width:50px}.crowdsignal-forms__reset-width-button{margin-left:auto;margin-top:25px}.crowdsignal-forms-poll__edit-bar{font-family:-apple-system,blinkmacsystemfont,"Segoe UI",roboto,oxygen-sans,ubuntu,cantarell,"Helvetica Neue",sans-serif;font-size:13px;margin-top:24px;padding:18px 24px;color:#d82e20;border-left:4px solid #d82e20;background:#f8dad8;display:flex;flex-direction:row;justify-content:space-between;align-items:center}.crowdsignal-forms-poll__edit-bar .crowdsignal-forms-poll__edit-bar-message{padding-inline-end:24px}.crowdsignal-forms-poll__edit-bar button.crowdsignal-forms-poll__edit-bar-button{border:2px solid #d82e20;border-radius:4px;color:#d82e20;background:transparent;padding:8px 16px;cursor:pointer}.crowdsignal-forms__connect-to-crowdsignal{border:1px solid #000;font-family:-apple-system,blinkmacsystemfont,"Segoe UI",roboto,oxygen-sans,ubuntu,cantarell,"Helvetica Neue",sans-serif;padding:24px;text-align:initial}.crowdsignal-forms__connect-to-crowdsignal-header{display:flex;flex-direction:row;align-items:center}.crowdsignal-forms__connect-to-crowdsignal-body{font-size:13px;margin-top:24px;margin-bottom:16px}.crowdsignal-forms__connect-to-crowdsignal-title{font-size:24pt;margin-inline-start:16px}.crowdsignal-poll-wrapper:not(:first-child),[data-type="crowdsignal-forms/poll"]:not(:first-child){margin-top:3em}.crowdsignal-poll-wrapper:not(:last-child),[data-type="crowdsignal-forms/poll"]:not(:last-child){margin-bottom:3em}.crowdsignal-forms-poll{border-color:var(--crowdsignal-forms-border-color);border-style:solid;border-width:var(--crowdsignal-forms-border-width);margin-left:auto;margin-right:auto;margin-top:5px;position:relative;text-align:left}.entry-content .alignfull.crowdsignal-poll-wrapper .crowdsignal-forms-poll{border-left-width:0;border-right-width:0}.crowdsignal-forms-poll h3.crowdsignal-forms-poll__question{margin:0 0 28px}.crowdsignal-forms-poll h3.crowdsignal-forms-poll__question:first-child{margin-top:0}.crowdsignal-forms-poll p.crowdsignal-forms-poll__note{font-style:italic;margin:0 0 32px}.crowdsignal-forms-poll .crowdsignal-forms-poll__content{padding:40px 24px 16px 24px}.crowdsignal-forms-poll .crowdsignal-forms-poll__content .crowdsignal-forms-poll__question{font-family:var(--crowdsignal-forms-question-font-family)}.crowdsignal-forms-poll .crowdsignal-forms-poll__content .crowdsignal-forms-poll__answer-label,.crowdsignal-forms-poll .crowdsignal-forms-poll__content .crowdsignal-forms-poll__answer-results-answer,.crowdsignal-forms-poll .crowdsignal-forms-poll__content .crowdsignal-forms-poll__note{font-family:var(--crowdsignal-forms-body-font-family)}.entry-content .alignfull.crowdsignal-poll-wrapper .crowdsignal-forms-poll .crowdsignal-forms-poll__content{margin:0 auto;max-width:var(--crowdsignal-forms-content-wide-width)}@media screen and (min-width: 660px){.alignwide.crowdsignal-poll-wrapper .crowdsignal-forms-poll .crowdsignal-forms-poll__content,.alignfull.crowdsignal-poll-wrapper .crowdsignal-forms-poll .crowdsignal-forms-poll__content{padding:80px}}.crowdsignal-forms-poll.is-closed .crowdsignal-forms-poll__form{opacity:0.5}.crowdsignal-forms-poll.is-hidden{opacity:0.5}.crowdsignal-forms-poll.has-text-color{color:var(--crowdsignal-forms-text-color)}.crowdsignal-forms-poll.has-bg-color{background-color:var(--crowdsignal-forms-bg-color)}.crowdsignal-forms-poll.has-border-radius{border-radius:var(--crowdsignal-forms-border-radius);overflow:hidden}.crowdsignal-forms-poll.has-box-shadow{box-shadow:0 3px 6px rgba(0,0,0,0.16),0 3px 6px rgba(0,0,0,0.23)}.crowdsignal-forms-poll .is-transparent{opacity:0;pointer-events:none}.crowdsignal-forms-poll__block-button .crowdsignal-forms-poll__submit-button{-webkit-appearance:initial}.crowdsignal-forms-poll__block-button .crowdsignal-forms-poll__submit-button:disabled{opacity:0.7}.crowdsignal-forms-poll.has-submit-button-bg-color .crowdsignal-forms-poll__block-button .crowdsignal-forms-poll__submit-button.wp-block-button__link{background-color:var(--crowdsignal-forms-submit-button-bg-color)}.crowdsignal-forms-poll.has-submit-button-text-color .crowdsignal-forms-poll__block-button .crowdsignal-forms-poll__submit-button.wp-block-button__link{color:var(--crowdsignal-forms-submit-button-text-color)}.crowdsignal-forms-poll__options.is-button{display:flex;flex-direction:column;flex-wrap:wrap}.crowdsignal-forms-poll__options.is-button.is-inline-button-alignment{flex-direction:row}.crowdsignal-forms-poll__answer{cursor:pointer;display:flex;font-size:inherit;font-weight:600;margin:0;padding:0 2px;position:relative}.crowdsignal-forms-poll__answer.is-button{margin-inline-end:20px;margin-block-end:20px;max-width:100%}.crowdsignal-forms-poll__answer.is-button .wp-block-button.crowdsignal-forms-poll__block-button,.crowdsignal-forms-poll__answer.is-button .crowdsignal-forms-poll__submit-button{max-width:100%}.crowdsignal-forms-poll__answer.is-button .crowdsignal-forms-poll__submit-button{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.crowdsignal-forms-poll__answer:not(.is-button){margin-block-end:16px}.crowdsignal-forms-poll__answer:hover,.crowdsignal-forms-poll__answer.is-focused{color:var(--crowdsignal-forms-submit-button-bg-color)}.has-voted .crowdsignal-forms-poll__answer{opacity:0.5}input[type="checkbox"].crowdsignal-forms-poll__input,input[type="radio"].crowdsignal-forms-poll__input{height:0;opacity:0;position:absolute;width:0}.crowdsignal-forms-poll__check{display:inline-block;height:1em;margin:0 10px 0 0;position:relative;width:1em}.crowdsignal-forms-poll__check::before{background-color:transparent;border:1.5px solid var(--crowdsignal-forms-text-color);border-radius:50%;box-sizing:border-box;content:"";display:block;height:100%;transition:background-color 0.3s, border-color 0.3s;width:100%}.crowdsignal-forms-poll__answer.is-multiple-choice .crowdsignal-forms-poll__check::before{border-radius:3px}.crowdsignal-forms-poll__answer.is-multiple-choice.is-selected .crowdsignal-forms-poll__check::before{border-color:var(--crowdsignal-forms-text-color);background-color:var(--crowdsignal-forms-text-color)}.crowdsignal-forms-poll__answer.is-selected:not(.is-multiple-choice) .crowdsignal-forms-poll__check::after{animation-duration:0.3s;animation-name:crowdsignal-forms-animation__pop;animation-iteration-count:1;background-clip:padding-box;background-color:var(--crowdsignal-forms-text-color);border:4.5px solid transparent;border-radius:50%;box-sizing:border-box;content:"";display:block;height:100%;position:absolute;left:0;top:0;width:100%}.crowdsignal-forms-poll__answer.is-selected.is-multiple-choice .crowdsignal-forms-poll__check::after{border-color:var(--crowdsignal-forms-submit-button-text-color);border-style:solid;border-width:0 0 2px 2px;box-sizing:border-box;content:"";display:block;height:25%;margin:-0.1em 0 0 -0.2em;position:absolute;left:50%;top:50%;transform:rotateZ(-45deg);width:50%}div.crowdsignal-forms-poll__answer-label-wrapper{flex:1;word-break:break-word}div.crowdsignal-forms-poll__answer-label-wrapper span.crowdsignal-forms-poll__answer-label{line-height:1;vertical-align:top}div.crowdsignal-forms-poll__answer-label-wrapper span.crowdsignal-forms-poll__answer-label span::after{vertical-align:top}.crowdsignal-forms-poll__button{border:0;padding:0}.crowdsignal-forms-poll__actions .wp-block-button,.crowdsignal-forms-poll__options .wp-block-button{margin:0}.crowdsignal-forms-poll__actions{display:flex;justify-content:flex-end}.editor-styles-wrapper .crowdsignal-forms-poll .crowdsignal-forms-poll__actions .wp-block-button.crowdsignal-forms-poll__block-button,.editor-styles-wrapper .crowdsignal-forms-poll .crowdsignal-forms-poll__options .wp-block-button.crowdsignal-forms-poll__block-button{margin:0}.crowdsignal-forms-poll__closed-banner{background-color:var(--crowdsignal-forms-border-color);box-sizing:border-box;display:flex;color:var(--crowdsignal-forms-submit-button-text-color);font-family:-apple-system,blinkmacsystemfont,"Segoe UI",roboto,oxygen-sans,ubuntu,cantarell,"Helvetica Neue",sans-serif;justify-content:center;padding:calc(var(--crowdsignal-forms-border-width) + 0.2em) 0 0.2em;width:100%}.is-hidden .crowdsignal-forms-poll__closed-banner{font-style:italic}.crowdsignal-forms-poll__error{color:red}.crowdsignal-forms-poll__results-list{margin:0 0 1em;position:relative}.crowdsignal-forms-poll__answer-results{display:flex;flex-direction:column;margin:0 0 16px;width:100%}.crowdsignal-forms-poll__answer-results:last-child{margin:0}.crowdsignal-forms-poll__answer-results-labels{align-items:flex-end;display:flex;margin:0 0 8px;width:100%;word-break:break-word}.crowdsignal-forms-poll__answer-results-answer{flex:1;font-size:1em;font-weight:600}.crowdsignal-forms-poll__answer-results-votes{font-size:0.75em;line-height:2}.crowdsignal-forms-poll__answer-results-percent{font-weight:600;line-height:1.6}.crowdsignal-forms-poll__answer-results-votes,.crowdsignal-forms-poll__answer-results-percent{font-family:-apple-system,blinkmacsystemfont,"Segoe UI",roboto,oxygen-sans,ubuntu,cantarell,"Helvetica Neue",sans-serif;margin-left:20px;transition:opacity 0.3s}.crowdsignal-forms-poll__answer-results.is-error .crowdsignal-forms-poll__answer-results-votes,.crowdsignal-forms-poll__answer-results.is-error .crowdsignal-forms-poll__answer-results-percent{display:none}.crowdsignal-forms-poll__answer-results.is-loading .crowdsignal-forms-poll__answer-results-votes,.crowdsignal-forms-poll__answer-results.is-loading .crowdsignal-forms-poll__answer-results-percent{animation-duration:1.5s;animation-iteration-count:infinite;animation-name:crowdsignal-forms-animation__pulse;background-color:var(--crowdsignal-forms-text-color);font-size:0.7em;height:1em;width:50px}.crowdsignal-forms-poll__answer-results.is-loading .crowdsignal-forms-poll__answer-results-votes:last-child,.crowdsignal-forms-poll__answer-results.is-loading .crowdsignal-forms-poll__answer-results-percent:last-child{width:40px}.crowdsignal-forms-poll__answer-results-progress-track{border:1px solid;border-color:rgba(var(--crowdsignal-forms-text-color-properties), 0.3);box-sizing:border-box;height:1em;width:100%}.crowdsignal-forms-poll__answer-results.is-loading .crowdsignal-forms-poll__answer-results-progress-track{animation-duration:1.5s;animation-iteration-count:infinite;animation-name:crowdsignal-forms-animation__pulse}.crowdsignal-forms-poll__answer-results-progress-bar{animation-fill-mode:forwards;background-color:var(--crowdsignal-forms-submit-button-bg-color);height:100%;transition:background-color 0.3s, width 0.3s}.crowdsignal-forms-poll__answer-results.is-error .crowdsignal-forms-poll__answer-results-progress-bar{width:0}.crowdsignal-forms-poll__answer-results.is-loading .crowdsignal-forms-poll__answer-results-progress-bar{background-color:var(--crowdsignal-forms-text-color);width:25%}.crowdsignal-forms-poll__answer-results.is-loading:nth-child(5n+1) .crowdsignal-forms-poll__answer-results-progress-bar{width:40%}.crowdsignal-forms-poll__answer-results.is-loading:nth-child(5n+2) .crowdsignal-forms-poll__answer-results-progress-bar{width:75%}.crowdsignal-forms-poll__answer-results.is-loading:nth-child(5n+3) .crowdsignal-forms-poll__answer-results-progress-bar{width:50%}.crowdsignal-forms-poll__answer-results.is-loading:nth-child(5n+4) .crowdsignal-forms-poll__answer-results-progress-bar{width:60%}.crowdsignal-forms-poll__results-footer{display:flex;flex-direction:column;justify-content:space-between;width:100%;font-size:0.9em}.crowdsignal-forms-poll__results-total{font-family:-apple-system,blinkmacsystemfont,"Segoe UI",roboto,oxygen-sans,ubuntu,cantarell,"Helvetica Neue",sans-serif;position:relative;text-align:right;width:100%;margin-bottom:1em}.crowdsignal-forms-poll__results.is-loading .crowdsignal-forms-poll__results-total{color:transparent}.crowdsignal-forms-poll__results.is-loading .crowdsignal-forms-poll__results-total::before{animation-name:crowdsignal-forms-animation__pulse;animation-duration:1.5s;animation-iteration-count:infinite;background-color:var(--crowdsignal-forms-text-color);content:"";display:block;position:absolute;right:0;height:1em;width:150px}.crowdsignal-forms-poll__footer-branding{display:flex;justify-content:space-between;align-items:center;width:100%}.crowdsignal-forms-poll__footer-branding img.crowdsignal-forms-poll__footer-branding-logo{width:50px;height:50px;margin-left:0;margin-right:0}.crowdsignal-forms-poll__footer-cs-link{font-family:-apple-system,blinkmacsystemfont,"Segoe UI",roboto,oxygen-sans,ubuntu,cantarell,"Helvetica Neue",sans-serif;font-size:16px;text-decoration:none;text-transform:uppercase}.crowdsignal-forms-poll__footer-cs-link:not(:hover){color:var(--crowdsignal-forms-text-color);opacity:0.4}.has-default-thankyou .crowdsignal-forms-poll__footer-cs-link{color:#333}.crowdsignal-forms-poll__error-banner{font-family:-apple-system,blinkmacsystemfont,"Segoe UI",roboto,oxygen-sans,ubuntu,cantarell,"Helvetica Neue",sans-serif;font-size:13px;margin-top:24px;padding:18px 24px;color:#d82e20;border-left:4px solid #d82e20;background:#f8dad8}.crowdsignal-forms-poll__submit-message-container{position:absolute;background-color:var(--crowdsignal-forms-bg-color);left:0;top:0;width:100%;height:100%;overflow:hidden}.has-default-thankyou .crowdsignal-forms-poll__submit-message-container{background-color:#fff}.crowdsignal-forms-poll__submit-message{position:relative}.crowdsignal-forms-poll__submit-message button.crowdsignal-forms-poll__dismiss-submit-message{position:absolute;right:0;top:0;background-color:transparent;color:#000;text-decoration:none;border:none}.crowdsignal-forms-poll__submit-message button.crowdsignal-forms-poll__dismiss-submit-message:hover{background:inherit}.crowdsignal-forms-poll__submit-message-footer{position:absolute;bottom:0;left:0;padding:16px 24px;width:100%;background-color:inherit}.crowdsignal-forms-poll__thank-you-cs-sticker{right:25px;top:66px}.crowdsignal-forms-poll__thank-you-sticker{right:132px;top:12px}.crowdsignal-forms-poll__thank-you-cs-sticker,.crowdsignal-forms-poll__thank-you-sticker{filter:drop-shadow(0 1px 2px rgba(0,0,0,0.2));width:100px;height:100px;position:absolute}.crowdsignal-forms-poll__custom-message-check{color:var(--crowdsignal-forms-text-color);padding-left:24px;padding-top:24px}.crowdsignal-forms-poll__custom-message{font-family:var(--crowdsignal-forms-question-font-family);font-weight:600;padding:16px 24px}.wp_block-crowdsignal-forms-poll__vote-branding{margin-top:16px}.crowdsignal-forms__style-probe{display:none}
|
1 |
+
.crowdsignal-forms__connect-to-crowdsignal{border:1px solid #000;font-family:-apple-system,blinkmacsystemfont,"Segoe UI",roboto,oxygen-sans,ubuntu,cantarell,"Helvetica Neue",sans-serif;padding:24px;text-align:initial}.crowdsignal-forms__connect-to-crowdsignal-header{display:flex;flex-direction:row;align-items:center}.crowdsignal-forms__connect-to-crowdsignal-body{font-size:13px;margin-top:24px;margin-bottom:16px}.crowdsignal-forms__connect-to-crowdsignal-title{font-size:24pt;margin-inline-start:16px}#editor .editor-styles-wrapper .crowdsignal-forms-poll{margin-left:0;margin-right:0}#editor .editor-styles-wrapper .block-editor-block-list__block[data-type="crowdsignal-forms/poll"][data-align="full"] .crowdsignal-forms-poll{border-left-width:0;border-right-width:0}@media screen and (min-width: 660px){#editor .editor-styles-wrapper .block-editor-block-list__block[data-type="crowdsignal-forms/poll"][data-align="wide"] .crowdsignal-forms-poll__content,#editor .editor-styles-wrapper .block-editor-block-list__block[data-type="crowdsignal-forms/poll"][data-align="full"] .crowdsignal-forms-poll__content{padding:80px}}#editor .editor-styles-wrapper .crowdsignal-forms-poll__answer{cursor:text}#editor .editor-styles-wrapper .crowdsignal-forms-poll__answer:hover,#editor .editor-styles-wrapper .crowdsignal-forms-poll__answer.is-focused{color:inherit}#editor .editor-styles-wrapper .wp-block-button .crowdsignal-forms-poll__submit-button.wp-block-button__link{cursor:text}#editor .editor-styles-wrapper .wp-block-button .crowdsignal-forms-poll__submit-button.wp-block-button__link:hover{opacity:inherit}.crowdsignal-forms-poll__resize-wrapper{margin-left:auto;margin-right:auto}.crowdsignal-forms__redirect-url input[type="text"]{width:100%}.crowdsignal-forms__redirect-url__suggestions{width:260px}.crowdsignal-forms__row{display:flex;flex-direction:row}.crowdsignal-forms__row .crowdsignal-forms__small-text-input input[type="text"]{width:40px}.crowdsignal-forms__row .crowdsignal-forms__small-text-input input[type="number"]{width:50px}.crowdsignal-forms__reset-width-button{margin-left:auto;margin-top:25px}.crowdsignal-forms-poll__edit-bar{font-family:-apple-system,blinkmacsystemfont,"Segoe UI",roboto,oxygen-sans,ubuntu,cantarell,"Helvetica Neue",sans-serif;font-size:13px;margin-top:24px;padding:18px 24px;color:#d82e20;border-left:4px solid #d82e20;background:#f8dad8;display:flex;flex-direction:row;justify-content:space-between;align-items:center}.crowdsignal-forms-poll__edit-bar .crowdsignal-forms-poll__edit-bar-message{padding-inline-end:24px}.crowdsignal-forms-poll__edit-bar button.crowdsignal-forms-poll__edit-bar-button{border:2px solid #d82e20;border-radius:4px;color:#d82e20;background:transparent;padding:8px 16px;cursor:pointer}.crowdsignal-poll-wrapper:not(:first-child),[data-type="crowdsignal-forms/poll"]:not(:first-child){margin-top:3em}.crowdsignal-poll-wrapper:not(:last-child),[data-type="crowdsignal-forms/poll"]:not(:last-child){margin-bottom:3em}.crowdsignal-forms-poll{border-color:var(--crowdsignal-forms-border-color);border-style:solid;border-width:var(--crowdsignal-forms-border-width);margin-left:auto;margin-right:auto;margin-top:5px;position:relative;text-align:left}.entry-content .alignfull.crowdsignal-poll-wrapper .crowdsignal-forms-poll{border-left-width:0;border-right-width:0}.crowdsignal-forms-poll h3.crowdsignal-forms-poll__question{margin:0 0 28px}.crowdsignal-forms-poll h3.crowdsignal-forms-poll__question:first-child{margin-top:0}.crowdsignal-forms-poll p.crowdsignal-forms-poll__note{font-style:italic;margin:0 0 32px}.crowdsignal-forms-poll .crowdsignal-forms-poll__content{padding:40px 24px 16px 24px}.crowdsignal-forms-poll .crowdsignal-forms-poll__content .crowdsignal-forms-poll__question{font-family:var(--crowdsignal-forms-question-font-family)}.crowdsignal-forms-poll .crowdsignal-forms-poll__content .crowdsignal-forms-poll__answer-label,.crowdsignal-forms-poll .crowdsignal-forms-poll__content .crowdsignal-forms-poll__answer-results-answer,.crowdsignal-forms-poll .crowdsignal-forms-poll__content .crowdsignal-forms-poll__note{font-family:var(--crowdsignal-forms-body-font-family)}.entry-content .alignfull.crowdsignal-poll-wrapper .crowdsignal-forms-poll .crowdsignal-forms-poll__content{margin:0 auto;max-width:var(--crowdsignal-forms-content-wide-width)}@media screen and (min-width: 660px){.alignwide.crowdsignal-poll-wrapper .crowdsignal-forms-poll .crowdsignal-forms-poll__content,.alignfull.crowdsignal-poll-wrapper .crowdsignal-forms-poll .crowdsignal-forms-poll__content{padding:80px}}.crowdsignal-forms-poll.is-closed .crowdsignal-forms-poll__form{opacity:0.5}.crowdsignal-forms-poll.is-hidden{opacity:0.5}.crowdsignal-forms-poll.has-text-color{color:var(--crowdsignal-forms-text-color)}.crowdsignal-forms-poll.has-bg-color{background-color:var(--crowdsignal-forms-bg-color)}.crowdsignal-forms-poll.has-border-radius{border-radius:var(--crowdsignal-forms-border-radius);overflow:hidden}.crowdsignal-forms-poll.has-box-shadow{box-shadow:0 3px 6px rgba(0,0,0,0.16),0 3px 6px rgba(0,0,0,0.23)}.crowdsignal-forms-poll .is-transparent{opacity:0;pointer-events:none}.crowdsignal-forms-poll__block-button .crowdsignal-forms-poll__submit-button{-webkit-appearance:initial}.crowdsignal-forms-poll__block-button .crowdsignal-forms-poll__submit-button:disabled{opacity:0.7}.crowdsignal-forms-poll.has-submit-button-text-color .crowdsignal-forms-poll__block-button .crowdsignal-forms-poll__submit-button.wp-block-button__link{color:var(--crowdsignal-forms-submit-button-text-color)}.crowdsignal-forms-poll.has-submit-button-bg-color .crowdsignal-forms-poll__block-button .crowdsignal-forms-poll__submit-button.wp-block-button__link{background-color:var(--crowdsignal-forms-submit-button-bg-color)}.crowdsignal-forms-poll.has-submit-button-bg-color .crowdsignal-forms-poll__block-button .crowdsignal-forms-poll__submit-button.wp-block-button__link:hover{opacity:0.9}.crowdsignal-forms-poll__options.is-button{display:flex;flex-direction:column;flex-wrap:wrap}.crowdsignal-forms-poll__options.is-button.is-inline-button-alignment{flex-direction:row}.crowdsignal-forms-poll__answer{cursor:pointer;display:flex;font-size:inherit;font-weight:600;margin:0;padding:0 2px;position:relative}.crowdsignal-forms-poll__answer.is-button{margin-inline-end:20px;margin-block-end:20px;max-width:100%}.crowdsignal-forms-poll__answer.is-button .wp-block-button.crowdsignal-forms-poll__block-button,.crowdsignal-forms-poll__answer.is-button .crowdsignal-forms-poll__submit-button{max-width:100%}.crowdsignal-forms-poll__answer.is-button .crowdsignal-forms-poll__submit-button{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.crowdsignal-forms-poll__answer:not(.is-button){margin-block-end:16px}.crowdsignal-forms-poll__answer:hover,.crowdsignal-forms-poll__answer.is-focused{color:var(--crowdsignal-forms-submit-button-bg-color)}.has-voted .crowdsignal-forms-poll__answer{opacity:0.5}input[type="checkbox"].crowdsignal-forms-poll__input,input[type="radio"].crowdsignal-forms-poll__input{height:0;opacity:0;position:absolute;width:0}.crowdsignal-forms-poll__check{display:inline-block;height:1em;margin:0 10px 0 0;position:relative;width:1em}.crowdsignal-forms-poll__check::before{background-color:transparent;border:1.5px solid var(--crowdsignal-forms-text-color);border-radius:50%;box-sizing:border-box;content:"";display:block;height:100%;transition:background-color 0.3s, border-color 0.3s;width:100%}.crowdsignal-forms-poll__answer.is-multiple-choice .crowdsignal-forms-poll__check::before{border-radius:3px}.crowdsignal-forms-poll__answer.is-multiple-choice.is-selected .crowdsignal-forms-poll__check::before{border-color:var(--crowdsignal-forms-text-color);background-color:var(--crowdsignal-forms-text-color)}.crowdsignal-forms-poll__answer.is-selected:not(.is-multiple-choice) .crowdsignal-forms-poll__check::after{animation-duration:0.3s;animation-name:crowdsignal-forms-animation__pop;animation-iteration-count:1;background-clip:padding-box;background-color:var(--crowdsignal-forms-text-color);border:4.5px solid transparent;border-radius:50%;box-sizing:border-box;content:"";display:block;height:100%;position:absolute;left:0;top:0;width:100%}.crowdsignal-forms-poll__answer.is-selected.is-multiple-choice .crowdsignal-forms-poll__check::after{border-color:var(--crowdsignal-forms-submit-button-text-color);border-style:solid;border-width:0 0 2px 2px;box-sizing:border-box;content:"";display:block;height:25%;margin:-0.1em 0 0 -0.2em;position:absolute;left:50%;top:50%;transform:rotateZ(-45deg);width:50%}div.crowdsignal-forms-poll__answer-label-wrapper{flex:1;word-break:break-word}div.crowdsignal-forms-poll__answer-label-wrapper span.crowdsignal-forms-poll__answer-label{line-height:1;vertical-align:top}div.crowdsignal-forms-poll__answer-label-wrapper span.crowdsignal-forms-poll__answer-label span::after{vertical-align:top}.crowdsignal-forms-poll__button{border:0;padding:0}.crowdsignal-forms-poll__actions .wp-block-button,.crowdsignal-forms-poll__options .wp-block-button{margin:0}.crowdsignal-forms-poll__actions{display:flex;justify-content:flex-end}.editor-styles-wrapper .crowdsignal-forms-poll .crowdsignal-forms-poll__actions .wp-block-button.crowdsignal-forms-poll__block-button,.editor-styles-wrapper .crowdsignal-forms-poll .crowdsignal-forms-poll__options .wp-block-button.crowdsignal-forms-poll__block-button{margin:0}.crowdsignal-forms-poll__closed-banner{background-color:var(--crowdsignal-forms-border-color);box-sizing:border-box;display:flex;color:var(--crowdsignal-forms-submit-button-text-color);font-family:-apple-system,blinkmacsystemfont,"Segoe UI",roboto,oxygen-sans,ubuntu,cantarell,"Helvetica Neue",sans-serif;justify-content:center;padding:calc(var(--crowdsignal-forms-border-width) + 0.2em) 0 0.2em;width:100%}.is-hidden .crowdsignal-forms-poll__closed-banner{font-style:italic}.crowdsignal-forms-poll__error{color:red}.crowdsignal-forms-poll__results-list{margin:0 0 1em;position:relative}.crowdsignal-forms-poll__answer-results{display:flex;flex-direction:column;margin:0 0 16px;width:100%}.crowdsignal-forms-poll__answer-results:last-child{margin:0}.crowdsignal-forms-poll__answer-results-labels{align-items:flex-end;display:flex;margin:0 0 8px;width:100%;word-break:break-word}.crowdsignal-forms-poll__answer-results-answer{flex:1;font-size:1em;font-weight:600}.crowdsignal-forms-poll__answer-results-votes{font-size:0.75em;line-height:2}.crowdsignal-forms-poll__answer-results-percent{font-weight:600;line-height:1.6}.crowdsignal-forms-poll__answer-results-votes,.crowdsignal-forms-poll__answer-results-percent{font-family:-apple-system,blinkmacsystemfont,"Segoe UI",roboto,oxygen-sans,ubuntu,cantarell,"Helvetica Neue",sans-serif;margin-left:20px;transition:opacity 0.3s}.crowdsignal-forms-poll__answer-results.is-error .crowdsignal-forms-poll__answer-results-votes,.crowdsignal-forms-poll__answer-results.is-error .crowdsignal-forms-poll__answer-results-percent{display:none}.crowdsignal-forms-poll__answer-results.is-loading .crowdsignal-forms-poll__answer-results-votes,.crowdsignal-forms-poll__answer-results.is-loading .crowdsignal-forms-poll__answer-results-percent{animation-duration:1.5s;animation-iteration-count:infinite;animation-name:crowdsignal-forms-animation__pulse;background-color:var(--crowdsignal-forms-text-color);font-size:0.7em;height:1em;width:50px}.crowdsignal-forms-poll__answer-results.is-loading .crowdsignal-forms-poll__answer-results-votes:last-child,.crowdsignal-forms-poll__answer-results.is-loading .crowdsignal-forms-poll__answer-results-percent:last-child{width:40px}.crowdsignal-forms-poll__answer-results-progress-track{border:1px solid;border-color:rgba(var(--crowdsignal-forms-text-color-properties), 0.3);box-sizing:border-box;height:1em;width:100%}.crowdsignal-forms-poll__answer-results.is-loading .crowdsignal-forms-poll__answer-results-progress-track{animation-duration:1.5s;animation-iteration-count:infinite;animation-name:crowdsignal-forms-animation__pulse}.crowdsignal-forms-poll__answer-results-progress-bar{animation-fill-mode:forwards;background-color:var(--crowdsignal-forms-submit-button-bg-color);height:100%;transition:background-color 0.3s, width 0.3s}.crowdsignal-forms-poll__answer-results.is-error .crowdsignal-forms-poll__answer-results-progress-bar{width:0}.crowdsignal-forms-poll__answer-results.is-loading .crowdsignal-forms-poll__answer-results-progress-bar{background-color:var(--crowdsignal-forms-text-color);width:25%}.crowdsignal-forms-poll__answer-results.is-loading:nth-child(5n+1) .crowdsignal-forms-poll__answer-results-progress-bar{width:40%}.crowdsignal-forms-poll__answer-results.is-loading:nth-child(5n+2) .crowdsignal-forms-poll__answer-results-progress-bar{width:75%}.crowdsignal-forms-poll__answer-results.is-loading:nth-child(5n+3) .crowdsignal-forms-poll__answer-results-progress-bar{width:50%}.crowdsignal-forms-poll__answer-results.is-loading:nth-child(5n+4) .crowdsignal-forms-poll__answer-results-progress-bar{width:60%}.crowdsignal-forms-poll__results-footer{display:flex;flex-direction:column;justify-content:space-between;width:100%;font-size:0.9em}.crowdsignal-forms-poll__results-total{font-family:-apple-system,blinkmacsystemfont,"Segoe UI",roboto,oxygen-sans,ubuntu,cantarell,"Helvetica Neue",sans-serif;position:relative;text-align:right;width:100%;margin-bottom:1em}.crowdsignal-forms-poll__results.is-loading .crowdsignal-forms-poll__results-total{color:transparent}.crowdsignal-forms-poll__results.is-loading .crowdsignal-forms-poll__results-total::before{animation-name:crowdsignal-forms-animation__pulse;animation-duration:1.5s;animation-iteration-count:infinite;background-color:var(--crowdsignal-forms-text-color);content:"";display:block;position:absolute;right:0;height:1em;width:150px}.crowdsignal-forms-poll__footer-branding{display:flex;justify-content:space-between;align-items:center;width:100%}.crowdsignal-forms-poll__footer-branding img.crowdsignal-forms-poll__footer-branding-logo{width:50px;height:50px;margin-left:0;margin-right:0}.crowdsignal-forms-poll__footer-cs-link{font-family:-apple-system,blinkmacsystemfont,"Segoe UI",roboto,oxygen-sans,ubuntu,cantarell,"Helvetica Neue",sans-serif;font-size:16px;text-decoration:none;text-transform:uppercase}.crowdsignal-forms-poll__footer-cs-link:not(:hover){color:var(--crowdsignal-forms-text-color);opacity:0.4}.has-default-thankyou .crowdsignal-forms-poll__footer-cs-link{color:#333}.crowdsignal-forms-poll__error-banner{font-family:-apple-system,blinkmacsystemfont,"Segoe UI",roboto,oxygen-sans,ubuntu,cantarell,"Helvetica Neue",sans-serif;font-size:13px;margin-top:24px;padding:18px 24px;color:#d82e20;border-left:4px solid #d82e20;background:#f8dad8}.crowdsignal-forms-poll__submit-message-container{position:absolute;background-color:var(--crowdsignal-forms-bg-color);left:0;top:0;width:100%;height:100%;overflow:hidden}.has-default-thankyou .crowdsignal-forms-poll__submit-message-container{background-color:#fff}.crowdsignal-forms-poll__submit-message{position:relative}.crowdsignal-forms-poll__submit-message button.crowdsignal-forms-poll__dismiss-submit-message{position:absolute;right:0;top:0;background-color:transparent;color:#000;text-decoration:none;border:none}.crowdsignal-forms-poll__submit-message button.crowdsignal-forms-poll__dismiss-submit-message:hover{background:inherit}.crowdsignal-forms-poll__submit-message-footer{position:absolute;bottom:0;left:0;padding:16px 24px;width:100%;background-color:inherit}.crowdsignal-forms-poll__thank-you-cs-sticker{right:25px;top:66px}.crowdsignal-forms-poll__thank-you-sticker{right:132px;top:12px}.crowdsignal-forms-poll__thank-you-cs-sticker,.crowdsignal-forms-poll__thank-you-sticker{filter:drop-shadow(0 1px 2px rgba(0,0,0,0.2));width:100px;height:100px;position:absolute}.crowdsignal-forms-poll__custom-message-check{color:var(--crowdsignal-forms-text-color);padding-left:24px;padding-top:24px}.crowdsignal-forms-poll__custom-message{font-family:var(--crowdsignal-forms-question-font-family);font-weight:600;padding:16px 24px}.wp_block-crowdsignal-forms-poll__vote-branding{margin-top:16px}.crowdsignal-forms__style-probe{display:none}.crowdsignal-forms-vote .block-editor-block-list__layout{display:flex;flex-direction:row}.crowdsignal-forms__border-popover .crowdsignal-forms__row{padding:10px}.crowdsignal-forms-vote.no-results .crowdsignal-forms-vote-item__count{display:none}.crowdsignal-forms-vote__size-dropdown .components-button.components-dropdown-menu__menu-item.is-active::after{content:"\2713";margin-inline-start:auto;margin-inline-end:0}.crowdsignal-vote-wrapper:not(:first-child),[data-type="crowdsignal-forms/vote"]:not(:first-child){margin-top:3em}.crowdsignal-vote-wrapper:not(:last-child),[data-type="crowdsignal-forms/vote"]:not(:last-child){margin-bottom:3em}.crowdsignal-forms-vote{align-items:flex-start;display:flex;flex-direction:column}.crowdsignal-forms-vote.crowdsignal-forms-vote__example{align-items:center}[data-type="crowdsignal-forms/vote-item"]{margin-top:28px !important;margin-bottom:28px !important}.crowdsignal-forms-vote__items{display:flex;flex-direction:row}.crowdsignal-forms-vote-item{border:var(--crowdsignal-forms-vote-border-width) solid #d2d2d2;border-radius:var(--crowdsignal-forms-vote-border-radius);cursor:pointer;display:flex;flex-direction:row;align-items:center;margin-inline-end:8px !important;position:relative}.crowdsignal-forms-vote-item.has-bg-color{background-color:var(--crowdsignal-forms-vote-bg-color)}.crowdsignal-forms-vote-item.has-border-color{border-color:var(--crowdsignal-forms-vote-border-color)}.crowdsignal-forms-vote-item.has-text-color{color:var(--crowdsignal-forms-vote-text-color)}.is-closed .crowdsignal-forms-vote-item,.crowdsignal-forms-vote-item.is-disabled{cursor:inherit}.is-closed .crowdsignal-forms-vote-item,.crowdsignal-forms-vote-item.is-disabled:not(.is-voted-on){opacity:0.5}.size-small .crowdsignal-forms-vote-item{padding:18px 10px;height:0.7em}.size-medium .crowdsignal-forms-vote-item{height:1em;padding:20px 10px}.size-large .crowdsignal-forms-vote-item{height:1.2em;padding:22px 16px;margin-inline-end:16px}.crowdsignal-forms-vote-item.is-voted-on,.crowdsignal-forms-vote-item:hover:not(.is-disabled){border-color:var(--crowdsignal-forms-vote-voted-color);color:var(--crowdsignal-forms-vote-voted-color)}.crowdsignal-forms-vote-item.is-voted-on.has-bg-color,.crowdsignal-forms-vote-item.is-voted-on.has-text-color,.crowdsignal-forms-vote-item:hover:not(.is-disabled).has-bg-color,.crowdsignal-forms-vote-item:hover:not(.is-disabled).has-text-color{background-color:var(--crowdsignal-forms-vote-text-color);border-color:var(--crowdsignal-forms-vote-bg-color);color:var(--crowdsignal-forms-vote-bg-color)}.size-small .crowdsignal-forms-vote-item .crowdsignal-forms-vote-item__icon{width:0.7em;height:0.7em;max-height:0.7em}.size-medium .crowdsignal-forms-vote-item .crowdsignal-forms-vote-item__icon{width:1em;height:1em;max-height:1em}.size-large .crowdsignal-forms-vote-item .crowdsignal-forms-vote-item__icon{width:1.2em;height:1.2em;max-height:1.2em}.crowdsignal-forms-vote-item.is-voted-on .crowdsignal-forms-vote-item .crowdsignal-forms-vote-item__icon{animation-duration:0.3s;animation-name:crowdsignal-forms-animation__pop;animation-iteration-count:1}.crowdsignal-forms-vote-item .crowdsignal-forms-vote-item__count{font-size:14pt;font-family:-apple-system,blinkmacsystemfont,"Segoe UI",roboto,oxygen-sans,ubuntu,cantarell,"Helvetica Neue",sans-serif;margin-inline-start:10px;transform:rotateX(0deg);transform-origin:50% 50% 10px;transition:transform 0.3s}.size-small .crowdsignal-forms-vote-item .crowdsignal-forms-vote-item__count{font-size:0.6em}.size-medium .crowdsignal-forms-vote-item .crowdsignal-forms-vote-item__count{font-size:0.8em}.size-large .crowdsignal-forms-vote-item .crowdsignal-forms-vote-item__count{font-size:1em}.crowdsignal-forms-vote-item .crowdsignal-forms-vote-item__count-enter,.crowdsignal-forms-vote-item .crowdsignal-forms-vote-item__count-enter-active{margin:0;position:absolute;right:0}.crowdsignal-forms-vote-item .crowdsignal-forms-vote-item__count-enter{transform:rotateX(-90deg)}.crowdsignal-forms-vote-item.is-voted-on .crowdsignal-forms-vote-item .crowdsignal-forms-vote-item__count-enter{transform:rotateX(90deg)}.crowdsignal-forms-vote-item .crowdsignal-forms-vote-item__count-exit,.crowdsignal-forms-vote-item .crowdsignal-forms-vote-item__count-exit-active{margin:0;position:absolute;right:10px;top:4px;transform:rotateX(90deg)}.crowdsignal-forms-vote-item.is-voted-on .crowdsignal-forms-vote-item .crowdsignal-forms-vote-item__count-exit,.crowdsignal-forms-vote-item.is-voted-on .crowdsignal-forms-vote-item .crowdsignal-forms-vote-item__count-exit-active{transform:rotateX(-90deg)}.crowdsignal-forms-vote__branding{display:flex}.crowdsignal-forms-vote__branding .crowdsignal-forms-vote__branding-link{font-family:-apple-system,blinkmacsystemfont,"Segoe UI",roboto,oxygen-sans,ubuntu,cantarell,"Helvetica Neue",sans-serif;font-size:8px;padding:8px 20px 0;text-decoration:none !important;text-transform:uppercase}.crowdsignal-forms-vote__branding .crowdsignal-forms-vote__branding-link.with-external-icon::after{content:"\2197";display:inline;font-size:6px;vertical-align:super}.crowdsignal-forms-vote__branding .crowdsignal-forms-vote__branding-link:not(:hover){color:var(--crowdsignal-forms-text-color)}
|
build/editor.js
CHANGED
@@ -98,18 +98,6 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _con
|
|
98 |
|
99 |
/***/ }),
|
100 |
|
101 |
-
/***/ "./client/blocks/poll/connect-to-crowdsignal.js":
|
102 |
-
/*!******************************************************!*\
|
103 |
-
!*** ./client/blocks/poll/connect-to-crowdsignal.js ***!
|
104 |
-
\******************************************************/
|
105 |
-
/*! exports provided: default */
|
106 |
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
107 |
-
|
108 |
-
"use strict";
|
109 |
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"@babel/runtime/regenerator\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"./node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ \"@wordpress/element\");\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/components */ \"@wordpress/components\");\n/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var lib_i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! lib/i18n */ \"./client/lib/i18n/index.js\");\n/* harmony import */ var components_icon_poll__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! components/icon/poll */ \"./client/components/icon/poll.js\");\n/* harmony import */ var data_hooks__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! data/hooks */ \"./client/data/hooks/index.js\");\n\n\n\n\n/**\n * External dependencies\n */\n\n/**\n * Internal dependencies\n */\n\n\n\n\n\nvar ConnectToCrowdsignal = function ConnectToCrowdsignal(props) {\n var _useIsCsConnected = Object(data_hooks__WEBPACK_IMPORTED_MODULE_6__[\"useIsCsConnected\"])(),\n isConnected = _useIsCsConnected.isConnected,\n isAccountVerified = _useIsCsConnected.isAccountVerified,\n checkIsConnected = _useIsCsConnected.checkIsConnected;\n\n var handleConnectClick = /*#__PURE__*/function () {\n var _ref = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee() {\n var initialConnectedState, _yield$checkIsConnect, isNowConnected, isNowVerified;\n\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n initialConnectedState = isConnected;\n _context.next = 3;\n return checkIsConnected();\n\n case 3:\n _yield$checkIsConnect = _context.sent;\n isNowConnected = _yield$checkIsConnect.isNowConnected;\n isNowVerified = _yield$checkIsConnect.isNowVerified;\n\n if (!isNowConnected) {\n window.open('/wp-admin/admin.php?page=crowdsignal-forms-setup');\n } // Don't pop open the email window if the connection state just changed.\n // Allow the new placeholder to be displayed first.\n\n\n if (initialConnectedState && !isNowVerified) {\n window.open('https://wordpress.com/me/account');\n }\n\n case 8:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee);\n }));\n\n return function handleConnectClick() {\n return _ref.apply(this, arguments);\n };\n }();\n\n if (isConnected && isAccountVerified) {\n return props.children;\n }\n\n var showConnectionMessage = !isConnected;\n var showVerificationMessage = isConnected && !isAccountVerified;\n return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__[\"createElement\"])(\"div\", {\n className: \"crowdsignal-forms__connect-to-crowdsignal\"\n }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__[\"createElement\"])(\"div\", {\n className: \"crowdsignal-forms__connect-to-crowdsignal-header\"\n }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__[\"createElement\"])(components_icon_poll__WEBPACK_IMPORTED_MODULE_5__[\"default\"], null), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__[\"createElement\"])(\"div\", {\n className: \"crowdsignal-forms__connect-to-crowdsignal-title\"\n }, Object(lib_i18n__WEBPACK_IMPORTED_MODULE_4__[\"__\"])('Crowdsignal Poll'))), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__[\"createElement\"])(\"div\", {\n className: \"crowdsignal-forms__connect-to-crowdsignal-body\"\n }, showConnectionMessage && Object(lib_i18n__WEBPACK_IMPORTED_MODULE_4__[\"__\"])('You need to connect to a Crowdsignal account to collect and manage your results.'), showVerificationMessage && Object(lib_i18n__WEBPACK_IMPORTED_MODULE_4__[\"__\"])('Please verify your WordPress.com email address in order to publish your poll.')), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__[\"createElement\"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__[\"Button\"], {\n isPrimary: true,\n onClick: handleConnectClick\n }, showConnectionMessage && Object(lib_i18n__WEBPACK_IMPORTED_MODULE_4__[\"__\"])('Connect to Crowdsignal'), showVerificationMessage && Object(lib_i18n__WEBPACK_IMPORTED_MODULE_4__[\"__\"])('Verify or Change your Email Address')));\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (ConnectToCrowdsignal);\n\n//# sourceURL=webpack:///./client/blocks/poll/connect-to-crowdsignal.js?");
|
110 |
-
|
111 |
-
/***/ }),
|
112 |
-
|
113 |
/***/ "./client/blocks/poll/constants.js":
|
114 |
/*!*****************************************!*\
|
115 |
!*** ./client/blocks/poll/constants.js ***!
|
@@ -166,7 +154,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _wor
|
|
166 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
167 |
|
168 |
"use strict";
|
169 |
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/extends */ \"./node_modules/@babel/runtime/helpers/extends.js\");\n/* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ \"./node_modules/@babel/runtime/helpers/slicedToArray.js\");\n/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"./node_modules/@babel/runtime/helpers/defineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/element */ \"@wordpress/element\");\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! lodash */ \"lodash\");\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/block-editor */ \"@wordpress/block-editor\");\n/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/components */ \"@wordpress/components\");\n/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_7__);\n/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/data */ \"@wordpress/data\");\n/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_8__);\n/* harmony import */ var _wordpress_html_entities__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/html-entities */ \"@wordpress/html-entities\");\n/* harmony import */ var _wordpress_html_entities__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_9__);\n/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/compose */ \"@wordpress/compose\");\n/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_10__);\n/* harmony import */ var components_poll_closed_banner__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! components/poll/closed-banner */ \"./client/components/poll/closed-banner.js\");\n/* harmony import */ var components_poll_styles__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! components/poll/styles */ \"./client/components/poll/styles.js\");\n/* harmony import */ var components_poll_results__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! components/poll/results */ \"./client/components/poll/results.js\");\n/* harmony import */ var components_poll_util__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! components/poll/util */ \"./client/components/poll/util.js\");\n/* harmony import */ var components_with_fallback_styles__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! components/with-fallback-styles */ \"./client/components/with-fallback-styles/index.js\");\n/* harmony import */ var lib_i18n__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! lib/i18n */ \"./client/lib/i18n/index.js\");\n/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./constants */ \"./client/blocks/poll/constants.js\");\n/* harmony import */ var _edit_answers__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./edit-answers */ \"./client/blocks/poll/edit-answers.js\");\n/* harmony import */ var _sidebar__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./sidebar */ \"./client/blocks/poll/sidebar.js\");\n/* harmony import */ var _toolbar__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./toolbar */ \"./client/blocks/poll/toolbar.js\");\n/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./util */ \"./client/blocks/poll/util.js\");\n/* harmony import */ var components_poll_error_banner__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! components/poll/error-banner */ \"./client/components/poll/error-banner.js\");\n/* harmony import */ var uuid__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! uuid */ \"./node_modules/uuid/dist/esm-browser/index.js\");\n/* harmony import */ var _edit_bar__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./edit-bar */ \"./client/blocks/poll/edit-bar.js\");\n/* harmony import */ var _subscriptions__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./subscriptions */ \"./client/blocks/poll/subscriptions.js\");\n/* harmony import */ var _connect_to_crowdsignal__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./connect-to-crowdsignal */ \"./client/blocks/poll/connect-to-crowdsignal.js\");\n\n\n\n\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_2___default()(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\n/**\n * External dependencies\n */\n\n\n/**\n * WordPress dependencies\n */\n\n\n\n\n\n\n/**\n * Internal dependencies\n */\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nObject(_subscriptions__WEBPACK_IMPORTED_MODULE_25__[\"startSubscriptions\"])();\n\nvar isP2tenberg = function isP2tenberg() {\n return 'p2tenberg' in window;\n};\n\nvar withPollAndAnswerIds = function withPollAndAnswerIds(Element) {\n return function (props) {\n var attributes = props.attributes,\n setAttributes = props.setAttributes;\n Object(react__WEBPACK_IMPORTED_MODULE_4__[\"useEffect\"])(function () {\n if (!attributes.pollId) {\n var thePollId = Object(uuid__WEBPACK_IMPORTED_MODULE_23__[\"v4\"])();\n setAttributes({\n pollId: thePollId\n });\n }\n\n if (Object(lodash__WEBPACK_IMPORTED_MODULE_5__[\"some\"])(attributes.answers, function (a) {\n return !a.answerId && a.text;\n })) {\n var answers = Object(lodash__WEBPACK_IMPORTED_MODULE_5__[\"map\"])(attributes.answers, function (answer) {\n if (answer.answerId || !answer.text) {\n return answer;\n }\n\n var answerId = Object(uuid__WEBPACK_IMPORTED_MODULE_23__[\"v4\"])();\n return _objectSpread({}, answer, {\n answerId: answerId\n });\n });\n setAttributes({\n answers: answers\n });\n }\n });\n return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__[\"createElement\"])(Element, props);\n };\n};\n\nvar PollBlock = function PollBlock(props) {\n var attributes = props.attributes,\n className = props.className,\n fallbackStyles = props.fallbackStyles,\n isSelected = props.isSelected,\n setAttributes = props.setAttributes,\n renderStyleProbe = props.renderStyleProbe,\n pollDataFromApi = props.pollDataFromApi,\n addPollClientId = props.addPollClientId,\n removePollClientId = props.removePollClientId;\n Object(react__WEBPACK_IMPORTED_MODULE_4__[\"useEffect\"])(function () {\n if (isP2tenberg()) {\n Object(_subscriptions__WEBPACK_IMPORTED_MODULE_25__[\"startPolling\"])();\n }\n\n if (attributes.pollId) {\n addPollClientId(attributes.pollId);\n }\n\n return function () {\n if (attributes.pollId) {\n removePollClientId(attributes.pollId);\n }\n };\n }, []); // duplicate & same page copy/paste detector/cleaner-upper\n\n Object(react__WEBPACK_IMPORTED_MODULE_4__[\"useEffect\"])(function () {\n if (Object(lodash__WEBPACK_IMPORTED_MODULE_5__[\"isEmpty\"])(attributes.pollId)) {\n return;\n }\n\n if (!window.csPolls) {\n window.csPolls = {};\n }\n\n if (!window.csPolls[attributes.pollId]) {\n window.csPolls[attributes.pollId] = [props.clientId];\n } else if (window.csPolls[attributes.pollId].indexOf(props.clientId) > -1) {// clientid already known, ignore.\n } else {\n var answers = Object(lodash__WEBPACK_IMPORTED_MODULE_5__[\"map\"])(attributes.answers, function (answer) {\n return Object(lodash__WEBPACK_IMPORTED_MODULE_5__[\"omit\"])(answer, ['answerId']);\n });\n setAttributes({\n pollId: null,\n answers: answers\n });\n }\n }, [attributes.pollId]);\n\n var _useState = Object(react__WEBPACK_IMPORTED_MODULE_4__[\"useState\"])(true),\n _useState2 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1___default()(_useState, 2),\n isPollEditable = _useState2[0],\n setIsPollEditable = _useState2[1];\n\n var _useState3 = Object(react__WEBPACK_IMPORTED_MODULE_4__[\"useState\"])(''),\n _useState4 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1___default()(_useState3, 2),\n errorMessage = _useState4[0],\n setErrorMessage = _useState4[1];\n\n var pollIsPublished = !Object(lodash__WEBPACK_IMPORTED_MODULE_5__[\"isEmpty\"])(pollDataFromApi);\n var viewResultsUrl = pollDataFromApi ? pollDataFromApi.viewResultsUrl : '';\n var pollIdFromApi = pollDataFromApi ? pollDataFromApi.id : null;\n var answerIdMap = {};\n\n if (pollDataFromApi) {\n Object(lodash__WEBPACK_IMPORTED_MODULE_5__[\"map\"])(pollDataFromApi.answers, function (answer) {\n answerIdMap[answer.client_id] = answer.id;\n });\n }\n\n var handleChangeQuestion = function handleChangeQuestion(question) {\n return setAttributes({\n question: question\n });\n };\n\n var handleChangeNote = function handleChangeNote(note) {\n return setAttributes({\n note: note\n });\n };\n\n var handleResize = function handleResize(event, handle, element) {\n if (handle !== 'right' && handle !== 'left') {\n return;\n }\n\n setAttributes({\n width: Object(lodash__WEBPACK_IMPORTED_MODULE_5__[\"round\"])(element.offsetWidth / element.parentNode.offsetWidth * 100)\n });\n };\n\n var isResizable = isSelected && attributes.align !== 'full';\n var blockWidth = attributes.align !== 'full' ? \"\".concat(attributes.width, \"%\") : 'auto';\n var isClosed = Object(_util__WEBPACK_IMPORTED_MODULE_21__[\"isPollClosed\"])(attributes.pollStatus, attributes.closedAfterDateTime);\n var showNote = attributes.note || isSelected && isPollEditable;\n var showResults = isClosed && _constants__WEBPACK_IMPORTED_MODULE_17__[\"ClosedPollState\"].SHOW_RESULTS === attributes.closedPollState;\n var isHidden = isClosed && _constants__WEBPACK_IMPORTED_MODULE_17__[\"ClosedPollState\"].HIDDEN === attributes.closedPollState;\n var hideBranding = true; // hide branding in editor for now\n\n Object(react__WEBPACK_IMPORTED_MODULE_4__[\"useEffect\"])(function () {\n return setIsPollEditable(!pollIsPublished);\n }, [isSelected]);\n Object(react__WEBPACK_IMPORTED_MODULE_4__[\"useEffect\"])(function () {\n if (isSelected) {\n Object(_util__WEBPACK_IMPORTED_MODULE_21__[\"toggleButtonStyleAvailability\"])(!attributes.isMultipleChoice);\n }\n }, [attributes.isMultipleChoice, isSelected]);\n var showEditBar = isSelected && pollIsPublished && !isPollEditable;\n var answerStyle = Object(_util__WEBPACK_IMPORTED_MODULE_21__[\"getAnswerStyle\"])(attributes, className);\n\n if (attributes.fontFamily) {\n Object(components_poll_util__WEBPACK_IMPORTED_MODULE_14__[\"loadCustomFont\"])(attributes.fontFamily);\n }\n\n return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__[\"createElement\"])(_connect_to_crowdsignal__WEBPACK_IMPORTED_MODULE_26__[\"default\"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__[\"createElement\"])(_toolbar__WEBPACK_IMPORTED_MODULE_20__[\"default\"], props), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__[\"createElement\"])(_sidebar__WEBPACK_IMPORTED_MODULE_19__[\"default\"], _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, props, {\n viewResultsUrl: viewResultsUrl\n })), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__[\"createElement\"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_7__[\"ResizableBox\"], {\n className: \"crowdsignal-forms-poll__resize-wrapper\",\n size: {\n height: 'auto',\n width: blockWidth\n },\n minWidth: \"25%\",\n maxWidth: \"100%\",\n enable: {\n left: true,\n right: true\n },\n onResizeStop: handleResize,\n showHandle: isResizable,\n resizeRatio: 2\n }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__[\"createElement\"])(\"div\", {\n className: Object(_util__WEBPACK_IMPORTED_MODULE_21__[\"getBlockCssClasses\"])(attributes, className, {\n 'is-selected-in-editor': isSelected,\n 'is-closed': isClosed,\n 'is-hidden': isHidden\n }, 'crowdsignal-forms-poll'),\n style: Object(_util__WEBPACK_IMPORTED_MODULE_21__[\"getStyleVars\"])(attributes, fallbackStyles)\n }, showEditBar && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__[\"createElement\"])(_edit_bar__WEBPACK_IMPORTED_MODULE_24__[\"default\"], {\n onEditClick: function onEditClick() {\n setIsPollEditable(true);\n }\n }), errorMessage && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__[\"createElement\"])(components_poll_error_banner__WEBPACK_IMPORTED_MODULE_22__[\"default\"], null, errorMessage), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__[\"createElement\"])(\"div\", {\n className: \"crowdsignal-forms-poll__content\"\n }, isPollEditable ? Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__[\"createElement\"])(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_6__[\"RichText\"], {\n tagName: \"h3\",\n className: \"crowdsignal-forms-poll__question\",\n placeholder: Object(lib_i18n__WEBPACK_IMPORTED_MODULE_16__[\"__\"])('Enter your question'),\n onChange: handleChangeQuestion,\n value: attributes.question,\n allowedFormats: []\n }) : Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__[\"createElement\"])(\"h3\", {\n className: \"crowdsignal-forms-poll__question\"\n }, attributes.question ? Object(_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_9__[\"decodeEntities\"])(attributes.question) : Object(lib_i18n__WEBPACK_IMPORTED_MODULE_16__[\"__\"])('Enter your question')), showNote && (isPollEditable ? Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__[\"createElement\"])(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_6__[\"RichText\"], {\n tagName: \"p\",\n className: \"crowdsignal-forms-poll__note\",\n placeholder: Object(lib_i18n__WEBPACK_IMPORTED_MODULE_16__[\"__\"])('Add a note (optional)'),\n onChange: handleChangeNote,\n value: attributes.note,\n allowedFormats: []\n }) : Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__[\"createElement\"])(\"p\", {\n className: \"crowdsignal-forms-poll__note\"\n }, attributes.note ? Object(_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_9__[\"decodeEntities\"])(attributes.note) : Object(lib_i18n__WEBPACK_IMPORTED_MODULE_16__[\"__\"])('Add a note (optional)'))), !showResults && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__[\"createElement\"])(_edit_answers__WEBPACK_IMPORTED_MODULE_18__[\"default\"], _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, props, {\n setAttributes: setAttributes,\n disabled: !isPollEditable,\n answerStyle: answerStyle,\n buttonAlignment: attributes.buttonAlignment\n })), showResults && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__[\"createElement\"])(components_poll_results__WEBPACK_IMPORTED_MODULE_13__[\"default\"], {\n answers: Object(components_poll_util__WEBPACK_IMPORTED_MODULE_14__[\"addApiAnswerIds\"])(Object(lodash__WEBPACK_IMPORTED_MODULE_5__[\"filter\"])(attributes.answers, function (answer) {\n return !Object(components_poll_util__WEBPACK_IMPORTED_MODULE_14__[\"isAnswerEmpty\"])(answer);\n }), answerIdMap),\n pollIdFromApi: pollIdFromApi,\n hideBranding: hideBranding,\n setErrorMessage: setErrorMessage\n })), isClosed && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__[\"createElement\"])(components_poll_closed_banner__WEBPACK_IMPORTED_MODULE_11__[\"default\"], {\n isPollHidden: isHidden,\n isPollClosed: isClosed\n }), renderStyleProbe())));\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_10__[\"compose\"])([Object(components_with_fallback_styles__WEBPACK_IMPORTED_MODULE_15__[\"withFallbackStyles\"])(components_poll_styles__WEBPACK_IMPORTED_MODULE_12__[\"PollStyles\"], components_poll_styles__WEBPACK_IMPORTED_MODULE_12__[\"getPollStyles\"]), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_8__[\"withSelect\"])(function (select, ownProps) {\n var _select = select('crowdsignal-forms/polls'),\n getPollDataByClientId = _select.getPollDataByClientId,\n shouldTryFetchingPollData = _select.shouldTryFetchingPollData,\n isFetchingPollData = _select.isFetchingPollData;\n\n var attributes = ownProps.attributes;\n var pollDataFromApi = attributes.pollId ? getPollDataByClientId(attributes.pollId) : null;\n return {\n pollDataFromApi: pollDataFromApi,\n getPollDataByClientId: getPollDataByClientId,\n shouldTryFetchingPollData: shouldTryFetchingPollData,\n isFetchingPollData: isFetchingPollData\n };\n}), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_8__[\"withDispatch\"])(function (dispatch) {\n var _dispatch = dispatch('crowdsignal-forms/polls'),\n setTryFetchPollData = _dispatch.setTryFetchPollData,\n setPollApiDataForClientId = _dispatch.setPollApiDataForClientId,\n setIsFetchingPollData = _dispatch.setIsFetchingPollData,\n addPollClientId = _dispatch.addPollClientId,\n removePollClientId = _dispatch.removePollClientId;\n\n return {\n setTryFetchPollData: setTryFetchPollData,\n setPollApiDataForClientId: setPollApiDataForClientId,\n setIsFetchingPollData: setIsFetchingPollData,\n addPollClientId: addPollClientId,\n removePollClientId: removePollClientId\n };\n})])(withPollAndAnswerIds(PollBlock)));\n\n//# sourceURL=webpack:///./client/blocks/poll/edit.js?");
|
170 |
|
171 |
/***/ }),
|
172 |
|
@@ -178,7 +166,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _bab
|
|
178 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
179 |
|
180 |
"use strict";
|
181 |
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ \"@wordpress/element\");\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var components_icon_poll__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! components/icon/poll */ \"./client/components/icon/poll.js\");\n/* harmony import */ var lib_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lib/i18n */ \"./client/lib/i18n/index.js\");\n/* harmony import */ var _store__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./store */ \"./client/blocks/poll/store.js\");\n/* harmony import */ var _edit__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./edit */ \"./client/blocks/poll/edit.js\");\n/* harmony import */ var _attributes__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./attributes */ \"./client/blocks/poll/attributes.js\");\n\n\n/**\n * Internal dependencies\n */\n\n\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n title: Object(lib_i18n__WEBPACK_IMPORTED_MODULE_2__[\"__\"])('Poll'),\n description: Object(lib_i18n__WEBPACK_IMPORTED_MODULE_2__[\"__\"])('Create polls and get your audience’s opinion — powered by Crowdsignal.'),\n category: '
|
182 |
|
183 |
/***/ }),
|
184 |
|
@@ -210,11 +198,11 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _bab
|
|
210 |
/*!*********************************************!*\
|
211 |
!*** ./client/blocks/poll/subscriptions.js ***!
|
212 |
\*********************************************/
|
213 |
-
/*! exports provided: startPolling, startSubscriptions */
|
214 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
215 |
|
216 |
"use strict";
|
217 |
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"startPolling\", function() { return startPolling; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"startSubscriptions\", function() { return startSubscriptions; });\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"./node_modules/@babel/runtime/helpers/defineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/data */ \"@wordpress/data\");\n/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/api-fetch */ \"@wordpress/api-fetch\");\n/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lodash */ \"lodash\");\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_3__);\n\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\n/**\n * WordPress dependencies\n */\n\n\n\n\nvar isPollBlock = function isPollBlock(block) {\n return block.name === 'crowdsignal-forms/poll';\n};\n\nvar subsStarted = false;\nvar pollingStarted = false;\nvar startPolling = function startPolling() {\n if (pollingStarted) {\n return;\n }\n\n pollingStarted = true;\n var lastInterval = null;\n\n var scheduleNextTick = function scheduleNextTick() {\n if (null !== lastInterval) {\n clearTimeout(lastInterval);\n }\n\n lastInterval = setTimeout(function () {\n return tick();\n }, 1000 + Math.random() * 1000);\n };\n\n var tick = function tick() {\n var _select = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__[\"select\"])('crowdsignal-forms/polls'),\n getPollClientIds = _select.getPollClientIds,\n getPollDataByClientId = _select.getPollDataByClientId,\n shouldTryFetchingPollData = _select.shouldTryFetchingPollData,\n isFetchingPollData = _select.isFetchingPollData;\n\n var pollsWithNoApiData = Object(lodash__WEBPACK_IMPORTED_MODULE_3__[\"filter\"])(getPollClientIds(), function (clientId) {\n return null === getPollDataByClientId(clientId);\n });\n\n if (pollsWithNoApiData.length < 1) {\n return scheduleNextTick();\n }\n\n var _dispatch = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__[\"dispatch\"])('crowdsignal-forms/polls'),\n setTryFetchPollData = _dispatch.setTryFetchPollData,\n setPollApiDataForClientId = _dispatch.setPollApiDataForClientId,\n setIsFetchingPollData = _dispatch.setIsFetchingPollData;\n\n if (!shouldTryFetchingPollData()) {\n setTryFetchPollData(true);\n } else if (!isFetchingPollData()) {\n setIsFetchingPollData(true);\n Promise.all(Object(lodash__WEBPACK_IMPORTED_MODULE_3__[\"map\"])(pollsWithNoApiData, function (clientId) {\n return _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_2___default()({\n path: \"/crowdsignal-forms/v1/polls/\".concat(clientId, \"?cached=1\"),\n method: 'GET'\n }).then(function (response) {\n return setPollApiDataForClientId(clientId, _objectSpread({}, response, {\n viewResultsUrl: \"https://app.crowdsignal.com/polls/\".concat(response.id, \"/results\")\n }));\n }, function () {\n return setPollApiDataForClientId(clientId, null);\n });\n })).finally(function () {\n return setIsFetchingPollData(false);\n });\n }\n\n return scheduleNextTick();\n };\n\n tick();\n};\nvar startSubscriptions = function startSubscriptions() {\n if (subsStarted) {\n return;\n }\n\n subsStarted = true;\n\n var _select2 = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__[\"select\"])('core/editor'),\n isEditedPostDirty = _select2.isEditedPostDirty,\n isEditedPostNew = _select2.isEditedPostNew,\n isSavingPost = _select2.isSavingPost,\n isCleanNewPost = _select2.isCleanNewPost,\n getCurrentPostId = _select2.getCurrentPostId;\n\n var _dispatch2 = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__[\"dispatch\"])('crowdsignal-forms/polls'),\n setTryFetchPollData = _dispatch2.setTryFetchPollData,\n setPollApiDataForClientId = _dispatch2.setPollApiDataForClientId,\n setIsFetchingPollData = _dispatch2.setIsFetchingPollData;\n\n var _select3 = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__[\"select\"])('crowdsignal-forms/polls'),\n shouldTryFetchingPollData = _select3.shouldTryFetchingPollData,\n getPollDataByClientId = _select3.getPollDataByClientId,\n isFetchingPollData = _select3.isFetchingPollData;\n\n Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__[\"subscribe\"])(function () {\n var pollBlocks = Object(lodash__WEBPACK_IMPORTED_MODULE_3__[\"filter\"])(Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__[\"select\"])('core/block-editor').getBlocks(), isPollBlock);\n\n if (pollBlocks.length < 1) {\n return;\n }\n\n if (isFetchingPollData()) {\n return;\n }\n\n if (isCleanNewPost() || isEditedPostNew() || isSavingPost() || isEditedPostDirty()) {\n return;\n }\n\n var postId = getCurrentPostId();\n\n if (!postId) {\n return;\n }\n\n var pollsThatAreNotFetched = Object(lodash__WEBPACK_IMPORTED_MODULE_3__[\"filter\"])(pollBlocks, function (_ref) {\n var attributes = _ref.attributes;\n return attributes.pollId && null === getPollDataByClientId(attributes.pollId);\n });\n\n if (pollsThatAreNotFetched.length < 1) {\n return;\n }\n\n if (!shouldTryFetchingPollData()) {\n setTryFetchPollData(true);\n } else if (!isFetchingPollData()) {\n setIsFetchingPollData(true);\n Promise.all(Object(lodash__WEBPACK_IMPORTED_MODULE_3__[\"map\"])(pollsThatAreNotFetched, function (pollBlock) {\n var pollId = pollBlock.attributes.pollId;\n return _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_2___default()({\n path: \"/crowdsignal-forms/v1/polls/\".concat(pollId, \"?cached=1\"),\n method: 'GET'\n }).then(function (response) {\n return setPollApiDataForClientId(pollId, _objectSpread({}, response, {\n viewResultsUrl: \"https://app.crowdsignal.com/polls/\".concat(response.id, \"/results\")\n }));\n }, function () {\n return setPollApiDataForClientId(pollId, null);\n });\n })).finally(function () {\n return setIsFetchingPollData(false);\n });\n }\n });\n};\n\n//# sourceURL=webpack:///./client/blocks/poll/subscriptions.js?");
|
218 |
|
219 |
/***/ }),
|
220 |
|
@@ -242,6 +230,162 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) *
|
|
242 |
|
243 |
/***/ }),
|
244 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
245 |
/***/ "./client/components/icon/checklist-multiple-choice.js":
|
246 |
/*!*************************************************************!*\
|
247 |
!*** ./client/components/icon/checklist-multiple-choice.js ***!
|
@@ -266,6 +410,18 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _wor
|
|
266 |
|
267 |
/***/ }),
|
268 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
269 |
/***/ "./client/components/icon/poll.js":
|
270 |
/*!****************************************!*\
|
271 |
!*** ./client/components/icon/poll.js ***!
|
@@ -278,6 +434,54 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _wor
|
|
278 |
|
279 |
/***/ }),
|
280 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
281 |
/***/ "./client/components/poll/answer-results.js":
|
282 |
/*!**************************************************!*\
|
283 |
!*** ./client/components/poll/answer-results.js ***!
|
@@ -362,6 +566,78 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) *
|
|
362 |
|
363 |
/***/ }),
|
364 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
365 |
/***/ "./client/components/with-fallback-styles/index.js":
|
366 |
/*!*********************************************************!*\
|
367 |
!*** ./client/components/with-fallback-styles/index.js ***!
|
@@ -386,6 +662,18 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) *
|
|
386 |
|
387 |
/***/ }),
|
388 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
389 |
/***/ "./client/data/hooks/index.js":
|
390 |
/*!************************************!*\
|
391 |
!*** ./client/data/hooks/index.js ***!
|
@@ -394,7 +682,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) *
|
|
394 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
395 |
|
396 |
"use strict";
|
397 |
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"usePollResults\", function() { return usePollResults; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"usePollVote\", function() { return usePollVote; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"useIsCsConnected\", function() { return useIsCsConnected; });\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"@babel/runtime/regenerator\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"./node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ \"./node_modules/@babel/runtime/helpers/slicedToArray.js\");\n/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var js_cookie__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! js-cookie */ \"./node_modules/js-cookie/src/js.cookie.js\");\n/* harmony import */ var js_cookie__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(js_cookie__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var data_poll__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! data/poll */ \"./client/data/poll/index.js\");\n/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./util */ \"./client/data/hooks/util.js\");\n/* harmony import */ var blocks_poll_constants__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! blocks/poll/constants */ \"./client/blocks/poll/constants.js\");\n\n\n\n\n/**\n * External dependencies\n */\n\n\n/**\n * Internal dependencies\n */\n\n\n\n\nvar usePollResults = function usePollResults(pollId) {\n var _useFetch = Object(_util__WEBPACK_IMPORTED_MODULE_6__[\"useFetch\"])(function () {\n return Object(data_poll__WEBPACK_IMPORTED_MODULE_5__[\"requestResults\"])(pollId);\n }, [pollId]),\n data = _useFetch.data,\n error = _useFetch.error,\n loading = _useFetch.loading;\n\n return {\n error: error,\n loading: loading,\n results: data\n };\n};\n/**\n * React Hook that returns state variables for voting status and a function to perform a vote.\n *\n * @param {number} pollId ID of the poll being loaded.\n * @param {boolean} enableVoteRestriction sets whether or not the vote cookie is read and set\n */\n\nvar usePollVote = function usePollVote(pollId) {\n var enableVoteRestriction = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n var cookieName = \"cs-poll-\".concat(pollId);\n\n var _useState = Object(react__WEBPACK_IMPORTED_MODULE_3__[\"useState\"])(false),\n _useState2 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_2___default()(_useState, 2),\n isVoting = _useState2[0],\n setIsVoting = _useState2[1];\n\n var _useState3 = Object(react__WEBPACK_IMPORTED_MODULE_3__[\"useState\"])(false),\n _useState4 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_2___default()(_useState3, 2),\n hasVoted = _useState4[0],\n setHasVoted = _useState4[1];\n\n Object(react__WEBPACK_IMPORTED_MODULE_3__[\"useEffect\"])(function () {\n if (enableVoteRestriction && undefined !== js_cookie__WEBPACK_IMPORTED_MODULE_4___default.a.get(cookieName)) {\n setHasVoted(true);\n }\n }, []);\n\n var vote = /*#__PURE__*/function () {\n var _ref = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee(selectedAnswerIds) {\n var nonce;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n _context.prev = 0;\n setIsVoting(true);\n _context.next = 4;\n return Object(data_poll__WEBPACK_IMPORTED_MODULE_5__[\"requestVoteNonce\"])(pollId);\n\n case 4:\n nonce = _context.sent;\n _context.next = 7;\n return Object(data_poll__WEBPACK_IMPORTED_MODULE_5__[\"requestVote\"])(nonce, pollId, selectedAnswerIds);\n\n case 7:\n setHasVoted(true);\n\n if (enableVoteRestriction) {\n
|
398 |
|
399 |
/***/ }),
|
400 |
|
@@ -418,7 +706,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) *
|
|
418 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
419 |
|
420 |
"use strict";
|
421 |
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"requestResults\", function() { return requestResults; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"requestVoteNonce\", function() { return requestVoteNonce; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"requestVote\", function() { return requestVote; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"CrowdsignalFormsError\", function() { return CrowdsignalFormsError; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"CrowdsignalFormsServerError\", function() { return CrowdsignalFormsServerError; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"requestIsCsConnected\", function() { return requestIsCsConnected; });\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ \"./node_modules/@babel/runtime/helpers/inherits.js\");\n/* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ \"./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js\");\n/* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ \"./node_modules/@babel/runtime/helpers/getPrototypeOf.js\");\n/* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _babel_runtime_helpers_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/wrapNativeSuper */ \"./node_modules/@babel/runtime/helpers/wrapNativeSuper.js\");\n/* harmony import */ var _babel_runtime_helpers_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"@babel/runtime/regenerator\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"./node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/api-fetch */ \"@wordpress/api-fetch\");\n/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_7__);\n/* harmony import */ var lib_i18n__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! lib/i18n */ \"./client/lib/i18n/index.js\");\n\n\n\n\n\n\n\n\nfunction _createSuper(Derived) { return function () { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default()(Derived), result; if (_isNativeReflectConstruct()) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default()(this, result); }; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\n/**\n * External dependencies\n */\n\n/**\n * Internal dependencies\n */\n\n\n/**\n * Fetch the poll results for the given pollId\n *\n * @param {number} pollId Poll ID.\n * @return {Promise} Promise that resolves to a key-value object with answer IDs and vote counts.\n */\n\nvar requestResults = /*#__PURE__*/function () {\n var _ref = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_6___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5___default.a.mark(function _callee(pollId) {\n var baseUrl;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5___default.a.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n baseUrl = 'https://api.crowdsignal.com/v3/polls';\n return _context.abrupt(\"return\", window.fetch(\"\".concat(baseUrl, \"/\").concat(pollId, \"/results\"), {\n method: 'GET',\n headers: {\n 'content-type': 'application/json'\n }\n }).then(function (response) {\n if (response.status >= 200 && response.status < 300) {\n return response.json();\n }\n\n throw response;\n }).then(function (response) {\n if (404 === response.status) {\n // poll doesn't exist on the platform yet, return an empty result\n return {};\n } else if (response.error) {\n throw new Error(response.message);\n }\n\n return response.results.votes_by_answer;\n }));\n\n case 2:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee);\n }));\n\n return function requestResults(_x) {\n return _ref.apply(this, arguments);\n };\n}();\nvar requestVoteNonce = /*#__PURE__*/function () {\n var _ref2 = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_6___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5___default.a.mark(function _callee2(pollId) {\n var hash, timestamp, respNonce, jsonNonce;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5___default.a.wrap(function _callee2$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n hash = '5430eeac3911395001d731d9702fc38b'; // hash not used when format=json is passed\n\n timestamp = new Date().getTime();\n _context2.next = 4;\n return window.fetch(\"https://polldaddy.com/n/\".concat(hash, \"/\").concat(pollId, \"?\").concat(timestamp, \"&format=json\"));\n\n case 4:\n respNonce = _context2.sent;\n\n if (respNonce.ok) {\n _context2.next = 7;\n break;\n }\n\n throw new CrowdsignalFormsServerError();\n\n case 7:\n _context2.next = 9;\n return respNonce.json();\n\n case 9:\n jsonNonce = _context2.sent;\n\n if (jsonNonce.nonce) {\n _context2.next = 12;\n break;\n }\n\n throw new CrowdsignalFormsServerError();\n\n case 12:\n return _context2.abrupt(\"return\", jsonNonce.nonce);\n\n case 13:\n case \"end\":\n return _context2.stop();\n }\n }\n }, _callee2);\n }));\n\n return function requestVoteNonce(_x2) {\n return _ref2.apply(this, arguments);\n };\n}();\nvar requestVote = /*#__PURE__*/function () {\n var _ref3 = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_6___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5___default.a.mark(function _callee3(nonce, pollId, selectedAnswerIds) {\n var answerString, respVote, jsonVote;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5___default.a.wrap(function _callee3$(_context3) {\n while (1) {\n switch (_context3.prev = _context3.next) {\n case 0:\n answerString = selectedAnswerIds.join(',');\n _context3.next = 3;\n return window.fetch(\"https://polls.polldaddy.com/vote-js.php?format=json&p=\".concat(pollId, \"&b=1&a=\").concat(answerString, \"&o=&va=16&cookie=0&n=\").concat(nonce, \"&url=\").concat(encodeURIComponent(window.location)));\n\n case 3:\n respVote = _context3.sent;\n\n if (respVote.ok) {\n _context3.next = 6;\n break;\n }\n\n throw new CrowdsignalFormsServerError();\n\n case 6:\n _context3.next = 8;\n return respVote.json();\n\n case 8:\n jsonVote = _context3.sent;\n\n if (!('error' === jsonVote.status)) {\n _context3.next = 11;\n break;\n }\n\n throw new CrowdsignalFormsError(jsonVote.error);\n\n case 11:\n case \"end\":\n return _context3.stop();\n }\n }\n }, _callee3);\n }));\n\n return function requestVote(_x3, _x4, _x5) {\n return _ref3.apply(this, arguments);\n };\n}();\nvar CrowdsignalFormsError = /*#__PURE__*/function (_Error) {\n _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1___default()(CrowdsignalFormsError, _Error);\n\n var _super = _createSuper(CrowdsignalFormsError);\n\n function CrowdsignalFormsError() {\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, CrowdsignalFormsError);\n\n return _super.apply(this, arguments);\n }\n\n return CrowdsignalFormsError;\n}( /*#__PURE__*/_babel_runtime_helpers_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_4___default()(Error));\nvar CrowdsignalFormsServerError = /*#__PURE__*/function (_CrowdsignalFormsErro) {\n _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1___default()(CrowdsignalFormsServerError, _CrowdsignalFormsErro);\n\n var _super2 = _createSuper(CrowdsignalFormsServerError);\n\n function CrowdsignalFormsServerError() {\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, CrowdsignalFormsServerError);\n\n return _super2.call(this, Object(lib_i18n__WEBPACK_IMPORTED_MODULE_8__[\"__\"])('Server error. Please try again.'));\n }\n\n return CrowdsignalFormsServerError;\n}(CrowdsignalFormsError);\n/**\n * Returns the connected state of the current user's account.\n *\n * @return {string} Enum value of the account's state.\n */\n\nvar requestIsCsConnected = /*#__PURE__*/function () {\n var _ref4 = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_6___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5___default.a.mark(function _callee4() {\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5___default.a.wrap(function _callee4$(_context4) {\n while (1) {\n switch (_context4.prev = _context4.next) {\n case 0:\n _context4.next = 2;\n return _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_7___default()({\n path: \"/crowdsignal-forms/v1/account/connected\",\n method: 'GET'\n });\n\n case 2:\n return _context4.abrupt(\"return\", _context4.sent);\n\n case 3:\n case \"end\":\n return _context4.stop();\n }\n }\n }, _callee4);\n }));\n\n return function requestIsCsConnected() {\n return _ref4.apply(this, arguments);\n };\n}();\n\n//# sourceURL=webpack:///./client/data/poll/index.js?");
|
422 |
|
423 |
/***/ }),
|
424 |
|
@@ -430,7 +718,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) *
|
|
430 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
431 |
|
432 |
"use strict";
|
433 |
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/blocks */ \"@wordpress/blocks\");\n/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var blocks_poll__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! blocks/poll */ \"./client/blocks/poll/index.js\");\n/**\n * External dependencies\n */\n\n/**\n * Internal dependencies\n */\n\n\nObject(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__[\"registerBlockType\"])('crowdsignal-forms/poll', blocks_poll__WEBPACK_IMPORTED_MODULE_1__[\"default\"]);\n\n//# sourceURL=webpack:///./client/editor.js?");
|
434 |
|
435 |
/***/ }),
|
436 |
|
@@ -534,6 +822,54 @@ eval("function _defineProperty(obj, key, value) {\n if (key in obj) {\n Obje
|
|
534 |
|
535 |
/***/ }),
|
536 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
537 |
/***/ "./node_modules/@babel/runtime/helpers/extends.js":
|
538 |
/*!********************************************************!*\
|
539 |
!*** ./node_modules/@babel/runtime/helpers/extends.js ***!
|
@@ -743,6 +1079,42 @@ eval("var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!\n Cop
|
|
743 |
|
744 |
/***/ }),
|
745 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
746 |
/***/ "./node_modules/js-cookie/src/js.cookie.js":
|
747 |
/*!*************************************************!*\
|
748 |
!*** ./node_modules/js-cookie/src/js.cookie.js ***!
|
@@ -861,6 +1233,126 @@ eval("\n\nif (undefined === 'production') {\n module.exports = __webpack_requir
|
|
861 |
|
862 |
/***/ }),
|
863 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
864 |
/***/ "./node_modules/uuid/dist/esm-browser/bytesToUuid.js":
|
865 |
/*!***********************************************************!*\
|
866 |
!*** ./node_modules/uuid/dist/esm-browser/bytesToUuid.js ***!
|
@@ -1111,6 +1603,17 @@ eval("(function() { module.exports = this[\"lodash\"]; }());\n\n//# sourceURL=we
|
|
1111 |
|
1112 |
eval("(function() { module.exports = this[\"React\"]; }());\n\n//# sourceURL=webpack:///external_%7B%22this%22:%22React%22%7D?");
|
1113 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1114 |
/***/ })
|
1115 |
|
1116 |
/******/ })));
|
98 |
|
99 |
/***/ }),
|
100 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
101 |
/***/ "./client/blocks/poll/constants.js":
|
102 |
/*!*****************************************!*\
|
103 |
!*** ./client/blocks/poll/constants.js ***!
|
154 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
155 |
|
156 |
"use strict";
|
157 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/extends */ \"./node_modules/@babel/runtime/helpers/extends.js\");\n/* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ \"./node_modules/@babel/runtime/helpers/slicedToArray.js\");\n/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"./node_modules/@babel/runtime/helpers/defineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/element */ \"@wordpress/element\");\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! lodash */ \"lodash\");\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/block-editor */ \"@wordpress/block-editor\");\n/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/components */ \"@wordpress/components\");\n/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_7__);\n/* harmony import */ var _wordpress_html_entities__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/html-entities */ \"@wordpress/html-entities\");\n/* harmony import */ var _wordpress_html_entities__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_8__);\n/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/compose */ \"@wordpress/compose\");\n/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_9__);\n/* harmony import */ var components_poll_closed_banner__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! components/poll/closed-banner */ \"./client/components/poll/closed-banner.js\");\n/* harmony import */ var components_poll_styles__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! components/poll/styles */ \"./client/components/poll/styles.js\");\n/* harmony import */ var components_poll_results__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! components/poll/results */ \"./client/components/poll/results.js\");\n/* harmony import */ var components_poll_util__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! components/poll/util */ \"./client/components/poll/util.js\");\n/* harmony import */ var components_with_fallback_styles__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! components/with-fallback-styles */ \"./client/components/with-fallback-styles/index.js\");\n/* harmony import */ var lib_i18n__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! lib/i18n */ \"./client/lib/i18n/index.js\");\n/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./constants */ \"./client/blocks/poll/constants.js\");\n/* harmony import */ var _edit_answers__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./edit-answers */ \"./client/blocks/poll/edit-answers.js\");\n/* harmony import */ var _sidebar__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./sidebar */ \"./client/blocks/poll/sidebar.js\");\n/* harmony import */ var _toolbar__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./toolbar */ \"./client/blocks/poll/toolbar.js\");\n/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./util */ \"./client/blocks/poll/util.js\");\n/* harmony import */ var components_poll_error_banner__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! components/poll/error-banner */ \"./client/components/poll/error-banner.js\");\n/* harmony import */ var uuid__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! uuid */ \"./node_modules/uuid/dist/esm-browser/index.js\");\n/* harmony import */ var _edit_bar__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./edit-bar */ \"./client/blocks/poll/edit-bar.js\");\n/* harmony import */ var components_connect_to_crowdsignal__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! components/connect-to-crowdsignal */ \"./client/components/connect-to-crowdsignal/index.js\");\n/* harmony import */ var components_icon_poll__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! components/icon/poll */ \"./client/components/icon/poll.js\");\n/* harmony import */ var components_with_poll_base__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! components/with-poll-base */ \"./client/components/with-poll-base/index.js\");\n\n\n\n\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_2___default()(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\n/**\n * External dependencies\n */\n\n\n/**\n * WordPress dependencies\n */\n\n\n\n\n\n/**\n * Internal dependencies\n */\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nvar withPollAndAnswerIds = function withPollAndAnswerIds(Element) {\n return function (props) {\n var attributes = props.attributes,\n setAttributes = props.setAttributes;\n Object(react__WEBPACK_IMPORTED_MODULE_4__[\"useEffect\"])(function () {\n if (!attributes.pollId) {\n var thePollId = Object(uuid__WEBPACK_IMPORTED_MODULE_22__[\"v4\"])();\n setAttributes({\n pollId: thePollId\n });\n }\n\n if (Object(lodash__WEBPACK_IMPORTED_MODULE_5__[\"some\"])(attributes.answers, function (a) {\n return !a.answerId && a.text;\n })) {\n var answers = Object(lodash__WEBPACK_IMPORTED_MODULE_5__[\"map\"])(attributes.answers, function (answer) {\n if (answer.answerId || !answer.text) {\n return answer;\n }\n\n var answerId = Object(uuid__WEBPACK_IMPORTED_MODULE_22__[\"v4\"])();\n return _objectSpread({}, answer, {\n answerId: answerId\n });\n });\n setAttributes({\n answers: answers\n });\n }\n });\n return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__[\"createElement\"])(Element, props);\n };\n};\n\nvar PollBlock = function PollBlock(props) {\n var attributes = props.attributes,\n className = props.className,\n fallbackStyles = props.fallbackStyles,\n isSelected = props.isSelected,\n setAttributes = props.setAttributes,\n renderStyleProbe = props.renderStyleProbe,\n pollDataFromApi = props.pollDataFromApi;\n\n var _useState = Object(react__WEBPACK_IMPORTED_MODULE_4__[\"useState\"])(true),\n _useState2 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1___default()(_useState, 2),\n isPollEditable = _useState2[0],\n setIsPollEditable = _useState2[1];\n\n var _useState3 = Object(react__WEBPACK_IMPORTED_MODULE_4__[\"useState\"])(''),\n _useState4 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1___default()(_useState3, 2),\n errorMessage = _useState4[0],\n setErrorMessage = _useState4[1];\n\n var pollIsPublished = !Object(lodash__WEBPACK_IMPORTED_MODULE_5__[\"isEmpty\"])(pollDataFromApi);\n var viewResultsUrl = pollDataFromApi ? pollDataFromApi.viewResultsUrl : '';\n var pollIdFromApi = pollDataFromApi ? pollDataFromApi.id : null;\n var answerIdMap = {};\n\n if (pollDataFromApi) {\n Object(lodash__WEBPACK_IMPORTED_MODULE_5__[\"map\"])(pollDataFromApi.answers, function (answer) {\n answerIdMap[answer.client_id] = answer.id;\n });\n }\n\n var handleChangeQuestion = function handleChangeQuestion(question) {\n return setAttributes({\n question: question\n });\n };\n\n var handleChangeNote = function handleChangeNote(note) {\n return setAttributes({\n note: note\n });\n };\n\n var handleResize = function handleResize(event, handle, element) {\n if (handle !== 'right' && handle !== 'left') {\n return;\n }\n\n setAttributes({\n width: Object(lodash__WEBPACK_IMPORTED_MODULE_5__[\"round\"])(element.offsetWidth / element.parentNode.offsetWidth * 100)\n });\n };\n\n var isResizable = isSelected && attributes.align !== 'full';\n var blockWidth = attributes.align !== 'full' ? \"\".concat(attributes.width, \"%\") : 'auto';\n var isClosed = Object(_util__WEBPACK_IMPORTED_MODULE_20__[\"isPollClosed\"])(attributes.pollStatus, attributes.closedAfterDateTime);\n var showNote = attributes.note || isSelected && isPollEditable;\n var showResults = isClosed && _constants__WEBPACK_IMPORTED_MODULE_16__[\"ClosedPollState\"].SHOW_RESULTS === attributes.closedPollState;\n var isHidden = isClosed && _constants__WEBPACK_IMPORTED_MODULE_16__[\"ClosedPollState\"].HIDDEN === attributes.closedPollState;\n var hideBranding = true; // hide branding in editor for now\n\n Object(react__WEBPACK_IMPORTED_MODULE_4__[\"useEffect\"])(function () {\n return setIsPollEditable(!pollIsPublished);\n }, [isSelected]);\n Object(react__WEBPACK_IMPORTED_MODULE_4__[\"useEffect\"])(function () {\n if (isSelected) {\n Object(_util__WEBPACK_IMPORTED_MODULE_20__[\"toggleButtonStyleAvailability\"])(!attributes.isMultipleChoice);\n }\n }, [attributes.isMultipleChoice, isSelected]);\n var showEditBar = isSelected && pollIsPublished && !isPollEditable;\n var answerStyle = Object(_util__WEBPACK_IMPORTED_MODULE_20__[\"getAnswerStyle\"])(attributes, className);\n\n if (attributes.fontFamily) {\n Object(components_poll_util__WEBPACK_IMPORTED_MODULE_13__[\"loadCustomFont\"])(attributes.fontFamily);\n }\n\n return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__[\"createElement\"])(components_connect_to_crowdsignal__WEBPACK_IMPORTED_MODULE_24__[\"default\"], {\n blockIcon: Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__[\"createElement\"])(components_icon_poll__WEBPACK_IMPORTED_MODULE_25__[\"default\"], null),\n blockName: Object(lib_i18n__WEBPACK_IMPORTED_MODULE_15__[\"__\"])('Crowdsignal Poll')\n }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__[\"createElement\"])(_toolbar__WEBPACK_IMPORTED_MODULE_19__[\"default\"], props), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__[\"createElement\"])(_sidebar__WEBPACK_IMPORTED_MODULE_18__[\"default\"], _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, props, {\n viewResultsUrl: viewResultsUrl\n })), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__[\"createElement\"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_7__[\"ResizableBox\"], {\n className: \"crowdsignal-forms-poll__resize-wrapper\",\n size: {\n height: 'auto',\n width: blockWidth\n },\n minWidth: \"25%\",\n maxWidth: \"100%\",\n enable: {\n left: true,\n right: true\n },\n onResizeStop: handleResize,\n showHandle: isResizable,\n resizeRatio: 2\n }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__[\"createElement\"])(\"div\", {\n className: Object(_util__WEBPACK_IMPORTED_MODULE_20__[\"getBlockCssClasses\"])(attributes, className, {\n 'is-selected-in-editor': isSelected,\n 'is-closed': isClosed,\n 'is-hidden': isHidden\n }, 'crowdsignal-forms-poll'),\n style: Object(_util__WEBPACK_IMPORTED_MODULE_20__[\"getStyleVars\"])(attributes, fallbackStyles)\n }, showEditBar && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__[\"createElement\"])(_edit_bar__WEBPACK_IMPORTED_MODULE_23__[\"default\"], {\n onEditClick: function onEditClick() {\n setIsPollEditable(true);\n }\n }), errorMessage && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__[\"createElement\"])(components_poll_error_banner__WEBPACK_IMPORTED_MODULE_21__[\"default\"], null, errorMessage), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__[\"createElement\"])(\"div\", {\n className: \"crowdsignal-forms-poll__content\"\n }, isPollEditable ? Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__[\"createElement\"])(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_6__[\"RichText\"], {\n tagName: \"h3\",\n className: \"crowdsignal-forms-poll__question\",\n placeholder: Object(lib_i18n__WEBPACK_IMPORTED_MODULE_15__[\"__\"])('Enter your question'),\n onChange: handleChangeQuestion,\n value: attributes.question,\n allowedFormats: []\n }) : Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__[\"createElement\"])(\"h3\", {\n className: \"crowdsignal-forms-poll__question\"\n }, attributes.question ? Object(_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_8__[\"decodeEntities\"])(attributes.question) : Object(lib_i18n__WEBPACK_IMPORTED_MODULE_15__[\"__\"])('Enter your question')), showNote && (isPollEditable ? Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__[\"createElement\"])(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_6__[\"RichText\"], {\n tagName: \"p\",\n className: \"crowdsignal-forms-poll__note\",\n placeholder: Object(lib_i18n__WEBPACK_IMPORTED_MODULE_15__[\"__\"])('Add a note (optional)'),\n onChange: handleChangeNote,\n value: attributes.note,\n allowedFormats: []\n }) : Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__[\"createElement\"])(\"p\", {\n className: \"crowdsignal-forms-poll__note\"\n }, attributes.note ? Object(_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_8__[\"decodeEntities\"])(attributes.note) : Object(lib_i18n__WEBPACK_IMPORTED_MODULE_15__[\"__\"])('Add a note (optional)'))), !showResults && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__[\"createElement\"])(_edit_answers__WEBPACK_IMPORTED_MODULE_17__[\"default\"], _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, props, {\n setAttributes: setAttributes,\n disabled: !isPollEditable,\n answerStyle: answerStyle,\n buttonAlignment: attributes.buttonAlignment\n })), showResults && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__[\"createElement\"])(components_poll_results__WEBPACK_IMPORTED_MODULE_12__[\"default\"], {\n answers: Object(components_poll_util__WEBPACK_IMPORTED_MODULE_13__[\"addApiAnswerIds\"])(Object(lodash__WEBPACK_IMPORTED_MODULE_5__[\"filter\"])(attributes.answers, function (answer) {\n return !Object(components_poll_util__WEBPACK_IMPORTED_MODULE_13__[\"isAnswerEmpty\"])(answer);\n }), answerIdMap),\n pollIdFromApi: pollIdFromApi,\n hideBranding: hideBranding,\n setErrorMessage: setErrorMessage\n })), isClosed && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__[\"createElement\"])(components_poll_closed_banner__WEBPACK_IMPORTED_MODULE_10__[\"default\"], {\n isPollHidden: isHidden,\n isPollClosed: isClosed\n }), renderStyleProbe())));\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_9__[\"compose\"])([Object(components_with_fallback_styles__WEBPACK_IMPORTED_MODULE_14__[\"withFallbackStyles\"])(components_poll_styles__WEBPACK_IMPORTED_MODULE_11__[\"PollStyles\"], components_poll_styles__WEBPACK_IMPORTED_MODULE_11__[\"getPollStyles\"]), components_with_poll_base__WEBPACK_IMPORTED_MODULE_26__[\"default\"], withPollAndAnswerIds])(PollBlock));\n\n//# sourceURL=webpack:///./client/blocks/poll/edit.js?");
|
158 |
|
159 |
/***/ }),
|
160 |
|
166 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
167 |
|
168 |
"use strict";
|
169 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ \"@wordpress/element\");\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var components_icon_poll__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! components/icon/poll */ \"./client/components/icon/poll.js\");\n/* harmony import */ var lib_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lib/i18n */ \"./client/lib/i18n/index.js\");\n/* harmony import */ var _store__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./store */ \"./client/blocks/poll/store.js\");\n/* harmony import */ var _edit__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./edit */ \"./client/blocks/poll/edit.js\");\n/* harmony import */ var _attributes__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./attributes */ \"./client/blocks/poll/attributes.js\");\n\n\n/**\n * Internal dependencies\n */\n\n\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n title: Object(lib_i18n__WEBPACK_IMPORTED_MODULE_2__[\"__\"])('Poll'),\n description: Object(lib_i18n__WEBPACK_IMPORTED_MODULE_2__[\"__\"])('Create polls and get your audience’s opinion — powered by Crowdsignal.'),\n category: 'crowdsignal-forms',\n keywords: [Object(lib_i18n__WEBPACK_IMPORTED_MODULE_2__[\"__\"])('ask'), 'crowdsignal', Object(lib_i18n__WEBPACK_IMPORTED_MODULE_2__[\"__\"])('feedback'), Object(lib_i18n__WEBPACK_IMPORTED_MODULE_2__[\"__\"])('poll'), Object(lib_i18n__WEBPACK_IMPORTED_MODULE_2__[\"__\"])('pop'), Object(lib_i18n__WEBPACK_IMPORTED_MODULE_2__[\"__\"])('question'), Object(lib_i18n__WEBPACK_IMPORTED_MODULE_2__[\"__\"])('quiz'), Object(lib_i18n__WEBPACK_IMPORTED_MODULE_2__[\"__\"])('research'), Object(lib_i18n__WEBPACK_IMPORTED_MODULE_2__[\"__\"])('survey'), Object(lib_i18n__WEBPACK_IMPORTED_MODULE_2__[\"__\"])('vote')],\n icon: Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"])(components_icon_poll__WEBPACK_IMPORTED_MODULE_1__[\"default\"], null),\n edit: _edit__WEBPACK_IMPORTED_MODULE_4__[\"default\"],\n attributes: _attributes__WEBPACK_IMPORTED_MODULE_5__[\"default\"],\n supports: {\n align: ['center', 'wide', 'full']\n },\n getEditWrapperProps: function getEditWrapperProps(_ref) {\n var align = _ref.align;\n return {\n 'data-align': align\n };\n },\n example: {\n attributes: {\n question: Object(lib_i18n__WEBPACK_IMPORTED_MODULE_2__[\"__\"])('How did you hear about us?'),\n answers: [{\n text: Object(lib_i18n__WEBPACK_IMPORTED_MODULE_2__[\"__\"])('Search')\n }, {\n text: Object(lib_i18n__WEBPACK_IMPORTED_MODULE_2__[\"__\"])('Friend')\n }, {\n text: Object(lib_i18n__WEBPACK_IMPORTED_MODULE_2__[\"__\"])('Email')\n }]\n }\n },\n styles: [{\n name: 'default',\n label: Object(lib_i18n__WEBPACK_IMPORTED_MODULE_2__[\"__\"])('Default'),\n isDefault: true\n }]\n});\n\n//# sourceURL=webpack:///./client/blocks/poll/index.js?");
|
170 |
|
171 |
/***/ }),
|
172 |
|
198 |
/*!*********************************************!*\
|
199 |
!*** ./client/blocks/poll/subscriptions.js ***!
|
200 |
\*********************************************/
|
201 |
+
/*! exports provided: startPolling, startSubscriptions, withPollDataSelect, withPollDataDispatch */
|
202 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
203 |
|
204 |
"use strict";
|
205 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"startPolling\", function() { return startPolling; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"startSubscriptions\", function() { return startSubscriptions; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"withPollDataSelect\", function() { return withPollDataSelect; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"withPollDataDispatch\", function() { return withPollDataDispatch; });\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"./node_modules/@babel/runtime/helpers/defineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/data */ \"@wordpress/data\");\n/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/api-fetch */ \"@wordpress/api-fetch\");\n/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lodash */ \"lodash\");\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_3__);\n\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\n/**\n * WordPress dependencies\n */\n\n\n\n\nvar isPollBlock = function isPollBlock(block) {\n return block.name === 'crowdsignal-forms/poll' || block.name === 'crowdsignal-forms/vote';\n};\n\nvar subsStarted = false;\nvar pollingStarted = false;\nvar startPolling = function startPolling() {\n if (pollingStarted) {\n return;\n }\n\n pollingStarted = true;\n var lastInterval = null;\n\n var scheduleNextTick = function scheduleNextTick() {\n if (null !== lastInterval) {\n clearTimeout(lastInterval);\n }\n\n lastInterval = setTimeout(function () {\n return tick();\n }, 1000 + Math.random() * 1000);\n };\n\n var tick = function tick() {\n var _select = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__[\"select\"])('crowdsignal-forms/polls'),\n getPollClientIds = _select.getPollClientIds,\n getPollDataByClientId = _select.getPollDataByClientId,\n shouldTryFetchingPollData = _select.shouldTryFetchingPollData,\n isFetchingPollData = _select.isFetchingPollData;\n\n var pollsWithNoApiData = Object(lodash__WEBPACK_IMPORTED_MODULE_3__[\"filter\"])(getPollClientIds(), function (clientId) {\n return null === getPollDataByClientId(clientId);\n });\n\n if (pollsWithNoApiData.length < 1) {\n return scheduleNextTick();\n }\n\n var _dispatch = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__[\"dispatch\"])('crowdsignal-forms/polls'),\n setTryFetchPollData = _dispatch.setTryFetchPollData,\n setPollApiDataForClientId = _dispatch.setPollApiDataForClientId,\n setIsFetchingPollData = _dispatch.setIsFetchingPollData;\n\n if (!shouldTryFetchingPollData()) {\n setTryFetchPollData(true);\n } else if (!isFetchingPollData()) {\n setIsFetchingPollData(true);\n Promise.all(Object(lodash__WEBPACK_IMPORTED_MODULE_3__[\"map\"])(pollsWithNoApiData, function (clientId) {\n return _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_2___default()({\n path: \"/crowdsignal-forms/v1/polls/\".concat(clientId, \"?cached=1\"),\n method: 'GET'\n }).then(function (response) {\n return setPollApiDataForClientId(clientId, _objectSpread({}, response, {\n viewResultsUrl: \"https://app.crowdsignal.com/polls/\".concat(response.id, \"/results\")\n }));\n }, function () {\n return setPollApiDataForClientId(clientId, null);\n });\n })).finally(function () {\n return setIsFetchingPollData(false);\n });\n }\n\n return scheduleNextTick();\n };\n\n tick();\n};\nvar startSubscriptions = function startSubscriptions() {\n if (subsStarted) {\n return;\n }\n\n subsStarted = true;\n\n var _select2 = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__[\"select\"])('core/editor'),\n isEditedPostDirty = _select2.isEditedPostDirty,\n isEditedPostNew = _select2.isEditedPostNew,\n isSavingPost = _select2.isSavingPost,\n isCleanNewPost = _select2.isCleanNewPost,\n getCurrentPostId = _select2.getCurrentPostId;\n\n var _dispatch2 = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__[\"dispatch\"])('crowdsignal-forms/polls'),\n setTryFetchPollData = _dispatch2.setTryFetchPollData,\n setPollApiDataForClientId = _dispatch2.setPollApiDataForClientId,\n setIsFetchingPollData = _dispatch2.setIsFetchingPollData;\n\n var _select3 = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__[\"select\"])('crowdsignal-forms/polls'),\n shouldTryFetchingPollData = _select3.shouldTryFetchingPollData,\n getPollDataByClientId = _select3.getPollDataByClientId,\n isFetchingPollData = _select3.isFetchingPollData;\n\n Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__[\"subscribe\"])(function () {\n var pollBlocks = Object(lodash__WEBPACK_IMPORTED_MODULE_3__[\"filter\"])(Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__[\"select\"])('core/block-editor').getBlocks(), isPollBlock);\n\n if (pollBlocks.length < 1) {\n return;\n }\n\n if (isFetchingPollData()) {\n return;\n }\n\n if (isCleanNewPost() || isEditedPostNew() || isSavingPost() || isEditedPostDirty()) {\n return;\n }\n\n var postId = getCurrentPostId();\n\n if (!postId) {\n return;\n }\n\n var pollsThatAreNotFetched = Object(lodash__WEBPACK_IMPORTED_MODULE_3__[\"filter\"])(pollBlocks, function (_ref) {\n var attributes = _ref.attributes;\n return attributes.pollId && null === getPollDataByClientId(attributes.pollId);\n });\n\n if (pollsThatAreNotFetched.length < 1) {\n return;\n }\n\n if (!shouldTryFetchingPollData()) {\n setTryFetchPollData(true);\n } else if (!isFetchingPollData()) {\n setIsFetchingPollData(true);\n Promise.all(Object(lodash__WEBPACK_IMPORTED_MODULE_3__[\"map\"])(pollsThatAreNotFetched, function (pollBlock) {\n var pollId = pollBlock.attributes.pollId;\n return _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_2___default()({\n path: \"/crowdsignal-forms/v1/polls/\".concat(pollId, \"?cached=1\"),\n method: 'GET'\n }).then(function (response) {\n return setPollApiDataForClientId(pollId, _objectSpread({}, response, {\n viewResultsUrl: \"https://app.crowdsignal.com/polls/\".concat(response.id, \"/results\")\n }));\n }, function () {\n return setPollApiDataForClientId(pollId, null);\n });\n })).finally(function () {\n return setIsFetchingPollData(false);\n });\n }\n });\n};\nvar withPollDataSelect = function withPollDataSelect() {\n return (// eslint-disable-next-line no-shadow\n Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__[\"withSelect\"])(function (select, ownProps) {\n var _select4 = select('crowdsignal-forms/polls'),\n getPollDataByClientId = _select4.getPollDataByClientId,\n shouldTryFetchingPollData = _select4.shouldTryFetchingPollData,\n isFetchingPollData = _select4.isFetchingPollData;\n\n var attributes = ownProps.attributes;\n var pollDataFromApi = attributes.pollId ? getPollDataByClientId(attributes.pollId) : null;\n return {\n pollDataFromApi: pollDataFromApi,\n getPollDataByClientId: getPollDataByClientId,\n shouldTryFetchingPollData: shouldTryFetchingPollData,\n isFetchingPollData: isFetchingPollData\n };\n })\n );\n};\nvar withPollDataDispatch = function withPollDataDispatch() {\n return (// eslint-disable-next-line no-shadow\n Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__[\"withDispatch\"])(function (dispatch) {\n var _dispatch3 = dispatch('crowdsignal-forms/polls'),\n setTryFetchPollData = _dispatch3.setTryFetchPollData,\n setPollApiDataForClientId = _dispatch3.setPollApiDataForClientId,\n setIsFetchingPollData = _dispatch3.setIsFetchingPollData,\n addPollClientId = _dispatch3.addPollClientId,\n removePollClientId = _dispatch3.removePollClientId;\n\n return {\n setTryFetchPollData: setTryFetchPollData,\n setPollApiDataForClientId: setPollApiDataForClientId,\n setIsFetchingPollData: setIsFetchingPollData,\n addPollClientId: addPollClientId,\n removePollClientId: removePollClientId\n };\n })\n );\n};\n\n//# sourceURL=webpack:///./client/blocks/poll/subscriptions.js?");
|
206 |
|
207 |
/***/ }),
|
208 |
|
230 |
|
231 |
/***/ }),
|
232 |
|
233 |
+
/***/ "./client/blocks/vote-item/attributes.js":
|
234 |
+
/*!***********************************************!*\
|
235 |
+
!*** ./client/blocks/vote-item/attributes.js ***!
|
236 |
+
\***********************************************/
|
237 |
+
/*! exports provided: default */
|
238 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
239 |
+
|
240 |
+
"use strict";
|
241 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/*\n * Note: Any changes made to the attributes definition need to be duplicated in\n * Crowdsignal_Forms\\Frontend\\Blocks\\Crowdsignal_Forms_Vote_Item_Block::attributes()\n * inside includes/frontend/blocks/class-crowdsignal-forms-vote-item-block.php.\n */\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n answerId: {\n type: 'string',\n default: null\n },\n type: {\n type: 'string'\n },\n textColor: {\n type: 'string'\n },\n backgroundColor: {\n type: 'string'\n },\n borderColor: {\n type: 'string'\n }\n});\n\n//# sourceURL=webpack:///./client/blocks/vote-item/attributes.js?");
|
242 |
+
|
243 |
+
/***/ }),
|
244 |
+
|
245 |
+
/***/ "./client/blocks/vote-item/edit.js":
|
246 |
+
/*!*****************************************!*\
|
247 |
+
!*** ./client/blocks/vote-item/edit.js ***!
|
248 |
+
\*****************************************/
|
249 |
+
/*! exports provided: default */
|
250 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
251 |
+
|
252 |
+
"use strict";
|
253 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/extends */ \"./node_modules/@babel/runtime/helpers/extends.js\");\n/* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ \"@wordpress/element\");\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/compose */ \"@wordpress/compose\");\n/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _sidebar__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./sidebar */ \"./client/blocks/vote-item/sidebar.js\");\n/* harmony import */ var components_with_client_id__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! components/with-client-id */ \"./client/components/with-client-id/index.js\");\n/* harmony import */ var components_vote_vote_item__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! components/vote/vote-item */ \"./client/components/vote/vote-item.js\");\n/* harmony import */ var components_with_fallback_styles__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! components/with-fallback-styles */ \"./client/components/with-fallback-styles/index.js\");\n/* harmony import */ var components_vote_styles__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! components/vote/styles */ \"./client/components/vote/styles.js\");\n\n\n\n/**\n * External dependencies\n */\n\n/**\n * WordPress dependencies\n */\n\n\n/**\n * Internal dependencies\n */\n\n\n\n\n\n\n\nvar EditVoteItemBlock = function EditVoteItemBlock(props) {\n var attributes = props.attributes,\n className = props.className,\n fallbackStyles = props.fallbackStyles,\n renderStyleProbe = props.renderStyleProbe;\n return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__[\"createElement\"])(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__[\"Fragment\"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__[\"createElement\"])(_sidebar__WEBPACK_IMPORTED_MODULE_4__[\"default\"], props), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__[\"createElement\"])(components_vote_vote_item__WEBPACK_IMPORTED_MODULE_6__[\"default\"], _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, attributes, {\n fallbackStyles: fallbackStyles,\n className: className,\n voteCount: 0\n })), renderStyleProbe());\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_3__[\"compose\"])([Object(components_with_fallback_styles__WEBPACK_IMPORTED_MODULE_7__[\"withFallbackStyles\"])(components_vote_styles__WEBPACK_IMPORTED_MODULE_8__[\"VoteStyles\"], components_vote_styles__WEBPACK_IMPORTED_MODULE_8__[\"getVoteStyles\"])])(Object(components_with_client_id__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(EditVoteItemBlock, 'answerId')));\n\n//# sourceURL=webpack:///./client/blocks/vote-item/edit.js?");
|
254 |
+
|
255 |
+
/***/ }),
|
256 |
+
|
257 |
+
/***/ "./client/blocks/vote-item/index.js":
|
258 |
+
/*!******************************************!*\
|
259 |
+
!*** ./client/blocks/vote-item/index.js ***!
|
260 |
+
\******************************************/
|
261 |
+
/*! exports provided: default */
|
262 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
263 |
+
|
264 |
+
"use strict";
|
265 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ \"@wordpress/element\");\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var components_icon_vote__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! components/icon/vote */ \"./client/components/icon/vote.js\");\n/* harmony import */ var lib_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lib/i18n */ \"./client/lib/i18n/index.js\");\n/* harmony import */ var _edit__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./edit */ \"./client/blocks/vote-item/edit.js\");\n/* harmony import */ var _attributes__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./attributes */ \"./client/blocks/vote-item/attributes.js\");\n\n\n/**\n * Internal dependencies\n */\n\n // import './store';\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n title: Object(lib_i18n__WEBPACK_IMPORTED_MODULE_2__[\"__\"])('Vote Item'),\n description: Object(lib_i18n__WEBPACK_IMPORTED_MODULE_2__[\"__\"])('Allow your audience to rate your work or express their opinion — powered by Crowdsignal.'),\n category: 'crowdsignal-forms',\n parent: ['crowdsignal-forms/vote'],\n icon: Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"])(components_icon_vote__WEBPACK_IMPORTED_MODULE_1__[\"default\"], null),\n edit: _edit__WEBPACK_IMPORTED_MODULE_3__[\"default\"],\n attributes: _attributes__WEBPACK_IMPORTED_MODULE_4__[\"default\"]\n});\n\n//# sourceURL=webpack:///./client/blocks/vote-item/index.js?");
|
266 |
+
|
267 |
+
/***/ }),
|
268 |
+
|
269 |
+
/***/ "./client/blocks/vote-item/sidebar.js":
|
270 |
+
/*!********************************************!*\
|
271 |
+
!*** ./client/blocks/vote-item/sidebar.js ***!
|
272 |
+
\********************************************/
|
273 |
+
/*! exports provided: default */
|
274 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
275 |
+
|
276 |
+
"use strict";
|
277 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ \"@wordpress/element\");\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/block-editor */ \"@wordpress/block-editor\");\n/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var lib_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lib/i18n */ \"./client/lib/i18n/index.js\");\n\n\n/**\n * External dependencies\n */\n\n/**\n * WordPress dependencies\n */\n\n\n/**\n * Internal dependencies\n */\n\n\n\nvar SideBar = function SideBar(_ref) {\n var attributes = _ref.attributes,\n setAttributes = _ref.setAttributes;\n\n var handleChangeTextColor = function handleChangeTextColor(textColor) {\n return setAttributes({\n textColor: textColor\n });\n };\n\n var handleChangeBackgroundColor = function handleChangeBackgroundColor(backgroundColor) {\n return setAttributes({\n backgroundColor: backgroundColor\n });\n };\n\n var handleChangeBorderColor = function handleChangeBorderColor(borderColor) {\n return setAttributes({\n borderColor: borderColor\n });\n };\n\n return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"])(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__[\"InspectorControls\"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"])(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__[\"PanelColorSettings\"], {\n title: Object(lib_i18n__WEBPACK_IMPORTED_MODULE_3__[\"__\"])('Styling'),\n initialOpen: true,\n colorSettings: [{\n value: attributes.textColor,\n onChange: handleChangeTextColor,\n label: Object(lib_i18n__WEBPACK_IMPORTED_MODULE_3__[\"__\"])('Text color')\n }, {\n value: attributes.backgroundColor,\n onChange: handleChangeBackgroundColor,\n label: Object(lib_i18n__WEBPACK_IMPORTED_MODULE_3__[\"__\"])('Background color')\n }, {\n value: attributes.borderColor,\n onChange: handleChangeBorderColor,\n label: Object(lib_i18n__WEBPACK_IMPORTED_MODULE_3__[\"__\"])('Border color')\n }]\n }));\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (SideBar);\n\n//# sourceURL=webpack:///./client/blocks/vote-item/sidebar.js?");
|
278 |
+
|
279 |
+
/***/ }),
|
280 |
+
|
281 |
+
/***/ "./client/blocks/vote/attributes.js":
|
282 |
+
/*!******************************************!*\
|
283 |
+
!*** ./client/blocks/vote/attributes.js ***!
|
284 |
+
\******************************************/
|
285 |
+
/*! exports provided: default */
|
286 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
287 |
+
|
288 |
+
"use strict";
|
289 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constants */ \"./client/blocks/vote/constants.js\");\n/*\n * Note: Any changes made to the attributes definition need to be duplicated in\n * Crowdsignal_Forms\\Frontend\\Blocks\\Crowdsignal_Forms_Vote_Block::attributes()\n * inside includes/frontend/blocks/class-crowdsignal-forms-vote-block.php.\n */\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n pollId: {\n type: 'string',\n default: null\n },\n hideBranding: {\n type: 'boolean',\n default: false\n },\n title: {\n type: 'string',\n default: null\n },\n pollStatus: {\n type: 'string',\n default: _constants__WEBPACK_IMPORTED_MODULE_0__[\"PollStatus\"].OPEN\n },\n closedAfterDateTime: {\n type: 'string',\n default: null\n },\n size: {\n type: 'string',\n default: 'medium'\n },\n borderWidth: {\n type: 'number',\n default: 1\n },\n borderRadius: {\n type: 'number',\n default: 5\n },\n hideResults: {\n type: 'boolean',\n default: false\n }\n});\n\n//# sourceURL=webpack:///./client/blocks/vote/attributes.js?");
|
290 |
+
|
291 |
+
/***/ }),
|
292 |
+
|
293 |
+
/***/ "./client/blocks/vote/constants.js":
|
294 |
+
/*!*****************************************!*\
|
295 |
+
!*** ./client/blocks/vote/constants.js ***!
|
296 |
+
\*****************************************/
|
297 |
+
/*! exports provided: PollStatus, ConnectedAccountState, DEFAULT_SIZE_CONTROLS, POPOVER_PROPS */
|
298 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
299 |
+
|
300 |
+
"use strict";
|
301 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"PollStatus\", function() { return PollStatus; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ConnectedAccountState\", function() { return ConnectedAccountState; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DEFAULT_SIZE_CONTROLS\", function() { return DEFAULT_SIZE_CONTROLS; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"POPOVER_PROPS\", function() { return POPOVER_PROPS; });\n/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ \"@wordpress/i18n\");\n/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);\n/**\n * WordPress dependencies\n */\n\nvar PollStatus = Object.freeze({\n OPEN: 'open',\n CLOSED: 'closed',\n CLOSED_AFTER: 'closed-after'\n});\nvar ConnectedAccountState = Object.freeze({\n CONNECTED: 'connected',\n NOT_CONNECTED: 'not-connected',\n NOT_VERIFIED: 'not-verified'\n});\nvar DEFAULT_SIZE_CONTROLS = [{\n title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__[\"__\"])('Small'),\n size: 'small'\n}, {\n title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__[\"__\"])('Medium'),\n size: 'medium'\n}, {\n title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__[\"__\"])('Large'),\n size: 'large'\n}];\nvar POPOVER_PROPS = {\n position: 'bottom right',\n isAlternate: true,\n className: 'crowdsignal-forms-vote__size-dropdown'\n};\n\n//# sourceURL=webpack:///./client/blocks/vote/constants.js?");
|
302 |
+
|
303 |
+
/***/ }),
|
304 |
+
|
305 |
+
/***/ "./client/blocks/vote/edit.js":
|
306 |
+
/*!************************************!*\
|
307 |
+
!*** ./client/blocks/vote/edit.js ***!
|
308 |
+
\************************************/
|
309 |
+
/*! exports provided: default */
|
310 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
311 |
+
|
312 |
+
"use strict";
|
313 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/extends */ \"./node_modules/@babel/runtime/helpers/extends.js\");\n/* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ \"@wordpress/element\");\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! classnames */ \"./node_modules/classnames/index.js\");\n/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/block-editor */ \"@wordpress/block-editor\");\n/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/compose */ \"@wordpress/compose\");\n/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _sidebar__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./sidebar */ \"./client/blocks/vote/sidebar.js\");\n/* harmony import */ var _toolbar__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./toolbar */ \"./client/blocks/vote/toolbar.js\");\n/* harmony import */ var components_connect_to_crowdsignal__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! components/connect-to-crowdsignal */ \"./client/components/connect-to-crowdsignal/index.js\");\n/* harmony import */ var lib_i18n__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! lib/i18n */ \"./client/lib/i18n/index.js\");\n/* harmony import */ var components_with_client_id__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! components/with-client-id */ \"./client/components/with-client-id/index.js\");\n/* harmony import */ var blocks_vote_util__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! blocks/vote/util */ \"./client/blocks/vote/util.js\");\n/* harmony import */ var blocks_poll_util__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! blocks/poll/util */ \"./client/blocks/poll/util.js\");\n/* harmony import */ var components_use_numbered_title__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! components/use-numbered-title */ \"./client/components/use-numbered-title/index.js\");\n/* harmony import */ var components_with_poll_base__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! components/with-poll-base */ \"./client/components/with-poll-base/index.js\");\n\n\n\n/**\n * External dependencies\n */\n\n\n/**\n * WordPress dependencies\n */\n\n\n\n/**\n * Internal dependencies\n */\n\n\n\n\n\n\n\n\n\n\n\nvar EditVoteBlock = function EditVoteBlock(props) {\n var attributes = props.attributes,\n setAttributes = props.setAttributes,\n className = props.className,\n pollDataFromApi = props.pollDataFromApi;\n Object(components_use_numbered_title__WEBPACK_IMPORTED_MODULE_13__[\"default\"])(props.name, Object(lib_i18n__WEBPACK_IMPORTED_MODULE_9__[\"__\"])('Untitled Vote'), attributes, setAttributes);\n var viewResultsUrl = pollDataFromApi ? pollDataFromApi.viewResultsUrl : '';\n var isClosed = Object(blocks_poll_util__WEBPACK_IMPORTED_MODULE_12__[\"isPollClosed\"])(attributes.pollStatus, attributes.closedAfterDateTime);\n var classes = classnames__WEBPACK_IMPORTED_MODULE_3___default()(className, 'crowdsignal-forms-vote', \"size-\".concat(attributes.size), {\n 'no-results': attributes.hideResults,\n 'is-closed': isClosed\n });\n var voteItemStyleVars = Object(blocks_vote_util__WEBPACK_IMPORTED_MODULE_11__[\"getVoteStyleVars\"])(attributes);\n return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__[\"createElement\"])(components_connect_to_crowdsignal__WEBPACK_IMPORTED_MODULE_8__[\"default\"], {\n blockIcon: null,\n blockName: Object(lib_i18n__WEBPACK_IMPORTED_MODULE_9__[\"__\"])('Crowdsignal Vote')\n }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__[\"createElement\"])(_sidebar__WEBPACK_IMPORTED_MODULE_6__[\"default\"], _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, props, {\n viewResultsUrl: viewResultsUrl\n })), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__[\"createElement\"])(_toolbar__WEBPACK_IMPORTED_MODULE_7__[\"default\"], props), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__[\"createElement\"])(\"div\", {\n className: classes,\n style: voteItemStyleVars\n }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__[\"createElement\"])(\"div\", {\n className: \"crowdsignal-forms-vote__items\"\n }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__[\"createElement\"])(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_4__[\"InnerBlocks\"], {\n template: [['crowdsignal-forms/vote-item', {\n type: 'up'\n }], ['crowdsignal-forms/vote-item', {\n type: 'down'\n }]],\n templateInsertUpdatesSelection: false,\n templateLock: \"insert\",\n allowedBlocks: ['crowdsignal-forms/vote-item'],\n orientation: \"horizontal\",\n __experimentalMoverDirection: \"horizontal\" // required for pre WP 5.5, post 5.5 only requires `orientation` to be set\n\n }))));\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_5__[\"compose\"])([components_with_poll_base__WEBPACK_IMPORTED_MODULE_14__[\"default\"]])(Object(components_with_client_id__WEBPACK_IMPORTED_MODULE_10__[\"default\"])(EditVoteBlock, 'pollId')));\n\n//# sourceURL=webpack:///./client/blocks/vote/edit.js?");
|
314 |
+
|
315 |
+
/***/ }),
|
316 |
+
|
317 |
+
/***/ "./client/blocks/vote/index.js":
|
318 |
+
/*!*************************************!*\
|
319 |
+
!*** ./client/blocks/vote/index.js ***!
|
320 |
+
\*************************************/
|
321 |
+
/*! exports provided: default */
|
322 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
323 |
+
|
324 |
+
"use strict";
|
325 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ \"@wordpress/element\");\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/block-editor */ \"@wordpress/block-editor\");\n/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var components_icon_vote__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! components/icon/vote */ \"./client/components/icon/vote.js\");\n/* harmony import */ var lib_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lib/i18n */ \"./client/lib/i18n/index.js\");\n/* harmony import */ var _edit__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./edit */ \"./client/blocks/vote/edit.js\");\n/* harmony import */ var _attributes__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./attributes */ \"./client/blocks/vote/attributes.js\");\n\n\n/**\n * WordPress dependencies\n */\n\n/**\n * Internal dependencies\n */\n\n\n // import './store';\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n title: Object(lib_i18n__WEBPACK_IMPORTED_MODULE_3__[\"__\"])('Vote'),\n description: Object(lib_i18n__WEBPACK_IMPORTED_MODULE_3__[\"__\"])('Allow your audience to rate your work or express their opinion — powered by Crowdsignal.'),\n category: 'crowdsignal-forms',\n keywords: ['crowdsignal', Object(lib_i18n__WEBPACK_IMPORTED_MODULE_3__[\"__\"])('vote'), Object(lib_i18n__WEBPACK_IMPORTED_MODULE_3__[\"__\"])('thumbs'), Object(lib_i18n__WEBPACK_IMPORTED_MODULE_3__[\"__\"])('like')],\n icon: Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"])(components_icon_vote__WEBPACK_IMPORTED_MODULE_2__[\"default\"], null),\n edit: _edit__WEBPACK_IMPORTED_MODULE_4__[\"default\"],\n save: function save() {\n return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"])(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__[\"InnerBlocks\"].Content, null);\n },\n attributes: _attributes__WEBPACK_IMPORTED_MODULE_5__[\"default\"],\n example: {\n attributes: {\n className: 'crowdsignal-forms-vote__example',\n size: 'large'\n }\n }\n});\n\n//# sourceURL=webpack:///./client/blocks/vote/index.js?");
|
326 |
+
|
327 |
+
/***/ }),
|
328 |
+
|
329 |
+
/***/ "./client/blocks/vote/sidebar.js":
|
330 |
+
/*!***************************************!*\
|
331 |
+
!*** ./client/blocks/vote/sidebar.js ***!
|
332 |
+
\***************************************/
|
333 |
+
/*! exports provided: default */
|
334 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
335 |
+
|
336 |
+
"use strict";
|
337 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ \"@wordpress/element\");\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/components */ \"@wordpress/components\");\n/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/block-editor */ \"@wordpress/block-editor\");\n/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! lodash */ \"lodash\");\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./constants */ \"./client/blocks/vote/constants.js\");\n/* harmony import */ var lib_i18n__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! lib/i18n */ \"./client/lib/i18n/index.js\");\n\n\n/**\n * External dependencies\n */\n\n/**\n * WordPress dependencies\n */\n\n\n\n\n\n/**\n * Internal dependencies\n */\n\n\n\nvar SideBar = function SideBar(_ref) {\n var attributes = _ref.attributes,\n setAttributes = _ref.setAttributes,\n viewResultsUrl = _ref.viewResultsUrl;\n\n var handleChangeTitle = function handleChangeTitle(title) {\n return setAttributes({\n title: title\n });\n };\n\n var resultsLinkEnabled = '' !== viewResultsUrl;\n\n var handleChangePollStatus = function handleChangePollStatus(pollStatus) {\n if (!Object(lodash__WEBPACK_IMPORTED_MODULE_4__[\"includes\"])(_constants__WEBPACK_IMPORTED_MODULE_5__[\"PollStatus\"], pollStatus)) {\n return;\n } // closedAfterDateTime MUST be set when pollStatus is set to CLOSED_AFTER\n\n\n setAttributes({\n closedAfterDateTime: pollStatus === _constants__WEBPACK_IMPORTED_MODULE_5__[\"PollStatus\"].CLOSED_AFTER ? new Date(new Date().getTime() + 24 * 60 * 60 * 1000).toISOString() : null,\n pollStatus: pollStatus\n });\n };\n\n var handleChangeCloseAfterDateTime = function handleChangeCloseAfterDateTime(closedAfterDateTime) {\n var dateTime = new Date(closedAfterDateTime);\n setAttributes({\n closedAfterDateTime: dateTime.toISOString()\n });\n };\n\n return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"])(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__[\"InspectorControls\"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__[\"PanelBody\"], {\n title: Object(lib_i18n__WEBPACK_IMPORTED_MODULE_6__[\"__\"])('Results'),\n initialOpen: true\n }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"])(\"p\", null, resultsLinkEnabled ? Object(lib_i18n__WEBPACK_IMPORTED_MODULE_6__[\"__\"])('Manage results on ') : Object(lib_i18n__WEBPACK_IMPORTED_MODULE_6__[\"__\"])('Publish this post to enable results on '), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__[\"ExternalLink\"], {\n href: resultsLinkEnabled ? viewResultsUrl : 'https://www.crowdsignal.com'\n }, \"crowdsignal.com\")), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"])(\"p\", null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__[\"Button\"], {\n href: viewResultsUrl,\n isSecondary: true,\n target: \"_blank\",\n disabled: !resultsLinkEnabled\n }, Object(lib_i18n__WEBPACK_IMPORTED_MODULE_6__[\"__\"])('View results'))), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__[\"TextControl\"], {\n value: attributes.title,\n label: Object(lib_i18n__WEBPACK_IMPORTED_MODULE_6__[\"__\"])('Title of the vote block'),\n onChange: handleChangeTitle\n })), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__[\"PanelBody\"], {\n title: Object(lib_i18n__WEBPACK_IMPORTED_MODULE_6__[\"__\"])('Status')\n }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__[\"SelectControl\"], {\n value: attributes.pollStatus,\n label: Object(lib_i18n__WEBPACK_IMPORTED_MODULE_6__[\"__\"])('Currently'),\n options: [{\n label: Object(lib_i18n__WEBPACK_IMPORTED_MODULE_6__[\"__\"])('Open'),\n value: _constants__WEBPACK_IMPORTED_MODULE_5__[\"PollStatus\"].OPEN\n }, {\n label: Object(lib_i18n__WEBPACK_IMPORTED_MODULE_6__[\"__\"])('Closed after'),\n value: _constants__WEBPACK_IMPORTED_MODULE_5__[\"PollStatus\"].CLOSED_AFTER\n }, {\n label: Object(lib_i18n__WEBPACK_IMPORTED_MODULE_6__[\"__\"])('Closed'),\n value: _constants__WEBPACK_IMPORTED_MODULE_5__[\"PollStatus\"].CLOSED\n }],\n onChange: handleChangePollStatus\n }), _constants__WEBPACK_IMPORTED_MODULE_5__[\"PollStatus\"].CLOSED_AFTER === attributes.pollStatus && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__[\"TimePicker\"], {\n currentTime: attributes.closedAfterDateTime,\n label: Object(lib_i18n__WEBPACK_IMPORTED_MODULE_6__[\"__\"])('Close vote block on'),\n onChange: handleChangeCloseAfterDateTime,\n is12Hour: true\n })));\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (SideBar);\n\n//# sourceURL=webpack:///./client/blocks/vote/sidebar.js?");
|
338 |
+
|
339 |
+
/***/ }),
|
340 |
+
|
341 |
+
/***/ "./client/blocks/vote/toolbar.js":
|
342 |
+
/*!***************************************!*\
|
343 |
+
!*** ./client/blocks/vote/toolbar.js ***!
|
344 |
+
\***************************************/
|
345 |
+
/*! exports provided: default */
|
346 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
347 |
+
|
348 |
+
"use strict";
|
349 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"./node_modules/@babel/runtime/helpers/defineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ \"./node_modules/@babel/runtime/helpers/slicedToArray.js\");\n/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ \"@wordpress/element\");\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! lodash */ \"lodash\");\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/i18n */ \"@wordpress/i18n\");\n/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/block-editor */ \"@wordpress/block-editor\");\n/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/components */ \"@wordpress/components\");\n/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_7__);\n/* harmony import */ var blocks_vote_constants__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! blocks/vote/constants */ \"./client/blocks/vote/constants.js\");\n/* harmony import */ var components_icon_size__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! components/icon/size */ \"./client/components/icon/size.js\");\n/* harmony import */ var components_icon_border__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! components/icon/border */ \"./client/components/icon/border.js\");\n/* harmony import */ var components_icon_counter__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! components/icon/counter */ \"./client/components/icon/counter.js\");\n\n\n\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\n/**\n * External dependencies\n */\n\n\n/**\n * WordPress dependencies\n */\n\n\n\n\n/**\n * Internal dependencies\n */\n\n\n\n\n\n\nvar ToolBar = function ToolBar(_ref) {\n var attributes = _ref.attributes,\n setAttributes = _ref.setAttributes;\n var size = Object(lodash__WEBPACK_IMPORTED_MODULE_4__[\"get\"])(attributes, 'size', 'medium');\n var sizeControls = blocks_vote_constants__WEBPACK_IMPORTED_MODULE_8__[\"DEFAULT_SIZE_CONTROLS\"];\n\n var handleChangeBorderRadius = function handleChangeBorderRadius(borderRadius) {\n setAttributes({\n borderRadius: parseInt(borderRadius, 10) || 0\n });\n };\n\n var handleChangeBorderWidth = function handleChangeBorderWidth(borderWidth) {\n setAttributes({\n borderWidth: parseInt(borderWidth, 10) || 0\n });\n };\n\n var handleToggleResults = function handleToggleResults() {\n return setAttributes({\n hideResults: !attributes.hideResults\n });\n };\n\n var _useState = Object(react__WEBPACK_IMPORTED_MODULE_3__[\"useState\"])(false),\n _useState2 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1___default()(_useState, 2),\n isPopoverVisible = _useState2[0],\n setPopoverVisible = _useState2[1];\n\n var handlePopoverVisible = function handlePopoverVisible() {\n return setPopoverVisible(!isPopoverVisible);\n };\n\n var toggleResultsLabel = attributes.hideResults ? Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__[\"__\"])('Show vote counters') : Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__[\"__\"])('Hide vote counters');\n return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__[\"createElement\"])(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_6__[\"BlockControls\"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__[\"createElement\"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_7__[\"ToolbarGroup\"], {\n isCollapsed: true,\n icon: components_icon_size__WEBPACK_IMPORTED_MODULE_9__[\"default\"],\n label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__[\"__\"])('Change block size'),\n popoverProps: blocks_vote_constants__WEBPACK_IMPORTED_MODULE_8__[\"POPOVER_PROPS\"],\n controls: sizeControls.map(function (control) {\n var controlSize = control.size;\n var isActive = size === controlSize;\n return _objectSpread({}, control, {\n isActive: isActive,\n role: 'menuitemradio',\n onClick: function onClick() {\n return setAttributes({\n size: controlSize\n });\n }\n });\n })\n }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__[\"createElement\"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_7__[\"Toolbar\"], {\n controls: [{\n icon: components_icon_border__WEBPACK_IMPORTED_MODULE_10__[\"default\"],\n onClick: handlePopoverVisible\n }, {\n icon: components_icon_counter__WEBPACK_IMPORTED_MODULE_11__[\"default\"],\n label: toggleResultsLabel,\n onClick: handleToggleResults,\n isActive: !attributes.hideResults,\n // Pre gutenberg 8\n isPressed: !attributes.hideResults\n }]\n }), isPopoverVisible && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__[\"createElement\"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_7__[\"Popover\"], {\n className: \"crowdsignal-forms__border-popover\",\n onFocusOutside: handlePopoverVisible\n }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__[\"createElement\"])(\"div\", {\n className: \"crowdsignal-forms__row\"\n }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__[\"createElement\"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_7__[\"TextControl\"], {\n label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__[\"__\"])('Border thickness'),\n type: \"number\",\n className: \"crowdsignal-forms__small-text-input\",\n onChange: handleChangeBorderWidth,\n value: attributes.borderWidth\n }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__[\"createElement\"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_7__[\"TextControl\"], {\n label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__[\"__\"])('Corner radius'),\n type: \"number\",\n className: \"crowdsignal-forms__small-text-input\",\n onChange: handleChangeBorderRadius,\n value: attributes.borderRadius\n }))));\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (ToolBar);\n\n//# sourceURL=webpack:///./client/blocks/vote/toolbar.js?");
|
350 |
+
|
351 |
+
/***/ }),
|
352 |
+
|
353 |
+
/***/ "./client/blocks/vote/util.js":
|
354 |
+
/*!************************************!*\
|
355 |
+
!*** ./client/blocks/vote/util.js ***!
|
356 |
+
\************************************/
|
357 |
+
/*! exports provided: getVoteStyleVars, getVoteItemStyleVars, getBlockCssClasses */
|
358 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
359 |
+
|
360 |
+
"use strict";
|
361 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getVoteStyleVars\", function() { return getVoteStyleVars; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getVoteItemStyleVars\", function() { return getVoteItemStyleVars; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getBlockCssClasses\", function() { return getBlockCssClasses; });\n/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ \"./node_modules/classnames/index.js\");\n/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash */ \"lodash\");\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__);\n/**\n * External dependencies\n */\n\n/**\n * Internal dependencies\n */\n\n\nvar getVoteStyleVars = function getVoteStyleVars(attributes) {\n return Object(lodash__WEBPACK_IMPORTED_MODULE_1__[\"mapKeys\"])({\n borderRadius: \"\".concat(attributes.borderRadius, \"px\"),\n borderWidth: \"\".concat(attributes.borderWidth, \"px\")\n }, function (_, key) {\n return \"--crowdsignal-forms-vote-\".concat(Object(lodash__WEBPACK_IMPORTED_MODULE_1__[\"kebabCase\"])(key));\n });\n};\nvar getVoteItemStyleVars = function getVoteItemStyleVars(attributes, fallbackStyles) {\n var textColor = Object(lodash__WEBPACK_IMPORTED_MODULE_1__[\"isEmpty\"])(attributes.textColor) ? fallbackStyles.textColor : attributes.textColor;\n var backgroundColor = Object(lodash__WEBPACK_IMPORTED_MODULE_1__[\"isEmpty\"])(attributes.backgroundColor) ? fallbackStyles.backgroundColor : attributes.backgroundColor;\n return Object(lodash__WEBPACK_IMPORTED_MODULE_1__[\"mapKeys\"])({\n borderColor: attributes.borderColor,\n bgColor: backgroundColor,\n textColor: textColor,\n votedColor: fallbackStyles.accentColor\n }, function (_, key) {\n return \"--crowdsignal-forms-vote-\".concat(Object(lodash__WEBPACK_IMPORTED_MODULE_1__[\"kebabCase\"])(key));\n });\n};\n/**\n * Returns a css 'class' string of overridden styles given a collection of attributes.\n *\n * @param {*} attributes The block's attributes\n * @param {...any} extraClasses A list of additional classes to add to the class string\n */\n\nvar getBlockCssClasses = function getBlockCssClasses(attributes) {\n for (var _len = arguments.length, extraClasses = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n extraClasses[_key - 1] = arguments[_key];\n }\n\n return classnames__WEBPACK_IMPORTED_MODULE_0___default()({\n 'has-bg-color': attributes.backgroundColor,\n 'has-text-color': attributes.textColor,\n 'has-border-color': attributes.borderColor\n }, extraClasses);\n};\n\n//# sourceURL=webpack:///./client/blocks/vote/util.js?");
|
362 |
+
|
363 |
+
/***/ }),
|
364 |
+
|
365 |
+
/***/ "./client/components/connect-to-crowdsignal/index.js":
|
366 |
+
/*!***********************************************************!*\
|
367 |
+
!*** ./client/components/connect-to-crowdsignal/index.js ***!
|
368 |
+
\***********************************************************/
|
369 |
+
/*! exports provided: default */
|
370 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
371 |
+
|
372 |
+
"use strict";
|
373 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"@babel/runtime/regenerator\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"./node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ \"@wordpress/element\");\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/components */ \"@wordpress/components\");\n/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var lib_i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! lib/i18n */ \"./client/lib/i18n/index.js\");\n/* harmony import */ var data_hooks__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! data/hooks */ \"./client/data/hooks/index.js\");\n\n\n\n\n/**\n * External dependencies\n */\n\n/**\n * Internal dependencies\n */\n\n\n\n\nvar ConnectToCrowdsignal = function ConnectToCrowdsignal(props) {\n var blockIcon = props.blockIcon,\n blockName = props.blockName,\n children = props.children;\n\n var _useIsCsConnected = Object(data_hooks__WEBPACK_IMPORTED_MODULE_5__[\"useIsCsConnected\"])(),\n isConnected = _useIsCsConnected.isConnected,\n isAccountVerified = _useIsCsConnected.isAccountVerified,\n checkIsConnected = _useIsCsConnected.checkIsConnected;\n\n var handleConnectClick = /*#__PURE__*/function () {\n var _ref = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee() {\n var initialConnectedState, _yield$checkIsConnect, isNowConnected, isNowVerified;\n\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n initialConnectedState = isConnected;\n _context.next = 3;\n return checkIsConnected();\n\n case 3:\n _yield$checkIsConnect = _context.sent;\n isNowConnected = _yield$checkIsConnect.isNowConnected;\n isNowVerified = _yield$checkIsConnect.isNowVerified;\n\n if (!isNowConnected) {\n window.open('/wp-admin/admin.php?page=crowdsignal-forms-setup');\n } // Don't pop open the email window if the connection state just changed.\n // Allow the new placeholder to be displayed first.\n\n\n if (initialConnectedState && !isNowVerified) {\n window.open('https://wordpress.com/me/account');\n }\n\n case 8:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee);\n }));\n\n return function handleConnectClick() {\n return _ref.apply(this, arguments);\n };\n }();\n\n if (isConnected && isAccountVerified) {\n return children;\n }\n\n var showConnectionMessage = !isConnected;\n var showVerificationMessage = isConnected && !isAccountVerified;\n return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__[\"createElement\"])(\"div\", {\n className: \"crowdsignal-forms__connect-to-crowdsignal\"\n }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__[\"createElement\"])(\"div\", {\n className: \"crowdsignal-forms__connect-to-crowdsignal-header\"\n }, blockIcon, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__[\"createElement\"])(\"div\", {\n className: \"crowdsignal-forms__connect-to-crowdsignal-title\"\n }, blockName)), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__[\"createElement\"])(\"div\", {\n className: \"crowdsignal-forms__connect-to-crowdsignal-body\"\n }, showConnectionMessage && Object(lib_i18n__WEBPACK_IMPORTED_MODULE_4__[\"__\"])('You need to connect to a Crowdsignal account to collect and manage your results.'), showVerificationMessage && Object(lib_i18n__WEBPACK_IMPORTED_MODULE_4__[\"__\"])('Please verify your WordPress.com email address in order to publish your poll.')), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__[\"createElement\"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__[\"Button\"], {\n isPrimary: true,\n onClick: handleConnectClick\n }, showConnectionMessage && Object(lib_i18n__WEBPACK_IMPORTED_MODULE_4__[\"__\"])('Connect to Crowdsignal'), showVerificationMessage && Object(lib_i18n__WEBPACK_IMPORTED_MODULE_4__[\"__\"])('Verify or Change your Email Address')));\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (ConnectToCrowdsignal);\n\n//# sourceURL=webpack:///./client/components/connect-to-crowdsignal/index.js?");
|
374 |
+
|
375 |
+
/***/ }),
|
376 |
+
|
377 |
+
/***/ "./client/components/icon/border.js":
|
378 |
+
/*!******************************************!*\
|
379 |
+
!*** ./client/components/icon/border.js ***!
|
380 |
+
\******************************************/
|
381 |
+
/*! exports provided: default */
|
382 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
383 |
+
|
384 |
+
"use strict";
|
385 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ \"@wordpress/element\");\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function () {\n return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"])(\"svg\", {\n width: \"32\",\n height: \"32\",\n viewBox: \"0 0 32 32\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"])(\"line\", {\n x1: \"8\",\n y1: \"8.5\",\n x2: \"24\",\n y2: \"8.5\",\n stroke: \"currentColor\"\n }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"])(\"line\", {\n x1: \"8\",\n y1: \"15\",\n x2: \"24\",\n y2: \"15\",\n stroke: \"currentColor\",\n strokeWidth: \"2\"\n }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"])(\"line\", {\n x1: \"8\",\n y1: \"22.5\",\n x2: \"24\",\n y2: \"22.5\",\n stroke: \"currentColor\",\n strokeWidth: \"3\"\n }));\n});\n\n//# sourceURL=webpack:///./client/components/icon/border.js?");
|
386 |
+
|
387 |
+
/***/ }),
|
388 |
+
|
389 |
/***/ "./client/components/icon/checklist-multiple-choice.js":
|
390 |
/*!*************************************************************!*\
|
391 |
!*** ./client/components/icon/checklist-multiple-choice.js ***!
|
410 |
|
411 |
/***/ }),
|
412 |
|
413 |
+
/***/ "./client/components/icon/counter.js":
|
414 |
+
/*!*******************************************!*\
|
415 |
+
!*** ./client/components/icon/counter.js ***!
|
416 |
+
\*******************************************/
|
417 |
+
/*! exports provided: default */
|
418 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
419 |
+
|
420 |
+
"use strict";
|
421 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ \"@wordpress/element\");\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function () {\n return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"])(\"svg\", {\n width: \"24\",\n height: \"24\",\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"])(\"path\", {\n d: \"M12.0078 18.2266C14.7656 18.2266 16.4062 15.9531 16.4062 12.3438C16.4062 8.73438 14.75 6.5 12.0078 6.5C9.25781 6.5 7.59375 8.75 7.59375 12.3516C7.59375 15.9688 9.24219 18.2266 12.0078 18.2266ZM12.0078 16.5781C10.5078 16.5781 9.625 15 9.625 12.3438C9.625 9.73438 10.5234 8.14844 12.0078 8.14844C13.4844 8.14844 14.3672 9.71875 14.3672 12.3516C14.3672 15.0078 13.5 16.5781 12.0078 16.5781Z\"\n }));\n});\n\n//# sourceURL=webpack:///./client/components/icon/counter.js?");
|
422 |
+
|
423 |
+
/***/ }),
|
424 |
+
|
425 |
/***/ "./client/components/icon/poll.js":
|
426 |
/*!****************************************!*\
|
427 |
!*** ./client/components/icon/poll.js ***!
|
434 |
|
435 |
/***/ }),
|
436 |
|
437 |
+
/***/ "./client/components/icon/size.js":
|
438 |
+
/*!****************************************!*\
|
439 |
+
!*** ./client/components/icon/size.js ***!
|
440 |
+
\****************************************/
|
441 |
+
/*! exports provided: default */
|
442 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
443 |
+
|
444 |
+
"use strict";
|
445 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ \"@wordpress/element\");\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function () {\n return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"])(\"svg\", {\n width: \"24\",\n height: \"24\",\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"])(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M17.1894 5.75L13.6668 5.75L13.6668 4.25H19.0002H19.7502L19.7502 5V10.3333H18.2502V6.81054L6.81072 18.25L10.3333 18.25V19.75L5 19.75H4.25V19V13.6666L5.75 13.6666L5.75 17.1894L17.1894 5.75Z\"\n }));\n});\n\n//# sourceURL=webpack:///./client/components/icon/size.js?");
|
446 |
+
|
447 |
+
/***/ }),
|
448 |
+
|
449 |
+
/***/ "./client/components/icon/thumbs-down.js":
|
450 |
+
/*!***********************************************!*\
|
451 |
+
!*** ./client/components/icon/thumbs-down.js ***!
|
452 |
+
\***********************************************/
|
453 |
+
/*! exports provided: default */
|
454 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
455 |
+
|
456 |
+
"use strict";
|
457 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ \"@wordpress/element\");\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (_ref) {\n var className = _ref.className,\n _ref$fillColor = _ref.fillColor,\n fillColor = _ref$fillColor === void 0 ? 'black' : _ref$fillColor;\n return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"])(\"svg\", {\n className: className,\n width: \"24\",\n height: \"24\",\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"])(\"g\", {\n clipPath: \"url(#clipThumbsDown)\"\n }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"])(\"mask\", {\n id: \"maskThumbsDown\",\n \"mask-type\": \"alpha\",\n maskUnits: \"userSpaceOnUse\",\n x: \"2\",\n y: \"5\",\n width: \"20\",\n height: \"20\"\n }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"])(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M4.65002 17.75H10.4342L9.56336 21.9392L9.53586 22.2325C9.53586 22.6083 9.69169 22.9567 9.93919 23.2042L10.9109 24.1667L16.9425 18.1258C17.2817 17.7958 17.4834 17.3375 17.4834 16.8333L21.15 16.8333L21.15 7.57499H17.4834V7.66666C17.4834 6.65832 16.6584 5.83332 15.65 5.83332H7.40003C6.63919 5.83332 5.98836 6.29165 5.71336 6.95166L2.94503 13.4142C2.86253 13.625 2.81669 13.845 2.81669 14.0833V15.9167C2.81669 16.925 3.64169 17.75 4.65002 17.75ZM4.65002 14.0833L7.40002 7.66666H15.65L15.65 16.8333L11.6717 20.8117L12.6892 15.9167H4.65002V14.0833Z\",\n fill: \"white\"\n })), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"])(\"g\", {\n mask: \"url(#maskThumbsDown)\"\n }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"])(\"rect\", {\n x: \"23.0001\",\n y: \"24\",\n width: \"22\",\n height: \"22\",\n transform: \"rotate(-180 23.0001 24)\",\n fill: fillColor\n }))), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"])(\"defs\", null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"])(\"clipPath\", {\n id: \"clipThumbsDown\"\n }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"])(\"rect\", {\n width: \"24\",\n height: \"24\",\n fill: \"white\"\n }))));\n});\n\n//# sourceURL=webpack:///./client/components/icon/thumbs-down.js?");
|
458 |
+
|
459 |
+
/***/ }),
|
460 |
+
|
461 |
+
/***/ "./client/components/icon/thumbs-up.js":
|
462 |
+
/*!*********************************************!*\
|
463 |
+
!*** ./client/components/icon/thumbs-up.js ***!
|
464 |
+
\*********************************************/
|
465 |
+
/*! exports provided: default */
|
466 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
467 |
+
|
468 |
+
"use strict";
|
469 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ \"@wordpress/element\");\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (_ref) {\n var className = _ref.className,\n _ref$fillColor = _ref.fillColor,\n fillColor = _ref$fillColor === void 0 ? 'black' : _ref$fillColor;\n return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"])(\"svg\", {\n className: className,\n width: \"24\",\n height: \"24\",\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"])(\"g\", {\n clipPath: \"url(#clipThumbsUp)\"\n }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"])(\"mask\", {\n id: \"maskThumbsUp\",\n \"mask-type\": \"alpha\",\n maskUnits: \"userSpaceOnUse\",\n x: \"2\",\n y: \"-1\",\n width: \"20\",\n height: \"20\"\n }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"])(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M19.35 6.24998H13.5658L14.4366 2.06081L14.4641 1.76748C14.4641 1.39165 14.3083 1.04331 14.0608 0.795813L13.0891 -0.166687L7.05748 5.87415C6.71831 6.20415 6.51664 6.66248 6.51664 7.16665L2.84998 7.16665V16.425H6.51664V16.3333C6.51664 17.3416 7.34164 18.1666 8.34998 18.1666H16.6C17.3608 18.1666 18.0116 17.7083 18.2866 17.0483L21.055 10.5858C21.1375 10.375 21.1833 10.155 21.1833 9.91665V8.08331C21.1833 7.07498 20.3583 6.24998 19.35 6.24998ZM19.35 9.91665L16.6 16.3333H8.34998V7.16665L12.3283 3.18831L11.3108 8.08331H19.35V9.91665Z\",\n fill: \"white\"\n })), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"])(\"g\", {\n mask: \"url(#maskThumbsUp)\"\n }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"])(\"rect\", {\n x: \"0.999878\",\n y: \"-3.05176e-05\",\n width: \"22\",\n height: \"22\",\n fill: fillColor\n }))), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"])(\"defs\", null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"])(\"clipPath\", {\n id: \"clipThumbsUp\"\n }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"])(\"rect\", {\n width: \"24\",\n height: \"24\",\n fill: \"white\"\n }))));\n});\n\n//# sourceURL=webpack:///./client/components/icon/thumbs-up.js?");
|
470 |
+
|
471 |
+
/***/ }),
|
472 |
+
|
473 |
+
/***/ "./client/components/icon/vote.js":
|
474 |
+
/*!****************************************!*\
|
475 |
+
!*** ./client/components/icon/vote.js ***!
|
476 |
+
\****************************************/
|
477 |
+
/*! exports provided: default */
|
478 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
479 |
+
|
480 |
+
"use strict";
|
481 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ \"@wordpress/element\");\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function () {\n return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"])(\"svg\", {\n width: \"24\",\n height: \"24\",\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"])(\"mask\", {\n id: \"maskVote\",\n \"mask-type\": \"alpha\",\n maskUnits: \"userSpaceOnUse\",\n x: \"3\",\n y: \"3\",\n width: \"18\",\n height: \"18\"\n }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"])(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M18.5999 9.525H13.3942L14.1779 5.75475L14.2027 5.49075C14.2027 5.1525 14.0624 4.839 13.8397 4.61625L12.9652 3.75L7.53666 9.18675C7.23142 9.48374 7.04992 9.89621 7.04991 10.3499H3.75V18.6824H7.05V18.6178C7.05963 19.5172 7.79834 20.25 8.69991 20.25H16.1249C16.8097 20.25 17.3954 19.8375 17.6429 19.2435L20.1344 13.4273C20.2087 13.2375 20.2499 13.0395 20.2499 12.825V11.175C20.2499 10.2675 19.5074 9.525 18.5999 9.525ZM7.05 18.6178V10.3499H7.04991C7.04991 10.35 7.04991 10.35 7.04991 10.35V18.6C7.04991 18.6059 7.04994 18.6119 7.05 18.6178ZM18.5999 12.825L16.1249 18.6H8.69986V10.35L12.2804 6.76952L11.3646 11.175H18.5999V12.825Z\",\n fill: \"white\"\n })), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"])(\"g\", {\n mask: \"url(#maskVote)\"\n }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"])(\"rect\", {\n x: \"1.00024\",\n y: \"1.25\",\n width: \"22\",\n height: \"22\",\n fill: \"#1E1E1E\"\n })));\n});\n\n//# sourceURL=webpack:///./client/components/icon/vote.js?");
|
482 |
+
|
483 |
+
/***/ }),
|
484 |
+
|
485 |
/***/ "./client/components/poll/answer-results.js":
|
486 |
/*!**************************************************!*\
|
487 |
!*** ./client/components/poll/answer-results.js ***!
|
566 |
|
567 |
/***/ }),
|
568 |
|
569 |
+
/***/ "./client/components/use-numbered-title/index.js":
|
570 |
+
/*!*******************************************************!*\
|
571 |
+
!*** ./client/components/use-numbered-title/index.js ***!
|
572 |
+
\*******************************************************/
|
573 |
+
/*! exports provided: default */
|
574 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
575 |
+
|
576 |
+
"use strict";
|
577 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash */ \"lodash\");\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__);\n/**\n * External dependencies\n */\n\n\n\nvar useNumberedTitle = function useNumberedTitle(blockName, titlePrefix, attributes, setAttributes) {\n return Object(react__WEBPACK_IMPORTED_MODULE_0__[\"useEffect\"])(function () {\n if (Object(lodash__WEBPACK_IMPORTED_MODULE_1__[\"isEmpty\"])(window.csBlockTypeCount)) {\n window.csBlockTypeCount = {};\n }\n\n if (Object(lodash__WEBPACK_IMPORTED_MODULE_1__[\"isNil\"])(window.csBlockTypeCount[blockName])) {\n window.csBlockTypeCount[blockName] = 0;\n }\n\n window.csBlockTypeCount[blockName]++;\n\n if (null !== attributes.title) {\n // exit if title is set, but only after block count has been set, so newer blocks get the correct count.\n return;\n }\n\n if (1 === window.csBlockTypeCount[blockName]) {\n setAttributes({\n title: titlePrefix\n });\n } else {\n setAttributes({\n title: \"\".concat(titlePrefix, \" \").concat(window.csBlockTypeCount[blockName])\n });\n }\n }, []);\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (useNumberedTitle);\n\n//# sourceURL=webpack:///./client/components/use-numbered-title/index.js?");
|
578 |
+
|
579 |
+
/***/ }),
|
580 |
+
|
581 |
+
/***/ "./client/components/use-poll-duplicate-cleaner/index.js":
|
582 |
+
/*!***************************************************************!*\
|
583 |
+
!*** ./client/components/use-poll-duplicate-cleaner/index.js ***!
|
584 |
+
\***************************************************************/
|
585 |
+
/*! exports provided: default */
|
586 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
587 |
+
|
588 |
+
"use strict";
|
589 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash */ \"lodash\");\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__);\n/**\n * External dependencies\n */\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (blockClientId, pollId, answers, setAttributes) {\n return Object(react__WEBPACK_IMPORTED_MODULE_0__[\"useEffect\"])(function () {\n if (Object(lodash__WEBPACK_IMPORTED_MODULE_1__[\"isEmpty\"])(pollId)) {\n return;\n }\n\n if (!window.csPolls) {\n window.csPolls = {};\n }\n\n if (!window.csPolls[pollId]) {\n window.csPolls[pollId] = [blockClientId];\n } else if (window.csPolls[pollId].indexOf(blockClientId) > -1) {// clientid already known, ignore.\n } else {\n var newAnswers = Object(lodash__WEBPACK_IMPORTED_MODULE_1__[\"map\"])(answers, function (answer) {\n return Object(lodash__WEBPACK_IMPORTED_MODULE_1__[\"omit\"])(answer, ['answerId']);\n });\n setAttributes({\n pollId: null,\n answers: newAnswers\n });\n }\n }, [pollId]);\n});\n\n//# sourceURL=webpack:///./client/components/use-poll-duplicate-cleaner/index.js?");
|
590 |
+
|
591 |
+
/***/ }),
|
592 |
+
|
593 |
+
/***/ "./client/components/vote/styles.js":
|
594 |
+
/*!******************************************!*\
|
595 |
+
!*** ./client/components/vote/styles.js ***!
|
596 |
+
\******************************************/
|
597 |
+
/*! exports provided: getVoteStyles, VoteStyles */
|
598 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
599 |
+
|
600 |
+
"use strict";
|
601 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getVoteStyles\", function() { return getVoteStyles; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"VoteStyles\", function() { return VoteStyles; });\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ \"@wordpress/element\");\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var components_with_fallback_styles_util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! components/with-fallback-styles/util */ \"./client/components/with-fallback-styles/util.js\");\n\n\n/**\n * External dependencies\n */\n\n/**\n * Internal dependencies\n */\n\n\nvar getVoteStyles = function getVoteStyles(node) {\n if (null === node) {\n return {};\n }\n\n var buttonNode = node.querySelector('.wp-block-button__link');\n var textNode = node.querySelector('p');\n var accentColor = Object(components_with_fallback_styles_util__WEBPACK_IMPORTED_MODULE_2__[\"getBackgroundColor\"])(buttonNode);\n var surfaceColor = Object(components_with_fallback_styles_util__WEBPACK_IMPORTED_MODULE_2__[\"getBackgroundColor\"])(textNode);\n var textColor = window.getComputedStyle(textNode).color; // Ensure that we don't end up with the same color for surface and accent.\n // Falls back to button border color, then text color.\n\n if (accentColor === surfaceColor) {\n var borderColor = Object(components_with_fallback_styles_util__WEBPACK_IMPORTED_MODULE_2__[\"getBorderColor\"])(buttonNode);\n accentColor = borderColor ? borderColor : textColor;\n }\n\n return {\n accentColor: accentColor,\n textColor: textColor,\n backgroundColor: surfaceColor\n };\n};\nvar VoteStyles = function VoteStyles() {\n return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"])(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__[\"Fragment\"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"])(\"p\", null), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"])(\"div\", {\n className: \"wp-block-button\"\n }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"])(\"div\", {\n className: \"wp-block-button__link\"\n })));\n};\n\n//# sourceURL=webpack:///./client/components/vote/styles.js?");
|
602 |
+
|
603 |
+
/***/ }),
|
604 |
+
|
605 |
+
/***/ "./client/components/vote/util.js":
|
606 |
+
/*!****************************************!*\
|
607 |
+
!*** ./client/components/vote/util.js ***!
|
608 |
+
\****************************************/
|
609 |
+
/*! exports provided: formatVoteCount */
|
610 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
611 |
+
|
612 |
+
"use strict";
|
613 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"formatVoteCount\", function() { return formatVoteCount; });\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ \"lodash\");\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__);\n/**\n * External dependencies\n */\n\n/**\n * Formats the counter values on vote items:\n *\n * @param {number} count Vote count\n * @return {string} Formatted count\n */\n\nvar formatVoteCount = function formatVoteCount(count) {\n if (!count) {\n return '0';\n }\n\n if (count >= 10000000) {\n return \"\".concat(Object(lodash__WEBPACK_IMPORTED_MODULE_0__[\"round\"])(count / 1000000), \"M\");\n }\n\n if (count >= 1000000) {\n return \"\".concat((count / 1000000).toFixed(1), \"M\");\n }\n\n if (count >= 10000) {\n return \"\".concat(Object(lodash__WEBPACK_IMPORTED_MODULE_0__[\"round\"])(count / 1000), \"K\");\n }\n\n if (count >= 1000) {\n return \"\".concat((count / 1000).toFixed(1), \"K\");\n }\n\n return count.toString();\n};\n\n//# sourceURL=webpack:///./client/components/vote/util.js?");
|
614 |
+
|
615 |
+
/***/ }),
|
616 |
+
|
617 |
+
/***/ "./client/components/vote/vote-item.js":
|
618 |
+
/*!*********************************************!*\
|
619 |
+
!*** ./client/components/vote/vote-item.js ***!
|
620 |
+
\*********************************************/
|
621 |
+
/*! exports provided: default */
|
622 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
623 |
+
|
624 |
+
"use strict";
|
625 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ \"./node_modules/@babel/runtime/helpers/slicedToArray.js\");\n/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ \"@wordpress/element\");\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\");\n/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var react_transition_group__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react-transition-group */ \"./node_modules/react-transition-group/esm/index.js\");\n/* harmony import */ var components_icon_thumbs_up__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! components/icon/thumbs-up */ \"./client/components/icon/thumbs-up.js\");\n/* harmony import */ var components_icon_thumbs_down__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! components/icon/thumbs-down */ \"./client/components/icon/thumbs-down.js\");\n/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./util */ \"./client/components/vote/util.js\");\n/* harmony import */ var blocks_vote_util__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! blocks/vote/util */ \"./client/blocks/vote/util.js\");\n\n\n\n/**\n * External dependencies\n */\n\n\n\n/**\n * Internal dependencies\n */\n\n\n\n\n\n\nvar VoteItem = function VoteItem(props) {\n var className = props.className,\n type = props.type,\n voteCount = props.voteCount,\n apiAnswerId = props.apiAnswerId,\n onVote = props.onVote,\n disabled = props.disabled,\n isVotedOn = props.isVotedOn,\n hideCount = props.hideCount,\n fallbackStyles = props.fallbackStyles;\n\n var _useState = Object(react__WEBPACK_IMPORTED_MODULE_2__[\"useState\"])(0),\n _useState2 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0___default()(_useState, 2),\n currentVote = _useState2[0],\n setCurrentVote = _useState2[1];\n\n var handleVote = function handleVote() {\n if (disabled || !onVote) {\n return;\n }\n\n setCurrentVote(1);\n onVote(apiAnswerId);\n };\n\n var Icon = 'up' === type ? components_icon_thumbs_up__WEBPACK_IMPORTED_MODULE_5__[\"default\"] : components_icon_thumbs_down__WEBPACK_IMPORTED_MODULE_6__[\"default\"];\n var classes = Object(blocks_vote_util__WEBPACK_IMPORTED_MODULE_8__[\"getBlockCssClasses\"])(props, 'crowdsignal-forms-vote-item', className, {\n 'is-voted-on': isVotedOn,\n 'is-disabled': disabled\n });\n var blockStyle = Object(blocks_vote_util__WEBPACK_IMPORTED_MODULE_8__[\"getVoteItemStyleVars\"])(props, fallbackStyles);\n var displayedVoteCount = voteCount + currentVote;\n return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__[\"createElement\"])(\"div\", {\n className: classes,\n onClick: handleVote,\n onKeyPress: handleVote,\n role: \"button\",\n style: blockStyle,\n tabIndex: 0\n }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__[\"createElement\"])(Icon, {\n className: \"crowdsignal-forms-vote-item__icon\",\n fillColor: \"currentColor\"\n }), !hideCount && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__[\"createElement\"])(react_transition_group__WEBPACK_IMPORTED_MODULE_4__[\"SwitchTransition\"], {\n mode: \"in-out\"\n }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__[\"createElement\"])(react_transition_group__WEBPACK_IMPORTED_MODULE_4__[\"CSSTransition\"], {\n key: currentVote,\n classNames: \"crowdsignal-forms-vote-item__count\",\n timeout: 300\n }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__[\"createElement\"])(\"div\", {\n className: \"crowdsignal-forms-vote-item__count\"\n }, Object(_util__WEBPACK_IMPORTED_MODULE_7__[\"formatVoteCount\"])(displayedVoteCount)))));\n};\n\nVoteItem.propTypes = {\n apiAnswerId: prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.number,\n className: prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.string,\n disabled: prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.bool,\n isVotedOn: prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.bool,\n onVote: prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.func,\n type: prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.string.isRequired,\n voteCount: prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.number.isRequired\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (VoteItem);\n\n//# sourceURL=webpack:///./client/components/vote/vote-item.js?");
|
626 |
+
|
627 |
+
/***/ }),
|
628 |
+
|
629 |
+
/***/ "./client/components/with-client-id/index.js":
|
630 |
+
/*!***************************************************!*\
|
631 |
+
!*** ./client/components/with-client-id/index.js ***!
|
632 |
+
\***************************************************/
|
633 |
+
/*! exports provided: default */
|
634 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
635 |
+
|
636 |
+
"use strict";
|
637 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ \"@wordpress/element\");\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var uuid__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! uuid */ \"./node_modules/uuid/dist/esm-browser/index.js\");\n\n\n/**\n * External dependencies\n */\n\n\n\nvar withClientId = function withClientId(Element, clientIdAttributeName) {\n return function (props) {\n var attributes = props.attributes,\n setAttributes = props.setAttributes;\n Object(react__WEBPACK_IMPORTED_MODULE_1__[\"useEffect\"])(function () {\n if (!attributes[clientIdAttributeName]) {\n var clientId = Object(uuid__WEBPACK_IMPORTED_MODULE_2__[\"v4\"])();\n var newAttribute = {};\n newAttribute[clientIdAttributeName] = clientId;\n setAttributes(newAttribute);\n }\n });\n return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"])(Element, props);\n };\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (withClientId);\n\n//# sourceURL=webpack:///./client/components/with-client-id/index.js?");
|
638 |
+
|
639 |
+
/***/ }),
|
640 |
+
|
641 |
/***/ "./client/components/with-fallback-styles/index.js":
|
642 |
/*!*********************************************************!*\
|
643 |
!*** ./client/components/with-fallback-styles/index.js ***!
|
662 |
|
663 |
/***/ }),
|
664 |
|
665 |
+
/***/ "./client/components/with-poll-base/index.js":
|
666 |
+
/*!***************************************************!*\
|
667 |
+
!*** ./client/components/with-poll-base/index.js ***!
|
668 |
+
\***************************************************/
|
669 |
+
/*! exports provided: default */
|
670 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
671 |
+
|
672 |
+
"use strict";
|
673 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ \"@wordpress/element\");\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/compose */ \"@wordpress/compose\");\n/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var blocks_poll_subscriptions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! blocks/poll/subscriptions */ \"./client/blocks/poll/subscriptions.js\");\n/* harmony import */ var components_use_poll_duplicate_cleaner__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! components/use-poll-duplicate-cleaner */ \"./client/components/use-poll-duplicate-cleaner/index.js\");\n\n\n/**\n * External dependencies\n */\n\n/**\n * WordPress dependencies\n */\n\n\n/**\n * Internal dependencies\n */\n\n\n\nObject(blocks_poll_subscriptions__WEBPACK_IMPORTED_MODULE_3__[\"startSubscriptions\"])();\n\nvar isP2tenberg = function isP2tenberg() {\n return 'p2tenberg' in window;\n};\n\nvar withPollBase = function withPollBase(Element) {\n return function (props) {\n var attributes = props.attributes,\n setAttributes = props.setAttributes,\n addPollClientId = props.addPollClientId,\n removePollClientId = props.removePollClientId;\n Object(react__WEBPACK_IMPORTED_MODULE_1__[\"useEffect\"])(function () {\n if (isP2tenberg()) {\n Object(blocks_poll_subscriptions__WEBPACK_IMPORTED_MODULE_3__[\"startPolling\"])();\n }\n\n if (attributes.pollId) {\n addPollClientId(attributes.pollId);\n }\n\n return function () {\n if (attributes.pollId) {\n removePollClientId(attributes.pollId);\n }\n };\n }, []);\n Object(components_use_poll_duplicate_cleaner__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(props.clientId, attributes.pollId, attributes.answers, setAttributes);\n return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"])(Element, props);\n };\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (Element) {\n return Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_2__[\"compose\"])([Object(blocks_poll_subscriptions__WEBPACK_IMPORTED_MODULE_3__[\"withPollDataSelect\"])(), Object(blocks_poll_subscriptions__WEBPACK_IMPORTED_MODULE_3__[\"withPollDataDispatch\"])(), withPollBase])(Element);\n});\n\n//# sourceURL=webpack:///./client/components/with-poll-base/index.js?");
|
674 |
+
|
675 |
+
/***/ }),
|
676 |
+
|
677 |
/***/ "./client/data/hooks/index.js":
|
678 |
/*!************************************!*\
|
679 |
!*** ./client/data/hooks/index.js ***!
|
682 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
683 |
|
684 |
"use strict";
|
685 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"usePollResults\", function() { return usePollResults; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"usePollVote\", function() { return usePollVote; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"useIsCsConnected\", function() { return useIsCsConnected; });\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"@babel/runtime/regenerator\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"./node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ \"./node_modules/@babel/runtime/helpers/slicedToArray.js\");\n/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var js_cookie__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! js-cookie */ \"./node_modules/js-cookie/src/js.cookie.js\");\n/* harmony import */ var js_cookie__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(js_cookie__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var data_poll__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! data/poll */ \"./client/data/poll/index.js\");\n/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./util */ \"./client/data/hooks/util.js\");\n/* harmony import */ var blocks_poll_constants__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! blocks/poll/constants */ \"./client/blocks/poll/constants.js\");\n\n\n\n\n/**\n * External dependencies\n */\n\n\n/**\n * Internal dependencies\n */\n\n\n\n\nvar usePollResults = function usePollResults(pollId) {\n var doFetch = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n\n var _useFetch = Object(_util__WEBPACK_IMPORTED_MODULE_6__[\"useFetch\"])(function () {\n return Object(data_poll__WEBPACK_IMPORTED_MODULE_5__[\"requestResults\"])(pollId, doFetch);\n }, [pollId]),\n data = _useFetch.data,\n error = _useFetch.error,\n loading = _useFetch.loading;\n\n return {\n error: error,\n loading: loading,\n results: data\n };\n};\n/**\n * React Hook that returns state variables for voting status and a function to perform a vote.\n *\n * @param {number} pollId ID of the poll being loaded.\n * @param {boolean} enableVoteRestriction sets whether or not the vote cookie is read and set\n * @param {boolean} storeAnswerIdsInCookie sets whether or not the answer ids are stored in the vote restriction cookie\n */\n\nvar usePollVote = function usePollVote(pollId) {\n var enableVoteRestriction = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n var storeAnswerIdsInCookie = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n var cookieName = \"cs-poll-\".concat(pollId);\n\n var _useState = Object(react__WEBPACK_IMPORTED_MODULE_3__[\"useState\"])(false),\n _useState2 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_2___default()(_useState, 2),\n isVoting = _useState2[0],\n setIsVoting = _useState2[1];\n\n var _useState3 = Object(react__WEBPACK_IMPORTED_MODULE_3__[\"useState\"])(false),\n _useState4 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_2___default()(_useState3, 2),\n hasVoted = _useState4[0],\n setHasVoted = _useState4[1];\n\n var _useState5 = Object(react__WEBPACK_IMPORTED_MODULE_3__[\"useState\"])(''),\n _useState6 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_2___default()(_useState5, 2),\n storedCookieValue = _useState6[0],\n setStoredCookieValue = _useState6[1];\n\n Object(react__WEBPACK_IMPORTED_MODULE_3__[\"useEffect\"])(function () {\n if (enableVoteRestriction && undefined !== js_cookie__WEBPACK_IMPORTED_MODULE_4___default.a.get(cookieName)) {\n setHasVoted(true);\n setStoredCookieValue(js_cookie__WEBPACK_IMPORTED_MODULE_4___default.a.get(cookieName));\n }\n }, []);\n\n var vote = /*#__PURE__*/function () {\n var _ref = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee(selectedAnswerIds) {\n var nonce, cookieValue;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n _context.prev = 0;\n setIsVoting(true);\n _context.next = 4;\n return Object(data_poll__WEBPACK_IMPORTED_MODULE_5__[\"requestVoteNonce\"])(pollId);\n\n case 4:\n nonce = _context.sent;\n _context.next = 7;\n return Object(data_poll__WEBPACK_IMPORTED_MODULE_5__[\"requestVote\"])(nonce, pollId, selectedAnswerIds);\n\n case 7:\n setHasVoted(true);\n\n if (enableVoteRestriction) {\n cookieValue = storeAnswerIdsInCookie ? selectedAnswerIds.join(',') : new Date().getTime();\n js_cookie__WEBPACK_IMPORTED_MODULE_4___default.a.set(cookieName, cookieValue, {\n sameSite: 'Strict',\n expires: 365\n });\n setStoredCookieValue(cookieValue);\n }\n\n case 9:\n _context.prev = 9;\n setIsVoting(false);\n return _context.finish(9);\n\n case 12:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee, null, [[0,, 9, 12]]);\n }));\n\n return function vote(_x) {\n return _ref.apply(this, arguments);\n };\n }();\n\n return {\n hasVoted: hasVoted,\n isVoting: isVoting,\n vote: vote,\n storedCookieValue: storedCookieValue\n };\n};\nvar useIsCsConnected = function useIsCsConnected() {\n /* assume connection is enabled, so placeholder doesn't flash while we add a block and wait for the request */\n var _useState7 = Object(react__WEBPACK_IMPORTED_MODULE_3__[\"useState\"])(true),\n _useState8 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_2___default()(_useState7, 2),\n isConnected = _useState8[0],\n setIsConnected = _useState8[1];\n\n var _useState9 = Object(react__WEBPACK_IMPORTED_MODULE_3__[\"useState\"])(true),\n _useState10 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_2___default()(_useState9, 2),\n isAccountVerified = _useState10[0],\n setIsAccountVerified = _useState10[1];\n\n var checkIsConnected = /*#__PURE__*/function () {\n var _ref2 = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee2() {\n var connectedState, isNowConnected, isNowVerified;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee2$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n _context2.next = 2;\n return Object(data_poll__WEBPACK_IMPORTED_MODULE_5__[\"requestIsCsConnected\"])();\n\n case 2:\n connectedState = _context2.sent;\n isNowConnected = blocks_poll_constants__WEBPACK_IMPORTED_MODULE_7__[\"ConnectedAccountState\"].CONNECTED === connectedState || blocks_poll_constants__WEBPACK_IMPORTED_MODULE_7__[\"ConnectedAccountState\"].NOT_VERIFIED === connectedState;\n isNowVerified = blocks_poll_constants__WEBPACK_IMPORTED_MODULE_7__[\"ConnectedAccountState\"].CONNECTED === connectedState;\n setIsConnected(isNowConnected);\n setIsAccountVerified(isNowVerified);\n return _context2.abrupt(\"return\", {\n isNowConnected: isNowConnected,\n isNowVerified: isNowVerified\n });\n\n case 8:\n case \"end\":\n return _context2.stop();\n }\n }\n }, _callee2);\n }));\n\n return function checkIsConnected() {\n return _ref2.apply(this, arguments);\n };\n }();\n\n Object(react__WEBPACK_IMPORTED_MODULE_3__[\"useEffect\"])(function () {\n checkIsConnected();\n }, []);\n return {\n isConnected: isConnected,\n isAccountVerified: isAccountVerified,\n checkIsConnected: checkIsConnected\n };\n};\n\n//# sourceURL=webpack:///./client/data/hooks/index.js?");
|
686 |
|
687 |
/***/ }),
|
688 |
|
706 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
707 |
|
708 |
"use strict";
|
709 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"requestResults\", function() { return requestResults; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"requestVoteNonce\", function() { return requestVoteNonce; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"requestVote\", function() { return requestVote; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"CrowdsignalFormsError\", function() { return CrowdsignalFormsError; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"CrowdsignalFormsServerError\", function() { return CrowdsignalFormsServerError; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"requestIsCsConnected\", function() { return requestIsCsConnected; });\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ \"./node_modules/@babel/runtime/helpers/inherits.js\");\n/* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ \"./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js\");\n/* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ \"./node_modules/@babel/runtime/helpers/getPrototypeOf.js\");\n/* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _babel_runtime_helpers_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/wrapNativeSuper */ \"./node_modules/@babel/runtime/helpers/wrapNativeSuper.js\");\n/* harmony import */ var _babel_runtime_helpers_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"@babel/runtime/regenerator\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"./node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/api-fetch */ \"@wordpress/api-fetch\");\n/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_7__);\n/* harmony import */ var lib_i18n__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! lib/i18n */ \"./client/lib/i18n/index.js\");\n\n\n\n\n\n\n\n\nfunction _createSuper(Derived) { return function () { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default()(Derived), result; if (_isNativeReflectConstruct()) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default()(this, result); }; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\n/**\n * External dependencies\n */\n\n/**\n * Internal dependencies\n */\n\n\n/**\n * Fetch the poll results for the given pollId\n *\n * @param {number} pollId Poll ID.\n * @param {boolean} doFetch Whether or not to actually perform the request.\n * @return {Promise} Promise that resolves to a key-value object with answer IDs and vote counts.\n */\n\nvar requestResults = /*#__PURE__*/function () {\n var _ref = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_6___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5___default.a.mark(function _callee(pollId) {\n var doFetch,\n baseUrl,\n _args = arguments;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5___default.a.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n doFetch = _args.length > 1 && _args[1] !== undefined ? _args[1] : true;\n baseUrl = 'https://api.crowdsignal.com/v3/polls';\n\n if (doFetch) {\n _context.next = 4;\n break;\n }\n\n return _context.abrupt(\"return\", null);\n\n case 4:\n return _context.abrupt(\"return\", window.fetch(\"\".concat(baseUrl, \"/\").concat(pollId, \"/results\"), {\n method: 'GET',\n headers: {\n 'content-type': 'application/json'\n }\n }).then(function (response) {\n if (response.status >= 200 && response.status < 300) {\n return response.json();\n }\n\n throw response;\n }).then(function (response) {\n if (404 === response.status) {\n // poll doesn't exist on the platform yet, return an empty result\n return {};\n } else if (response.error) {\n throw new Error(response.message);\n }\n\n return response.results.votes_by_answer;\n }));\n\n case 5:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee);\n }));\n\n return function requestResults(_x) {\n return _ref.apply(this, arguments);\n };\n}();\nvar requestVoteNonce = /*#__PURE__*/function () {\n var _ref2 = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_6___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5___default.a.mark(function _callee2(pollId) {\n var hash, timestamp, respNonce, jsonNonce;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5___default.a.wrap(function _callee2$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n hash = '5430eeac3911395001d731d9702fc38b'; // hash not used when format=json is passed\n\n timestamp = new Date().getTime();\n _context2.next = 4;\n return window.fetch(\"https://polldaddy.com/n/\".concat(hash, \"/\").concat(pollId, \"?\").concat(timestamp, \"&format=json\"));\n\n case 4:\n respNonce = _context2.sent;\n\n if (respNonce.ok) {\n _context2.next = 7;\n break;\n }\n\n throw new CrowdsignalFormsServerError();\n\n case 7:\n _context2.next = 9;\n return respNonce.json();\n\n case 9:\n jsonNonce = _context2.sent;\n\n if (jsonNonce.nonce) {\n _context2.next = 12;\n break;\n }\n\n throw new CrowdsignalFormsServerError();\n\n case 12:\n return _context2.abrupt(\"return\", jsonNonce.nonce);\n\n case 13:\n case \"end\":\n return _context2.stop();\n }\n }\n }, _callee2);\n }));\n\n return function requestVoteNonce(_x2) {\n return _ref2.apply(this, arguments);\n };\n}();\nvar requestVote = /*#__PURE__*/function () {\n var _ref3 = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_6___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5___default.a.mark(function _callee3(nonce, pollId, selectedAnswerIds) {\n var answerString, respVote, jsonVote;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5___default.a.wrap(function _callee3$(_context3) {\n while (1) {\n switch (_context3.prev = _context3.next) {\n case 0:\n answerString = selectedAnswerIds.join(',');\n _context3.next = 3;\n return window.fetch(\"https://polls.polldaddy.com/vote-js.php?format=json&p=\".concat(pollId, \"&b=1&a=\").concat(answerString, \"&o=&va=16&cookie=0&n=\").concat(nonce, \"&url=\").concat(encodeURIComponent(window.location)));\n\n case 3:\n respVote = _context3.sent;\n\n if (respVote.ok) {\n _context3.next = 6;\n break;\n }\n\n throw new CrowdsignalFormsServerError();\n\n case 6:\n _context3.next = 8;\n return respVote.json();\n\n case 8:\n jsonVote = _context3.sent;\n\n if (!('error' === jsonVote.status)) {\n _context3.next = 11;\n break;\n }\n\n throw new CrowdsignalFormsError(jsonVote.error);\n\n case 11:\n case \"end\":\n return _context3.stop();\n }\n }\n }, _callee3);\n }));\n\n return function requestVote(_x3, _x4, _x5) {\n return _ref3.apply(this, arguments);\n };\n}();\nvar CrowdsignalFormsError = /*#__PURE__*/function (_Error) {\n _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1___default()(CrowdsignalFormsError, _Error);\n\n var _super = _createSuper(CrowdsignalFormsError);\n\n function CrowdsignalFormsError() {\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, CrowdsignalFormsError);\n\n return _super.apply(this, arguments);\n }\n\n return CrowdsignalFormsError;\n}( /*#__PURE__*/_babel_runtime_helpers_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_4___default()(Error));\nvar CrowdsignalFormsServerError = /*#__PURE__*/function (_CrowdsignalFormsErro) {\n _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1___default()(CrowdsignalFormsServerError, _CrowdsignalFormsErro);\n\n var _super2 = _createSuper(CrowdsignalFormsServerError);\n\n function CrowdsignalFormsServerError() {\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, CrowdsignalFormsServerError);\n\n return _super2.call(this, Object(lib_i18n__WEBPACK_IMPORTED_MODULE_8__[\"__\"])('Server error. Please try again.'));\n }\n\n return CrowdsignalFormsServerError;\n}(CrowdsignalFormsError);\n/**\n * Returns the connected state of the current user's account.\n *\n * @return {string} Enum value of the account's state.\n */\n\nvar requestIsCsConnected = /*#__PURE__*/function () {\n var _ref4 = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_6___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5___default.a.mark(function _callee4() {\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5___default.a.wrap(function _callee4$(_context4) {\n while (1) {\n switch (_context4.prev = _context4.next) {\n case 0:\n _context4.next = 2;\n return _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_7___default()({\n path: \"/crowdsignal-forms/v1/account/connected\",\n method: 'GET'\n });\n\n case 2:\n return _context4.abrupt(\"return\", _context4.sent);\n\n case 3:\n case \"end\":\n return _context4.stop();\n }\n }\n }, _callee4);\n }));\n\n return function requestIsCsConnected() {\n return _ref4.apply(this, arguments);\n };\n}();\n\n//# sourceURL=webpack:///./client/data/poll/index.js?");
|
710 |
|
711 |
/***/ }),
|
712 |
|
718 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
719 |
|
720 |
"use strict";
|
721 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/blocks */ \"@wordpress/blocks\");\n/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var blocks_poll__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! blocks/poll */ \"./client/blocks/poll/index.js\");\n/* harmony import */ var blocks_vote__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! blocks/vote */ \"./client/blocks/vote/index.js\");\n/* harmony import */ var blocks_vote_item__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! blocks/vote-item */ \"./client/blocks/vote-item/index.js\");\n/**\n * External dependencies\n */\n\n/**\n * Internal dependencies\n */\n\n\n\n\nObject(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__[\"registerBlockType\"])('crowdsignal-forms/poll', blocks_poll__WEBPACK_IMPORTED_MODULE_1__[\"default\"]);\nObject(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__[\"registerBlockType\"])('crowdsignal-forms/vote', blocks_vote__WEBPACK_IMPORTED_MODULE_2__[\"default\"]);\nObject(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__[\"registerBlockType\"])('crowdsignal-forms/vote-item', blocks_vote_item__WEBPACK_IMPORTED_MODULE_3__[\"default\"]);\n\n//# sourceURL=webpack:///./client/editor.js?");
|
722 |
|
723 |
/***/ }),
|
724 |
|
822 |
|
823 |
/***/ }),
|
824 |
|
825 |
+
/***/ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js":
|
826 |
+
/*!**************************************************************************!*\
|
827 |
+
!*** ./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js ***!
|
828 |
+
\**************************************************************************/
|
829 |
+
/*! exports provided: default */
|
830 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
831 |
+
|
832 |
+
"use strict";
|
833 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return _assertThisInitialized; });\nfunction _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js?");
|
834 |
+
|
835 |
+
/***/ }),
|
836 |
+
|
837 |
+
/***/ "./node_modules/@babel/runtime/helpers/esm/extends.js":
|
838 |
+
/*!************************************************************!*\
|
839 |
+
!*** ./node_modules/@babel/runtime/helpers/esm/extends.js ***!
|
840 |
+
\************************************************************/
|
841 |
+
/*! exports provided: default */
|
842 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
843 |
+
|
844 |
+
"use strict";
|
845 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return _extends; });\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/esm/extends.js?");
|
846 |
+
|
847 |
+
/***/ }),
|
848 |
+
|
849 |
+
/***/ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js":
|
850 |
+
/*!******************************************************************!*\
|
851 |
+
!*** ./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js ***!
|
852 |
+
\******************************************************************/
|
853 |
+
/*! exports provided: default */
|
854 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
855 |
+
|
856 |
+
"use strict";
|
857 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return _inheritsLoose; });\nfunction _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js?");
|
858 |
+
|
859 |
+
/***/ }),
|
860 |
+
|
861 |
+
/***/ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js":
|
862 |
+
/*!*********************************************************************************!*\
|
863 |
+
!*** ./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js ***!
|
864 |
+
\*********************************************************************************/
|
865 |
+
/*! exports provided: default */
|
866 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
867 |
+
|
868 |
+
"use strict";
|
869 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return _objectWithoutPropertiesLoose; });\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js?");
|
870 |
+
|
871 |
+
/***/ }),
|
872 |
+
|
873 |
/***/ "./node_modules/@babel/runtime/helpers/extends.js":
|
874 |
/*!********************************************************!*\
|
875 |
!*** ./node_modules/@babel/runtime/helpers/extends.js ***!
|
1079 |
|
1080 |
/***/ }),
|
1081 |
|
1082 |
+
/***/ "./node_modules/dom-helpers/esm/addClass.js":
|
1083 |
+
/*!**************************************************!*\
|
1084 |
+
!*** ./node_modules/dom-helpers/esm/addClass.js ***!
|
1085 |
+
\**************************************************/
|
1086 |
+
/*! exports provided: default */
|
1087 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
1088 |
+
|
1089 |
+
"use strict";
|
1090 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return addClass; });\n/* harmony import */ var _hasClass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./hasClass */ \"./node_modules/dom-helpers/esm/hasClass.js\");\n\nfunction addClass(element, className) {\n if (element.classList) element.classList.add(className);else if (!Object(_hasClass__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(element, className)) if (typeof element.className === 'string') element.className = element.className + \" \" + className;else element.setAttribute('class', (element.className && element.className.baseVal || '') + \" \" + className);\n}\n\n//# sourceURL=webpack:///./node_modules/dom-helpers/esm/addClass.js?");
|
1091 |
+
|
1092 |
+
/***/ }),
|
1093 |
+
|
1094 |
+
/***/ "./node_modules/dom-helpers/esm/hasClass.js":
|
1095 |
+
/*!**************************************************!*\
|
1096 |
+
!*** ./node_modules/dom-helpers/esm/hasClass.js ***!
|
1097 |
+
\**************************************************/
|
1098 |
+
/*! exports provided: default */
|
1099 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
1100 |
+
|
1101 |
+
"use strict";
|
1102 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return hasClass; });\nfunction hasClass(element, className) {\n if (element.classList) return !!className && element.classList.contains(className);\n return (\" \" + (element.className.baseVal || element.className) + \" \").indexOf(\" \" + className + \" \") !== -1;\n}\n\n//# sourceURL=webpack:///./node_modules/dom-helpers/esm/hasClass.js?");
|
1103 |
+
|
1104 |
+
/***/ }),
|
1105 |
+
|
1106 |
+
/***/ "./node_modules/dom-helpers/esm/removeClass.js":
|
1107 |
+
/*!*****************************************************!*\
|
1108 |
+
!*** ./node_modules/dom-helpers/esm/removeClass.js ***!
|
1109 |
+
\*****************************************************/
|
1110 |
+
/*! exports provided: default */
|
1111 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
1112 |
+
|
1113 |
+
"use strict";
|
1114 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return removeClass; });\nfunction replaceClassName(origClass, classToRemove) {\n return origClass.replace(new RegExp(\"(^|\\\\s)\" + classToRemove + \"(?:\\\\s|$)\", 'g'), '$1').replace(/\\s+/g, ' ').replace(/^\\s*|\\s*$/g, '');\n}\n\nfunction removeClass(element, className) {\n if (element.classList) {\n element.classList.remove(className);\n } else if (typeof element.className === 'string') {\n ;\n element.className = replaceClassName(element.className, className);\n } else {\n element.setAttribute('class', replaceClassName(element.className && element.className.baseVal || '', className));\n }\n}\n\n//# sourceURL=webpack:///./node_modules/dom-helpers/esm/removeClass.js?");
|
1115 |
+
|
1116 |
+
/***/ }),
|
1117 |
+
|
1118 |
/***/ "./node_modules/js-cookie/src/js.cookie.js":
|
1119 |
/*!*************************************************!*\
|
1120 |
!*** ./node_modules/js-cookie/src/js.cookie.js ***!
|
1233 |
|
1234 |
/***/ }),
|
1235 |
|
1236 |
+
/***/ "./node_modules/react-transition-group/esm/CSSTransition.js":
|
1237 |
+
/*!******************************************************************!*\
|
1238 |
+
!*** ./node_modules/react-transition-group/esm/CSSTransition.js ***!
|
1239 |
+
\******************************************************************/
|
1240 |
+
/*! exports provided: default */
|
1241 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
1242 |
+
|
1243 |
+
"use strict";
|
1244 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ \"./node_modules/@babel/runtime/helpers/esm/extends.js\");\n/* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ \"./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js\");\n/* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ \"./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js\");\n/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\");\n/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var dom_helpers_addClass__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! dom-helpers/addClass */ \"./node_modules/dom-helpers/esm/addClass.js\");\n/* harmony import */ var dom_helpers_removeClass__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! dom-helpers/removeClass */ \"./node_modules/dom-helpers/esm/removeClass.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var _Transition__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./Transition */ \"./node_modules/react-transition-group/esm/Transition.js\");\n/* harmony import */ var _utils_PropTypes__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./utils/PropTypes */ \"./node_modules/react-transition-group/esm/utils/PropTypes.js\");\n\n\n\n\n\n\n\n\n\n\nvar _addClass = function addClass(node, classes) {\n return node && classes && classes.split(' ').forEach(function (c) {\n return Object(dom_helpers_addClass__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(node, c);\n });\n};\n\nvar removeClass = function removeClass(node, classes) {\n return node && classes && classes.split(' ').forEach(function (c) {\n return Object(dom_helpers_removeClass__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(node, c);\n });\n};\n/**\n * A transition component inspired by the excellent\n * [ng-animate](https://docs.angularjs.org/api/ngAnimate) library, you should\n * use it if you're using CSS transitions or animations. It's built upon the\n * [`Transition`](https://reactcommunity.org/react-transition-group/transition)\n * component, so it inherits all of its props.\n *\n * `CSSTransition` applies a pair of class names during the `appear`, `enter`,\n * and `exit` states of the transition. The first class is applied and then a\n * second `*-active` class in order to activate the CSS transition. After the\n * transition, matching `*-done` class names are applied to persist the\n * transition state.\n *\n * ```jsx\n * function App() {\n * const [inProp, setInProp] = useState(false);\n * return (\n * <div>\n * <CSSTransition in={inProp} timeout={200} classNames=\"my-node\">\n * <div>\n * {\"I'll receive my-node-* classes\"}\n * </div>\n * </CSSTransition>\n * <button type=\"button\" onClick={() => setInProp(true)}>\n * Click to Enter\n * </button>\n * </div>\n * );\n * }\n * ```\n *\n * When the `in` prop is set to `true`, the child component will first receive\n * the class `example-enter`, then the `example-enter-active` will be added in\n * the next tick. `CSSTransition` [forces a\n * reflow](https://github.com/reactjs/react-transition-group/blob/5007303e729a74be66a21c3e2205e4916821524b/src/CSSTransition.js#L208-L215)\n * between before adding the `example-enter-active`. This is an important trick\n * because it allows us to transition between `example-enter` and\n * `example-enter-active` even though they were added immediately one after\n * another. Most notably, this is what makes it possible for us to animate\n * _appearance_.\n *\n * ```css\n * .my-node-enter {\n * opacity: 0;\n * }\n * .my-node-enter-active {\n * opacity: 1;\n * transition: opacity 200ms;\n * }\n * .my-node-exit {\n * opacity: 1;\n * }\n * .my-node-exit-active {\n * opacity: 0;\n * transition: opacity 200ms;\n * }\n * ```\n *\n * `*-active` classes represent which styles you want to animate **to**, so it's\n * important to add `transition` declaration only to them, otherwise transitions\n * might not behave as intended! This might not be obvious when the transitions\n * are symmetrical, i.e. when `*-enter-active` is the same as `*-exit`, like in\n * the example above (minus `transition`), but it becomes apparent in more\n * complex transitions.\n *\n * **Note**: If you're using the\n * [`appear`](http://reactcommunity.org/react-transition-group/transition#Transition-prop-appear)\n * prop, make sure to define styles for `.appear-*` classes as well.\n */\n\n\nvar CSSTransition = /*#__PURE__*/function (_React$Component) {\n Object(_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(CSSTransition, _React$Component);\n\n function CSSTransition() {\n var _this;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;\n _this.appliedClasses = {\n appear: {},\n enter: {},\n exit: {}\n };\n\n _this.onEnter = function (maybeNode, maybeAppearing) {\n var _this$resolveArgument = _this.resolveArguments(maybeNode, maybeAppearing),\n node = _this$resolveArgument[0],\n appearing = _this$resolveArgument[1];\n\n _this.removeClasses(node, 'exit');\n\n _this.addClass(node, appearing ? 'appear' : 'enter', 'base');\n\n if (_this.props.onEnter) {\n _this.props.onEnter(maybeNode, maybeAppearing);\n }\n };\n\n _this.onEntering = function (maybeNode, maybeAppearing) {\n var _this$resolveArgument2 = _this.resolveArguments(maybeNode, maybeAppearing),\n node = _this$resolveArgument2[0],\n appearing = _this$resolveArgument2[1];\n\n var type = appearing ? 'appear' : 'enter';\n\n _this.addClass(node, type, 'active');\n\n if (_this.props.onEntering) {\n _this.props.onEntering(maybeNode, maybeAppearing);\n }\n };\n\n _this.onEntered = function (maybeNode, maybeAppearing) {\n var _this$resolveArgument3 = _this.resolveArguments(maybeNode, maybeAppearing),\n node = _this$resolveArgument3[0],\n appearing = _this$resolveArgument3[1];\n\n var type = appearing ? 'appear' : 'enter';\n\n _this.removeClasses(node, type);\n\n _this.addClass(node, type, 'done');\n\n if (_this.props.onEntered) {\n _this.props.onEntered(maybeNode, maybeAppearing);\n }\n };\n\n _this.onExit = function (maybeNode) {\n var _this$resolveArgument4 = _this.resolveArguments(maybeNode),\n node = _this$resolveArgument4[0];\n\n _this.removeClasses(node, 'appear');\n\n _this.removeClasses(node, 'enter');\n\n _this.addClass(node, 'exit', 'base');\n\n if (_this.props.onExit) {\n _this.props.onExit(maybeNode);\n }\n };\n\n _this.onExiting = function (maybeNode) {\n var _this$resolveArgument5 = _this.resolveArguments(maybeNode),\n node = _this$resolveArgument5[0];\n\n _this.addClass(node, 'exit', 'active');\n\n if (_this.props.onExiting) {\n _this.props.onExiting(maybeNode);\n }\n };\n\n _this.onExited = function (maybeNode) {\n var _this$resolveArgument6 = _this.resolveArguments(maybeNode),\n node = _this$resolveArgument6[0];\n\n _this.removeClasses(node, 'exit');\n\n _this.addClass(node, 'exit', 'done');\n\n if (_this.props.onExited) {\n _this.props.onExited(maybeNode);\n }\n };\n\n _this.resolveArguments = function (maybeNode, maybeAppearing) {\n return _this.props.nodeRef ? [_this.props.nodeRef.current, maybeNode] // here `maybeNode` is actually `appearing`\n : [maybeNode, maybeAppearing];\n };\n\n _this.getClassNames = function (type) {\n var classNames = _this.props.classNames;\n var isStringClassNames = typeof classNames === 'string';\n var prefix = isStringClassNames && classNames ? classNames + \"-\" : '';\n var baseClassName = isStringClassNames ? \"\" + prefix + type : classNames[type];\n var activeClassName = isStringClassNames ? baseClassName + \"-active\" : classNames[type + \"Active\"];\n var doneClassName = isStringClassNames ? baseClassName + \"-done\" : classNames[type + \"Done\"];\n return {\n baseClassName: baseClassName,\n activeClassName: activeClassName,\n doneClassName: doneClassName\n };\n };\n\n return _this;\n }\n\n var _proto = CSSTransition.prototype;\n\n _proto.addClass = function addClass(node, type, phase) {\n var className = this.getClassNames(type)[phase + \"ClassName\"];\n\n var _this$getClassNames = this.getClassNames('enter'),\n doneClassName = _this$getClassNames.doneClassName;\n\n if (type === 'appear' && phase === 'done' && doneClassName) {\n className += \" \" + doneClassName;\n } // This is for to force a repaint,\n // which is necessary in order to transition styles when adding a class name.\n\n\n if (phase === 'active') {\n /* eslint-disable no-unused-expressions */\n node && node.scrollTop;\n }\n\n if (className) {\n this.appliedClasses[type][phase] = className;\n\n _addClass(node, className);\n }\n };\n\n _proto.removeClasses = function removeClasses(node, type) {\n var _this$appliedClasses$ = this.appliedClasses[type],\n baseClassName = _this$appliedClasses$.base,\n activeClassName = _this$appliedClasses$.active,\n doneClassName = _this$appliedClasses$.done;\n this.appliedClasses[type] = {};\n\n if (baseClassName) {\n removeClass(node, baseClassName);\n }\n\n if (activeClassName) {\n removeClass(node, activeClassName);\n }\n\n if (doneClassName) {\n removeClass(node, doneClassName);\n }\n };\n\n _proto.render = function render() {\n var _this$props = this.props,\n _ = _this$props.classNames,\n props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(_this$props, [\"classNames\"]);\n\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_6___default.a.createElement(_Transition__WEBPACK_IMPORTED_MODULE_7__[\"default\"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({}, props, {\n onEnter: this.onEnter,\n onEntered: this.onEntered,\n onEntering: this.onEntering,\n onExit: this.onExit,\n onExiting: this.onExiting,\n onExited: this.onExited\n }));\n };\n\n return CSSTransition;\n}(react__WEBPACK_IMPORTED_MODULE_6___default.a.Component);\n\nCSSTransition.defaultProps = {\n classNames: ''\n};\nCSSTransition.propTypes = undefined !== \"production\" ? Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({}, _Transition__WEBPACK_IMPORTED_MODULE_7__[\"default\"].propTypes, {\n /**\n * The animation classNames applied to the component as it appears, enters,\n * exits or has finished the transition. A single name can be provided, which\n * will be suffixed for each stage, e.g. `classNames=\"fade\"` applies:\n *\n * - `fade-appear`, `fade-appear-active`, `fade-appear-done`\n * - `fade-enter`, `fade-enter-active`, `fade-enter-done`\n * - `fade-exit`, `fade-exit-active`, `fade-exit-done`\n *\n * A few details to note about how these classes are applied:\n *\n * 1. They are _joined_ with the ones that are already defined on the child\n * component, so if you want to add some base styles, you can use\n * `className` without worrying that it will be overridden.\n *\n * 2. If the transition component mounts with `in={false}`, no classes are\n * applied yet. You might be expecting `*-exit-done`, but if you think\n * about it, a component cannot finish exiting if it hasn't entered yet.\n *\n * 2. `fade-appear-done` and `fade-enter-done` will _both_ be applied. This\n * allows you to define different behavior for when appearing is done and\n * when regular entering is done, using selectors like\n * `.fade-enter-done:not(.fade-appear-done)`. For example, you could apply\n * an epic entrance animation when element first appears in the DOM using\n * [Animate.css](https://daneden.github.io/animate.css/). Otherwise you can\n * simply use `fade-enter-done` for defining both cases.\n *\n * Each individual classNames can also be specified independently like:\n *\n * ```js\n * classNames={{\n * appear: 'my-appear',\n * appearActive: 'my-active-appear',\n * appearDone: 'my-done-appear',\n * enter: 'my-enter',\n * enterActive: 'my-active-enter',\n * enterDone: 'my-done-enter',\n * exit: 'my-exit',\n * exitActive: 'my-active-exit',\n * exitDone: 'my-done-exit',\n * }}\n * ```\n *\n * If you want to set these classes using CSS Modules:\n *\n * ```js\n * import styles from './styles.css';\n * ```\n *\n * you might want to use camelCase in your CSS file, that way could simply\n * spread them instead of listing them one by one:\n *\n * ```js\n * classNames={{ ...styles }}\n * ```\n *\n * @type {string | {\n * appear?: string,\n * appearActive?: string,\n * appearDone?: string,\n * enter?: string,\n * enterActive?: string,\n * enterDone?: string,\n * exit?: string,\n * exitActive?: string,\n * exitDone?: string,\n * }}\n */\n classNames: _utils_PropTypes__WEBPACK_IMPORTED_MODULE_8__[\"classNamesShape\"],\n\n /**\n * A `<Transition>` callback fired immediately after the 'enter' or 'appear' class is\n * applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement, isAppearing: bool)\n */\n onEnter: prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.func,\n\n /**\n * A `<Transition>` callback fired immediately after the 'enter-active' or\n * 'appear-active' class is applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement, isAppearing: bool)\n */\n onEntering: prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.func,\n\n /**\n * A `<Transition>` callback fired immediately after the 'enter' or\n * 'appear' classes are **removed** and the `done` class is added to the DOM node.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement, isAppearing: bool)\n */\n onEntered: prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.func,\n\n /**\n * A `<Transition>` callback fired immediately after the 'exit' class is\n * applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed\n *\n * @type Function(node: HtmlElement)\n */\n onExit: prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.func,\n\n /**\n * A `<Transition>` callback fired immediately after the 'exit-active' is applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed\n *\n * @type Function(node: HtmlElement)\n */\n onExiting: prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.func,\n\n /**\n * A `<Transition>` callback fired immediately after the 'exit' classes\n * are **removed** and the `exit-done` class is added to the DOM node.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed\n *\n * @type Function(node: HtmlElement)\n */\n onExited: prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.func\n}) : {};\n/* harmony default export */ __webpack_exports__[\"default\"] = (CSSTransition);\n\n//# sourceURL=webpack:///./node_modules/react-transition-group/esm/CSSTransition.js?");
|
1245 |
+
|
1246 |
+
/***/ }),
|
1247 |
+
|
1248 |
+
/***/ "./node_modules/react-transition-group/esm/ReplaceTransition.js":
|
1249 |
+
/*!**********************************************************************!*\
|
1250 |
+
!*** ./node_modules/react-transition-group/esm/ReplaceTransition.js ***!
|
1251 |
+
\**********************************************************************/
|
1252 |
+
/*! exports provided: default */
|
1253 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
1254 |
+
|
1255 |
+
"use strict";
|
1256 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ \"./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js\");\n/* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ \"./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js\");\n/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\");\n/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react-dom */ \"react-dom\");\n/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _TransitionGroup__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./TransitionGroup */ \"./node_modules/react-transition-group/esm/TransitionGroup.js\");\n\n\n\n\n\n\n/**\n * The `<ReplaceTransition>` component is a specialized `Transition` component\n * that animates between two children.\n *\n * ```jsx\n * <ReplaceTransition in>\n * <Fade><div>I appear first</div></Fade>\n * <Fade><div>I replace the above</div></Fade>\n * </ReplaceTransition>\n * ```\n */\n\nvar ReplaceTransition = /*#__PURE__*/function (_React$Component) {\n Object(_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(ReplaceTransition, _React$Component);\n\n function ReplaceTransition() {\n var _this;\n\n for (var _len = arguments.length, _args = new Array(_len), _key = 0; _key < _len; _key++) {\n _args[_key] = arguments[_key];\n }\n\n _this = _React$Component.call.apply(_React$Component, [this].concat(_args)) || this;\n\n _this.handleEnter = function () {\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n return _this.handleLifecycle('onEnter', 0, args);\n };\n\n _this.handleEntering = function () {\n for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n args[_key3] = arguments[_key3];\n }\n\n return _this.handleLifecycle('onEntering', 0, args);\n };\n\n _this.handleEntered = function () {\n for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {\n args[_key4] = arguments[_key4];\n }\n\n return _this.handleLifecycle('onEntered', 0, args);\n };\n\n _this.handleExit = function () {\n for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {\n args[_key5] = arguments[_key5];\n }\n\n return _this.handleLifecycle('onExit', 1, args);\n };\n\n _this.handleExiting = function () {\n for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {\n args[_key6] = arguments[_key6];\n }\n\n return _this.handleLifecycle('onExiting', 1, args);\n };\n\n _this.handleExited = function () {\n for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {\n args[_key7] = arguments[_key7];\n }\n\n return _this.handleLifecycle('onExited', 1, args);\n };\n\n return _this;\n }\n\n var _proto = ReplaceTransition.prototype;\n\n _proto.handleLifecycle = function handleLifecycle(handler, idx, originalArgs) {\n var _child$props;\n\n var children = this.props.children;\n var child = react__WEBPACK_IMPORTED_MODULE_3___default.a.Children.toArray(children)[idx];\n if (child.props[handler]) (_child$props = child.props)[handler].apply(_child$props, originalArgs);\n\n if (this.props[handler]) {\n var maybeNode = child.props.nodeRef ? undefined : react_dom__WEBPACK_IMPORTED_MODULE_4___default.a.findDOMNode(this);\n this.props[handler](maybeNode);\n }\n };\n\n _proto.render = function render() {\n var _this$props = this.props,\n children = _this$props.children,\n inProp = _this$props.in,\n props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(_this$props, [\"children\", \"in\"]);\n\n var _React$Children$toArr = react__WEBPACK_IMPORTED_MODULE_3___default.a.Children.toArray(children),\n first = _React$Children$toArr[0],\n second = _React$Children$toArr[1];\n\n delete props.onEnter;\n delete props.onEntering;\n delete props.onEntered;\n delete props.onExit;\n delete props.onExiting;\n delete props.onExited;\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_TransitionGroup__WEBPACK_IMPORTED_MODULE_5__[\"default\"], props, inProp ? react__WEBPACK_IMPORTED_MODULE_3___default.a.cloneElement(first, {\n key: 'first',\n onEnter: this.handleEnter,\n onEntering: this.handleEntering,\n onEntered: this.handleEntered\n }) : react__WEBPACK_IMPORTED_MODULE_3___default.a.cloneElement(second, {\n key: 'second',\n onEnter: this.handleExit,\n onEntering: this.handleExiting,\n onEntered: this.handleExited\n }));\n };\n\n return ReplaceTransition;\n}(react__WEBPACK_IMPORTED_MODULE_3___default.a.Component);\n\nReplaceTransition.propTypes = undefined !== \"production\" ? {\n in: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool.isRequired,\n children: function children(props, propName) {\n if (react__WEBPACK_IMPORTED_MODULE_3___default.a.Children.count(props[propName]) !== 2) return new Error(\"\\\"\" + propName + \"\\\" must be exactly two transition components.\");\n return null;\n }\n} : {};\n/* harmony default export */ __webpack_exports__[\"default\"] = (ReplaceTransition);\n\n//# sourceURL=webpack:///./node_modules/react-transition-group/esm/ReplaceTransition.js?");
|
1257 |
+
|
1258 |
+
/***/ }),
|
1259 |
+
|
1260 |
+
/***/ "./node_modules/react-transition-group/esm/SwitchTransition.js":
|
1261 |
+
/*!*********************************************************************!*\
|
1262 |
+
!*** ./node_modules/react-transition-group/esm/SwitchTransition.js ***!
|
1263 |
+
\*********************************************************************/
|
1264 |
+
/*! exports provided: modes, default */
|
1265 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
1266 |
+
|
1267 |
+
"use strict";
|
1268 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"modes\", function() { return modes; });\n/* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ \"./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\");\n/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _Transition__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Transition */ \"./node_modules/react-transition-group/esm/Transition.js\");\n/* harmony import */ var _TransitionGroupContext__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./TransitionGroupContext */ \"./node_modules/react-transition-group/esm/TransitionGroupContext.js\");\n\n\nvar _leaveRenders, _enterRenders;\n\n\n\n\n\n\nfunction areChildrenDifferent(oldChildren, newChildren) {\n if (oldChildren === newChildren) return false;\n\n if (react__WEBPACK_IMPORTED_MODULE_1___default.a.isValidElement(oldChildren) && react__WEBPACK_IMPORTED_MODULE_1___default.a.isValidElement(newChildren) && oldChildren.key != null && oldChildren.key === newChildren.key) {\n return false;\n }\n\n return true;\n}\n/**\n * Enum of modes for SwitchTransition component\n * @enum { string }\n */\n\n\nvar modes = {\n out: 'out-in',\n in: 'in-out'\n};\n\nvar callHook = function callHook(element, name, cb) {\n return function () {\n var _element$props;\n\n element.props[name] && (_element$props = element.props)[name].apply(_element$props, arguments);\n cb();\n };\n};\n\nvar leaveRenders = (_leaveRenders = {}, _leaveRenders[modes.out] = function (_ref) {\n var current = _ref.current,\n changeState = _ref.changeState;\n return react__WEBPACK_IMPORTED_MODULE_1___default.a.cloneElement(current, {\n in: false,\n onExited: callHook(current, 'onExited', function () {\n changeState(_Transition__WEBPACK_IMPORTED_MODULE_3__[\"ENTERING\"], null);\n })\n });\n}, _leaveRenders[modes.in] = function (_ref2) {\n var current = _ref2.current,\n changeState = _ref2.changeState,\n children = _ref2.children;\n return [current, react__WEBPACK_IMPORTED_MODULE_1___default.a.cloneElement(children, {\n in: true,\n onEntered: callHook(children, 'onEntered', function () {\n changeState(_Transition__WEBPACK_IMPORTED_MODULE_3__[\"ENTERING\"]);\n })\n })];\n}, _leaveRenders);\nvar enterRenders = (_enterRenders = {}, _enterRenders[modes.out] = function (_ref3) {\n var children = _ref3.children,\n changeState = _ref3.changeState;\n return react__WEBPACK_IMPORTED_MODULE_1___default.a.cloneElement(children, {\n in: true,\n onEntered: callHook(children, 'onEntered', function () {\n changeState(_Transition__WEBPACK_IMPORTED_MODULE_3__[\"ENTERED\"], react__WEBPACK_IMPORTED_MODULE_1___default.a.cloneElement(children, {\n in: true\n }));\n })\n });\n}, _enterRenders[modes.in] = function (_ref4) {\n var current = _ref4.current,\n children = _ref4.children,\n changeState = _ref4.changeState;\n return [react__WEBPACK_IMPORTED_MODULE_1___default.a.cloneElement(current, {\n in: false,\n onExited: callHook(current, 'onExited', function () {\n changeState(_Transition__WEBPACK_IMPORTED_MODULE_3__[\"ENTERED\"], react__WEBPACK_IMPORTED_MODULE_1___default.a.cloneElement(children, {\n in: true\n }));\n })\n }), react__WEBPACK_IMPORTED_MODULE_1___default.a.cloneElement(children, {\n in: true\n })];\n}, _enterRenders);\n/**\n * A transition component inspired by the [vue transition modes](https://vuejs.org/v2/guide/transitions.html#Transition-Modes).\n * You can use it when you want to control the render between state transitions.\n * Based on the selected mode and the child's key which is the `Transition` or `CSSTransition` component, the `SwitchTransition` makes a consistent transition between them.\n *\n * If the `out-in` mode is selected, the `SwitchTransition` waits until the old child leaves and then inserts a new child.\n * If the `in-out` mode is selected, the `SwitchTransition` inserts a new child first, waits for the new child to enter and then removes the old child.\n *\n * **Note**: If you want the animation to happen simultaneously\n * (that is, to have the old child removed and a new child inserted **at the same time**),\n * you should use\n * [`TransitionGroup`](https://reactcommunity.org/react-transition-group/transition-group)\n * instead.\n *\n * ```jsx\n * function App() {\n * const [state, setState] = useState(false);\n * return (\n * <SwitchTransition>\n * <CSSTransition\n * key={state ? \"Goodbye, world!\" : \"Hello, world!\"}\n * addEndListener={(node, done) => node.addEventListener(\"transitionend\", done, false)}\n * classNames='fade'\n * >\n * <button onClick={() => setState(state => !state)}>\n * {state ? \"Goodbye, world!\" : \"Hello, world!\"}\n * </button>\n * </CSSTransition>\n * </SwitchTransition>\n * );\n * }\n * ```\n *\n * ```css\n * .fade-enter{\n * opacity: 0;\n * }\n * .fade-exit{\n * opacity: 1;\n * }\n * .fade-enter-active{\n * opacity: 1;\n * }\n * .fade-exit-active{\n * opacity: 0;\n * }\n * .fade-enter-active,\n * .fade-exit-active{\n * transition: opacity 500ms;\n * }\n * ```\n */\n\nvar SwitchTransition = /*#__PURE__*/function (_React$Component) {\n Object(_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(SwitchTransition, _React$Component);\n\n function SwitchTransition() {\n var _this;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;\n _this.state = {\n status: _Transition__WEBPACK_IMPORTED_MODULE_3__[\"ENTERED\"],\n current: null\n };\n _this.appeared = false;\n\n _this.changeState = function (status, current) {\n if (current === void 0) {\n current = _this.state.current;\n }\n\n _this.setState({\n status: status,\n current: current\n });\n };\n\n return _this;\n }\n\n var _proto = SwitchTransition.prototype;\n\n _proto.componentDidMount = function componentDidMount() {\n this.appeared = true;\n };\n\n SwitchTransition.getDerivedStateFromProps = function getDerivedStateFromProps(props, state) {\n if (props.children == null) {\n return {\n current: null\n };\n }\n\n if (state.status === _Transition__WEBPACK_IMPORTED_MODULE_3__[\"ENTERING\"] && props.mode === modes.in) {\n return {\n status: _Transition__WEBPACK_IMPORTED_MODULE_3__[\"ENTERING\"]\n };\n }\n\n if (state.current && areChildrenDifferent(state.current, props.children)) {\n return {\n status: _Transition__WEBPACK_IMPORTED_MODULE_3__[\"EXITING\"]\n };\n }\n\n return {\n current: react__WEBPACK_IMPORTED_MODULE_1___default.a.cloneElement(props.children, {\n in: true\n })\n };\n };\n\n _proto.render = function render() {\n var _this$props = this.props,\n children = _this$props.children,\n mode = _this$props.mode,\n _this$state = this.state,\n status = _this$state.status,\n current = _this$state.current;\n var data = {\n children: children,\n current: current,\n changeState: this.changeState,\n status: status\n };\n var component;\n\n switch (status) {\n case _Transition__WEBPACK_IMPORTED_MODULE_3__[\"ENTERING\"]:\n component = enterRenders[mode](data);\n break;\n\n case _Transition__WEBPACK_IMPORTED_MODULE_3__[\"EXITING\"]:\n component = leaveRenders[mode](data);\n break;\n\n case _Transition__WEBPACK_IMPORTED_MODULE_3__[\"ENTERED\"]:\n component = current;\n }\n\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_TransitionGroupContext__WEBPACK_IMPORTED_MODULE_4__[\"default\"].Provider, {\n value: {\n isMounting: !this.appeared\n }\n }, component);\n };\n\n return SwitchTransition;\n}(react__WEBPACK_IMPORTED_MODULE_1___default.a.Component);\n\nSwitchTransition.propTypes = undefined !== \"production\" ? {\n /**\n * Transition modes.\n * `out-in`: Current element transitions out first, then when complete, the new element transitions in.\n * `in-out`: New element transitions in first, then when complete, the current element transitions out.\n *\n * @type {'out-in'|'in-out'}\n */\n mode: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.oneOf([modes.in, modes.out]),\n\n /**\n * Any `Transition` or `CSSTransition` component.\n */\n children: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.element.isRequired])\n} : {};\nSwitchTransition.defaultProps = {\n mode: modes.out\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (SwitchTransition);\n\n//# sourceURL=webpack:///./node_modules/react-transition-group/esm/SwitchTransition.js?");
|
1269 |
+
|
1270 |
+
/***/ }),
|
1271 |
+
|
1272 |
+
/***/ "./node_modules/react-transition-group/esm/Transition.js":
|
1273 |
+
/*!***************************************************************!*\
|
1274 |
+
!*** ./node_modules/react-transition-group/esm/Transition.js ***!
|
1275 |
+
\***************************************************************/
|
1276 |
+
/*! exports provided: UNMOUNTED, EXITED, ENTERING, ENTERED, EXITING, default */
|
1277 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
1278 |
+
|
1279 |
+
"use strict";
|
1280 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"UNMOUNTED\", function() { return UNMOUNTED; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"EXITED\", function() { return EXITED; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ENTERING\", function() { return ENTERING; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ENTERED\", function() { return ENTERED; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"EXITING\", function() { return EXITING; });\n/* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ \"./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js\");\n/* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ \"./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js\");\n/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\");\n/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react-dom */ \"react-dom\");\n/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./config */ \"./node_modules/react-transition-group/esm/config.js\");\n/* harmony import */ var _utils_PropTypes__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./utils/PropTypes */ \"./node_modules/react-transition-group/esm/utils/PropTypes.js\");\n/* harmony import */ var _TransitionGroupContext__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./TransitionGroupContext */ \"./node_modules/react-transition-group/esm/TransitionGroupContext.js\");\n\n\n\n\n\n\n\n\nvar UNMOUNTED = 'unmounted';\nvar EXITED = 'exited';\nvar ENTERING = 'entering';\nvar ENTERED = 'entered';\nvar EXITING = 'exiting';\n/**\n * The Transition component lets you describe a transition from one component\n * state to another _over time_ with a simple declarative API. Most commonly\n * it's used to animate the mounting and unmounting of a component, but can also\n * be used to describe in-place transition states as well.\n *\n * ---\n *\n * **Note**: `Transition` is a platform-agnostic base component. If you're using\n * transitions in CSS, you'll probably want to use\n * [`CSSTransition`](https://reactcommunity.org/react-transition-group/css-transition)\n * instead. It inherits all the features of `Transition`, but contains\n * additional features necessary to play nice with CSS transitions (hence the\n * name of the component).\n *\n * ---\n *\n * By default the `Transition` component does not alter the behavior of the\n * component it renders, it only tracks \"enter\" and \"exit\" states for the\n * components. It's up to you to give meaning and effect to those states. For\n * example we can add styles to a component when it enters or exits:\n *\n * ```jsx\n * import { Transition } from 'react-transition-group';\n *\n * const duration = 300;\n *\n * const defaultStyle = {\n * transition: `opacity ${duration}ms ease-in-out`,\n * opacity: 0,\n * }\n *\n * const transitionStyles = {\n * entering: { opacity: 1 },\n * entered: { opacity: 1 },\n * exiting: { opacity: 0 },\n * exited: { opacity: 0 },\n * };\n *\n * const Fade = ({ in: inProp }) => (\n * <Transition in={inProp} timeout={duration}>\n * {state => (\n * <div style={{\n * ...defaultStyle,\n * ...transitionStyles[state]\n * }}>\n * I'm a fade Transition!\n * </div>\n * )}\n * </Transition>\n * );\n * ```\n *\n * There are 4 main states a Transition can be in:\n * - `'entering'`\n * - `'entered'`\n * - `'exiting'`\n * - `'exited'`\n *\n * Transition state is toggled via the `in` prop. When `true` the component\n * begins the \"Enter\" stage. During this stage, the component will shift from\n * its current transition state, to `'entering'` for the duration of the\n * transition and then to the `'entered'` stage once it's complete. Let's take\n * the following example (we'll use the\n * [useState](https://reactjs.org/docs/hooks-reference.html#usestate) hook):\n *\n * ```jsx\n * function App() {\n * const [inProp, setInProp] = useState(false);\n * return (\n * <div>\n * <Transition in={inProp} timeout={500}>\n * {state => (\n * // ...\n * )}\n * </Transition>\n * <button onClick={() => setInProp(true)}>\n * Click to Enter\n * </button>\n * </div>\n * );\n * }\n * ```\n *\n * When the button is clicked the component will shift to the `'entering'` state\n * and stay there for 500ms (the value of `timeout`) before it finally switches\n * to `'entered'`.\n *\n * When `in` is `false` the same thing happens except the state moves from\n * `'exiting'` to `'exited'`.\n */\n\nvar Transition = /*#__PURE__*/function (_React$Component) {\n Object(_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(Transition, _React$Component);\n\n function Transition(props, context) {\n var _this;\n\n _this = _React$Component.call(this, props, context) || this;\n var parentGroup = context; // In the context of a TransitionGroup all enters are really appears\n\n var appear = parentGroup && !parentGroup.isMounting ? props.enter : props.appear;\n var initialStatus;\n _this.appearStatus = null;\n\n if (props.in) {\n if (appear) {\n initialStatus = EXITED;\n _this.appearStatus = ENTERING;\n } else {\n initialStatus = ENTERED;\n }\n } else {\n if (props.unmountOnExit || props.mountOnEnter) {\n initialStatus = UNMOUNTED;\n } else {\n initialStatus = EXITED;\n }\n }\n\n _this.state = {\n status: initialStatus\n };\n _this.nextCallback = null;\n return _this;\n }\n\n Transition.getDerivedStateFromProps = function getDerivedStateFromProps(_ref, prevState) {\n var nextIn = _ref.in;\n\n if (nextIn && prevState.status === UNMOUNTED) {\n return {\n status: EXITED\n };\n }\n\n return null;\n } // getSnapshotBeforeUpdate(prevProps) {\n // let nextStatus = null\n // if (prevProps !== this.props) {\n // const { status } = this.state\n // if (this.props.in) {\n // if (status !== ENTERING && status !== ENTERED) {\n // nextStatus = ENTERING\n // }\n // } else {\n // if (status === ENTERING || status === ENTERED) {\n // nextStatus = EXITING\n // }\n // }\n // }\n // return { nextStatus }\n // }\n ;\n\n var _proto = Transition.prototype;\n\n _proto.componentDidMount = function componentDidMount() {\n this.updateStatus(true, this.appearStatus);\n };\n\n _proto.componentDidUpdate = function componentDidUpdate(prevProps) {\n var nextStatus = null;\n\n if (prevProps !== this.props) {\n var status = this.state.status;\n\n if (this.props.in) {\n if (status !== ENTERING && status !== ENTERED) {\n nextStatus = ENTERING;\n }\n } else {\n if (status === ENTERING || status === ENTERED) {\n nextStatus = EXITING;\n }\n }\n }\n\n this.updateStatus(false, nextStatus);\n };\n\n _proto.componentWillUnmount = function componentWillUnmount() {\n this.cancelNextCallback();\n };\n\n _proto.getTimeouts = function getTimeouts() {\n var timeout = this.props.timeout;\n var exit, enter, appear;\n exit = enter = appear = timeout;\n\n if (timeout != null && typeof timeout !== 'number') {\n exit = timeout.exit;\n enter = timeout.enter; // TODO: remove fallback for next major\n\n appear = timeout.appear !== undefined ? timeout.appear : enter;\n }\n\n return {\n exit: exit,\n enter: enter,\n appear: appear\n };\n };\n\n _proto.updateStatus = function updateStatus(mounting, nextStatus) {\n if (mounting === void 0) {\n mounting = false;\n }\n\n if (nextStatus !== null) {\n // nextStatus will always be ENTERING or EXITING.\n this.cancelNextCallback();\n\n if (nextStatus === ENTERING) {\n this.performEnter(mounting);\n } else {\n this.performExit();\n }\n } else if (this.props.unmountOnExit && this.state.status === EXITED) {\n this.setState({\n status: UNMOUNTED\n });\n }\n };\n\n _proto.performEnter = function performEnter(mounting) {\n var _this2 = this;\n\n var enter = this.props.enter;\n var appearing = this.context ? this.context.isMounting : mounting;\n\n var _ref2 = this.props.nodeRef ? [appearing] : [react_dom__WEBPACK_IMPORTED_MODULE_4___default.a.findDOMNode(this), appearing],\n maybeNode = _ref2[0],\n maybeAppearing = _ref2[1];\n\n var timeouts = this.getTimeouts();\n var enterTimeout = appearing ? timeouts.appear : timeouts.enter; // no enter animation skip right to ENTERED\n // if we are mounting and running this it means appear _must_ be set\n\n if (!mounting && !enter || _config__WEBPACK_IMPORTED_MODULE_5__[\"default\"].disabled) {\n this.safeSetState({\n status: ENTERED\n }, function () {\n _this2.props.onEntered(maybeNode);\n });\n return;\n }\n\n this.props.onEnter(maybeNode, maybeAppearing);\n this.safeSetState({\n status: ENTERING\n }, function () {\n _this2.props.onEntering(maybeNode, maybeAppearing);\n\n _this2.onTransitionEnd(enterTimeout, function () {\n _this2.safeSetState({\n status: ENTERED\n }, function () {\n _this2.props.onEntered(maybeNode, maybeAppearing);\n });\n });\n });\n };\n\n _proto.performExit = function performExit() {\n var _this3 = this;\n\n var exit = this.props.exit;\n var timeouts = this.getTimeouts();\n var maybeNode = this.props.nodeRef ? undefined : react_dom__WEBPACK_IMPORTED_MODULE_4___default.a.findDOMNode(this); // no exit animation skip right to EXITED\n\n if (!exit || _config__WEBPACK_IMPORTED_MODULE_5__[\"default\"].disabled) {\n this.safeSetState({\n status: EXITED\n }, function () {\n _this3.props.onExited(maybeNode);\n });\n return;\n }\n\n this.props.onExit(maybeNode);\n this.safeSetState({\n status: EXITING\n }, function () {\n _this3.props.onExiting(maybeNode);\n\n _this3.onTransitionEnd(timeouts.exit, function () {\n _this3.safeSetState({\n status: EXITED\n }, function () {\n _this3.props.onExited(maybeNode);\n });\n });\n });\n };\n\n _proto.cancelNextCallback = function cancelNextCallback() {\n if (this.nextCallback !== null) {\n this.nextCallback.cancel();\n this.nextCallback = null;\n }\n };\n\n _proto.safeSetState = function safeSetState(nextState, callback) {\n // This shouldn't be necessary, but there are weird race conditions with\n // setState callbacks and unmounting in testing, so always make sure that\n // we can cancel any pending setState callbacks after we unmount.\n callback = this.setNextCallback(callback);\n this.setState(nextState, callback);\n };\n\n _proto.setNextCallback = function setNextCallback(callback) {\n var _this4 = this;\n\n var active = true;\n\n this.nextCallback = function (event) {\n if (active) {\n active = false;\n _this4.nextCallback = null;\n callback(event);\n }\n };\n\n this.nextCallback.cancel = function () {\n active = false;\n };\n\n return this.nextCallback;\n };\n\n _proto.onTransitionEnd = function onTransitionEnd(timeout, handler) {\n this.setNextCallback(handler);\n var node = this.props.nodeRef ? this.props.nodeRef.current : react_dom__WEBPACK_IMPORTED_MODULE_4___default.a.findDOMNode(this);\n var doesNotHaveTimeoutOrListener = timeout == null && !this.props.addEndListener;\n\n if (!node || doesNotHaveTimeoutOrListener) {\n setTimeout(this.nextCallback, 0);\n return;\n }\n\n if (this.props.addEndListener) {\n var _ref3 = this.props.nodeRef ? [this.nextCallback] : [node, this.nextCallback],\n maybeNode = _ref3[0],\n maybeNextCallback = _ref3[1];\n\n this.props.addEndListener(maybeNode, maybeNextCallback);\n }\n\n if (timeout != null) {\n setTimeout(this.nextCallback, timeout);\n }\n };\n\n _proto.render = function render() {\n var status = this.state.status;\n\n if (status === UNMOUNTED) {\n return null;\n }\n\n var _this$props = this.props,\n children = _this$props.children,\n _in = _this$props.in,\n _mountOnEnter = _this$props.mountOnEnter,\n _unmountOnExit = _this$props.unmountOnExit,\n _appear = _this$props.appear,\n _enter = _this$props.enter,\n _exit = _this$props.exit,\n _timeout = _this$props.timeout,\n _addEndListener = _this$props.addEndListener,\n _onEnter = _this$props.onEnter,\n _onEntering = _this$props.onEntering,\n _onEntered = _this$props.onEntered,\n _onExit = _this$props.onExit,\n _onExiting = _this$props.onExiting,\n _onExited = _this$props.onExited,\n _nodeRef = _this$props.nodeRef,\n childProps = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(_this$props, [\"children\", \"in\", \"mountOnEnter\", \"unmountOnExit\", \"appear\", \"enter\", \"exit\", \"timeout\", \"addEndListener\", \"onEnter\", \"onEntering\", \"onEntered\", \"onExit\", \"onExiting\", \"onExited\", \"nodeRef\"]);\n\n return (\n /*#__PURE__*/\n // allows for nested Transitions\n react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_TransitionGroupContext__WEBPACK_IMPORTED_MODULE_7__[\"default\"].Provider, {\n value: null\n }, typeof children === 'function' ? children(status, childProps) : react__WEBPACK_IMPORTED_MODULE_3___default.a.cloneElement(react__WEBPACK_IMPORTED_MODULE_3___default.a.Children.only(children), childProps))\n );\n };\n\n return Transition;\n}(react__WEBPACK_IMPORTED_MODULE_3___default.a.Component);\n\nTransition.contextType = _TransitionGroupContext__WEBPACK_IMPORTED_MODULE_7__[\"default\"];\nTransition.propTypes = undefined !== \"production\" ? {\n /**\n * A React reference to DOM element that need to transition:\n * https://stackoverflow.com/a/51127130/4671932\n *\n * - When `nodeRef` prop is used, `node` is not passed to callback functions\n * (e.g. `onEnter`) because user already has direct access to the node.\n * - When changing `key` prop of `Transition` in a `TransitionGroup` a new\n * `nodeRef` need to be provided to `Transition` with changed `key` prop\n * (see\n * [test/CSSTransition-test.js](https://github.com/reactjs/react-transition-group/blob/13435f897b3ab71f6e19d724f145596f5910581c/test/CSSTransition-test.js#L362-L437)).\n */\n nodeRef: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.shape({\n current: typeof Element === 'undefined' ? prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.any : prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.instanceOf(Element)\n }),\n\n /**\n * A `function` child can be used instead of a React element. This function is\n * called with the current transition status (`'entering'`, `'entered'`,\n * `'exiting'`, `'exited'`), which can be used to apply context\n * specific props to a component.\n *\n * ```jsx\n * <Transition in={this.state.in} timeout={150}>\n * {state => (\n * <MyComponent className={`fade fade-${state}`} />\n * )}\n * </Transition>\n * ```\n */\n children: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func.isRequired, prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.element.isRequired]).isRequired,\n\n /**\n * Show the component; triggers the enter or exit states\n */\n in: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool,\n\n /**\n * By default the child component is mounted immediately along with\n * the parent `Transition` component. If you want to \"lazy mount\" the component on the\n * first `in={true}` you can set `mountOnEnter`. After the first enter transition the component will stay\n * mounted, even on \"exited\", unless you also specify `unmountOnExit`.\n */\n mountOnEnter: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool,\n\n /**\n * By default the child component stays mounted after it reaches the `'exited'` state.\n * Set `unmountOnExit` if you'd prefer to unmount the component after it finishes exiting.\n */\n unmountOnExit: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool,\n\n /**\n * By default the child component does not perform the enter transition when\n * it first mounts, regardless of the value of `in`. If you want this\n * behavior, set both `appear` and `in` to `true`.\n *\n * > **Note**: there are no special appear states like `appearing`/`appeared`, this prop\n * > only adds an additional enter transition. However, in the\n * > `<CSSTransition>` component that first enter transition does result in\n * > additional `.appear-*` classes, that way you can choose to style it\n * > differently.\n */\n appear: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool,\n\n /**\n * Enable or disable enter transitions.\n */\n enter: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool,\n\n /**\n * Enable or disable exit transitions.\n */\n exit: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool,\n\n /**\n * The duration of the transition, in milliseconds.\n * Required unless `addEndListener` is provided.\n *\n * You may specify a single timeout for all transitions:\n *\n * ```jsx\n * timeout={500}\n * ```\n *\n * or individually:\n *\n * ```jsx\n * timeout={{\n * appear: 500,\n * enter: 300,\n * exit: 500,\n * }}\n * ```\n *\n * - `appear` defaults to the value of `enter`\n * - `enter` defaults to `0`\n * - `exit` defaults to `0`\n *\n * @type {number | { enter?: number, exit?: number, appear?: number }}\n */\n timeout: function timeout(props) {\n var pt = _utils_PropTypes__WEBPACK_IMPORTED_MODULE_6__[\"timeoutsShape\"];\n if (!props.addEndListener) pt = pt.isRequired;\n\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n return pt.apply(void 0, [props].concat(args));\n },\n\n /**\n * Add a custom transition end trigger. Called with the transitioning\n * DOM node and a `done` callback. Allows for more fine grained transition end\n * logic. Timeouts are still used as a fallback if provided.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * ```jsx\n * addEndListener={(node, done) => {\n * // use the css transitionend event to mark the finish of a transition\n * node.addEventListener('transitionend', done, false);\n * }}\n * ```\n */\n addEndListener: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func,\n\n /**\n * Callback fired before the \"entering\" status is applied. An extra parameter\n * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement, isAppearing: bool) -> void\n */\n onEnter: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func,\n\n /**\n * Callback fired after the \"entering\" status is applied. An extra parameter\n * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement, isAppearing: bool)\n */\n onEntering: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func,\n\n /**\n * Callback fired after the \"entered\" status is applied. An extra parameter\n * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement, isAppearing: bool) -> void\n */\n onEntered: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func,\n\n /**\n * Callback fired before the \"exiting\" status is applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement) -> void\n */\n onExit: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func,\n\n /**\n * Callback fired after the \"exiting\" status is applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement) -> void\n */\n onExiting: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func,\n\n /**\n * Callback fired after the \"exited\" status is applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed\n *\n * @type Function(node: HtmlElement) -> void\n */\n onExited: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func\n} : {}; // Name the function so it is clearer in the documentation\n\nfunction noop() {}\n\nTransition.defaultProps = {\n in: false,\n mountOnEnter: false,\n unmountOnExit: false,\n appear: false,\n enter: true,\n exit: true,\n onEnter: noop,\n onEntering: noop,\n onEntered: noop,\n onExit: noop,\n onExiting: noop,\n onExited: noop\n};\nTransition.UNMOUNTED = UNMOUNTED;\nTransition.EXITED = EXITED;\nTransition.ENTERING = ENTERING;\nTransition.ENTERED = ENTERED;\nTransition.EXITING = EXITING;\n/* harmony default export */ __webpack_exports__[\"default\"] = (Transition);\n\n//# sourceURL=webpack:///./node_modules/react-transition-group/esm/Transition.js?");
|
1281 |
+
|
1282 |
+
/***/ }),
|
1283 |
+
|
1284 |
+
/***/ "./node_modules/react-transition-group/esm/TransitionGroup.js":
|
1285 |
+
/*!********************************************************************!*\
|
1286 |
+
!*** ./node_modules/react-transition-group/esm/TransitionGroup.js ***!
|
1287 |
+
\********************************************************************/
|
1288 |
+
/*! exports provided: default */
|
1289 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
1290 |
+
|
1291 |
+
"use strict";
|
1292 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ \"./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js\");\n/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ \"./node_modules/@babel/runtime/helpers/esm/extends.js\");\n/* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ \"./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js\");\n/* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ \"./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js\");\n/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\");\n/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _TransitionGroupContext__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./TransitionGroupContext */ \"./node_modules/react-transition-group/esm/TransitionGroupContext.js\");\n/* harmony import */ var _utils_ChildMapping__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./utils/ChildMapping */ \"./node_modules/react-transition-group/esm/utils/ChildMapping.js\");\n\n\n\n\n\n\n\n\n\nvar values = Object.values || function (obj) {\n return Object.keys(obj).map(function (k) {\n return obj[k];\n });\n};\n\nvar defaultProps = {\n component: 'div',\n childFactory: function childFactory(child) {\n return child;\n }\n};\n/**\n * The `<TransitionGroup>` component manages a set of transition components\n * (`<Transition>` and `<CSSTransition>`) in a list. Like with the transition\n * components, `<TransitionGroup>` is a state machine for managing the mounting\n * and unmounting of components over time.\n *\n * Consider the example below. As items are removed or added to the TodoList the\n * `in` prop is toggled automatically by the `<TransitionGroup>`.\n *\n * Note that `<TransitionGroup>` does not define any animation behavior!\n * Exactly _how_ a list item animates is up to the individual transition\n * component. This means you can mix and match animations across different list\n * items.\n */\n\nvar TransitionGroup = /*#__PURE__*/function (_React$Component) {\n Object(_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(TransitionGroup, _React$Component);\n\n function TransitionGroup(props, context) {\n var _this;\n\n _this = _React$Component.call(this, props, context) || this;\n\n var handleExited = _this.handleExited.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(_this)); // Initial children should all be entering, dependent on appear\n\n\n _this.state = {\n contextValue: {\n isMounting: true\n },\n handleExited: handleExited,\n firstRender: true\n };\n return _this;\n }\n\n var _proto = TransitionGroup.prototype;\n\n _proto.componentDidMount = function componentDidMount() {\n this.mounted = true;\n this.setState({\n contextValue: {\n isMounting: false\n }\n });\n };\n\n _proto.componentWillUnmount = function componentWillUnmount() {\n this.mounted = false;\n };\n\n TransitionGroup.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, _ref) {\n var prevChildMapping = _ref.children,\n handleExited = _ref.handleExited,\n firstRender = _ref.firstRender;\n return {\n children: firstRender ? Object(_utils_ChildMapping__WEBPACK_IMPORTED_MODULE_7__[\"getInitialChildMapping\"])(nextProps, handleExited) : Object(_utils_ChildMapping__WEBPACK_IMPORTED_MODULE_7__[\"getNextChildMapping\"])(nextProps, prevChildMapping, handleExited),\n firstRender: false\n };\n } // node is `undefined` when user provided `nodeRef` prop\n ;\n\n _proto.handleExited = function handleExited(child, node) {\n var currentChildMapping = Object(_utils_ChildMapping__WEBPACK_IMPORTED_MODULE_7__[\"getChildMapping\"])(this.props.children);\n if (child.key in currentChildMapping) return;\n\n if (child.props.onExited) {\n child.props.onExited(node);\n }\n\n if (this.mounted) {\n this.setState(function (state) {\n var children = Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__[\"default\"])({}, state.children);\n\n delete children[child.key];\n return {\n children: children\n };\n });\n }\n };\n\n _proto.render = function render() {\n var _this$props = this.props,\n Component = _this$props.component,\n childFactory = _this$props.childFactory,\n props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(_this$props, [\"component\", \"childFactory\"]);\n\n var contextValue = this.state.contextValue;\n var children = values(this.state.children).map(childFactory);\n delete props.appear;\n delete props.enter;\n delete props.exit;\n\n if (Component === null) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement(_TransitionGroupContext__WEBPACK_IMPORTED_MODULE_6__[\"default\"].Provider, {\n value: contextValue\n }, children);\n }\n\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement(_TransitionGroupContext__WEBPACK_IMPORTED_MODULE_6__[\"default\"].Provider, {\n value: contextValue\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement(Component, props, children));\n };\n\n return TransitionGroup;\n}(react__WEBPACK_IMPORTED_MODULE_5___default.a.Component);\n\nTransitionGroup.propTypes = undefined !== \"production\" ? {\n /**\n * `<TransitionGroup>` renders a `<div>` by default. You can change this\n * behavior by providing a `component` prop.\n * If you use React v16+ and would like to avoid a wrapping `<div>` element\n * you can pass in `component={null}`. This is useful if the wrapping div\n * borks your css styles.\n */\n component: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.any,\n\n /**\n * A set of `<Transition>` components, that are toggled `in` and out as they\n * leave. the `<TransitionGroup>` will inject specific transition props, so\n * remember to spread them through if you are wrapping the `<Transition>` as\n * with our `<Fade>` example.\n *\n * While this component is meant for multiple `Transition` or `CSSTransition`\n * children, sometimes you may want to have a single transition child with\n * content that you want to be transitioned out and in when you change it\n * (e.g. routes, images etc.) In that case you can change the `key` prop of\n * the transition child as you change its content, this will cause\n * `TransitionGroup` to transition the child out and back in.\n */\n children: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.node,\n\n /**\n * A convenience prop that enables or disables appear animations\n * for all children. Note that specifying this will override any defaults set\n * on individual children Transitions.\n */\n appear: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.bool,\n\n /**\n * A convenience prop that enables or disables enter animations\n * for all children. Note that specifying this will override any defaults set\n * on individual children Transitions.\n */\n enter: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.bool,\n\n /**\n * A convenience prop that enables or disables exit animations\n * for all children. Note that specifying this will override any defaults set\n * on individual children Transitions.\n */\n exit: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.bool,\n\n /**\n * You may need to apply reactive updates to a child as it is exiting.\n * This is generally done by using `cloneElement` however in the case of an exiting\n * child the element has already been removed and not accessible to the consumer.\n *\n * If you do need to update a child as it leaves you can provide a `childFactory`\n * to wrap every child, even the ones that are leaving.\n *\n * @type Function(child: ReactElement) -> ReactElement\n */\n childFactory: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.func\n} : {};\nTransitionGroup.defaultProps = defaultProps;\n/* harmony default export */ __webpack_exports__[\"default\"] = (TransitionGroup);\n\n//# sourceURL=webpack:///./node_modules/react-transition-group/esm/TransitionGroup.js?");
|
1293 |
+
|
1294 |
+
/***/ }),
|
1295 |
+
|
1296 |
+
/***/ "./node_modules/react-transition-group/esm/TransitionGroupContext.js":
|
1297 |
+
/*!***************************************************************************!*\
|
1298 |
+
!*** ./node_modules/react-transition-group/esm/TransitionGroupContext.js ***!
|
1299 |
+
\***************************************************************************/
|
1300 |
+
/*! exports provided: default */
|
1301 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
1302 |
+
|
1303 |
+
"use strict";
|
1304 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (react__WEBPACK_IMPORTED_MODULE_0___default.a.createContext(null));\n\n//# sourceURL=webpack:///./node_modules/react-transition-group/esm/TransitionGroupContext.js?");
|
1305 |
+
|
1306 |
+
/***/ }),
|
1307 |
+
|
1308 |
+
/***/ "./node_modules/react-transition-group/esm/config.js":
|
1309 |
+
/*!***********************************************************!*\
|
1310 |
+
!*** ./node_modules/react-transition-group/esm/config.js ***!
|
1311 |
+
\***********************************************************/
|
1312 |
+
/*! exports provided: default */
|
1313 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
1314 |
+
|
1315 |
+
"use strict";
|
1316 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n disabled: false\n});\n\n//# sourceURL=webpack:///./node_modules/react-transition-group/esm/config.js?");
|
1317 |
+
|
1318 |
+
/***/ }),
|
1319 |
+
|
1320 |
+
/***/ "./node_modules/react-transition-group/esm/index.js":
|
1321 |
+
/*!**********************************************************!*\
|
1322 |
+
!*** ./node_modules/react-transition-group/esm/index.js ***!
|
1323 |
+
\**********************************************************/
|
1324 |
+
/*! exports provided: CSSTransition, ReplaceTransition, SwitchTransition, TransitionGroup, Transition, config */
|
1325 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
1326 |
+
|
1327 |
+
"use strict";
|
1328 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _CSSTransition__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./CSSTransition */ \"./node_modules/react-transition-group/esm/CSSTransition.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"CSSTransition\", function() { return _CSSTransition__WEBPACK_IMPORTED_MODULE_0__[\"default\"]; });\n\n/* harmony import */ var _ReplaceTransition__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ReplaceTransition */ \"./node_modules/react-transition-group/esm/ReplaceTransition.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"ReplaceTransition\", function() { return _ReplaceTransition__WEBPACK_IMPORTED_MODULE_1__[\"default\"]; });\n\n/* harmony import */ var _SwitchTransition__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./SwitchTransition */ \"./node_modules/react-transition-group/esm/SwitchTransition.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"SwitchTransition\", function() { return _SwitchTransition__WEBPACK_IMPORTED_MODULE_2__[\"default\"]; });\n\n/* harmony import */ var _TransitionGroup__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./TransitionGroup */ \"./node_modules/react-transition-group/esm/TransitionGroup.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"TransitionGroup\", function() { return _TransitionGroup__WEBPACK_IMPORTED_MODULE_3__[\"default\"]; });\n\n/* harmony import */ var _Transition__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Transition */ \"./node_modules/react-transition-group/esm/Transition.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Transition\", function() { return _Transition__WEBPACK_IMPORTED_MODULE_4__[\"default\"]; });\n\n/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./config */ \"./node_modules/react-transition-group/esm/config.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"config\", function() { return _config__WEBPACK_IMPORTED_MODULE_5__[\"default\"]; });\n\n\n\n\n\n\n\n\n//# sourceURL=webpack:///./node_modules/react-transition-group/esm/index.js?");
|
1329 |
+
|
1330 |
+
/***/ }),
|
1331 |
+
|
1332 |
+
/***/ "./node_modules/react-transition-group/esm/utils/ChildMapping.js":
|
1333 |
+
/*!***********************************************************************!*\
|
1334 |
+
!*** ./node_modules/react-transition-group/esm/utils/ChildMapping.js ***!
|
1335 |
+
\***********************************************************************/
|
1336 |
+
/*! exports provided: getChildMapping, mergeChildMappings, getInitialChildMapping, getNextChildMapping */
|
1337 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
1338 |
+
|
1339 |
+
"use strict";
|
1340 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getChildMapping\", function() { return getChildMapping; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"mergeChildMappings\", function() { return mergeChildMappings; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getInitialChildMapping\", function() { return getInitialChildMapping; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getNextChildMapping\", function() { return getNextChildMapping; });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n\n/**\n * Given `this.props.children`, return an object mapping key to child.\n *\n * @param {*} children `this.props.children`\n * @return {object} Mapping of key to child\n */\n\nfunction getChildMapping(children, mapFn) {\n var mapper = function mapper(child) {\n return mapFn && Object(react__WEBPACK_IMPORTED_MODULE_0__[\"isValidElement\"])(child) ? mapFn(child) : child;\n };\n\n var result = Object.create(null);\n if (children) react__WEBPACK_IMPORTED_MODULE_0__[\"Children\"].map(children, function (c) {\n return c;\n }).forEach(function (child) {\n // run the map function here instead so that the key is the computed one\n result[child.key] = mapper(child);\n });\n return result;\n}\n/**\n * When you're adding or removing children some may be added or removed in the\n * same render pass. We want to show *both* since we want to simultaneously\n * animate elements in and out. This function takes a previous set of keys\n * and a new set of keys and merges them with its best guess of the correct\n * ordering. In the future we may expose some of the utilities in\n * ReactMultiChild to make this easy, but for now React itself does not\n * directly have this concept of the union of prevChildren and nextChildren\n * so we implement it here.\n *\n * @param {object} prev prev children as returned from\n * `ReactTransitionChildMapping.getChildMapping()`.\n * @param {object} next next children as returned from\n * `ReactTransitionChildMapping.getChildMapping()`.\n * @return {object} a key set that contains all keys in `prev` and all keys\n * in `next` in a reasonable order.\n */\n\nfunction mergeChildMappings(prev, next) {\n prev = prev || {};\n next = next || {};\n\n function getValueForKey(key) {\n return key in next ? next[key] : prev[key];\n } // For each key of `next`, the list of keys to insert before that key in\n // the combined list\n\n\n var nextKeysPending = Object.create(null);\n var pendingKeys = [];\n\n for (var prevKey in prev) {\n if (prevKey in next) {\n if (pendingKeys.length) {\n nextKeysPending[prevKey] = pendingKeys;\n pendingKeys = [];\n }\n } else {\n pendingKeys.push(prevKey);\n }\n }\n\n var i;\n var childMapping = {};\n\n for (var nextKey in next) {\n if (nextKeysPending[nextKey]) {\n for (i = 0; i < nextKeysPending[nextKey].length; i++) {\n var pendingNextKey = nextKeysPending[nextKey][i];\n childMapping[nextKeysPending[nextKey][i]] = getValueForKey(pendingNextKey);\n }\n }\n\n childMapping[nextKey] = getValueForKey(nextKey);\n } // Finally, add the keys which didn't appear before any key in `next`\n\n\n for (i = 0; i < pendingKeys.length; i++) {\n childMapping[pendingKeys[i]] = getValueForKey(pendingKeys[i]);\n }\n\n return childMapping;\n}\n\nfunction getProp(child, prop, props) {\n return props[prop] != null ? props[prop] : child.props[prop];\n}\n\nfunction getInitialChildMapping(props, onExited) {\n return getChildMapping(props.children, function (child) {\n return Object(react__WEBPACK_IMPORTED_MODULE_0__[\"cloneElement\"])(child, {\n onExited: onExited.bind(null, child),\n in: true,\n appear: getProp(child, 'appear', props),\n enter: getProp(child, 'enter', props),\n exit: getProp(child, 'exit', props)\n });\n });\n}\nfunction getNextChildMapping(nextProps, prevChildMapping, onExited) {\n var nextChildMapping = getChildMapping(nextProps.children);\n var children = mergeChildMappings(prevChildMapping, nextChildMapping);\n Object.keys(children).forEach(function (key) {\n var child = children[key];\n if (!Object(react__WEBPACK_IMPORTED_MODULE_0__[\"isValidElement\"])(child)) return;\n var hasPrev = (key in prevChildMapping);\n var hasNext = (key in nextChildMapping);\n var prevChild = prevChildMapping[key];\n var isLeaving = Object(react__WEBPACK_IMPORTED_MODULE_0__[\"isValidElement\"])(prevChild) && !prevChild.props.in; // item is new (entering)\n\n if (hasNext && (!hasPrev || isLeaving)) {\n // console.log('entering', key)\n children[key] = Object(react__WEBPACK_IMPORTED_MODULE_0__[\"cloneElement\"])(child, {\n onExited: onExited.bind(null, child),\n in: true,\n exit: getProp(child, 'exit', nextProps),\n enter: getProp(child, 'enter', nextProps)\n });\n } else if (!hasNext && hasPrev && !isLeaving) {\n // item is old (exiting)\n // console.log('leaving', key)\n children[key] = Object(react__WEBPACK_IMPORTED_MODULE_0__[\"cloneElement\"])(child, {\n in: false\n });\n } else if (hasNext && hasPrev && Object(react__WEBPACK_IMPORTED_MODULE_0__[\"isValidElement\"])(prevChild)) {\n // item hasn't changed transition states\n // copy over the last transition props;\n // console.log('unchanged', key)\n children[key] = Object(react__WEBPACK_IMPORTED_MODULE_0__[\"cloneElement\"])(child, {\n onExited: onExited.bind(null, child),\n in: prevChild.props.in,\n exit: getProp(child, 'exit', nextProps),\n enter: getProp(child, 'enter', nextProps)\n });\n }\n });\n return children;\n}\n\n//# sourceURL=webpack:///./node_modules/react-transition-group/esm/utils/ChildMapping.js?");
|
1341 |
+
|
1342 |
+
/***/ }),
|
1343 |
+
|
1344 |
+
/***/ "./node_modules/react-transition-group/esm/utils/PropTypes.js":
|
1345 |
+
/*!********************************************************************!*\
|
1346 |
+
!*** ./node_modules/react-transition-group/esm/utils/PropTypes.js ***!
|
1347 |
+
\********************************************************************/
|
1348 |
+
/*! exports provided: timeoutsShape, classNamesShape */
|
1349 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
1350 |
+
|
1351 |
+
"use strict";
|
1352 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"timeoutsShape\", function() { return timeoutsShape; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"classNamesShape\", function() { return classNamesShape; });\n/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\");\n/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_0__);\n\nvar timeoutsShape = undefined !== 'production' ? prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.number, prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.shape({\n enter: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.number,\n exit: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.number,\n appear: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.number\n}).isRequired]) : null;\nvar classNamesShape = undefined !== 'production' ? prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string, prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.shape({\n enter: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string,\n exit: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string,\n active: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string\n}), prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.shape({\n enter: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string,\n enterDone: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string,\n enterActive: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string,\n exit: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string,\n exitDone: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string,\n exitActive: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string\n})]) : null;\n\n//# sourceURL=webpack:///./node_modules/react-transition-group/esm/utils/PropTypes.js?");
|
1353 |
+
|
1354 |
+
/***/ }),
|
1355 |
+
|
1356 |
/***/ "./node_modules/uuid/dist/esm-browser/bytesToUuid.js":
|
1357 |
/*!***********************************************************!*\
|
1358 |
!*** ./node_modules/uuid/dist/esm-browser/bytesToUuid.js ***!
|
1603 |
|
1604 |
eval("(function() { module.exports = this[\"React\"]; }());\n\n//# sourceURL=webpack:///external_%7B%22this%22:%22React%22%7D?");
|
1605 |
|
1606 |
+
/***/ }),
|
1607 |
+
|
1608 |
+
/***/ "react-dom":
|
1609 |
+
/*!************************************!*\
|
1610 |
+
!*** external {"this":"ReactDOM"} ***!
|
1611 |
+
\************************************/
|
1612 |
+
/*! no static exports found */
|
1613 |
+
/***/ (function(module, exports) {
|
1614 |
+
|
1615 |
+
eval("(function() { module.exports = this[\"ReactDOM\"]; }());\n\n//# sourceURL=webpack:///external_%7B%22this%22:%22ReactDOM%22%7D?");
|
1616 |
+
|
1617 |
/***/ })
|
1618 |
|
1619 |
/******/ })));
|
build/poll.asset.php
CHANGED
@@ -1 +1 @@
|
|
1 |
-
<?php return array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-api-fetch', 'wp-blocks', 'wp-components', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-polyfill'), 'version' => '
|
1 |
+
<?php return array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-api-fetch', 'wp-blocks', 'wp-components', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-polyfill'), 'version' => '1d8940d763e87fb42d328a60ce5de84d');
|
build/poll.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
@keyframes crowdsignal-forms-animation__pop{0%{transform:scale(0)}50%{transform:scale(1.2)}100%{transform:scale(1)}}@keyframes crowdsignal-forms-animation__pulse{0%{opacity:0.4}50%{opacity:0.7}100%{opacity:0.4}}.crowdsignal-poll-wrapper:not(:first-child),[data-type="crowdsignal-forms/poll"]:not(:first-child){margin-top:3em}.crowdsignal-poll-wrapper:not(:last-child),[data-type="crowdsignal-forms/poll"]:not(:last-child){margin-bottom:3em}.crowdsignal-forms-poll{border-color:var(--crowdsignal-forms-border-color);border-style:solid;border-width:var(--crowdsignal-forms-border-width);margin-left:auto;margin-right:auto;margin-top:5px;position:relative;text-align:left}.entry-content .alignfull.crowdsignal-poll-wrapper .crowdsignal-forms-poll{border-left-width:0;border-right-width:0}.crowdsignal-forms-poll h3.crowdsignal-forms-poll__question{margin:0 0 28px}.crowdsignal-forms-poll h3.crowdsignal-forms-poll__question:first-child{margin-top:0}.crowdsignal-forms-poll p.crowdsignal-forms-poll__note{font-style:italic;margin:0 0 32px}.crowdsignal-forms-poll .crowdsignal-forms-poll__content{padding:40px 24px 16px 24px}.crowdsignal-forms-poll .crowdsignal-forms-poll__content .crowdsignal-forms-poll__question{font-family:var(--crowdsignal-forms-question-font-family)}.crowdsignal-forms-poll .crowdsignal-forms-poll__content .crowdsignal-forms-poll__answer-label,.crowdsignal-forms-poll .crowdsignal-forms-poll__content .crowdsignal-forms-poll__answer-results-answer,.crowdsignal-forms-poll .crowdsignal-forms-poll__content .crowdsignal-forms-poll__note{font-family:var(--crowdsignal-forms-body-font-family)}.entry-content .alignfull.crowdsignal-poll-wrapper .crowdsignal-forms-poll .crowdsignal-forms-poll__content{margin:0 auto;max-width:var(--crowdsignal-forms-content-wide-width)}@media screen and (min-width: 660px){.alignwide.crowdsignal-poll-wrapper .crowdsignal-forms-poll .crowdsignal-forms-poll__content,.alignfull.crowdsignal-poll-wrapper .crowdsignal-forms-poll .crowdsignal-forms-poll__content{padding:80px}}.crowdsignal-forms-poll.is-closed .crowdsignal-forms-poll__form{opacity:0.5}.crowdsignal-forms-poll.is-hidden{opacity:0.5}.crowdsignal-forms-poll.has-text-color{color:var(--crowdsignal-forms-text-color)}.crowdsignal-forms-poll.has-bg-color{background-color:var(--crowdsignal-forms-bg-color)}.crowdsignal-forms-poll.has-border-radius{border-radius:var(--crowdsignal-forms-border-radius);overflow:hidden}.crowdsignal-forms-poll.has-box-shadow{box-shadow:0 3px 6px rgba(0,0,0,0.16),0 3px 6px rgba(0,0,0,0.23)}.crowdsignal-forms-poll .is-transparent{opacity:0;pointer-events:none}.crowdsignal-forms-poll__block-button .crowdsignal-forms-poll__submit-button{-webkit-appearance:initial}.crowdsignal-forms-poll__block-button .crowdsignal-forms-poll__submit-button:disabled{opacity:0.7}.crowdsignal-forms-poll.has-submit-button-bg-color .crowdsignal-forms-poll__block-button .crowdsignal-forms-poll__submit-button.wp-block-button__link{background-color:var(--crowdsignal-forms-submit-button-bg-color)}.crowdsignal-forms-poll.has-submit-button-text-color .crowdsignal-forms-poll__block-button .crowdsignal-forms-poll__submit-button.wp-block-button__link{color:var(--crowdsignal-forms-submit-button-text-color)}.crowdsignal-forms-poll__options.is-button{display:flex;flex-direction:column;flex-wrap:wrap}.crowdsignal-forms-poll__options.is-button.is-inline-button-alignment{flex-direction:row}.crowdsignal-forms-poll__answer{cursor:pointer;display:flex;font-size:inherit;font-weight:600;margin:0;padding:0 2px;position:relative}.crowdsignal-forms-poll__answer.is-button{margin-inline-end:20px;margin-block-end:20px;max-width:100%}.crowdsignal-forms-poll__answer.is-button .wp-block-button.crowdsignal-forms-poll__block-button,.crowdsignal-forms-poll__answer.is-button .crowdsignal-forms-poll__submit-button{max-width:100%}.crowdsignal-forms-poll__answer.is-button .crowdsignal-forms-poll__submit-button{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.crowdsignal-forms-poll__answer:not(.is-button){margin-block-end:16px}.crowdsignal-forms-poll__answer:hover,.crowdsignal-forms-poll__answer.is-focused{color:var(--crowdsignal-forms-submit-button-bg-color)}.has-voted .crowdsignal-forms-poll__answer{opacity:0.5}input[type="checkbox"].crowdsignal-forms-poll__input,input[type="radio"].crowdsignal-forms-poll__input{height:0;opacity:0;position:absolute;width:0}.crowdsignal-forms-poll__check{display:inline-block;height:1em;margin:0 10px 0 0;position:relative;width:1em}.crowdsignal-forms-poll__check::before{background-color:transparent;border:1.5px solid var(--crowdsignal-forms-text-color);border-radius:50%;box-sizing:border-box;content:"";display:block;height:100%;transition:background-color 0.3s, border-color 0.3s;width:100%}.crowdsignal-forms-poll__answer.is-multiple-choice .crowdsignal-forms-poll__check::before{border-radius:3px}.crowdsignal-forms-poll__answer.is-multiple-choice.is-selected .crowdsignal-forms-poll__check::before{border-color:var(--crowdsignal-forms-text-color);background-color:var(--crowdsignal-forms-text-color)}.crowdsignal-forms-poll__answer.is-selected:not(.is-multiple-choice) .crowdsignal-forms-poll__check::after{animation-duration:0.3s;animation-name:crowdsignal-forms-animation__pop;animation-iteration-count:1;background-clip:padding-box;background-color:var(--crowdsignal-forms-text-color);border:4.5px solid transparent;border-radius:50%;box-sizing:border-box;content:"";display:block;height:100%;position:absolute;left:0;top:0;width:100%}.crowdsignal-forms-poll__answer.is-selected.is-multiple-choice .crowdsignal-forms-poll__check::after{border-color:var(--crowdsignal-forms-submit-button-text-color);border-style:solid;border-width:0 0 2px 2px;box-sizing:border-box;content:"";display:block;height:25%;margin:-0.1em 0 0 -0.2em;position:absolute;left:50%;top:50%;transform:rotateZ(-45deg);width:50%}div.crowdsignal-forms-poll__answer-label-wrapper{flex:1;word-break:break-word}div.crowdsignal-forms-poll__answer-label-wrapper span.crowdsignal-forms-poll__answer-label{line-height:1;vertical-align:top}div.crowdsignal-forms-poll__answer-label-wrapper span.crowdsignal-forms-poll__answer-label span::after{vertical-align:top}.crowdsignal-forms-poll__button{border:0;padding:0}.crowdsignal-forms-poll__actions .wp-block-button,.crowdsignal-forms-poll__options .wp-block-button{margin:0}.crowdsignal-forms-poll__actions{display:flex;justify-content:flex-end}.editor-styles-wrapper .crowdsignal-forms-poll .crowdsignal-forms-poll__actions .wp-block-button.crowdsignal-forms-poll__block-button,.editor-styles-wrapper .crowdsignal-forms-poll .crowdsignal-forms-poll__options .wp-block-button.crowdsignal-forms-poll__block-button{margin:0}.crowdsignal-forms-poll__closed-banner{background-color:var(--crowdsignal-forms-border-color);box-sizing:border-box;display:flex;color:var(--crowdsignal-forms-submit-button-text-color);font-family:-apple-system,blinkmacsystemfont,"Segoe UI",roboto,oxygen-sans,ubuntu,cantarell,"Helvetica Neue",sans-serif;justify-content:center;padding:calc(var(--crowdsignal-forms-border-width) + 0.2em) 0 0.2em;width:100%}.is-hidden .crowdsignal-forms-poll__closed-banner{font-style:italic}.crowdsignal-forms-poll__error{color:red}.crowdsignal-forms-poll__results-list{margin:0 0 1em;position:relative}.crowdsignal-forms-poll__answer-results{display:flex;flex-direction:column;margin:0 0 16px;width:100%}.crowdsignal-forms-poll__answer-results:last-child{margin:0}.crowdsignal-forms-poll__answer-results-labels{align-items:flex-end;display:flex;margin:0 0 8px;width:100%;word-break:break-word}.crowdsignal-forms-poll__answer-results-answer{flex:1;font-size:1em;font-weight:600}.crowdsignal-forms-poll__answer-results-votes{font-size:0.75em;line-height:2}.crowdsignal-forms-poll__answer-results-percent{font-weight:600;line-height:1.6}.crowdsignal-forms-poll__answer-results-votes,.crowdsignal-forms-poll__answer-results-percent{font-family:-apple-system,blinkmacsystemfont,"Segoe UI",roboto,oxygen-sans,ubuntu,cantarell,"Helvetica Neue",sans-serif;margin-left:20px;transition:opacity 0.3s}.crowdsignal-forms-poll__answer-results.is-error .crowdsignal-forms-poll__answer-results-votes,.crowdsignal-forms-poll__answer-results.is-error .crowdsignal-forms-poll__answer-results-percent{display:none}.crowdsignal-forms-poll__answer-results.is-loading .crowdsignal-forms-poll__answer-results-votes,.crowdsignal-forms-poll__answer-results.is-loading .crowdsignal-forms-poll__answer-results-percent{animation-duration:1.5s;animation-iteration-count:infinite;animation-name:crowdsignal-forms-animation__pulse;background-color:var(--crowdsignal-forms-text-color);font-size:0.7em;height:1em;width:50px}.crowdsignal-forms-poll__answer-results.is-loading .crowdsignal-forms-poll__answer-results-votes:last-child,.crowdsignal-forms-poll__answer-results.is-loading .crowdsignal-forms-poll__answer-results-percent:last-child{width:40px}.crowdsignal-forms-poll__answer-results-progress-track{border:1px solid;border-color:rgba(var(--crowdsignal-forms-text-color-properties), 0.3);box-sizing:border-box;height:1em;width:100%}.crowdsignal-forms-poll__answer-results.is-loading .crowdsignal-forms-poll__answer-results-progress-track{animation-duration:1.5s;animation-iteration-count:infinite;animation-name:crowdsignal-forms-animation__pulse}.crowdsignal-forms-poll__answer-results-progress-bar{animation-fill-mode:forwards;background-color:var(--crowdsignal-forms-submit-button-bg-color);height:100%;transition:background-color 0.3s, width 0.3s}.crowdsignal-forms-poll__answer-results.is-error .crowdsignal-forms-poll__answer-results-progress-bar{width:0}.crowdsignal-forms-poll__answer-results.is-loading .crowdsignal-forms-poll__answer-results-progress-bar{background-color:var(--crowdsignal-forms-text-color);width:25%}.crowdsignal-forms-poll__answer-results.is-loading:nth-child(5n+1) .crowdsignal-forms-poll__answer-results-progress-bar{width:40%}.crowdsignal-forms-poll__answer-results.is-loading:nth-child(5n+2) .crowdsignal-forms-poll__answer-results-progress-bar{width:75%}.crowdsignal-forms-poll__answer-results.is-loading:nth-child(5n+3) .crowdsignal-forms-poll__answer-results-progress-bar{width:50%}.crowdsignal-forms-poll__answer-results.is-loading:nth-child(5n+4) .crowdsignal-forms-poll__answer-results-progress-bar{width:60%}.crowdsignal-forms-poll__results-footer{display:flex;flex-direction:column;justify-content:space-between;width:100%;font-size:0.9em}.crowdsignal-forms-poll__results-total{font-family:-apple-system,blinkmacsystemfont,"Segoe UI",roboto,oxygen-sans,ubuntu,cantarell,"Helvetica Neue",sans-serif;position:relative;text-align:right;width:100%;margin-bottom:1em}.crowdsignal-forms-poll__results.is-loading .crowdsignal-forms-poll__results-total{color:transparent}.crowdsignal-forms-poll__results.is-loading .crowdsignal-forms-poll__results-total::before{animation-name:crowdsignal-forms-animation__pulse;animation-duration:1.5s;animation-iteration-count:infinite;background-color:var(--crowdsignal-forms-text-color);content:"";display:block;position:absolute;right:0;height:1em;width:150px}.crowdsignal-forms-poll__footer-branding{display:flex;justify-content:space-between;align-items:center;width:100%}.crowdsignal-forms-poll__footer-branding img.crowdsignal-forms-poll__footer-branding-logo{width:50px;height:50px;margin-left:0;margin-right:0}.crowdsignal-forms-poll__footer-cs-link{font-family:-apple-system,blinkmacsystemfont,"Segoe UI",roboto,oxygen-sans,ubuntu,cantarell,"Helvetica Neue",sans-serif;font-size:16px;text-decoration:none;text-transform:uppercase}.crowdsignal-forms-poll__footer-cs-link:not(:hover){color:var(--crowdsignal-forms-text-color);opacity:0.4}.has-default-thankyou .crowdsignal-forms-poll__footer-cs-link{color:#333}.crowdsignal-forms-poll__error-banner{font-family:-apple-system,blinkmacsystemfont,"Segoe UI",roboto,oxygen-sans,ubuntu,cantarell,"Helvetica Neue",sans-serif;font-size:13px;margin-top:24px;padding:18px 24px;color:#d82e20;border-left:4px solid #d82e20;background:#f8dad8}.crowdsignal-forms-poll__submit-message-container{position:absolute;background-color:var(--crowdsignal-forms-bg-color);left:0;top:0;width:100%;height:100%;overflow:hidden}.has-default-thankyou .crowdsignal-forms-poll__submit-message-container{background-color:#fff}.crowdsignal-forms-poll__submit-message{position:relative}.crowdsignal-forms-poll__submit-message button.crowdsignal-forms-poll__dismiss-submit-message{position:absolute;right:0;top:0;background-color:transparent;color:#000;text-decoration:none;border:none}.crowdsignal-forms-poll__submit-message button.crowdsignal-forms-poll__dismiss-submit-message:hover{background:inherit}.crowdsignal-forms-poll__submit-message-footer{position:absolute;bottom:0;left:0;padding:16px 24px;width:100%;background-color:inherit}.crowdsignal-forms-poll__thank-you-cs-sticker{right:25px;top:66px}.crowdsignal-forms-poll__thank-you-sticker{right:132px;top:12px}.crowdsignal-forms-poll__thank-you-cs-sticker,.crowdsignal-forms-poll__thank-you-sticker{filter:drop-shadow(0 1px 2px rgba(0,0,0,0.2));width:100px;height:100px;position:absolute}.crowdsignal-forms-poll__custom-message-check{color:var(--crowdsignal-forms-text-color);padding-left:24px;padding-top:24px}.crowdsignal-forms-poll__custom-message{font-family:var(--crowdsignal-forms-question-font-family);font-weight:600;padding:16px 24px}.wp_block-crowdsignal-forms-poll__vote-branding{margin-top:16px}.crowdsignal-forms__style-probe{display:none}
|
1 |
+
@keyframes crowdsignal-forms-animation__pop{0%{transform:scale(0)}50%{transform:scale(1.2)}100%{transform:scale(1)}}@keyframes crowdsignal-forms-animation__pulse{0%{opacity:0.4}50%{opacity:0.7}100%{opacity:0.4}}.crowdsignal-poll-wrapper:not(:first-child),[data-type="crowdsignal-forms/poll"]:not(:first-child){margin-top:3em}.crowdsignal-poll-wrapper:not(:last-child),[data-type="crowdsignal-forms/poll"]:not(:last-child){margin-bottom:3em}.crowdsignal-forms-poll{border-color:var(--crowdsignal-forms-border-color);border-style:solid;border-width:var(--crowdsignal-forms-border-width);margin-left:auto;margin-right:auto;margin-top:5px;position:relative;text-align:left}.entry-content .alignfull.crowdsignal-poll-wrapper .crowdsignal-forms-poll{border-left-width:0;border-right-width:0}.crowdsignal-forms-poll h3.crowdsignal-forms-poll__question{margin:0 0 28px}.crowdsignal-forms-poll h3.crowdsignal-forms-poll__question:first-child{margin-top:0}.crowdsignal-forms-poll p.crowdsignal-forms-poll__note{font-style:italic;margin:0 0 32px}.crowdsignal-forms-poll .crowdsignal-forms-poll__content{padding:40px 24px 16px 24px}.crowdsignal-forms-poll .crowdsignal-forms-poll__content .crowdsignal-forms-poll__question{font-family:var(--crowdsignal-forms-question-font-family)}.crowdsignal-forms-poll .crowdsignal-forms-poll__content .crowdsignal-forms-poll__answer-label,.crowdsignal-forms-poll .crowdsignal-forms-poll__content .crowdsignal-forms-poll__answer-results-answer,.crowdsignal-forms-poll .crowdsignal-forms-poll__content .crowdsignal-forms-poll__note{font-family:var(--crowdsignal-forms-body-font-family)}.entry-content .alignfull.crowdsignal-poll-wrapper .crowdsignal-forms-poll .crowdsignal-forms-poll__content{margin:0 auto;max-width:var(--crowdsignal-forms-content-wide-width)}@media screen and (min-width: 660px){.alignwide.crowdsignal-poll-wrapper .crowdsignal-forms-poll .crowdsignal-forms-poll__content,.alignfull.crowdsignal-poll-wrapper .crowdsignal-forms-poll .crowdsignal-forms-poll__content{padding:80px}}.crowdsignal-forms-poll.is-closed .crowdsignal-forms-poll__form{opacity:0.5}.crowdsignal-forms-poll.is-hidden{opacity:0.5}.crowdsignal-forms-poll.has-text-color{color:var(--crowdsignal-forms-text-color)}.crowdsignal-forms-poll.has-bg-color{background-color:var(--crowdsignal-forms-bg-color)}.crowdsignal-forms-poll.has-border-radius{border-radius:var(--crowdsignal-forms-border-radius);overflow:hidden}.crowdsignal-forms-poll.has-box-shadow{box-shadow:0 3px 6px rgba(0,0,0,0.16),0 3px 6px rgba(0,0,0,0.23)}.crowdsignal-forms-poll .is-transparent{opacity:0;pointer-events:none}.crowdsignal-forms-poll__block-button .crowdsignal-forms-poll__submit-button{-webkit-appearance:initial}.crowdsignal-forms-poll__block-button .crowdsignal-forms-poll__submit-button:disabled{opacity:0.7}.crowdsignal-forms-poll.has-submit-button-text-color .crowdsignal-forms-poll__block-button .crowdsignal-forms-poll__submit-button.wp-block-button__link{color:var(--crowdsignal-forms-submit-button-text-color)}.crowdsignal-forms-poll.has-submit-button-bg-color .crowdsignal-forms-poll__block-button .crowdsignal-forms-poll__submit-button.wp-block-button__link{background-color:var(--crowdsignal-forms-submit-button-bg-color)}.crowdsignal-forms-poll.has-submit-button-bg-color .crowdsignal-forms-poll__block-button .crowdsignal-forms-poll__submit-button.wp-block-button__link:hover{opacity:0.9}.crowdsignal-forms-poll__options.is-button{display:flex;flex-direction:column;flex-wrap:wrap}.crowdsignal-forms-poll__options.is-button.is-inline-button-alignment{flex-direction:row}.crowdsignal-forms-poll__answer{cursor:pointer;display:flex;font-size:inherit;font-weight:600;margin:0;padding:0 2px;position:relative}.crowdsignal-forms-poll__answer.is-button{margin-inline-end:20px;margin-block-end:20px;max-width:100%}.crowdsignal-forms-poll__answer.is-button .wp-block-button.crowdsignal-forms-poll__block-button,.crowdsignal-forms-poll__answer.is-button .crowdsignal-forms-poll__submit-button{max-width:100%}.crowdsignal-forms-poll__answer.is-button .crowdsignal-forms-poll__submit-button{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.crowdsignal-forms-poll__answer:not(.is-button){margin-block-end:16px}.crowdsignal-forms-poll__answer:hover,.crowdsignal-forms-poll__answer.is-focused{color:var(--crowdsignal-forms-submit-button-bg-color)}.has-voted .crowdsignal-forms-poll__answer{opacity:0.5}input[type="checkbox"].crowdsignal-forms-poll__input,input[type="radio"].crowdsignal-forms-poll__input{height:0;opacity:0;position:absolute;width:0}.crowdsignal-forms-poll__check{display:inline-block;height:1em;margin:0 10px 0 0;position:relative;width:1em}.crowdsignal-forms-poll__check::before{background-color:transparent;border:1.5px solid var(--crowdsignal-forms-text-color);border-radius:50%;box-sizing:border-box;content:"";display:block;height:100%;transition:background-color 0.3s, border-color 0.3s;width:100%}.crowdsignal-forms-poll__answer.is-multiple-choice .crowdsignal-forms-poll__check::before{border-radius:3px}.crowdsignal-forms-poll__answer.is-multiple-choice.is-selected .crowdsignal-forms-poll__check::before{border-color:var(--crowdsignal-forms-text-color);background-color:var(--crowdsignal-forms-text-color)}.crowdsignal-forms-poll__answer.is-selected:not(.is-multiple-choice) .crowdsignal-forms-poll__check::after{animation-duration:0.3s;animation-name:crowdsignal-forms-animation__pop;animation-iteration-count:1;background-clip:padding-box;background-color:var(--crowdsignal-forms-text-color);border:4.5px solid transparent;border-radius:50%;box-sizing:border-box;content:"";display:block;height:100%;position:absolute;left:0;top:0;width:100%}.crowdsignal-forms-poll__answer.is-selected.is-multiple-choice .crowdsignal-forms-poll__check::after{border-color:var(--crowdsignal-forms-submit-button-text-color);border-style:solid;border-width:0 0 2px 2px;box-sizing:border-box;content:"";display:block;height:25%;margin:-0.1em 0 0 -0.2em;position:absolute;left:50%;top:50%;transform:rotateZ(-45deg);width:50%}div.crowdsignal-forms-poll__answer-label-wrapper{flex:1;word-break:break-word}div.crowdsignal-forms-poll__answer-label-wrapper span.crowdsignal-forms-poll__answer-label{line-height:1;vertical-align:top}div.crowdsignal-forms-poll__answer-label-wrapper span.crowdsignal-forms-poll__answer-label span::after{vertical-align:top}.crowdsignal-forms-poll__button{border:0;padding:0}.crowdsignal-forms-poll__actions .wp-block-button,.crowdsignal-forms-poll__options .wp-block-button{margin:0}.crowdsignal-forms-poll__actions{display:flex;justify-content:flex-end}.editor-styles-wrapper .crowdsignal-forms-poll .crowdsignal-forms-poll__actions .wp-block-button.crowdsignal-forms-poll__block-button,.editor-styles-wrapper .crowdsignal-forms-poll .crowdsignal-forms-poll__options .wp-block-button.crowdsignal-forms-poll__block-button{margin:0}.crowdsignal-forms-poll__closed-banner{background-color:var(--crowdsignal-forms-border-color);box-sizing:border-box;display:flex;color:var(--crowdsignal-forms-submit-button-text-color);font-family:-apple-system,blinkmacsystemfont,"Segoe UI",roboto,oxygen-sans,ubuntu,cantarell,"Helvetica Neue",sans-serif;justify-content:center;padding:calc(var(--crowdsignal-forms-border-width) + 0.2em) 0 0.2em;width:100%}.is-hidden .crowdsignal-forms-poll__closed-banner{font-style:italic}.crowdsignal-forms-poll__error{color:red}.crowdsignal-forms-poll__results-list{margin:0 0 1em;position:relative}.crowdsignal-forms-poll__answer-results{display:flex;flex-direction:column;margin:0 0 16px;width:100%}.crowdsignal-forms-poll__answer-results:last-child{margin:0}.crowdsignal-forms-poll__answer-results-labels{align-items:flex-end;display:flex;margin:0 0 8px;width:100%;word-break:break-word}.crowdsignal-forms-poll__answer-results-answer{flex:1;font-size:1em;font-weight:600}.crowdsignal-forms-poll__answer-results-votes{font-size:0.75em;line-height:2}.crowdsignal-forms-poll__answer-results-percent{font-weight:600;line-height:1.6}.crowdsignal-forms-poll__answer-results-votes,.crowdsignal-forms-poll__answer-results-percent{font-family:-apple-system,blinkmacsystemfont,"Segoe UI",roboto,oxygen-sans,ubuntu,cantarell,"Helvetica Neue",sans-serif;margin-left:20px;transition:opacity 0.3s}.crowdsignal-forms-poll__answer-results.is-error .crowdsignal-forms-poll__answer-results-votes,.crowdsignal-forms-poll__answer-results.is-error .crowdsignal-forms-poll__answer-results-percent{display:none}.crowdsignal-forms-poll__answer-results.is-loading .crowdsignal-forms-poll__answer-results-votes,.crowdsignal-forms-poll__answer-results.is-loading .crowdsignal-forms-poll__answer-results-percent{animation-duration:1.5s;animation-iteration-count:infinite;animation-name:crowdsignal-forms-animation__pulse;background-color:var(--crowdsignal-forms-text-color);font-size:0.7em;height:1em;width:50px}.crowdsignal-forms-poll__answer-results.is-loading .crowdsignal-forms-poll__answer-results-votes:last-child,.crowdsignal-forms-poll__answer-results.is-loading .crowdsignal-forms-poll__answer-results-percent:last-child{width:40px}.crowdsignal-forms-poll__answer-results-progress-track{border:1px solid;border-color:rgba(var(--crowdsignal-forms-text-color-properties), 0.3);box-sizing:border-box;height:1em;width:100%}.crowdsignal-forms-poll__answer-results.is-loading .crowdsignal-forms-poll__answer-results-progress-track{animation-duration:1.5s;animation-iteration-count:infinite;animation-name:crowdsignal-forms-animation__pulse}.crowdsignal-forms-poll__answer-results-progress-bar{animation-fill-mode:forwards;background-color:var(--crowdsignal-forms-submit-button-bg-color);height:100%;transition:background-color 0.3s, width 0.3s}.crowdsignal-forms-poll__answer-results.is-error .crowdsignal-forms-poll__answer-results-progress-bar{width:0}.crowdsignal-forms-poll__answer-results.is-loading .crowdsignal-forms-poll__answer-results-progress-bar{background-color:var(--crowdsignal-forms-text-color);width:25%}.crowdsignal-forms-poll__answer-results.is-loading:nth-child(5n+1) .crowdsignal-forms-poll__answer-results-progress-bar{width:40%}.crowdsignal-forms-poll__answer-results.is-loading:nth-child(5n+2) .crowdsignal-forms-poll__answer-results-progress-bar{width:75%}.crowdsignal-forms-poll__answer-results.is-loading:nth-child(5n+3) .crowdsignal-forms-poll__answer-results-progress-bar{width:50%}.crowdsignal-forms-poll__answer-results.is-loading:nth-child(5n+4) .crowdsignal-forms-poll__answer-results-progress-bar{width:60%}.crowdsignal-forms-poll__results-footer{display:flex;flex-direction:column;justify-content:space-between;width:100%;font-size:0.9em}.crowdsignal-forms-poll__results-total{font-family:-apple-system,blinkmacsystemfont,"Segoe UI",roboto,oxygen-sans,ubuntu,cantarell,"Helvetica Neue",sans-serif;position:relative;text-align:right;width:100%;margin-bottom:1em}.crowdsignal-forms-poll__results.is-loading .crowdsignal-forms-poll__results-total{color:transparent}.crowdsignal-forms-poll__results.is-loading .crowdsignal-forms-poll__results-total::before{animation-name:crowdsignal-forms-animation__pulse;animation-duration:1.5s;animation-iteration-count:infinite;background-color:var(--crowdsignal-forms-text-color);content:"";display:block;position:absolute;right:0;height:1em;width:150px}.crowdsignal-forms-poll__footer-branding{display:flex;justify-content:space-between;align-items:center;width:100%}.crowdsignal-forms-poll__footer-branding img.crowdsignal-forms-poll__footer-branding-logo{width:50px;height:50px;margin-left:0;margin-right:0}.crowdsignal-forms-poll__footer-cs-link{font-family:-apple-system,blinkmacsystemfont,"Segoe UI",roboto,oxygen-sans,ubuntu,cantarell,"Helvetica Neue",sans-serif;font-size:16px;text-decoration:none;text-transform:uppercase}.crowdsignal-forms-poll__footer-cs-link:not(:hover){color:var(--crowdsignal-forms-text-color);opacity:0.4}.has-default-thankyou .crowdsignal-forms-poll__footer-cs-link{color:#333}.crowdsignal-forms-poll__error-banner{font-family:-apple-system,blinkmacsystemfont,"Segoe UI",roboto,oxygen-sans,ubuntu,cantarell,"Helvetica Neue",sans-serif;font-size:13px;margin-top:24px;padding:18px 24px;color:#d82e20;border-left:4px solid #d82e20;background:#f8dad8}.crowdsignal-forms-poll__submit-message-container{position:absolute;background-color:var(--crowdsignal-forms-bg-color);left:0;top:0;width:100%;height:100%;overflow:hidden}.has-default-thankyou .crowdsignal-forms-poll__submit-message-container{background-color:#fff}.crowdsignal-forms-poll__submit-message{position:relative}.crowdsignal-forms-poll__submit-message button.crowdsignal-forms-poll__dismiss-submit-message{position:absolute;right:0;top:0;background-color:transparent;color:#000;text-decoration:none;border:none}.crowdsignal-forms-poll__submit-message button.crowdsignal-forms-poll__dismiss-submit-message:hover{background:inherit}.crowdsignal-forms-poll__submit-message-footer{position:absolute;bottom:0;left:0;padding:16px 24px;width:100%;background-color:inherit}.crowdsignal-forms-poll__thank-you-cs-sticker{right:25px;top:66px}.crowdsignal-forms-poll__thank-you-sticker{right:132px;top:12px}.crowdsignal-forms-poll__thank-you-cs-sticker,.crowdsignal-forms-poll__thank-you-sticker{filter:drop-shadow(0 1px 2px rgba(0,0,0,0.2));width:100px;height:100px;position:absolute}.crowdsignal-forms-poll__custom-message-check{color:var(--crowdsignal-forms-text-color);padding-left:24px;padding-top:24px}.crowdsignal-forms-poll__custom-message{font-family:var(--crowdsignal-forms-question-font-family);font-weight:600;padding:16px 24px}.wp_block-crowdsignal-forms-poll__vote-branding{margin-top:16px}.crowdsignal-forms__style-probe{display:none}
|
build/poll.js
CHANGED
@@ -310,7 +310,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) *
|
|
310 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
311 |
|
312 |
"use strict";
|
313 |
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"usePollResults\", function() { return usePollResults; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"usePollVote\", function() { return usePollVote; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"useIsCsConnected\", function() { return useIsCsConnected; });\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"@babel/runtime/regenerator\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"./node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ \"./node_modules/@babel/runtime/helpers/slicedToArray.js\");\n/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var js_cookie__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! js-cookie */ \"./node_modules/js-cookie/src/js.cookie.js\");\n/* harmony import */ var js_cookie__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(js_cookie__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var data_poll__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! data/poll */ \"./client/data/poll/index.js\");\n/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./util */ \"./client/data/hooks/util.js\");\n/* harmony import */ var blocks_poll_constants__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! blocks/poll/constants */ \"./client/blocks/poll/constants.js\");\n\n\n\n\n/**\n * External dependencies\n */\n\n\n/**\n * Internal dependencies\n */\n\n\n\n\nvar usePollResults = function usePollResults(pollId) {\n var _useFetch = Object(_util__WEBPACK_IMPORTED_MODULE_6__[\"useFetch\"])(function () {\n return Object(data_poll__WEBPACK_IMPORTED_MODULE_5__[\"requestResults\"])(pollId);\n }, [pollId]),\n data = _useFetch.data,\n error = _useFetch.error,\n loading = _useFetch.loading;\n\n return {\n error: error,\n loading: loading,\n results: data\n };\n};\n/**\n * React Hook that returns state variables for voting status and a function to perform a vote.\n *\n * @param {number} pollId ID of the poll being loaded.\n * @param {boolean} enableVoteRestriction sets whether or not the vote cookie is read and set\n */\n\nvar usePollVote = function usePollVote(pollId) {\n var enableVoteRestriction = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n var cookieName = \"cs-poll-\".concat(pollId);\n\n var _useState = Object(react__WEBPACK_IMPORTED_MODULE_3__[\"useState\"])(false),\n _useState2 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_2___default()(_useState, 2),\n isVoting = _useState2[0],\n setIsVoting = _useState2[1];\n\n var _useState3 = Object(react__WEBPACK_IMPORTED_MODULE_3__[\"useState\"])(false),\n _useState4 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_2___default()(_useState3, 2),\n hasVoted = _useState4[0],\n setHasVoted = _useState4[1];\n\n Object(react__WEBPACK_IMPORTED_MODULE_3__[\"useEffect\"])(function () {\n if (enableVoteRestriction && undefined !== js_cookie__WEBPACK_IMPORTED_MODULE_4___default.a.get(cookieName)) {\n setHasVoted(true);\n }\n }, []);\n\n var vote = /*#__PURE__*/function () {\n var _ref = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee(selectedAnswerIds) {\n var nonce;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n _context.prev = 0;\n setIsVoting(true);\n _context.next = 4;\n return Object(data_poll__WEBPACK_IMPORTED_MODULE_5__[\"requestVoteNonce\"])(pollId);\n\n case 4:\n nonce = _context.sent;\n _context.next = 7;\n return Object(data_poll__WEBPACK_IMPORTED_MODULE_5__[\"requestVote\"])(nonce, pollId, selectedAnswerIds);\n\n case 7:\n setHasVoted(true);\n\n if (enableVoteRestriction) {\n
|
314 |
|
315 |
/***/ }),
|
316 |
|
@@ -334,7 +334,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) *
|
|
334 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
335 |
|
336 |
"use strict";
|
337 |
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"requestResults\", function() { return requestResults; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"requestVoteNonce\", function() { return requestVoteNonce; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"requestVote\", function() { return requestVote; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"CrowdsignalFormsError\", function() { return CrowdsignalFormsError; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"CrowdsignalFormsServerError\", function() { return CrowdsignalFormsServerError; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"requestIsCsConnected\", function() { return requestIsCsConnected; });\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ \"./node_modules/@babel/runtime/helpers/inherits.js\");\n/* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ \"./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js\");\n/* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ \"./node_modules/@babel/runtime/helpers/getPrototypeOf.js\");\n/* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _babel_runtime_helpers_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/wrapNativeSuper */ \"./node_modules/@babel/runtime/helpers/wrapNativeSuper.js\");\n/* harmony import */ var _babel_runtime_helpers_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"@babel/runtime/regenerator\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"./node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/api-fetch */ \"@wordpress/api-fetch\");\n/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_7__);\n/* harmony import */ var lib_i18n__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! lib/i18n */ \"./client/lib/i18n/index.js\");\n\n\n\n\n\n\n\n\nfunction _createSuper(Derived) { return function () { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default()(Derived), result; if (_isNativeReflectConstruct()) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default()(this, result); }; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\n/**\n * External dependencies\n */\n\n/**\n * Internal dependencies\n */\n\n\n/**\n * Fetch the poll results for the given pollId\n *\n * @param {number} pollId Poll ID.\n * @return {Promise} Promise that resolves to a key-value object with answer IDs and vote counts.\n */\n\nvar requestResults = /*#__PURE__*/function () {\n var _ref = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_6___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5___default.a.mark(function _callee(pollId) {\n var baseUrl;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5___default.a.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n baseUrl = 'https://api.crowdsignal.com/v3/polls';\n return _context.abrupt(\"return\", window.fetch(\"\".concat(baseUrl, \"/\").concat(pollId, \"/results\"), {\n method: 'GET',\n headers: {\n 'content-type': 'application/json'\n }\n }).then(function (response) {\n if (response.status >= 200 && response.status < 300) {\n return response.json();\n }\n\n throw response;\n }).then(function (response) {\n if (404 === response.status) {\n // poll doesn't exist on the platform yet, return an empty result\n return {};\n } else if (response.error) {\n throw new Error(response.message);\n }\n\n return response.results.votes_by_answer;\n }));\n\n case 2:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee);\n }));\n\n return function requestResults(_x) {\n return _ref.apply(this, arguments);\n };\n}();\nvar requestVoteNonce = /*#__PURE__*/function () {\n var _ref2 = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_6___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5___default.a.mark(function _callee2(pollId) {\n var hash, timestamp, respNonce, jsonNonce;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5___default.a.wrap(function _callee2$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n hash = '5430eeac3911395001d731d9702fc38b'; // hash not used when format=json is passed\n\n timestamp = new Date().getTime();\n _context2.next = 4;\n return window.fetch(\"https://polldaddy.com/n/\".concat(hash, \"/\").concat(pollId, \"?\").concat(timestamp, \"&format=json\"));\n\n case 4:\n respNonce = _context2.sent;\n\n if (respNonce.ok) {\n _context2.next = 7;\n break;\n }\n\n throw new CrowdsignalFormsServerError();\n\n case 7:\n _context2.next = 9;\n return respNonce.json();\n\n case 9:\n jsonNonce = _context2.sent;\n\n if (jsonNonce.nonce) {\n _context2.next = 12;\n break;\n }\n\n throw new CrowdsignalFormsServerError();\n\n case 12:\n return _context2.abrupt(\"return\", jsonNonce.nonce);\n\n case 13:\n case \"end\":\n return _context2.stop();\n }\n }\n }, _callee2);\n }));\n\n return function requestVoteNonce(_x2) {\n return _ref2.apply(this, arguments);\n };\n}();\nvar requestVote = /*#__PURE__*/function () {\n var _ref3 = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_6___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5___default.a.mark(function _callee3(nonce, pollId, selectedAnswerIds) {\n var answerString, respVote, jsonVote;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5___default.a.wrap(function _callee3$(_context3) {\n while (1) {\n switch (_context3.prev = _context3.next) {\n case 0:\n answerString = selectedAnswerIds.join(',');\n _context3.next = 3;\n return window.fetch(\"https://polls.polldaddy.com/vote-js.php?format=json&p=\".concat(pollId, \"&b=1&a=\").concat(answerString, \"&o=&va=16&cookie=0&n=\").concat(nonce, \"&url=\").concat(encodeURIComponent(window.location)));\n\n case 3:\n respVote = _context3.sent;\n\n if (respVote.ok) {\n _context3.next = 6;\n break;\n }\n\n throw new CrowdsignalFormsServerError();\n\n case 6:\n _context3.next = 8;\n return respVote.json();\n\n case 8:\n jsonVote = _context3.sent;\n\n if (!('error' === jsonVote.status)) {\n _context3.next = 11;\n break;\n }\n\n throw new CrowdsignalFormsError(jsonVote.error);\n\n case 11:\n case \"end\":\n return _context3.stop();\n }\n }\n }, _callee3);\n }));\n\n return function requestVote(_x3, _x4, _x5) {\n return _ref3.apply(this, arguments);\n };\n}();\nvar CrowdsignalFormsError = /*#__PURE__*/function (_Error) {\n _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1___default()(CrowdsignalFormsError, _Error);\n\n var _super = _createSuper(CrowdsignalFormsError);\n\n function CrowdsignalFormsError() {\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, CrowdsignalFormsError);\n\n return _super.apply(this, arguments);\n }\n\n return CrowdsignalFormsError;\n}( /*#__PURE__*/_babel_runtime_helpers_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_4___default()(Error));\nvar CrowdsignalFormsServerError = /*#__PURE__*/function (_CrowdsignalFormsErro) {\n _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1___default()(CrowdsignalFormsServerError, _CrowdsignalFormsErro);\n\n var _super2 = _createSuper(CrowdsignalFormsServerError);\n\n function CrowdsignalFormsServerError() {\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, CrowdsignalFormsServerError);\n\n return _super2.call(this, Object(lib_i18n__WEBPACK_IMPORTED_MODULE_8__[\"__\"])('Server error. Please try again.'));\n }\n\n return CrowdsignalFormsServerError;\n}(CrowdsignalFormsError);\n/**\n * Returns the connected state of the current user's account.\n *\n * @return {string} Enum value of the account's state.\n */\n\nvar requestIsCsConnected = /*#__PURE__*/function () {\n var _ref4 = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_6___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5___default.a.mark(function _callee4() {\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5___default.a.wrap(function _callee4$(_context4) {\n while (1) {\n switch (_context4.prev = _context4.next) {\n case 0:\n _context4.next = 2;\n return _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_7___default()({\n path: \"/crowdsignal-forms/v1/account/connected\",\n method: 'GET'\n });\n\n case 2:\n return _context4.abrupt(\"return\", _context4.sent);\n\n case 3:\n case \"end\":\n return _context4.stop();\n }\n }\n }, _callee4);\n }));\n\n return function requestIsCsConnected() {\n return _ref4.apply(this, arguments);\n };\n}();\n\n//# sourceURL=webpack:///./client/data/poll/index.js?");
|
338 |
|
339 |
/***/ }),
|
340 |
|
@@ -350,6 +350,18 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) *
|
|
350 |
|
351 |
/***/ }),
|
352 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
353 |
/***/ "./client/poll.js":
|
354 |
/*!************************!*\
|
355 |
!*** ./client/poll.js ***!
|
@@ -358,7 +370,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) *
|
|
358 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
359 |
|
360 |
"use strict";
|
361 |
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ \"@wordpress/element\");\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var
|
362 |
|
363 |
/***/ }),
|
364 |
|
310 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
311 |
|
312 |
"use strict";
|
313 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"usePollResults\", function() { return usePollResults; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"usePollVote\", function() { return usePollVote; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"useIsCsConnected\", function() { return useIsCsConnected; });\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"@babel/runtime/regenerator\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"./node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ \"./node_modules/@babel/runtime/helpers/slicedToArray.js\");\n/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var js_cookie__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! js-cookie */ \"./node_modules/js-cookie/src/js.cookie.js\");\n/* harmony import */ var js_cookie__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(js_cookie__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var data_poll__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! data/poll */ \"./client/data/poll/index.js\");\n/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./util */ \"./client/data/hooks/util.js\");\n/* harmony import */ var blocks_poll_constants__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! blocks/poll/constants */ \"./client/blocks/poll/constants.js\");\n\n\n\n\n/**\n * External dependencies\n */\n\n\n/**\n * Internal dependencies\n */\n\n\n\n\nvar usePollResults = function usePollResults(pollId) {\n var doFetch = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n\n var _useFetch = Object(_util__WEBPACK_IMPORTED_MODULE_6__[\"useFetch\"])(function () {\n return Object(data_poll__WEBPACK_IMPORTED_MODULE_5__[\"requestResults\"])(pollId, doFetch);\n }, [pollId]),\n data = _useFetch.data,\n error = _useFetch.error,\n loading = _useFetch.loading;\n\n return {\n error: error,\n loading: loading,\n results: data\n };\n};\n/**\n * React Hook that returns state variables for voting status and a function to perform a vote.\n *\n * @param {number} pollId ID of the poll being loaded.\n * @param {boolean} enableVoteRestriction sets whether or not the vote cookie is read and set\n * @param {boolean} storeAnswerIdsInCookie sets whether or not the answer ids are stored in the vote restriction cookie\n */\n\nvar usePollVote = function usePollVote(pollId) {\n var enableVoteRestriction = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n var storeAnswerIdsInCookie = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n var cookieName = \"cs-poll-\".concat(pollId);\n\n var _useState = Object(react__WEBPACK_IMPORTED_MODULE_3__[\"useState\"])(false),\n _useState2 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_2___default()(_useState, 2),\n isVoting = _useState2[0],\n setIsVoting = _useState2[1];\n\n var _useState3 = Object(react__WEBPACK_IMPORTED_MODULE_3__[\"useState\"])(false),\n _useState4 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_2___default()(_useState3, 2),\n hasVoted = _useState4[0],\n setHasVoted = _useState4[1];\n\n var _useState5 = Object(react__WEBPACK_IMPORTED_MODULE_3__[\"useState\"])(''),\n _useState6 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_2___default()(_useState5, 2),\n storedCookieValue = _useState6[0],\n setStoredCookieValue = _useState6[1];\n\n Object(react__WEBPACK_IMPORTED_MODULE_3__[\"useEffect\"])(function () {\n if (enableVoteRestriction && undefined !== js_cookie__WEBPACK_IMPORTED_MODULE_4___default.a.get(cookieName)) {\n setHasVoted(true);\n setStoredCookieValue(js_cookie__WEBPACK_IMPORTED_MODULE_4___default.a.get(cookieName));\n }\n }, []);\n\n var vote = /*#__PURE__*/function () {\n var _ref = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee(selectedAnswerIds) {\n var nonce, cookieValue;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n _context.prev = 0;\n setIsVoting(true);\n _context.next = 4;\n return Object(data_poll__WEBPACK_IMPORTED_MODULE_5__[\"requestVoteNonce\"])(pollId);\n\n case 4:\n nonce = _context.sent;\n _context.next = 7;\n return Object(data_poll__WEBPACK_IMPORTED_MODULE_5__[\"requestVote\"])(nonce, pollId, selectedAnswerIds);\n\n case 7:\n setHasVoted(true);\n\n if (enableVoteRestriction) {\n cookieValue = storeAnswerIdsInCookie ? selectedAnswerIds.join(',') : new Date().getTime();\n js_cookie__WEBPACK_IMPORTED_MODULE_4___default.a.set(cookieName, cookieValue, {\n sameSite: 'Strict',\n expires: 365\n });\n setStoredCookieValue(cookieValue);\n }\n\n case 9:\n _context.prev = 9;\n setIsVoting(false);\n return _context.finish(9);\n\n case 12:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee, null, [[0,, 9, 12]]);\n }));\n\n return function vote(_x) {\n return _ref.apply(this, arguments);\n };\n }();\n\n return {\n hasVoted: hasVoted,\n isVoting: isVoting,\n vote: vote,\n storedCookieValue: storedCookieValue\n };\n};\nvar useIsCsConnected = function useIsCsConnected() {\n /* assume connection is enabled, so placeholder doesn't flash while we add a block and wait for the request */\n var _useState7 = Object(react__WEBPACK_IMPORTED_MODULE_3__[\"useState\"])(true),\n _useState8 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_2___default()(_useState7, 2),\n isConnected = _useState8[0],\n setIsConnected = _useState8[1];\n\n var _useState9 = Object(react__WEBPACK_IMPORTED_MODULE_3__[\"useState\"])(true),\n _useState10 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_2___default()(_useState9, 2),\n isAccountVerified = _useState10[0],\n setIsAccountVerified = _useState10[1];\n\n var checkIsConnected = /*#__PURE__*/function () {\n var _ref2 = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee2() {\n var connectedState, isNowConnected, isNowVerified;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee2$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n _context2.next = 2;\n return Object(data_poll__WEBPACK_IMPORTED_MODULE_5__[\"requestIsCsConnected\"])();\n\n case 2:\n connectedState = _context2.sent;\n isNowConnected = blocks_poll_constants__WEBPACK_IMPORTED_MODULE_7__[\"ConnectedAccountState\"].CONNECTED === connectedState || blocks_poll_constants__WEBPACK_IMPORTED_MODULE_7__[\"ConnectedAccountState\"].NOT_VERIFIED === connectedState;\n isNowVerified = blocks_poll_constants__WEBPACK_IMPORTED_MODULE_7__[\"ConnectedAccountState\"].CONNECTED === connectedState;\n setIsConnected(isNowConnected);\n setIsAccountVerified(isNowVerified);\n return _context2.abrupt(\"return\", {\n isNowConnected: isNowConnected,\n isNowVerified: isNowVerified\n });\n\n case 8:\n case \"end\":\n return _context2.stop();\n }\n }\n }, _callee2);\n }));\n\n return function checkIsConnected() {\n return _ref2.apply(this, arguments);\n };\n }();\n\n Object(react__WEBPACK_IMPORTED_MODULE_3__[\"useEffect\"])(function () {\n checkIsConnected();\n }, []);\n return {\n isConnected: isConnected,\n isAccountVerified: isAccountVerified,\n checkIsConnected: checkIsConnected\n };\n};\n\n//# sourceURL=webpack:///./client/data/hooks/index.js?");
|
314 |
|
315 |
/***/ }),
|
316 |
|
334 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
335 |
|
336 |
"use strict";
|
337 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"requestResults\", function() { return requestResults; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"requestVoteNonce\", function() { return requestVoteNonce; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"requestVote\", function() { return requestVote; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"CrowdsignalFormsError\", function() { return CrowdsignalFormsError; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"CrowdsignalFormsServerError\", function() { return CrowdsignalFormsServerError; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"requestIsCsConnected\", function() { return requestIsCsConnected; });\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ \"./node_modules/@babel/runtime/helpers/inherits.js\");\n/* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ \"./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js\");\n/* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ \"./node_modules/@babel/runtime/helpers/getPrototypeOf.js\");\n/* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _babel_runtime_helpers_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/wrapNativeSuper */ \"./node_modules/@babel/runtime/helpers/wrapNativeSuper.js\");\n/* harmony import */ var _babel_runtime_helpers_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"@babel/runtime/regenerator\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"./node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/api-fetch */ \"@wordpress/api-fetch\");\n/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_7__);\n/* harmony import */ var lib_i18n__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! lib/i18n */ \"./client/lib/i18n/index.js\");\n\n\n\n\n\n\n\n\nfunction _createSuper(Derived) { return function () { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default()(Derived), result; if (_isNativeReflectConstruct()) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default()(this, result); }; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\n/**\n * External dependencies\n */\n\n/**\n * Internal dependencies\n */\n\n\n/**\n * Fetch the poll results for the given pollId\n *\n * @param {number} pollId Poll ID.\n * @param {boolean} doFetch Whether or not to actually perform the request.\n * @return {Promise} Promise that resolves to a key-value object with answer IDs and vote counts.\n */\n\nvar requestResults = /*#__PURE__*/function () {\n var _ref = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_6___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5___default.a.mark(function _callee(pollId) {\n var doFetch,\n baseUrl,\n _args = arguments;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5___default.a.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n doFetch = _args.length > 1 && _args[1] !== undefined ? _args[1] : true;\n baseUrl = 'https://api.crowdsignal.com/v3/polls';\n\n if (doFetch) {\n _context.next = 4;\n break;\n }\n\n return _context.abrupt(\"return\", null);\n\n case 4:\n return _context.abrupt(\"return\", window.fetch(\"\".concat(baseUrl, \"/\").concat(pollId, \"/results\"), {\n method: 'GET',\n headers: {\n 'content-type': 'application/json'\n }\n }).then(function (response) {\n if (response.status >= 200 && response.status < 300) {\n return response.json();\n }\n\n throw response;\n }).then(function (response) {\n if (404 === response.status) {\n // poll doesn't exist on the platform yet, return an empty result\n return {};\n } else if (response.error) {\n throw new Error(response.message);\n }\n\n return response.results.votes_by_answer;\n }));\n\n case 5:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee);\n }));\n\n return function requestResults(_x) {\n return _ref.apply(this, arguments);\n };\n}();\nvar requestVoteNonce = /*#__PURE__*/function () {\n var _ref2 = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_6___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5___default.a.mark(function _callee2(pollId) {\n var hash, timestamp, respNonce, jsonNonce;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5___default.a.wrap(function _callee2$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n hash = '5430eeac3911395001d731d9702fc38b'; // hash not used when format=json is passed\n\n timestamp = new Date().getTime();\n _context2.next = 4;\n return window.fetch(\"https://polldaddy.com/n/\".concat(hash, \"/\").concat(pollId, \"?\").concat(timestamp, \"&format=json\"));\n\n case 4:\n respNonce = _context2.sent;\n\n if (respNonce.ok) {\n _context2.next = 7;\n break;\n }\n\n throw new CrowdsignalFormsServerError();\n\n case 7:\n _context2.next = 9;\n return respNonce.json();\n\n case 9:\n jsonNonce = _context2.sent;\n\n if (jsonNonce.nonce) {\n _context2.next = 12;\n break;\n }\n\n throw new CrowdsignalFormsServerError();\n\n case 12:\n return _context2.abrupt(\"return\", jsonNonce.nonce);\n\n case 13:\n case \"end\":\n return _context2.stop();\n }\n }\n }, _callee2);\n }));\n\n return function requestVoteNonce(_x2) {\n return _ref2.apply(this, arguments);\n };\n}();\nvar requestVote = /*#__PURE__*/function () {\n var _ref3 = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_6___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5___default.a.mark(function _callee3(nonce, pollId, selectedAnswerIds) {\n var answerString, respVote, jsonVote;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5___default.a.wrap(function _callee3$(_context3) {\n while (1) {\n switch (_context3.prev = _context3.next) {\n case 0:\n answerString = selectedAnswerIds.join(',');\n _context3.next = 3;\n return window.fetch(\"https://polls.polldaddy.com/vote-js.php?format=json&p=\".concat(pollId, \"&b=1&a=\").concat(answerString, \"&o=&va=16&cookie=0&n=\").concat(nonce, \"&url=\").concat(encodeURIComponent(window.location)));\n\n case 3:\n respVote = _context3.sent;\n\n if (respVote.ok) {\n _context3.next = 6;\n break;\n }\n\n throw new CrowdsignalFormsServerError();\n\n case 6:\n _context3.next = 8;\n return respVote.json();\n\n case 8:\n jsonVote = _context3.sent;\n\n if (!('error' === jsonVote.status)) {\n _context3.next = 11;\n break;\n }\n\n throw new CrowdsignalFormsError(jsonVote.error);\n\n case 11:\n case \"end\":\n return _context3.stop();\n }\n }\n }, _callee3);\n }));\n\n return function requestVote(_x3, _x4, _x5) {\n return _ref3.apply(this, arguments);\n };\n}();\nvar CrowdsignalFormsError = /*#__PURE__*/function (_Error) {\n _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1___default()(CrowdsignalFormsError, _Error);\n\n var _super = _createSuper(CrowdsignalFormsError);\n\n function CrowdsignalFormsError() {\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, CrowdsignalFormsError);\n\n return _super.apply(this, arguments);\n }\n\n return CrowdsignalFormsError;\n}( /*#__PURE__*/_babel_runtime_helpers_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_4___default()(Error));\nvar CrowdsignalFormsServerError = /*#__PURE__*/function (_CrowdsignalFormsErro) {\n _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1___default()(CrowdsignalFormsServerError, _CrowdsignalFormsErro);\n\n var _super2 = _createSuper(CrowdsignalFormsServerError);\n\n function CrowdsignalFormsServerError() {\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, CrowdsignalFormsServerError);\n\n return _super2.call(this, Object(lib_i18n__WEBPACK_IMPORTED_MODULE_8__[\"__\"])('Server error. Please try again.'));\n }\n\n return CrowdsignalFormsServerError;\n}(CrowdsignalFormsError);\n/**\n * Returns the connected state of the current user's account.\n *\n * @return {string} Enum value of the account's state.\n */\n\nvar requestIsCsConnected = /*#__PURE__*/function () {\n var _ref4 = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_6___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5___default.a.mark(function _callee4() {\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5___default.a.wrap(function _callee4$(_context4) {\n while (1) {\n switch (_context4.prev = _context4.next) {\n case 0:\n _context4.next = 2;\n return _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_7___default()({\n path: \"/crowdsignal-forms/v1/account/connected\",\n method: 'GET'\n });\n\n case 2:\n return _context4.abrupt(\"return\", _context4.sent);\n\n case 3:\n case \"end\":\n return _context4.stop();\n }\n }\n }, _callee4);\n }));\n\n return function requestIsCsConnected() {\n return _ref4.apply(this, arguments);\n };\n}();\n\n//# sourceURL=webpack:///./client/data/poll/index.js?");
|
338 |
|
339 |
/***/ }),
|
340 |
|
350 |
|
351 |
/***/ }),
|
352 |
|
353 |
+
/***/ "./client/lib/mutation-observer/index.js":
|
354 |
+
/*!***********************************************!*\
|
355 |
+
!*** ./client/lib/mutation-observer/index.js ***!
|
356 |
+
\***********************************************/
|
357 |
+
/*! exports provided: default */
|
358 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
359 |
+
|
360 |
+
"use strict";
|
361 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react-dom */ \"react-dom\");\n/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash */ \"lodash\");\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__);\n/**\n * External dependencies\n */\n\n\n\nvar MutationObserver = function MutationObserver(dataAttributeName, blockBuilder) {\n if ('complete' === document.readyState) {\n return blockObserver(dataAttributeName, blockBuilder);\n }\n\n window.addEventListener('load', function () {\n return blockObserver(dataAttributeName, blockBuilder);\n });\n};\n\nvar initBlocks = function initBlocks(dataAttributeName, blockBuilder) {\n return Object(lodash__WEBPACK_IMPORTED_MODULE_1__[\"forEach\"])(document.querySelectorAll(\"div[\".concat(dataAttributeName, \"]\")), function (element) {\n // Try-catch potentially prevents other blocks from breaking\n // when there's more then one on the page\n try {\n var attributes = JSON.parse(element.dataset[Object(lodash__WEBPACK_IMPORTED_MODULE_1__[\"camelCase\"])(dataAttributeName.substr('data-'.length))]);\n var block = blockBuilder(attributes, element);\n element.removeAttribute(dataAttributeName);\n Object(react_dom__WEBPACK_IMPORTED_MODULE_0__[\"render\"])(block, element);\n } catch (error) {\n // eslint-disable-next-line\n console.error('Crowdsignal Forms: Failed to parse block data for: %s', dataAttributeName);\n }\n });\n};\n\nvar blockObserver = function blockObserver(dataAttributeName, blockBuilder) {\n if (!Object(lodash__WEBPACK_IMPORTED_MODULE_1__[\"isEmpty\"])(window.CrowdsignalMutationObservers) && true === window.CrowdsignalMutationObservers[dataAttributeName]) {\n return;\n }\n\n var observer = new window.MutationObserver(function () {\n return initBlocks(dataAttributeName, blockBuilder);\n });\n observer.observe(document.body, {\n attributes: true,\n attributeFilter: [dataAttributeName],\n childList: true,\n subtree: true\n });\n\n if (Object(lodash__WEBPACK_IMPORTED_MODULE_1__[\"isEmpty\"])(window.CrowdsignalMutationObservers)) {\n window.CrowdsignalMutationObservers = [];\n }\n\n window.CrowdsignalMutationObservers[dataAttributeName] = true; // Run the first pass on load\n\n initBlocks(dataAttributeName, blockBuilder);\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (MutationObserver);\n\n//# sourceURL=webpack:///./client/lib/mutation-observer/index.js?");
|
362 |
+
|
363 |
+
/***/ }),
|
364 |
+
|
365 |
/***/ "./client/poll.js":
|
366 |
/*!************************!*\
|
367 |
!*** ./client/poll.js ***!
|
370 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
371 |
|
372 |
"use strict";
|
373 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ \"@wordpress/element\");\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var components_poll__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! components/poll */ \"./client/components/poll/index.js\");\n/* harmony import */ var lib_mutation_observer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lib/mutation-observer */ \"./client/lib/mutation-observer/index.js\");\n\n\n/**\n * External dependencies\n */\n\n/**\n * Internal dependencies\n */\n\n\n\nObject(lib_mutation_observer__WEBPACK_IMPORTED_MODULE_3__[\"default\"])('data-crowdsignal-poll', function (attributes) {\n return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"])(components_poll__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n attributes: attributes\n });\n});\n\n//# sourceURL=webpack:///./client/poll.js?");
|
374 |
|
375 |
/***/ }),
|
376 |
|
build/vote.asset.php
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<?php return array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-api-fetch', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => '66f00f1db13b082f8974621f811b1926');
|
build/vote.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
@keyframes crowdsignal-forms-animation__pop{0%{transform:scale(0)}50%{transform:scale(1.2)}100%{transform:scale(1)}}@keyframes crowdsignal-forms-animation__pulse{0%{opacity:0.4}50%{opacity:0.7}100%{opacity:0.4}}.crowdsignal-vote-wrapper:not(:first-child),[data-type="crowdsignal-forms/vote"]:not(:first-child){margin-top:3em}.crowdsignal-vote-wrapper:not(:last-child),[data-type="crowdsignal-forms/vote"]:not(:last-child){margin-bottom:3em}.crowdsignal-forms-vote{align-items:flex-start;display:flex;flex-direction:column}.crowdsignal-forms-vote.crowdsignal-forms-vote__example{align-items:center}[data-type="crowdsignal-forms/vote-item"]{margin-top:28px !important;margin-bottom:28px !important}.crowdsignal-forms-vote__items{display:flex;flex-direction:row}.crowdsignal-forms-vote-item{border:var(--crowdsignal-forms-vote-border-width) solid #d2d2d2;border-radius:var(--crowdsignal-forms-vote-border-radius);cursor:pointer;display:flex;flex-direction:row;align-items:center;margin-inline-end:8px !important;position:relative}.crowdsignal-forms-vote-item.has-bg-color{background-color:var(--crowdsignal-forms-vote-bg-color)}.crowdsignal-forms-vote-item.has-border-color{border-color:var(--crowdsignal-forms-vote-border-color)}.crowdsignal-forms-vote-item.has-text-color{color:var(--crowdsignal-forms-vote-text-color)}.is-closed .crowdsignal-forms-vote-item,.crowdsignal-forms-vote-item.is-disabled{cursor:inherit}.is-closed .crowdsignal-forms-vote-item,.crowdsignal-forms-vote-item.is-disabled:not(.is-voted-on){opacity:0.5}.size-small .crowdsignal-forms-vote-item{padding:18px 10px;height:0.7em}.size-medium .crowdsignal-forms-vote-item{height:1em;padding:20px 10px}.size-large .crowdsignal-forms-vote-item{height:1.2em;padding:22px 16px;margin-inline-end:16px}.crowdsignal-forms-vote-item.is-voted-on,.crowdsignal-forms-vote-item:hover:not(.is-disabled){border-color:var(--crowdsignal-forms-vote-voted-color);color:var(--crowdsignal-forms-vote-voted-color)}.crowdsignal-forms-vote-item.is-voted-on.has-bg-color,.crowdsignal-forms-vote-item.is-voted-on.has-text-color,.crowdsignal-forms-vote-item:hover:not(.is-disabled).has-bg-color,.crowdsignal-forms-vote-item:hover:not(.is-disabled).has-text-color{background-color:var(--crowdsignal-forms-vote-text-color);border-color:var(--crowdsignal-forms-vote-bg-color);color:var(--crowdsignal-forms-vote-bg-color)}.size-small .crowdsignal-forms-vote-item .crowdsignal-forms-vote-item__icon{width:0.7em;height:0.7em;max-height:0.7em}.size-medium .crowdsignal-forms-vote-item .crowdsignal-forms-vote-item__icon{width:1em;height:1em;max-height:1em}.size-large .crowdsignal-forms-vote-item .crowdsignal-forms-vote-item__icon{width:1.2em;height:1.2em;max-height:1.2em}.crowdsignal-forms-vote-item.is-voted-on .crowdsignal-forms-vote-item .crowdsignal-forms-vote-item__icon{animation-duration:0.3s;animation-name:crowdsignal-forms-animation__pop;animation-iteration-count:1}.crowdsignal-forms-vote-item .crowdsignal-forms-vote-item__count{font-size:14pt;font-family:-apple-system,blinkmacsystemfont,"Segoe UI",roboto,oxygen-sans,ubuntu,cantarell,"Helvetica Neue",sans-serif;margin-inline-start:10px;transform:rotateX(0deg);transform-origin:50% 50% 10px;transition:transform 0.3s}.size-small .crowdsignal-forms-vote-item .crowdsignal-forms-vote-item__count{font-size:0.6em}.size-medium .crowdsignal-forms-vote-item .crowdsignal-forms-vote-item__count{font-size:0.8em}.size-large .crowdsignal-forms-vote-item .crowdsignal-forms-vote-item__count{font-size:1em}.crowdsignal-forms-vote-item .crowdsignal-forms-vote-item__count-enter,.crowdsignal-forms-vote-item .crowdsignal-forms-vote-item__count-enter-active{margin:0;position:absolute;right:0}.crowdsignal-forms-vote-item .crowdsignal-forms-vote-item__count-enter{transform:rotateX(-90deg)}.crowdsignal-forms-vote-item.is-voted-on .crowdsignal-forms-vote-item .crowdsignal-forms-vote-item__count-enter{transform:rotateX(90deg)}.crowdsignal-forms-vote-item .crowdsignal-forms-vote-item__count-exit,.crowdsignal-forms-vote-item .crowdsignal-forms-vote-item__count-exit-active{margin:0;position:absolute;right:10px;top:4px;transform:rotateX(90deg)}.crowdsignal-forms-vote-item.is-voted-on .crowdsignal-forms-vote-item .crowdsignal-forms-vote-item__count-exit,.crowdsignal-forms-vote-item.is-voted-on .crowdsignal-forms-vote-item .crowdsignal-forms-vote-item__count-exit-active{transform:rotateX(-90deg)}.crowdsignal-forms-vote__branding{display:flex}.crowdsignal-forms-vote__branding .crowdsignal-forms-vote__branding-link{font-family:-apple-system,blinkmacsystemfont,"Segoe UI",roboto,oxygen-sans,ubuntu,cantarell,"Helvetica Neue",sans-serif;font-size:8px;padding:8px 20px 0;text-decoration:none !important;text-transform:uppercase}.crowdsignal-forms-vote__branding .crowdsignal-forms-vote__branding-link.with-external-icon::after{content:"\2197";display:inline;font-size:6px;vertical-align:super}.crowdsignal-forms-vote__branding .crowdsignal-forms-vote__branding-link:not(:hover){color:var(--crowdsignal-forms-text-color)}
|
build/vote.js
ADDED
@@ -0,0 +1,1023 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
(function(e, a) { for(var i in a) e[i] = a[i]; }(window, /******/ (function(modules) { // webpackBootstrap
|
2 |
+
/******/ // The module cache
|
3 |
+
/******/ var installedModules = {};
|
4 |
+
/******/
|
5 |
+
/******/ // The require function
|
6 |
+
/******/ function __webpack_require__(moduleId) {
|
7 |
+
/******/
|
8 |
+
/******/ // Check if module is in cache
|
9 |
+
/******/ if(installedModules[moduleId]) {
|
10 |
+
/******/ return installedModules[moduleId].exports;
|
11 |
+
/******/ }
|
12 |
+
/******/ // Create a new module (and put it into the cache)
|
13 |
+
/******/ var module = installedModules[moduleId] = {
|
14 |
+
/******/ i: moduleId,
|
15 |
+
/******/ l: false,
|
16 |
+
/******/ exports: {}
|
17 |
+
/******/ };
|
18 |
+
/******/
|
19 |
+
/******/ // Execute the module function
|
20 |
+
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
21 |
+
/******/
|
22 |
+
/******/ // Flag the module as loaded
|
23 |
+
/******/ module.l = true;
|
24 |
+
/******/
|
25 |
+
/******/ // Return the exports of the module
|
26 |
+
/******/ return module.exports;
|
27 |
+
/******/ }
|
28 |
+
/******/
|
29 |
+
/******/
|
30 |
+
/******/ // expose the modules object (__webpack_modules__)
|
31 |
+
/******/ __webpack_require__.m = modules;
|
32 |
+
/******/
|
33 |
+
/******/ // expose the module cache
|
34 |
+
/******/ __webpack_require__.c = installedModules;
|
35 |
+
/******/
|
36 |
+
/******/ // define getter function for harmony exports
|
37 |
+
/******/ __webpack_require__.d = function(exports, name, getter) {
|
38 |
+
/******/ if(!__webpack_require__.o(exports, name)) {
|
39 |
+
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
40 |
+
/******/ }
|
41 |
+
/******/ };
|
42 |
+
/******/
|
43 |
+
/******/ // define __esModule on exports
|
44 |
+
/******/ __webpack_require__.r = function(exports) {
|
45 |
+
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
46 |
+
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
47 |
+
/******/ }
|
48 |
+
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
49 |
+
/******/ };
|
50 |
+
/******/
|
51 |
+
/******/ // create a fake namespace object
|
52 |
+
/******/ // mode & 1: value is a module id, require it
|
53 |
+
/******/ // mode & 2: merge all properties of value into the ns
|
54 |
+
/******/ // mode & 4: return value when already ns object
|
55 |
+
/******/ // mode & 8|1: behave like require
|
56 |
+
/******/ __webpack_require__.t = function(value, mode) {
|
57 |
+
/******/ if(mode & 1) value = __webpack_require__(value);
|
58 |
+
/******/ if(mode & 8) return value;
|
59 |
+
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
60 |
+
/******/ var ns = Object.create(null);
|
61 |
+
/******/ __webpack_require__.r(ns);
|
62 |
+
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
63 |
+
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
64 |
+
/******/ return ns;
|
65 |
+
/******/ };
|
66 |
+
/******/
|
67 |
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
68 |
+
/******/ __webpack_require__.n = function(module) {
|
69 |
+
/******/ var getter = module && module.__esModule ?
|
70 |
+
/******/ function getDefault() { return module['default']; } :
|
71 |
+
/******/ function getModuleExports() { return module; };
|
72 |
+
/******/ __webpack_require__.d(getter, 'a', getter);
|
73 |
+
/******/ return getter;
|
74 |
+
/******/ };
|
75 |
+
/******/
|
76 |
+
/******/ // Object.prototype.hasOwnProperty.call
|
77 |
+
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
78 |
+
/******/
|
79 |
+
/******/ // __webpack_public_path__
|
80 |
+
/******/ __webpack_require__.p = "";
|
81 |
+
/******/
|
82 |
+
/******/
|
83 |
+
/******/ // Load entry module and return exports
|
84 |
+
/******/ return __webpack_require__(__webpack_require__.s = "./client/vote.js");
|
85 |
+
/******/ })
|
86 |
+
/************************************************************************/
|
87 |
+
/******/ ({
|
88 |
+
|
89 |
+
/***/ "./client/blocks/poll/constants.js":
|
90 |
+
/*!*****************************************!*\
|
91 |
+
!*** ./client/blocks/poll/constants.js ***!
|
92 |
+
\*****************************************/
|
93 |
+
/*! exports provided: ConfirmMessageType, FontFamilyType, GoogleFonts, FontFamilyMap, PollStatus, ClosedPollState, ConnectedAccountState, AnswerStyle, ButtonAlignment */
|
94 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
95 |
+
|
96 |
+
"use strict";
|
97 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ConfirmMessageType\", function() { return ConfirmMessageType; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"FontFamilyType\", function() { return FontFamilyType; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"GoogleFonts\", function() { return GoogleFonts; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"FontFamilyMap\", function() { return FontFamilyMap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"PollStatus\", function() { return PollStatus; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ClosedPollState\", function() { return ClosedPollState; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ConnectedAccountState\", function() { return ConnectedAccountState; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"AnswerStyle\", function() { return AnswerStyle; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ButtonAlignment\", function() { return ButtonAlignment; });\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"./node_modules/@babel/runtime/helpers/defineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__);\n\n\nvar _Object$freeze;\n\nvar ConfirmMessageType = Object.freeze({\n THANK_YOU: 'thank-you',\n CUSTOM_TEXT: 'custom-text',\n REDIRECT: 'redirect',\n RESULTS: 'results'\n});\nvar FontFamilyType = Object.freeze({\n THEME_DEFAULT: 'theme-default',\n GEORGIA: 'georgia',\n PALATINO: 'palatino',\n TIMES_NEW_ROMAN: 'times-new-roman',\n ARIAL: 'arial',\n IMPACT: 'impact',\n LUCIDA: 'lucida',\n TAHOMA: 'tahoma',\n TREBUCHET: 'trebuchet',\n VERDANA: 'verdana',\n COURIER: 'courier',\n // Google fonts: enum value = google font url slug\n CABIN: 'Cabin',\n CHIVO: 'Chivo',\n OPEN_SANS: 'Open+Sans',\n FIRA_SANS: 'Fira+Sans',\n ROBOTO: 'Roboto',\n NUNITO: 'Nunito',\n OVERPASS: 'Overpass',\n LATO: 'Lato',\n LIBRE_FRANKLIN: 'Libre+Franklin',\n MONTSERRAT: 'Montserrat',\n POPPINS: 'Poppins',\n RUBIK: 'Rubik',\n RALEWAY: 'Raleway',\n JOSEFIN_SANS: 'Josefin+Sans',\n ALEGREYA_SANS: 'Alegreya+Sans',\n OSWALD: 'Oswald'\n});\nvar GoogleFonts = Object.freeze([FontFamilyType.CABIN, FontFamilyType.CHIVO, FontFamilyType.OPEN_SANS, FontFamilyType.FIRA_SANS, FontFamilyType.ROBOTO, FontFamilyType.NUNITO, FontFamilyType.OVERPASS, FontFamilyType.LATO, FontFamilyType.LIBRE_FRANKLIN, FontFamilyType.MONTSERRAT, FontFamilyType.POPPINS, FontFamilyType.RUBIK, FontFamilyType.RALEWAY, FontFamilyType.JOSEFIN_SANS, FontFamilyType.ALEGREYA_SANS, FontFamilyType.OSWALD]);\nvar FontFamilyMap = Object.freeze((_Object$freeze = {}, _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_Object$freeze, FontFamilyType.THEME_DEFAULT, null), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_Object$freeze, FontFamilyType.GEORGIA, 'Georgia, serif'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_Object$freeze, FontFamilyType.PALATINO, '\"Palatino Linotype\", \"Book Antiqua\", Palatino, serif'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_Object$freeze, FontFamilyType.TIMES_NEW_ROMAN, '\"Times New Roman\", Times, serif'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_Object$freeze, FontFamilyType.ARIAL, 'Arial, Helvetica, sans-serif'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_Object$freeze, FontFamilyType.IMPACT, 'Impact, Charcoal, sans-serif'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_Object$freeze, FontFamilyType.LUCIDA, '\"Lucida Sans Unicode\", \"Lucida Grande\", sans-serif'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_Object$freeze, FontFamilyType.TAHOMA, 'Tahoma, Geneva, sans-serif'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_Object$freeze, FontFamilyType.TREBUCHET, '\"Trebuchet MS\", Helvetica, sans-serif'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_Object$freeze, FontFamilyType.VERDANA, 'Verdana, Geneva, sans-serif'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_Object$freeze, FontFamilyType.COURIER, '\"Courier New\", Courier, monospace'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_Object$freeze, FontFamilyType.CABIN, '\"Cabin\", sans-serif'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_Object$freeze, FontFamilyType.CHIVO, '\"Chivo\", sans-serif'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_Object$freeze, FontFamilyType.OPEN_SANS, '\"Open Sans\", sans-serif'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_Object$freeze, FontFamilyType.FIRA_SANS, '\"Fira Sans\", sans-serif'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_Object$freeze, FontFamilyType.ROBOTO, '\"Roboto\", sans-serif'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_Object$freeze, FontFamilyType.NUNITO, '\"Nunito\", sans-serif'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_Object$freeze, FontFamilyType.OVERPASS, '\"Overpass\", sans-serif'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_Object$freeze, FontFamilyType.LATO, '\"Lato\", sans-serif'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_Object$freeze, FontFamilyType.LIBRE_FRANKLIN, '\"Libre Franklin\", sans-serif'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_Object$freeze, FontFamilyType.MONTSERRAT, '\"Montserrat\", sans-serif'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_Object$freeze, FontFamilyType.POPPINS, '\"Poppins\", sans-serif'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_Object$freeze, FontFamilyType.RUBIK, '\"Rubik\", sans-serif'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_Object$freeze, FontFamilyType.RALEWAY, '\"Raleway\", sans-serif'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_Object$freeze, FontFamilyType.JOSEFIN_SANS, '\"Josefin Sans\", sans-serif'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_Object$freeze, FontFamilyType.ALEGREYA_SANS, '\"Alegreya Sans\", sans-serif'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_Object$freeze, FontFamilyType.OSWALD, '\"Oswald\", sans-serif'), _Object$freeze));\nvar PollStatus = Object.freeze({\n OPEN: 'open',\n CLOSED: 'closed',\n CLOSED_AFTER: 'closed-after'\n});\nvar ClosedPollState = Object.freeze({\n SHOW_RESULTS: 'show-results',\n SHOW_CLOSED_BANNER: 'show-closed-banner',\n HIDDEN: 'hidden'\n});\nvar ConnectedAccountState = Object.freeze({\n CONNECTED: 'connected',\n NOT_CONNECTED: 'not-connected',\n NOT_VERIFIED: 'not-verified'\n});\nvar AnswerStyle = Object.freeze({\n RADIO: 'radio',\n BUTTON: 'button'\n});\nvar ButtonAlignment = Object.freeze({\n LIST: 'list',\n INLINE: 'inline'\n});\n\n//# sourceURL=webpack:///./client/blocks/poll/constants.js?");
|
98 |
+
|
99 |
+
/***/ }),
|
100 |
+
|
101 |
+
/***/ "./client/blocks/poll/util.js":
|
102 |
+
/*!************************************!*\
|
103 |
+
!*** ./client/blocks/poll/util.js ***!
|
104 |
+
\************************************/
|
105 |
+
/*! exports provided: addAnswer, getFontFamilyFromType, getStyleVars, extractRGBColorProperties, hexToRGB, getBlockCssClasses, isPollClosed, getAnswerStyle, toggleButtonStyleAvailability */
|
106 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
107 |
+
|
108 |
+
"use strict";
|
109 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"addAnswer\", function() { return addAnswer; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getFontFamilyFromType\", function() { return getFontFamilyFromType; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getStyleVars\", function() { return getStyleVars; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extractRGBColorProperties\", function() { return extractRGBColorProperties; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"hexToRGB\", function() { return hexToRGB; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getBlockCssClasses\", function() { return getBlockCssClasses; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isPollClosed\", function() { return isPollClosed; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getAnswerStyle\", function() { return getAnswerStyle; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"toggleButtonStyleAvailability\", function() { return toggleButtonStyleAvailability; });\n/* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ \"./node_modules/@babel/runtime/helpers/toConsumableArray.js\");\n/* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! classnames */ \"./node_modules/classnames/index.js\");\n/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash */ \"lodash\");\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/blocks */ \"@wordpress/blocks\");\n/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./constants */ \"./client/blocks/poll/constants.js\");\n/* harmony import */ var lib_i18n__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! lib/i18n */ \"./client/lib/i18n/index.js\");\n\n\n/**\n * External dependencies\n */\n\n\n/**\n * WordPress dependencies\n */\n\n\n/**\n * Internal dependencies\n */\n\n\n\n/**\n * Creates a new Answer object then returns a copy of the passed in `answers` array with the new answer appended to it.\n *\n * @param {Array} answers The existing array of answers.\n * @param {string} text\tThe text for the new answer to add.\n * @return {Array}\t\t\tThe newly created answers array.\n */\n\nvar addAnswer = function addAnswer(answers, text) {\n return [].concat(_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default()(answers), [{\n answerId: null,\n text: text\n }]);\n};\nvar getFontFamilyFromType = function getFontFamilyFromType(type) {\n if (!Object(lodash__WEBPACK_IMPORTED_MODULE_2__[\"includes\"])(_constants__WEBPACK_IMPORTED_MODULE_4__[\"FontFamilyType\"], type)) {\n return null;\n }\n\n return _constants__WEBPACK_IMPORTED_MODULE_4__[\"FontFamilyMap\"][type];\n};\nvar getStyleVars = function getStyleVars(attributes, fallbackStyles) {\n var _attributes$borderCol, _getFontFamilyFromTyp, _getFontFamilyFromTyp2, _extractRGBColorPrope;\n\n var textColor = Object(lodash__WEBPACK_IMPORTED_MODULE_2__[\"isEmpty\"])(attributes.textColor) ? fallbackStyles.text : attributes.textColor;\n return Object(lodash__WEBPACK_IMPORTED_MODULE_2__[\"mapKeys\"])({\n borderColor: (_attributes$borderCol = attributes.borderColor) !== null && _attributes$borderCol !== void 0 ? _attributes$borderCol : fallbackStyles.accent,\n borderRadius: \"\".concat(attributes.borderRadius, \"px\"),\n borderWidth: \"\".concat(attributes.borderWidth, \"px\"),\n bgColor: attributes.backgroundColor,\n bodyFontFamily: (_getFontFamilyFromTyp = getFontFamilyFromType(attributes.fontFamily)) !== null && _getFontFamilyFromTyp !== void 0 ? _getFontFamilyFromTyp : fallbackStyles.bodyFontFamily,\n questionFontFamily: (_getFontFamilyFromTyp2 = getFontFamilyFromType(attributes.fontFamily)) !== null && _getFontFamilyFromTyp2 !== void 0 ? _getFontFamilyFromTyp2 : fallbackStyles.questionFontFamily,\n submitButtonBgColor: attributes.submitButtonBackgroundColor || fallbackStyles.accent,\n submitButtonTextColor: attributes.submitButtonTextColor || fallbackStyles.textInverted,\n textColor: textColor,\n textColorProperties: (_extractRGBColorPrope = extractRGBColorProperties(textColor)) !== null && _extractRGBColorPrope !== void 0 ? _extractRGBColorPrope : '0, 0, 0',\n contentWideWidth: fallbackStyles.contentWideWidth\n }, function (_, key) {\n return \"--crowdsignal-forms-\".concat(Object(lodash__WEBPACK_IMPORTED_MODULE_2__[\"kebabCase\"])(key));\n });\n};\n/**\n * Extracts the comma separated color properties from an rgb string.\n * rgba strings are not supported for now because it introduces too many complications.\n *\n * @param {string} color The color string.\n * @return {string} The 3 comma separated rgb color properties.\n */\n\nvar extractRGBColorProperties = function extractRGBColorProperties(color) {\n if (!color || 'string' !== typeof color || -1 === color.indexOf('rgb') && 0 !== color.indexOf('#') || -1 < color.indexOf('rgba')) {\n return null;\n }\n\n if (0 === color.indexOf('#')) {\n color = hexToRGB(color);\n }\n\n return color.match(/\\((.*?)\\)/)[1];\n};\n/**\n * converts css color hex to rgb\n *\n * @param {string} h The hex color string.\n * @return {string} The rgb value.\n */\n\nvar hexToRGB = function hexToRGB(h) {\n var r = 0,\n g = 0,\n b = 0;\n var hexCode = 4 === h.length ? \"#\".concat(h[1] + h[1] + h[2] + h[2] + h[3] + h[3]) : h;\n\n if (7 === hexCode.length) {\n r = parseInt(hexCode.substr(1, 2), 16) || 0;\n g = parseInt(hexCode.substr(3, 2), 16) || 0;\n b = parseInt(hexCode.substr(5, 2), 16) || 0;\n }\n\n return \"rgb(\".concat(r, \", \").concat(g, \", \").concat(b, \")\");\n};\n/**\n * Returns a css 'class' string of overridden styles given a collection of attributes.\n *\n * @param {*} attributes The block's attributes\n * @param {...any} extraClasses A list of additional classes to add to the class string\n */\n\nvar getBlockCssClasses = function getBlockCssClasses(attributes) {\n var _attributes$borderRad;\n\n for (var _len = arguments.length, extraClasses = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n extraClasses[_key - 1] = arguments[_key];\n }\n\n return classnames__WEBPACK_IMPORTED_MODULE_1___default()({\n 'has-bg-color': attributes.backgroundColor,\n 'has-text-color': attributes.textColor,\n 'has-submit-button-bg-color': attributes.submitButtonBackgroundColor,\n 'has-submit-button-text-color': attributes.submitButtonTextColor,\n 'has-border-radius': (_attributes$borderRad = attributes.borderRadius) !== null && _attributes$borderRad !== void 0 ? _attributes$borderRad : false,\n 'has-box-shadow': attributes.hasBoxShadow\n }, extraClasses);\n};\n/**\n * Determines if the poll is closed based on its editor settings.\n *\n * @param {string} pollStatus The poll's status, as set in the editor.\n * @param {string} closedAfterDateTimeUTC The UTC date time string to close the poll after if pollStatus is PollStatus.CLOSED_AFTER.\n * @param {Date} currentDateTime Optionally set the current date that will be used for current time comparisons.\n */\n\nvar isPollClosed = function isPollClosed(pollStatus, closedAfterDateTimeUTC) {\n var currentDateTime = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : new Date();\n\n if (_constants__WEBPACK_IMPORTED_MODULE_4__[\"PollStatus\"].CLOSED === pollStatus) {\n return true;\n }\n\n if (_constants__WEBPACK_IMPORTED_MODULE_4__[\"PollStatus\"].CLOSED_AFTER === pollStatus) {\n var closedAfterDateTime = new Date(closedAfterDateTimeUTC);\n return closedAfterDateTime < currentDateTime;\n }\n\n return false;\n};\n/**\n * Returns the type of answer controls that should be rendered given the current state of the block.\n *\n * @param {*} attributes the poll's attributes.\n * @param {string} className the css class string Gutenberg is passing into the block.\n */\n\nvar getAnswerStyle = function getAnswerStyle(attributes, className) {\n if (attributes.isMultipleChoice) {\n return _constants__WEBPACK_IMPORTED_MODULE_4__[\"AnswerStyle\"].RADIO;\n }\n\n if (!Object(lodash__WEBPACK_IMPORTED_MODULE_2__[\"isEmpty\"])(className) && className.indexOf('is-style-buttons') > -1) {\n return _constants__WEBPACK_IMPORTED_MODULE_4__[\"AnswerStyle\"].BUTTON;\n }\n\n return _constants__WEBPACK_IMPORTED_MODULE_4__[\"AnswerStyle\"].RADIO;\n};\n/**\n * Registers or de-registers the `buttons` block style.\n *\n * @param {boolean} enable True if button style should be available, false if not.\n */\n\nvar toggleButtonStyleAvailability = function toggleButtonStyleAvailability(enable) {\n if (enable) {\n Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_3__[\"registerBlockStyle\"])('crowdsignal-forms/poll', {\n name: 'buttons',\n label: Object(lib_i18n__WEBPACK_IMPORTED_MODULE_5__[\"__\"])('Buttons')\n });\n } else {\n Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_3__[\"unregisterBlockStyle\"])('crowdsignal-forms/poll', 'buttons');\n }\n};\n\n//# sourceURL=webpack:///./client/blocks/poll/util.js?");
|
110 |
+
|
111 |
+
/***/ }),
|
112 |
+
|
113 |
+
/***/ "./client/blocks/vote/util.js":
|
114 |
+
/*!************************************!*\
|
115 |
+
!*** ./client/blocks/vote/util.js ***!
|
116 |
+
\************************************/
|
117 |
+
/*! exports provided: getVoteStyleVars, getVoteItemStyleVars, getBlockCssClasses */
|
118 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
119 |
+
|
120 |
+
"use strict";
|
121 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getVoteStyleVars\", function() { return getVoteStyleVars; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getVoteItemStyleVars\", function() { return getVoteItemStyleVars; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getBlockCssClasses\", function() { return getBlockCssClasses; });\n/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ \"./node_modules/classnames/index.js\");\n/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash */ \"lodash\");\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__);\n/**\n * External dependencies\n */\n\n/**\n * Internal dependencies\n */\n\n\nvar getVoteStyleVars = function getVoteStyleVars(attributes) {\n return Object(lodash__WEBPACK_IMPORTED_MODULE_1__[\"mapKeys\"])({\n borderRadius: \"\".concat(attributes.borderRadius, \"px\"),\n borderWidth: \"\".concat(attributes.borderWidth, \"px\")\n }, function (_, key) {\n return \"--crowdsignal-forms-vote-\".concat(Object(lodash__WEBPACK_IMPORTED_MODULE_1__[\"kebabCase\"])(key));\n });\n};\nvar getVoteItemStyleVars = function getVoteItemStyleVars(attributes, fallbackStyles) {\n var textColor = Object(lodash__WEBPACK_IMPORTED_MODULE_1__[\"isEmpty\"])(attributes.textColor) ? fallbackStyles.textColor : attributes.textColor;\n var backgroundColor = Object(lodash__WEBPACK_IMPORTED_MODULE_1__[\"isEmpty\"])(attributes.backgroundColor) ? fallbackStyles.backgroundColor : attributes.backgroundColor;\n return Object(lodash__WEBPACK_IMPORTED_MODULE_1__[\"mapKeys\"])({\n borderColor: attributes.borderColor,\n bgColor: backgroundColor,\n textColor: textColor,\n votedColor: fallbackStyles.accentColor\n }, function (_, key) {\n return \"--crowdsignal-forms-vote-\".concat(Object(lodash__WEBPACK_IMPORTED_MODULE_1__[\"kebabCase\"])(key));\n });\n};\n/**\n * Returns a css 'class' string of overridden styles given a collection of attributes.\n *\n * @param {*} attributes The block's attributes\n * @param {...any} extraClasses A list of additional classes to add to the class string\n */\n\nvar getBlockCssClasses = function getBlockCssClasses(attributes) {\n for (var _len = arguments.length, extraClasses = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n extraClasses[_key - 1] = arguments[_key];\n }\n\n return classnames__WEBPACK_IMPORTED_MODULE_0___default()({\n 'has-bg-color': attributes.backgroundColor,\n 'has-text-color': attributes.textColor,\n 'has-border-color': attributes.borderColor\n }, extraClasses);\n};\n\n//# sourceURL=webpack:///./client/blocks/vote/util.js?");
|
122 |
+
|
123 |
+
/***/ }),
|
124 |
+
|
125 |
+
/***/ "./client/components/icon/thumbs-down.js":
|
126 |
+
/*!***********************************************!*\
|
127 |
+
!*** ./client/components/icon/thumbs-down.js ***!
|
128 |
+
\***********************************************/
|
129 |
+
/*! exports provided: default */
|
130 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
131 |
+
|
132 |
+
"use strict";
|
133 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ \"@wordpress/element\");\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (_ref) {\n var className = _ref.className,\n _ref$fillColor = _ref.fillColor,\n fillColor = _ref$fillColor === void 0 ? 'black' : _ref$fillColor;\n return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"])(\"svg\", {\n className: className,\n width: \"24\",\n height: \"24\",\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"])(\"g\", {\n clipPath: \"url(#clipThumbsDown)\"\n }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"])(\"mask\", {\n id: \"maskThumbsDown\",\n \"mask-type\": \"alpha\",\n maskUnits: \"userSpaceOnUse\",\n x: \"2\",\n y: \"5\",\n width: \"20\",\n height: \"20\"\n }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"])(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M4.65002 17.75H10.4342L9.56336 21.9392L9.53586 22.2325C9.53586 22.6083 9.69169 22.9567 9.93919 23.2042L10.9109 24.1667L16.9425 18.1258C17.2817 17.7958 17.4834 17.3375 17.4834 16.8333L21.15 16.8333L21.15 7.57499H17.4834V7.66666C17.4834 6.65832 16.6584 5.83332 15.65 5.83332H7.40003C6.63919 5.83332 5.98836 6.29165 5.71336 6.95166L2.94503 13.4142C2.86253 13.625 2.81669 13.845 2.81669 14.0833V15.9167C2.81669 16.925 3.64169 17.75 4.65002 17.75ZM4.65002 14.0833L7.40002 7.66666H15.65L15.65 16.8333L11.6717 20.8117L12.6892 15.9167H4.65002V14.0833Z\",\n fill: \"white\"\n })), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"])(\"g\", {\n mask: \"url(#maskThumbsDown)\"\n }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"])(\"rect\", {\n x: \"23.0001\",\n y: \"24\",\n width: \"22\",\n height: \"22\",\n transform: \"rotate(-180 23.0001 24)\",\n fill: fillColor\n }))), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"])(\"defs\", null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"])(\"clipPath\", {\n id: \"clipThumbsDown\"\n }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"])(\"rect\", {\n width: \"24\",\n height: \"24\",\n fill: \"white\"\n }))));\n});\n\n//# sourceURL=webpack:///./client/components/icon/thumbs-down.js?");
|
134 |
+
|
135 |
+
/***/ }),
|
136 |
+
|
137 |
+
/***/ "./client/components/icon/thumbs-up.js":
|
138 |
+
/*!*********************************************!*\
|
139 |
+
!*** ./client/components/icon/thumbs-up.js ***!
|
140 |
+
\*********************************************/
|
141 |
+
/*! exports provided: default */
|
142 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
143 |
+
|
144 |
+
"use strict";
|
145 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ \"@wordpress/element\");\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (_ref) {\n var className = _ref.className,\n _ref$fillColor = _ref.fillColor,\n fillColor = _ref$fillColor === void 0 ? 'black' : _ref$fillColor;\n return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"])(\"svg\", {\n className: className,\n width: \"24\",\n height: \"24\",\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"])(\"g\", {\n clipPath: \"url(#clipThumbsUp)\"\n }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"])(\"mask\", {\n id: \"maskThumbsUp\",\n \"mask-type\": \"alpha\",\n maskUnits: \"userSpaceOnUse\",\n x: \"2\",\n y: \"-1\",\n width: \"20\",\n height: \"20\"\n }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"])(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M19.35 6.24998H13.5658L14.4366 2.06081L14.4641 1.76748C14.4641 1.39165 14.3083 1.04331 14.0608 0.795813L13.0891 -0.166687L7.05748 5.87415C6.71831 6.20415 6.51664 6.66248 6.51664 7.16665L2.84998 7.16665V16.425H6.51664V16.3333C6.51664 17.3416 7.34164 18.1666 8.34998 18.1666H16.6C17.3608 18.1666 18.0116 17.7083 18.2866 17.0483L21.055 10.5858C21.1375 10.375 21.1833 10.155 21.1833 9.91665V8.08331C21.1833 7.07498 20.3583 6.24998 19.35 6.24998ZM19.35 9.91665L16.6 16.3333H8.34998V7.16665L12.3283 3.18831L11.3108 8.08331H19.35V9.91665Z\",\n fill: \"white\"\n })), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"])(\"g\", {\n mask: \"url(#maskThumbsUp)\"\n }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"])(\"rect\", {\n x: \"0.999878\",\n y: \"-3.05176e-05\",\n width: \"22\",\n height: \"22\",\n fill: fillColor\n }))), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"])(\"defs\", null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"])(\"clipPath\", {\n id: \"clipThumbsUp\"\n }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"])(\"rect\", {\n width: \"24\",\n height: \"24\",\n fill: \"white\"\n }))));\n});\n\n//# sourceURL=webpack:///./client/components/icon/thumbs-up.js?");
|
146 |
+
|
147 |
+
/***/ }),
|
148 |
+
|
149 |
+
/***/ "./client/components/vote/brand-link.js":
|
150 |
+
/*!**********************************************!*\
|
151 |
+
!*** ./client/components/vote/brand-link.js ***!
|
152 |
+
\**********************************************/
|
153 |
+
/*! exports provided: default */
|
154 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
155 |
+
|
156 |
+
"use strict";
|
157 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ \"@wordpress/element\");\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var lib_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lib/i18n */ \"./client/lib/i18n/index.js\");\n\n\n/**\n * External dependencies\n */\n\n/**\n * Internal dependencies\n */\n\n\n\nvar BrandLink = function BrandLink(_ref) {\n var showBranding = _ref.showBranding;\n return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"])(\"div\", {\n className: \"crowdsignal-forms-vote__branding\"\n }, showBranding && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"])(\"a\", {\n className: \"crowdsignal-forms-vote__branding-link with-external-icon\",\n href: \"https://crowdsignal.com\",\n target: \"blank\",\n rel: \"noopener noreferrer\"\n }, Object(lib_i18n__WEBPACK_IMPORTED_MODULE_2__[\"__\"])('Powered by Crowdsignal')), !showBranding && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"])(\"span\", {\n className: \"crowdsignal-forms-vote__branding-link\"\n }, \"\\xA0\"));\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (BrandLink);\n\n//# sourceURL=webpack:///./client/components/vote/brand-link.js?");
|
158 |
+
|
159 |
+
/***/ }),
|
160 |
+
|
161 |
+
/***/ "./client/components/vote/index.js":
|
162 |
+
/*!*****************************************!*\
|
163 |
+
!*** ./client/components/vote/index.js ***!
|
164 |
+
\*****************************************/
|
165 |
+
/*! exports provided: default */
|
166 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
167 |
+
|
168 |
+
"use strict";
|
169 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/extends */ \"./node_modules/@babel/runtime/helpers/extends.js\");\n/* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"@babel/runtime/regenerator\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"./node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ \"./node_modules/@babel/runtime/helpers/slicedToArray.js\");\n/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/element */ \"@wordpress/element\");\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! lodash */ \"lodash\");\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! classnames */ \"./node_modules/classnames/index.js\");\n/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_7__);\n/* harmony import */ var components_vote_vote_item__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! components/vote/vote-item */ \"./client/components/vote/vote-item.js\");\n/* harmony import */ var data_hooks__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! data/hooks */ \"./client/data/hooks/index.js\");\n/* harmony import */ var blocks_vote_util__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! blocks/vote/util */ \"./client/blocks/vote/util.js\");\n/* harmony import */ var _styles__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./styles */ \"./client/components/vote/styles.js\");\n/* harmony import */ var components_with_fallback_styles__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! components/with-fallback-styles */ \"./client/components/with-fallback-styles/index.js\");\n/* harmony import */ var _brand_link__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./brand-link */ \"./client/components/vote/brand-link.js\");\n/* harmony import */ var blocks_poll_util__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! blocks/poll/util */ \"./client/blocks/poll/util.js\");\n\n\n\n\n\n\n/**\n * External dependencies\n */\n\n\n\n/**\n * Internal dependencies\n */\n\n\n\n\n\n\n\n\n\nvar Vote = function Vote(_ref) {\n var attributes = _ref.attributes,\n fallbackStyles = _ref.fallbackStyles,\n renderStyleProbe = _ref.renderStyleProbe;\n var apiPollId = attributes.apiPollData.id;\n\n var _useState = Object(react__WEBPACK_IMPORTED_MODULE_5__[\"useState\"])(0),\n _useState2 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_3___default()(_useState, 2),\n votedOnId = _useState2[0],\n setVotedOnId = _useState2[1];\n\n var _usePollVote = Object(data_hooks__WEBPACK_IMPORTED_MODULE_9__[\"usePollVote\"])(apiPollId, true, true),\n hasVoted = _usePollVote.hasVoted,\n vote = _usePollVote.vote,\n storedCookieValue = _usePollVote.storedCookieValue;\n\n var _usePollResults = Object(data_hooks__WEBPACK_IMPORTED_MODULE_9__[\"usePollResults\"])(apiPollId, !attributes.hideResults),\n results = _usePollResults.results;\n\n Object(react__WEBPACK_IMPORTED_MODULE_5__[\"useEffect\"])(function () {\n if ('' !== storedCookieValue) {\n setVotedOnId(parseInt(storedCookieValue.split(',')[0], 10));\n }\n }, [storedCookieValue]);\n\n var handleVoteClick = /*#__PURE__*/function () {\n var _ref2 = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee(answerId) {\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n setVotedOnId(answerId);\n _context.next = 3;\n return vote([answerId]);\n\n case 3:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee);\n }));\n\n return function handleVoteClick(_x) {\n return _ref2.apply(this, arguments);\n };\n }();\n\n var classes = classnames__WEBPACK_IMPORTED_MODULE_7___default()('crowdsignal-forms-vote', attributes.className, \"size-\".concat(attributes.size));\n var answerClientIdToApiId = Object(lodash__WEBPACK_IMPORTED_MODULE_6__[\"zipObject\"])(Object(lodash__WEBPACK_IMPORTED_MODULE_6__[\"map\"])(attributes.apiPollData.answers, 'client_id'), Object(lodash__WEBPACK_IMPORTED_MODULE_6__[\"map\"])(attributes.apiPollData.answers, 'id'));\n var voteStyleVars = Object(blocks_vote_util__WEBPACK_IMPORTED_MODULE_10__[\"getVoteStyleVars\"])(attributes);\n var isClosed = Object(blocks_poll_util__WEBPACK_IMPORTED_MODULE_14__[\"isPollClosed\"])(attributes.pollStatus, attributes.closedAfterDateTime);\n return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_4__[\"createElement\"])(\"div\", {\n className: classes,\n style: voteStyleVars\n }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_4__[\"createElement\"])(\"div\", {\n className: \"crowdsignal-forms-vote__items\"\n }, Object(lodash__WEBPACK_IMPORTED_MODULE_6__[\"map\"])(attributes.innerBlocks, function (voteAttributes) {\n var apiAnswerId = answerClientIdToApiId[voteAttributes.answerId];\n return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_4__[\"createElement\"])(components_vote_vote_item__WEBPACK_IMPORTED_MODULE_8__[\"default\"], _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, voteAttributes, {\n fallbackStyles: fallbackStyles,\n key: voteAttributes.answerId,\n apiAnswerId: apiAnswerId,\n onVote: handleVoteClick,\n disabled: hasVoted || 0 !== votedOnId || isClosed,\n isVotedOn: apiAnswerId === votedOnId,\n voteCount: results ? results[apiAnswerId] : 0,\n hideCount: attributes.hideResults\n }));\n })), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_4__[\"createElement\"])(_brand_link__WEBPACK_IMPORTED_MODULE_13__[\"default\"], {\n showBranding: hasVoted && !attributes.hideBranding\n }), renderStyleProbe());\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Object(components_with_fallback_styles__WEBPACK_IMPORTED_MODULE_12__[\"withFallbackStyles\"])(_styles__WEBPACK_IMPORTED_MODULE_11__[\"VoteStyles\"], _styles__WEBPACK_IMPORTED_MODULE_11__[\"getVoteStyles\"])(Vote));\n\n//# sourceURL=webpack:///./client/components/vote/index.js?");
|
170 |
+
|
171 |
+
/***/ }),
|
172 |
+
|
173 |
+
/***/ "./client/components/vote/styles.js":
|
174 |
+
/*!******************************************!*\
|
175 |
+
!*** ./client/components/vote/styles.js ***!
|
176 |
+
\******************************************/
|
177 |
+
/*! exports provided: getVoteStyles, VoteStyles */
|
178 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
179 |
+
|
180 |
+
"use strict";
|
181 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getVoteStyles\", function() { return getVoteStyles; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"VoteStyles\", function() { return VoteStyles; });\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ \"@wordpress/element\");\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var components_with_fallback_styles_util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! components/with-fallback-styles/util */ \"./client/components/with-fallback-styles/util.js\");\n\n\n/**\n * External dependencies\n */\n\n/**\n * Internal dependencies\n */\n\n\nvar getVoteStyles = function getVoteStyles(node) {\n if (null === node) {\n return {};\n }\n\n var buttonNode = node.querySelector('.wp-block-button__link');\n var textNode = node.querySelector('p');\n var accentColor = Object(components_with_fallback_styles_util__WEBPACK_IMPORTED_MODULE_2__[\"getBackgroundColor\"])(buttonNode);\n var surfaceColor = Object(components_with_fallback_styles_util__WEBPACK_IMPORTED_MODULE_2__[\"getBackgroundColor\"])(textNode);\n var textColor = window.getComputedStyle(textNode).color; // Ensure that we don't end up with the same color for surface and accent.\n // Falls back to button border color, then text color.\n\n if (accentColor === surfaceColor) {\n var borderColor = Object(components_with_fallback_styles_util__WEBPACK_IMPORTED_MODULE_2__[\"getBorderColor\"])(buttonNode);\n accentColor = borderColor ? borderColor : textColor;\n }\n\n return {\n accentColor: accentColor,\n textColor: textColor,\n backgroundColor: surfaceColor\n };\n};\nvar VoteStyles = function VoteStyles() {\n return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"])(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__[\"Fragment\"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"])(\"p\", null), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"])(\"div\", {\n className: \"wp-block-button\"\n }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"])(\"div\", {\n className: \"wp-block-button__link\"\n })));\n};\n\n//# sourceURL=webpack:///./client/components/vote/styles.js?");
|
182 |
+
|
183 |
+
/***/ }),
|
184 |
+
|
185 |
+
/***/ "./client/components/vote/util.js":
|
186 |
+
/*!****************************************!*\
|
187 |
+
!*** ./client/components/vote/util.js ***!
|
188 |
+
\****************************************/
|
189 |
+
/*! exports provided: formatVoteCount */
|
190 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
191 |
+
|
192 |
+
"use strict";
|
193 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"formatVoteCount\", function() { return formatVoteCount; });\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ \"lodash\");\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__);\n/**\n * External dependencies\n */\n\n/**\n * Formats the counter values on vote items:\n *\n * @param {number} count Vote count\n * @return {string} Formatted count\n */\n\nvar formatVoteCount = function formatVoteCount(count) {\n if (!count) {\n return '0';\n }\n\n if (count >= 10000000) {\n return \"\".concat(Object(lodash__WEBPACK_IMPORTED_MODULE_0__[\"round\"])(count / 1000000), \"M\");\n }\n\n if (count >= 1000000) {\n return \"\".concat((count / 1000000).toFixed(1), \"M\");\n }\n\n if (count >= 10000) {\n return \"\".concat(Object(lodash__WEBPACK_IMPORTED_MODULE_0__[\"round\"])(count / 1000), \"K\");\n }\n\n if (count >= 1000) {\n return \"\".concat((count / 1000).toFixed(1), \"K\");\n }\n\n return count.toString();\n};\n\n//# sourceURL=webpack:///./client/components/vote/util.js?");
|
194 |
+
|
195 |
+
/***/ }),
|
196 |
+
|
197 |
+
/***/ "./client/components/vote/vote-item.js":
|
198 |
+
/*!*********************************************!*\
|
199 |
+
!*** ./client/components/vote/vote-item.js ***!
|
200 |
+
\*********************************************/
|
201 |
+
/*! exports provided: default */
|
202 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
203 |
+
|
204 |
+
"use strict";
|
205 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ \"./node_modules/@babel/runtime/helpers/slicedToArray.js\");\n/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ \"@wordpress/element\");\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\");\n/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var react_transition_group__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react-transition-group */ \"./node_modules/react-transition-group/esm/index.js\");\n/* harmony import */ var components_icon_thumbs_up__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! components/icon/thumbs-up */ \"./client/components/icon/thumbs-up.js\");\n/* harmony import */ var components_icon_thumbs_down__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! components/icon/thumbs-down */ \"./client/components/icon/thumbs-down.js\");\n/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./util */ \"./client/components/vote/util.js\");\n/* harmony import */ var blocks_vote_util__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! blocks/vote/util */ \"./client/blocks/vote/util.js\");\n\n\n\n/**\n * External dependencies\n */\n\n\n\n/**\n * Internal dependencies\n */\n\n\n\n\n\n\nvar VoteItem = function VoteItem(props) {\n var className = props.className,\n type = props.type,\n voteCount = props.voteCount,\n apiAnswerId = props.apiAnswerId,\n onVote = props.onVote,\n disabled = props.disabled,\n isVotedOn = props.isVotedOn,\n hideCount = props.hideCount,\n fallbackStyles = props.fallbackStyles;\n\n var _useState = Object(react__WEBPACK_IMPORTED_MODULE_2__[\"useState\"])(0),\n _useState2 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0___default()(_useState, 2),\n currentVote = _useState2[0],\n setCurrentVote = _useState2[1];\n\n var handleVote = function handleVote() {\n if (disabled || !onVote) {\n return;\n }\n\n setCurrentVote(1);\n onVote(apiAnswerId);\n };\n\n var Icon = 'up' === type ? components_icon_thumbs_up__WEBPACK_IMPORTED_MODULE_5__[\"default\"] : components_icon_thumbs_down__WEBPACK_IMPORTED_MODULE_6__[\"default\"];\n var classes = Object(blocks_vote_util__WEBPACK_IMPORTED_MODULE_8__[\"getBlockCssClasses\"])(props, 'crowdsignal-forms-vote-item', className, {\n 'is-voted-on': isVotedOn,\n 'is-disabled': disabled\n });\n var blockStyle = Object(blocks_vote_util__WEBPACK_IMPORTED_MODULE_8__[\"getVoteItemStyleVars\"])(props, fallbackStyles);\n var displayedVoteCount = voteCount + currentVote;\n return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__[\"createElement\"])(\"div\", {\n className: classes,\n onClick: handleVote,\n onKeyPress: handleVote,\n role: \"button\",\n style: blockStyle,\n tabIndex: 0\n }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__[\"createElement\"])(Icon, {\n className: \"crowdsignal-forms-vote-item__icon\",\n fillColor: \"currentColor\"\n }), !hideCount && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__[\"createElement\"])(react_transition_group__WEBPACK_IMPORTED_MODULE_4__[\"SwitchTransition\"], {\n mode: \"in-out\"\n }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__[\"createElement\"])(react_transition_group__WEBPACK_IMPORTED_MODULE_4__[\"CSSTransition\"], {\n key: currentVote,\n classNames: \"crowdsignal-forms-vote-item__count\",\n timeout: 300\n }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__[\"createElement\"])(\"div\", {\n className: \"crowdsignal-forms-vote-item__count\"\n }, Object(_util__WEBPACK_IMPORTED_MODULE_7__[\"formatVoteCount\"])(displayedVoteCount)))));\n};\n\nVoteItem.propTypes = {\n apiAnswerId: prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.number,\n className: prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.string,\n disabled: prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.bool,\n isVotedOn: prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.bool,\n onVote: prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.func,\n type: prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.string.isRequired,\n voteCount: prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.number.isRequired\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (VoteItem);\n\n//# sourceURL=webpack:///./client/components/vote/vote-item.js?");
|
206 |
+
|
207 |
+
/***/ }),
|
208 |
+
|
209 |
+
/***/ "./client/components/with-fallback-styles/index.js":
|
210 |
+
/*!*********************************************************!*\
|
211 |
+
!*** ./client/components/with-fallback-styles/index.js ***!
|
212 |
+
\*********************************************************/
|
213 |
+
/*! exports provided: withFallbackStyles */
|
214 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
215 |
+
|
216 |
+
"use strict";
|
217 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"withFallbackStyles\", function() { return withFallbackStyles; });\n/* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/extends */ \"./node_modules/@babel/runtime/helpers/extends.js\");\n/* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/objectWithoutProperties */ \"./node_modules/@babel/runtime/helpers/objectWithoutProperties.js\");\n/* harmony import */ var _babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ \"@wordpress/element\");\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/components */ \"@wordpress/components\");\n/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__);\n\n\n\n\n/**\n * External dependencies\n */\n\n/**\n * WordPress dependencies\n */\n\n\n\nvar StyleProbe = function StyleProbe(_ref) {\n var children = _ref.children;\n return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__[\"createElement\"])(\"div\", {\n className: \"crowdsignal-forms__style-probe\"\n }, children);\n};\n\nvar withFallbackStyles = function withFallbackStyles(VirtualComponent, getStyles) {\n return function (WrappedComponent) {\n var getFallbackStyles = Object(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__[\"withFallbackStyles\"])(function (node) {\n return {\n fallbackStyles: getStyles(node.querySelector('.crowdsignal-forms__style-probe'))\n };\n });\n return getFallbackStyles(function (_ref2) {\n var fallbackStyles = _ref2.fallbackStyles,\n props = _babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1___default()(_ref2, [\"fallbackStyles\"]);\n\n var renderProbe = function renderProbe() {\n if (fallbackStyles) {\n return null;\n }\n\n return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__[\"createElement\"])(StyleProbe, null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__[\"createElement\"])(VirtualComponent, null));\n };\n\n return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__[\"createElement\"])(WrappedComponent, _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({\n fallbackStyles: fallbackStyles || {},\n renderStyleProbe: renderProbe\n }, props));\n });\n };\n};\n\n//# sourceURL=webpack:///./client/components/with-fallback-styles/index.js?");
|
218 |
+
|
219 |
+
/***/ }),
|
220 |
+
|
221 |
+
/***/ "./client/components/with-fallback-styles/util.js":
|
222 |
+
/*!********************************************************!*\
|
223 |
+
!*** ./client/components/with-fallback-styles/util.js ***!
|
224 |
+
\********************************************************/
|
225 |
+
/*! exports provided: getBackgroundColor, getBorderColor */
|
226 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
227 |
+
|
228 |
+
"use strict";
|
229 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getBackgroundColor\", function() { return getBackgroundColor; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getBorderColor\", function() { return getBorderColor; });\n/**\n * Traverses the parent chain of the given node to get a 'best guess' of\n * what the background color is if the provided node has a transparent background.\n * Algorithm for traversing parent chain \"borrowed\" from\n * https://github.com/WordPress/gutenberg/blob/0c6e369/packages/block-editor/src/components/colors/use-colors.js#L201-L216\n *\n * @param {Element} backgroundColorNode The element to check for background color\n * @return {string} The background colour of the node\n */\nvar getBackgroundColor = function getBackgroundColor(backgroundColorNode) {\n var backgroundColor = window.getComputedStyle(backgroundColorNode).backgroundColor;\n\n while (backgroundColor === 'rgba(0, 0, 0, 0)' && backgroundColorNode.parentNode && backgroundColorNode.parentNode.nodeType === window.Node.ELEMENT_NODE) {\n backgroundColorNode = backgroundColorNode.parentNode;\n backgroundColor = window.getComputedStyle(backgroundColorNode).backgroundColor;\n }\n\n return backgroundColor;\n};\n/**\n * Gets the border color for a node, if it appears valid.\n * If we get '0px' for the width, then we likely don't have a border and return null.\n * We use 'borderBlockStartWidth' because of FF: https://bugzilla.mozilla.org/show_bug.cgi?id=137688\n *\n * @param {Element} borderNode The element to check for a border color\n * @return {string|null} The border colour value of null if invalid\n */\n\nvar getBorderColor = function getBorderColor(borderNode) {\n var borderWidth = window.getComputedStyle(borderNode).borderBlockStartWidth;\n return borderWidth !== '0px' ? window.getComputedStyle(borderNode).borderBlockStartColor : null;\n};\n\n//# sourceURL=webpack:///./client/components/with-fallback-styles/util.js?");
|
230 |
+
|
231 |
+
/***/ }),
|
232 |
+
|
233 |
+
/***/ "./client/data/hooks/index.js":
|
234 |
+
/*!************************************!*\
|
235 |
+
!*** ./client/data/hooks/index.js ***!
|
236 |
+
\************************************/
|
237 |
+
/*! exports provided: usePollResults, usePollVote, useIsCsConnected */
|
238 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
239 |
+
|
240 |
+
"use strict";
|
241 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"usePollResults\", function() { return usePollResults; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"usePollVote\", function() { return usePollVote; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"useIsCsConnected\", function() { return useIsCsConnected; });\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"@babel/runtime/regenerator\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"./node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ \"./node_modules/@babel/runtime/helpers/slicedToArray.js\");\n/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var js_cookie__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! js-cookie */ \"./node_modules/js-cookie/src/js.cookie.js\");\n/* harmony import */ var js_cookie__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(js_cookie__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var data_poll__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! data/poll */ \"./client/data/poll/index.js\");\n/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./util */ \"./client/data/hooks/util.js\");\n/* harmony import */ var blocks_poll_constants__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! blocks/poll/constants */ \"./client/blocks/poll/constants.js\");\n\n\n\n\n/**\n * External dependencies\n */\n\n\n/**\n * Internal dependencies\n */\n\n\n\n\nvar usePollResults = function usePollResults(pollId) {\n var doFetch = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n\n var _useFetch = Object(_util__WEBPACK_IMPORTED_MODULE_6__[\"useFetch\"])(function () {\n return Object(data_poll__WEBPACK_IMPORTED_MODULE_5__[\"requestResults\"])(pollId, doFetch);\n }, [pollId]),\n data = _useFetch.data,\n error = _useFetch.error,\n loading = _useFetch.loading;\n\n return {\n error: error,\n loading: loading,\n results: data\n };\n};\n/**\n * React Hook that returns state variables for voting status and a function to perform a vote.\n *\n * @param {number} pollId ID of the poll being loaded.\n * @param {boolean} enableVoteRestriction sets whether or not the vote cookie is read and set\n * @param {boolean} storeAnswerIdsInCookie sets whether or not the answer ids are stored in the vote restriction cookie\n */\n\nvar usePollVote = function usePollVote(pollId) {\n var enableVoteRestriction = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n var storeAnswerIdsInCookie = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n var cookieName = \"cs-poll-\".concat(pollId);\n\n var _useState = Object(react__WEBPACK_IMPORTED_MODULE_3__[\"useState\"])(false),\n _useState2 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_2___default()(_useState, 2),\n isVoting = _useState2[0],\n setIsVoting = _useState2[1];\n\n var _useState3 = Object(react__WEBPACK_IMPORTED_MODULE_3__[\"useState\"])(false),\n _useState4 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_2___default()(_useState3, 2),\n hasVoted = _useState4[0],\n setHasVoted = _useState4[1];\n\n var _useState5 = Object(react__WEBPACK_IMPORTED_MODULE_3__[\"useState\"])(''),\n _useState6 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_2___default()(_useState5, 2),\n storedCookieValue = _useState6[0],\n setStoredCookieValue = _useState6[1];\n\n Object(react__WEBPACK_IMPORTED_MODULE_3__[\"useEffect\"])(function () {\n if (enableVoteRestriction && undefined !== js_cookie__WEBPACK_IMPORTED_MODULE_4___default.a.get(cookieName)) {\n setHasVoted(true);\n setStoredCookieValue(js_cookie__WEBPACK_IMPORTED_MODULE_4___default.a.get(cookieName));\n }\n }, []);\n\n var vote = /*#__PURE__*/function () {\n var _ref = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee(selectedAnswerIds) {\n var nonce, cookieValue;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n _context.prev = 0;\n setIsVoting(true);\n _context.next = 4;\n return Object(data_poll__WEBPACK_IMPORTED_MODULE_5__[\"requestVoteNonce\"])(pollId);\n\n case 4:\n nonce = _context.sent;\n _context.next = 7;\n return Object(data_poll__WEBPACK_IMPORTED_MODULE_5__[\"requestVote\"])(nonce, pollId, selectedAnswerIds);\n\n case 7:\n setHasVoted(true);\n\n if (enableVoteRestriction) {\n cookieValue = storeAnswerIdsInCookie ? selectedAnswerIds.join(',') : new Date().getTime();\n js_cookie__WEBPACK_IMPORTED_MODULE_4___default.a.set(cookieName, cookieValue, {\n sameSite: 'Strict',\n expires: 365\n });\n setStoredCookieValue(cookieValue);\n }\n\n case 9:\n _context.prev = 9;\n setIsVoting(false);\n return _context.finish(9);\n\n case 12:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee, null, [[0,, 9, 12]]);\n }));\n\n return function vote(_x) {\n return _ref.apply(this, arguments);\n };\n }();\n\n return {\n hasVoted: hasVoted,\n isVoting: isVoting,\n vote: vote,\n storedCookieValue: storedCookieValue\n };\n};\nvar useIsCsConnected = function useIsCsConnected() {\n /* assume connection is enabled, so placeholder doesn't flash while we add a block and wait for the request */\n var _useState7 = Object(react__WEBPACK_IMPORTED_MODULE_3__[\"useState\"])(true),\n _useState8 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_2___default()(_useState7, 2),\n isConnected = _useState8[0],\n setIsConnected = _useState8[1];\n\n var _useState9 = Object(react__WEBPACK_IMPORTED_MODULE_3__[\"useState\"])(true),\n _useState10 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_2___default()(_useState9, 2),\n isAccountVerified = _useState10[0],\n setIsAccountVerified = _useState10[1];\n\n var checkIsConnected = /*#__PURE__*/function () {\n var _ref2 = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee2() {\n var connectedState, isNowConnected, isNowVerified;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee2$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n _context2.next = 2;\n return Object(data_poll__WEBPACK_IMPORTED_MODULE_5__[\"requestIsCsConnected\"])();\n\n case 2:\n connectedState = _context2.sent;\n isNowConnected = blocks_poll_constants__WEBPACK_IMPORTED_MODULE_7__[\"ConnectedAccountState\"].CONNECTED === connectedState || blocks_poll_constants__WEBPACK_IMPORTED_MODULE_7__[\"ConnectedAccountState\"].NOT_VERIFIED === connectedState;\n isNowVerified = blocks_poll_constants__WEBPACK_IMPORTED_MODULE_7__[\"ConnectedAccountState\"].CONNECTED === connectedState;\n setIsConnected(isNowConnected);\n setIsAccountVerified(isNowVerified);\n return _context2.abrupt(\"return\", {\n isNowConnected: isNowConnected,\n isNowVerified: isNowVerified\n });\n\n case 8:\n case \"end\":\n return _context2.stop();\n }\n }\n }, _callee2);\n }));\n\n return function checkIsConnected() {\n return _ref2.apply(this, arguments);\n };\n }();\n\n Object(react__WEBPACK_IMPORTED_MODULE_3__[\"useEffect\"])(function () {\n checkIsConnected();\n }, []);\n return {\n isConnected: isConnected,\n isAccountVerified: isAccountVerified,\n checkIsConnected: checkIsConnected\n };\n};\n\n//# sourceURL=webpack:///./client/data/hooks/index.js?");
|
242 |
+
|
243 |
+
/***/ }),
|
244 |
+
|
245 |
+
/***/ "./client/data/hooks/util.js":
|
246 |
+
/*!***********************************!*\
|
247 |
+
!*** ./client/data/hooks/util.js ***!
|
248 |
+
\***********************************/
|
249 |
+
/*! exports provided: useFetch */
|
250 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
251 |
+
|
252 |
+
"use strict";
|
253 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"useFetch\", function() { return useFetch; });\n/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ \"./node_modules/@babel/runtime/helpers/slicedToArray.js\");\n/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);\n\n\n/**\n * External dependencies\n */\n\nvar useFetch = function useFetch(fetchCallback, watchProps) {\n var _useState = Object(react__WEBPACK_IMPORTED_MODULE_1__[\"useState\"])(null),\n _useState2 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0___default()(_useState, 2),\n data = _useState2[0],\n setData = _useState2[1];\n\n var _useState3 = Object(react__WEBPACK_IMPORTED_MODULE_1__[\"useState\"])(null),\n _useState4 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0___default()(_useState3, 2),\n error = _useState4[0],\n setError = _useState4[1];\n\n var _useState5 = Object(react__WEBPACK_IMPORTED_MODULE_1__[\"useState\"])(true),\n _useState6 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0___default()(_useState5, 2),\n loading = _useState6[0],\n setLoading = _useState6[1];\n\n Object(react__WEBPACK_IMPORTED_MODULE_1__[\"useEffect\"])(function () {\n setLoading(true);\n setError(null);\n setData(null);\n fetchCallback().then(setData).catch(setError).finally(function () {\n return setLoading(false);\n });\n }, watchProps);\n return {\n data: data,\n error: error,\n loading: loading\n };\n};\n\n//# sourceURL=webpack:///./client/data/hooks/util.js?");
|
254 |
+
|
255 |
+
/***/ }),
|
256 |
+
|
257 |
+
/***/ "./client/data/poll/index.js":
|
258 |
+
/*!***********************************!*\
|
259 |
+
!*** ./client/data/poll/index.js ***!
|
260 |
+
\***********************************/
|
261 |
+
/*! exports provided: requestResults, requestVoteNonce, requestVote, CrowdsignalFormsError, CrowdsignalFormsServerError, requestIsCsConnected */
|
262 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
263 |
+
|
264 |
+
"use strict";
|
265 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"requestResults\", function() { return requestResults; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"requestVoteNonce\", function() { return requestVoteNonce; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"requestVote\", function() { return requestVote; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"CrowdsignalFormsError\", function() { return CrowdsignalFormsError; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"CrowdsignalFormsServerError\", function() { return CrowdsignalFormsServerError; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"requestIsCsConnected\", function() { return requestIsCsConnected; });\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ \"./node_modules/@babel/runtime/helpers/inherits.js\");\n/* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ \"./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js\");\n/* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ \"./node_modules/@babel/runtime/helpers/getPrototypeOf.js\");\n/* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _babel_runtime_helpers_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/wrapNativeSuper */ \"./node_modules/@babel/runtime/helpers/wrapNativeSuper.js\");\n/* harmony import */ var _babel_runtime_helpers_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"@babel/runtime/regenerator\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"./node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/api-fetch */ \"@wordpress/api-fetch\");\n/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_7__);\n/* harmony import */ var lib_i18n__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! lib/i18n */ \"./client/lib/i18n/index.js\");\n\n\n\n\n\n\n\n\nfunction _createSuper(Derived) { return function () { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default()(Derived), result; if (_isNativeReflectConstruct()) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default()(this, result); }; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\n/**\n * External dependencies\n */\n\n/**\n * Internal dependencies\n */\n\n\n/**\n * Fetch the poll results for the given pollId\n *\n * @param {number} pollId Poll ID.\n * @param {boolean} doFetch Whether or not to actually perform the request.\n * @return {Promise} Promise that resolves to a key-value object with answer IDs and vote counts.\n */\n\nvar requestResults = /*#__PURE__*/function () {\n var _ref = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_6___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5___default.a.mark(function _callee(pollId) {\n var doFetch,\n baseUrl,\n _args = arguments;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5___default.a.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n doFetch = _args.length > 1 && _args[1] !== undefined ? _args[1] : true;\n baseUrl = 'https://api.crowdsignal.com/v3/polls';\n\n if (doFetch) {\n _context.next = 4;\n break;\n }\n\n return _context.abrupt(\"return\", null);\n\n case 4:\n return _context.abrupt(\"return\", window.fetch(\"\".concat(baseUrl, \"/\").concat(pollId, \"/results\"), {\n method: 'GET',\n headers: {\n 'content-type': 'application/json'\n }\n }).then(function (response) {\n if (response.status >= 200 && response.status < 300) {\n return response.json();\n }\n\n throw response;\n }).then(function (response) {\n if (404 === response.status) {\n // poll doesn't exist on the platform yet, return an empty result\n return {};\n } else if (response.error) {\n throw new Error(response.message);\n }\n\n return response.results.votes_by_answer;\n }));\n\n case 5:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee);\n }));\n\n return function requestResults(_x) {\n return _ref.apply(this, arguments);\n };\n}();\nvar requestVoteNonce = /*#__PURE__*/function () {\n var _ref2 = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_6___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5___default.a.mark(function _callee2(pollId) {\n var hash, timestamp, respNonce, jsonNonce;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5___default.a.wrap(function _callee2$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n hash = '5430eeac3911395001d731d9702fc38b'; // hash not used when format=json is passed\n\n timestamp = new Date().getTime();\n _context2.next = 4;\n return window.fetch(\"https://polldaddy.com/n/\".concat(hash, \"/\").concat(pollId, \"?\").concat(timestamp, \"&format=json\"));\n\n case 4:\n respNonce = _context2.sent;\n\n if (respNonce.ok) {\n _context2.next = 7;\n break;\n }\n\n throw new CrowdsignalFormsServerError();\n\n case 7:\n _context2.next = 9;\n return respNonce.json();\n\n case 9:\n jsonNonce = _context2.sent;\n\n if (jsonNonce.nonce) {\n _context2.next = 12;\n break;\n }\n\n throw new CrowdsignalFormsServerError();\n\n case 12:\n return _context2.abrupt(\"return\", jsonNonce.nonce);\n\n case 13:\n case \"end\":\n return _context2.stop();\n }\n }\n }, _callee2);\n }));\n\n return function requestVoteNonce(_x2) {\n return _ref2.apply(this, arguments);\n };\n}();\nvar requestVote = /*#__PURE__*/function () {\n var _ref3 = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_6___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5___default.a.mark(function _callee3(nonce, pollId, selectedAnswerIds) {\n var answerString, respVote, jsonVote;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5___default.a.wrap(function _callee3$(_context3) {\n while (1) {\n switch (_context3.prev = _context3.next) {\n case 0:\n answerString = selectedAnswerIds.join(',');\n _context3.next = 3;\n return window.fetch(\"https://polls.polldaddy.com/vote-js.php?format=json&p=\".concat(pollId, \"&b=1&a=\").concat(answerString, \"&o=&va=16&cookie=0&n=\").concat(nonce, \"&url=\").concat(encodeURIComponent(window.location)));\n\n case 3:\n respVote = _context3.sent;\n\n if (respVote.ok) {\n _context3.next = 6;\n break;\n }\n\n throw new CrowdsignalFormsServerError();\n\n case 6:\n _context3.next = 8;\n return respVote.json();\n\n case 8:\n jsonVote = _context3.sent;\n\n if (!('error' === jsonVote.status)) {\n _context3.next = 11;\n break;\n }\n\n throw new CrowdsignalFormsError(jsonVote.error);\n\n case 11:\n case \"end\":\n return _context3.stop();\n }\n }\n }, _callee3);\n }));\n\n return function requestVote(_x3, _x4, _x5) {\n return _ref3.apply(this, arguments);\n };\n}();\nvar CrowdsignalFormsError = /*#__PURE__*/function (_Error) {\n _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1___default()(CrowdsignalFormsError, _Error);\n\n var _super = _createSuper(CrowdsignalFormsError);\n\n function CrowdsignalFormsError() {\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, CrowdsignalFormsError);\n\n return _super.apply(this, arguments);\n }\n\n return CrowdsignalFormsError;\n}( /*#__PURE__*/_babel_runtime_helpers_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_4___default()(Error));\nvar CrowdsignalFormsServerError = /*#__PURE__*/function (_CrowdsignalFormsErro) {\n _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1___default()(CrowdsignalFormsServerError, _CrowdsignalFormsErro);\n\n var _super2 = _createSuper(CrowdsignalFormsServerError);\n\n function CrowdsignalFormsServerError() {\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, CrowdsignalFormsServerError);\n\n return _super2.call(this, Object(lib_i18n__WEBPACK_IMPORTED_MODULE_8__[\"__\"])('Server error. Please try again.'));\n }\n\n return CrowdsignalFormsServerError;\n}(CrowdsignalFormsError);\n/**\n * Returns the connected state of the current user's account.\n *\n * @return {string} Enum value of the account's state.\n */\n\nvar requestIsCsConnected = /*#__PURE__*/function () {\n var _ref4 = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_6___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5___default.a.mark(function _callee4() {\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5___default.a.wrap(function _callee4$(_context4) {\n while (1) {\n switch (_context4.prev = _context4.next) {\n case 0:\n _context4.next = 2;\n return _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_7___default()({\n path: \"/crowdsignal-forms/v1/account/connected\",\n method: 'GET'\n });\n\n case 2:\n return _context4.abrupt(\"return\", _context4.sent);\n\n case 3:\n case \"end\":\n return _context4.stop();\n }\n }\n }, _callee4);\n }));\n\n return function requestIsCsConnected() {\n return _ref4.apply(this, arguments);\n };\n}();\n\n//# sourceURL=webpack:///./client/data/poll/index.js?");
|
266 |
+
|
267 |
+
/***/ }),
|
268 |
+
|
269 |
+
/***/ "./client/lib/i18n/index.js":
|
270 |
+
/*!**********************************!*\
|
271 |
+
!*** ./client/lib/i18n/index.js ***!
|
272 |
+
\**********************************/
|
273 |
+
/*! exports provided: __, _n, sprintf */
|
274 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
275 |
+
|
276 |
+
"use strict";
|
277 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__\", function() { return __; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_n\", function() { return _n; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"sprintf\", function() { return sprintf; });\n/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ \"@wordpress/i18n\");\n/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);\n/**\n * WordPress dependencies\n */\n\nvar __ = function __(text) {\n return Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__[\"__\"])(text, 'crowdsignal-forms');\n};\nvar _n = function _n(singular, plural, count) {\n return Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__[\"_n\"])(singular, plural, count, 'crowdsignal-forms');\n};\nvar sprintf = _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__[\"sprintf\"];\n\n//# sourceURL=webpack:///./client/lib/i18n/index.js?");
|
278 |
+
|
279 |
+
/***/ }),
|
280 |
+
|
281 |
+
/***/ "./client/lib/mutation-observer/index.js":
|
282 |
+
/*!***********************************************!*\
|
283 |
+
!*** ./client/lib/mutation-observer/index.js ***!
|
284 |
+
\***********************************************/
|
285 |
+
/*! exports provided: default */
|
286 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
287 |
+
|
288 |
+
"use strict";
|
289 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react-dom */ \"react-dom\");\n/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash */ \"lodash\");\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__);\n/**\n * External dependencies\n */\n\n\n\nvar MutationObserver = function MutationObserver(dataAttributeName, blockBuilder) {\n if ('complete' === document.readyState) {\n return blockObserver(dataAttributeName, blockBuilder);\n }\n\n window.addEventListener('load', function () {\n return blockObserver(dataAttributeName, blockBuilder);\n });\n};\n\nvar initBlocks = function initBlocks(dataAttributeName, blockBuilder) {\n return Object(lodash__WEBPACK_IMPORTED_MODULE_1__[\"forEach\"])(document.querySelectorAll(\"div[\".concat(dataAttributeName, \"]\")), function (element) {\n // Try-catch potentially prevents other blocks from breaking\n // when there's more then one on the page\n try {\n var attributes = JSON.parse(element.dataset[Object(lodash__WEBPACK_IMPORTED_MODULE_1__[\"camelCase\"])(dataAttributeName.substr('data-'.length))]);\n var block = blockBuilder(attributes, element);\n element.removeAttribute(dataAttributeName);\n Object(react_dom__WEBPACK_IMPORTED_MODULE_0__[\"render\"])(block, element);\n } catch (error) {\n // eslint-disable-next-line\n console.error('Crowdsignal Forms: Failed to parse block data for: %s', dataAttributeName);\n }\n });\n};\n\nvar blockObserver = function blockObserver(dataAttributeName, blockBuilder) {\n if (!Object(lodash__WEBPACK_IMPORTED_MODULE_1__[\"isEmpty\"])(window.CrowdsignalMutationObservers) && true === window.CrowdsignalMutationObservers[dataAttributeName]) {\n return;\n }\n\n var observer = new window.MutationObserver(function () {\n return initBlocks(dataAttributeName, blockBuilder);\n });\n observer.observe(document.body, {\n attributes: true,\n attributeFilter: [dataAttributeName],\n childList: true,\n subtree: true\n });\n\n if (Object(lodash__WEBPACK_IMPORTED_MODULE_1__[\"isEmpty\"])(window.CrowdsignalMutationObservers)) {\n window.CrowdsignalMutationObservers = [];\n }\n\n window.CrowdsignalMutationObservers[dataAttributeName] = true; // Run the first pass on load\n\n initBlocks(dataAttributeName, blockBuilder);\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (MutationObserver);\n\n//# sourceURL=webpack:///./client/lib/mutation-observer/index.js?");
|
290 |
+
|
291 |
+
/***/ }),
|
292 |
+
|
293 |
+
/***/ "./client/vote.js":
|
294 |
+
/*!************************!*\
|
295 |
+
!*** ./client/vote.js ***!
|
296 |
+
\************************/
|
297 |
+
/*! no exports provided */
|
298 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
299 |
+
|
300 |
+
"use strict";
|
301 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"./node_modules/@babel/runtime/helpers/defineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ \"@wordpress/element\");\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lodash */ \"lodash\");\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var components_vote__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! components/vote */ \"./client/components/vote/index.js\");\n/* harmony import */ var lib_mutation_observer__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! lib/mutation-observer */ \"./client/lib/mutation-observer/index.js\");\n\n\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\n/**\n * External dependencies\n */\n\n\n/**\n * Internal dependencies\n */\n\n\n\nObject(lib_mutation_observer__WEBPACK_IMPORTED_MODULE_5__[\"default\"])('data-crowdsignal-vote', function (attributes, element) {\n var innerBlocks = [];\n Object(lodash__WEBPACK_IMPORTED_MODULE_3__[\"forEach\"])(element.children, function (childElement) {\n if (Object(lodash__WEBPACK_IMPORTED_MODULE_3__[\"isEmpty\"])(childElement.dataset.crowdsignalVoteItem)) {\n return;\n }\n\n innerBlocks.push(JSON.parse(childElement.dataset.crowdsignalVoteItem));\n });\n\n var voteAttributes = _objectSpread({}, attributes, {\n innerBlocks: innerBlocks\n });\n\n return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__[\"createElement\"])(components_vote__WEBPACK_IMPORTED_MODULE_4__[\"default\"], {\n attributes: voteAttributes\n });\n});\n\n//# sourceURL=webpack:///./client/vote.js?");
|
302 |
+
|
303 |
+
/***/ }),
|
304 |
+
|
305 |
+
/***/ "./node_modules/@babel/runtime/helpers/arrayLikeToArray.js":
|
306 |
+
/*!*****************************************************************!*\
|
307 |
+
!*** ./node_modules/@babel/runtime/helpers/arrayLikeToArray.js ***!
|
308 |
+
\*****************************************************************/
|
309 |
+
/*! no static exports found */
|
310 |
+
/***/ (function(module, exports) {
|
311 |
+
|
312 |
+
eval("function _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) {\n arr2[i] = arr[i];\n }\n\n return arr2;\n}\n\nmodule.exports = _arrayLikeToArray;\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/arrayLikeToArray.js?");
|
313 |
+
|
314 |
+
/***/ }),
|
315 |
+
|
316 |
+
/***/ "./node_modules/@babel/runtime/helpers/arrayWithHoles.js":
|
317 |
+
/*!***************************************************************!*\
|
318 |
+
!*** ./node_modules/@babel/runtime/helpers/arrayWithHoles.js ***!
|
319 |
+
\***************************************************************/
|
320 |
+
/*! no static exports found */
|
321 |
+
/***/ (function(module, exports) {
|
322 |
+
|
323 |
+
eval("function _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n}\n\nmodule.exports = _arrayWithHoles;\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/arrayWithHoles.js?");
|
324 |
+
|
325 |
+
/***/ }),
|
326 |
+
|
327 |
+
/***/ "./node_modules/@babel/runtime/helpers/arrayWithoutHoles.js":
|
328 |
+
/*!******************************************************************!*\
|
329 |
+
!*** ./node_modules/@babel/runtime/helpers/arrayWithoutHoles.js ***!
|
330 |
+
\******************************************************************/
|
331 |
+
/*! no static exports found */
|
332 |
+
/***/ (function(module, exports, __webpack_require__) {
|
333 |
+
|
334 |
+
eval("var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray */ \"./node_modules/@babel/runtime/helpers/arrayLikeToArray.js\");\n\nfunction _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) return arrayLikeToArray(arr);\n}\n\nmodule.exports = _arrayWithoutHoles;\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/arrayWithoutHoles.js?");
|
335 |
+
|
336 |
+
/***/ }),
|
337 |
+
|
338 |
+
/***/ "./node_modules/@babel/runtime/helpers/assertThisInitialized.js":
|
339 |
+
/*!**********************************************************************!*\
|
340 |
+
!*** ./node_modules/@babel/runtime/helpers/assertThisInitialized.js ***!
|
341 |
+
\**********************************************************************/
|
342 |
+
/*! no static exports found */
|
343 |
+
/***/ (function(module, exports) {
|
344 |
+
|
345 |
+
eval("function _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\nmodule.exports = _assertThisInitialized;\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/assertThisInitialized.js?");
|
346 |
+
|
347 |
+
/***/ }),
|
348 |
+
|
349 |
+
/***/ "./node_modules/@babel/runtime/helpers/asyncToGenerator.js":
|
350 |
+
/*!*****************************************************************!*\
|
351 |
+
!*** ./node_modules/@babel/runtime/helpers/asyncToGenerator.js ***!
|
352 |
+
\*****************************************************************/
|
353 |
+
/*! no static exports found */
|
354 |
+
/***/ (function(module, exports) {
|
355 |
+
|
356 |
+
eval("function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {\n try {\n var info = gen[key](arg);\n var value = info.value;\n } catch (error) {\n reject(error);\n return;\n }\n\n if (info.done) {\n resolve(value);\n } else {\n Promise.resolve(value).then(_next, _throw);\n }\n}\n\nfunction _asyncToGenerator(fn) {\n return function () {\n var self = this,\n args = arguments;\n return new Promise(function (resolve, reject) {\n var gen = fn.apply(self, args);\n\n function _next(value) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value);\n }\n\n function _throw(err) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err);\n }\n\n _next(undefined);\n });\n };\n}\n\nmodule.exports = _asyncToGenerator;\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/asyncToGenerator.js?");
|
357 |
+
|
358 |
+
/***/ }),
|
359 |
+
|
360 |
+
/***/ "./node_modules/@babel/runtime/helpers/classCallCheck.js":
|
361 |
+
/*!***************************************************************!*\
|
362 |
+
!*** ./node_modules/@babel/runtime/helpers/classCallCheck.js ***!
|
363 |
+
\***************************************************************/
|
364 |
+
/*! no static exports found */
|
365 |
+
/***/ (function(module, exports) {
|
366 |
+
|
367 |
+
eval("function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nmodule.exports = _classCallCheck;\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/classCallCheck.js?");
|
368 |
+
|
369 |
+
/***/ }),
|
370 |
+
|
371 |
+
/***/ "./node_modules/@babel/runtime/helpers/construct.js":
|
372 |
+
/*!**********************************************************!*\
|
373 |
+
!*** ./node_modules/@babel/runtime/helpers/construct.js ***!
|
374 |
+
\**********************************************************/
|
375 |
+
/*! no static exports found */
|
376 |
+
/***/ (function(module, exports, __webpack_require__) {
|
377 |
+
|
378 |
+
eval("var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf */ \"./node_modules/@babel/runtime/helpers/setPrototypeOf.js\");\n\nvar isNativeReflectConstruct = __webpack_require__(/*! ./isNativeReflectConstruct */ \"./node_modules/@babel/runtime/helpers/isNativeReflectConstruct.js\");\n\nfunction _construct(Parent, args, Class) {\n if (isNativeReflectConstruct()) {\n module.exports = _construct = Reflect.construct;\n } else {\n module.exports = _construct = function _construct(Parent, args, Class) {\n var a = [null];\n a.push.apply(a, args);\n var Constructor = Function.bind.apply(Parent, a);\n var instance = new Constructor();\n if (Class) setPrototypeOf(instance, Class.prototype);\n return instance;\n };\n }\n\n return _construct.apply(null, arguments);\n}\n\nmodule.exports = _construct;\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/construct.js?");
|
379 |
+
|
380 |
+
/***/ }),
|
381 |
+
|
382 |
+
/***/ "./node_modules/@babel/runtime/helpers/defineProperty.js":
|
383 |
+
/*!***************************************************************!*\
|
384 |
+
!*** ./node_modules/@babel/runtime/helpers/defineProperty.js ***!
|
385 |
+
\***************************************************************/
|
386 |
+
/*! no static exports found */
|
387 |
+
/***/ (function(module, exports) {
|
388 |
+
|
389 |
+
eval("function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nmodule.exports = _defineProperty;\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/defineProperty.js?");
|
390 |
+
|
391 |
+
/***/ }),
|
392 |
+
|
393 |
+
/***/ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js":
|
394 |
+
/*!**************************************************************************!*\
|
395 |
+
!*** ./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js ***!
|
396 |
+
\**************************************************************************/
|
397 |
+
/*! exports provided: default */
|
398 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
399 |
+
|
400 |
+
"use strict";
|
401 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return _assertThisInitialized; });\nfunction _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js?");
|
402 |
+
|
403 |
+
/***/ }),
|
404 |
+
|
405 |
+
/***/ "./node_modules/@babel/runtime/helpers/esm/extends.js":
|
406 |
+
/*!************************************************************!*\
|
407 |
+
!*** ./node_modules/@babel/runtime/helpers/esm/extends.js ***!
|
408 |
+
\************************************************************/
|
409 |
+
/*! exports provided: default */
|
410 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
411 |
+
|
412 |
+
"use strict";
|
413 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return _extends; });\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/esm/extends.js?");
|
414 |
+
|
415 |
+
/***/ }),
|
416 |
+
|
417 |
+
/***/ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js":
|
418 |
+
/*!******************************************************************!*\
|
419 |
+
!*** ./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js ***!
|
420 |
+
\******************************************************************/
|
421 |
+
/*! exports provided: default */
|
422 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
423 |
+
|
424 |
+
"use strict";
|
425 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return _inheritsLoose; });\nfunction _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js?");
|
426 |
+
|
427 |
+
/***/ }),
|
428 |
+
|
429 |
+
/***/ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js":
|
430 |
+
/*!*********************************************************************************!*\
|
431 |
+
!*** ./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js ***!
|
432 |
+
\*********************************************************************************/
|
433 |
+
/*! exports provided: default */
|
434 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
435 |
+
|
436 |
+
"use strict";
|
437 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return _objectWithoutPropertiesLoose; });\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js?");
|
438 |
+
|
439 |
+
/***/ }),
|
440 |
+
|
441 |
+
/***/ "./node_modules/@babel/runtime/helpers/extends.js":
|
442 |
+
/*!********************************************************!*\
|
443 |
+
!*** ./node_modules/@babel/runtime/helpers/extends.js ***!
|
444 |
+
\********************************************************/
|
445 |
+
/*! no static exports found */
|
446 |
+
/***/ (function(module, exports) {
|
447 |
+
|
448 |
+
eval("function _extends() {\n module.exports = _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\nmodule.exports = _extends;\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/extends.js?");
|
449 |
+
|
450 |
+
/***/ }),
|
451 |
+
|
452 |
+
/***/ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js":
|
453 |
+
/*!***************************************************************!*\
|
454 |
+
!*** ./node_modules/@babel/runtime/helpers/getPrototypeOf.js ***!
|
455 |
+
\***************************************************************/
|
456 |
+
/*! no static exports found */
|
457 |
+
/***/ (function(module, exports) {
|
458 |
+
|
459 |
+
eval("function _getPrototypeOf(o) {\n module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}\n\nmodule.exports = _getPrototypeOf;\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/getPrototypeOf.js?");
|
460 |
+
|
461 |
+
/***/ }),
|
462 |
+
|
463 |
+
/***/ "./node_modules/@babel/runtime/helpers/inherits.js":
|
464 |
+
/*!*********************************************************!*\
|
465 |
+
!*** ./node_modules/@babel/runtime/helpers/inherits.js ***!
|
466 |
+
\*********************************************************/
|
467 |
+
/*! no static exports found */
|
468 |
+
/***/ (function(module, exports, __webpack_require__) {
|
469 |
+
|
470 |
+
eval("var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf */ \"./node_modules/@babel/runtime/helpers/setPrototypeOf.js\");\n\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n if (superClass) setPrototypeOf(subClass, superClass);\n}\n\nmodule.exports = _inherits;\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/inherits.js?");
|
471 |
+
|
472 |
+
/***/ }),
|
473 |
+
|
474 |
+
/***/ "./node_modules/@babel/runtime/helpers/isNativeFunction.js":
|
475 |
+
/*!*****************************************************************!*\
|
476 |
+
!*** ./node_modules/@babel/runtime/helpers/isNativeFunction.js ***!
|
477 |
+
\*****************************************************************/
|
478 |
+
/*! no static exports found */
|
479 |
+
/***/ (function(module, exports) {
|
480 |
+
|
481 |
+
eval("function _isNativeFunction(fn) {\n return Function.toString.call(fn).indexOf(\"[native code]\") !== -1;\n}\n\nmodule.exports = _isNativeFunction;\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/isNativeFunction.js?");
|
482 |
+
|
483 |
+
/***/ }),
|
484 |
+
|
485 |
+
/***/ "./node_modules/@babel/runtime/helpers/isNativeReflectConstruct.js":
|
486 |
+
/*!*************************************************************************!*\
|
487 |
+
!*** ./node_modules/@babel/runtime/helpers/isNativeReflectConstruct.js ***!
|
488 |
+
\*************************************************************************/
|
489 |
+
/*! no static exports found */
|
490 |
+
/***/ (function(module, exports) {
|
491 |
+
|
492 |
+
eval("function _isNativeReflectConstruct() {\n if (typeof Reflect === \"undefined\" || !Reflect.construct) return false;\n if (Reflect.construct.sham) return false;\n if (typeof Proxy === \"function\") return true;\n\n try {\n Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));\n return true;\n } catch (e) {\n return false;\n }\n}\n\nmodule.exports = _isNativeReflectConstruct;\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/isNativeReflectConstruct.js?");
|
493 |
+
|
494 |
+
/***/ }),
|
495 |
+
|
496 |
+
/***/ "./node_modules/@babel/runtime/helpers/iterableToArray.js":
|
497 |
+
/*!****************************************************************!*\
|
498 |
+
!*** ./node_modules/@babel/runtime/helpers/iterableToArray.js ***!
|
499 |
+
\****************************************************************/
|
500 |
+
/*! no static exports found */
|
501 |
+
/***/ (function(module, exports) {
|
502 |
+
|
503 |
+
eval("function _iterableToArray(iter) {\n if (typeof Symbol !== \"undefined\" && Symbol.iterator in Object(iter)) return Array.from(iter);\n}\n\nmodule.exports = _iterableToArray;\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/iterableToArray.js?");
|
504 |
+
|
505 |
+
/***/ }),
|
506 |
+
|
507 |
+
/***/ "./node_modules/@babel/runtime/helpers/iterableToArrayLimit.js":
|
508 |
+
/*!*********************************************************************!*\
|
509 |
+
!*** ./node_modules/@babel/runtime/helpers/iterableToArrayLimit.js ***!
|
510 |
+
\*********************************************************************/
|
511 |
+
/*! no static exports found */
|
512 |
+
/***/ (function(module, exports) {
|
513 |
+
|
514 |
+
eval("function _iterableToArrayLimit(arr, i) {\n if (typeof Symbol === \"undefined\" || !(Symbol.iterator in Object(arr))) return;\n var _arr = [];\n var _n = true;\n var _d = false;\n var _e = undefined;\n\n try {\n for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i[\"return\"] != null) _i[\"return\"]();\n } finally {\n if (_d) throw _e;\n }\n }\n\n return _arr;\n}\n\nmodule.exports = _iterableToArrayLimit;\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/iterableToArrayLimit.js?");
|
515 |
+
|
516 |
+
/***/ }),
|
517 |
+
|
518 |
+
/***/ "./node_modules/@babel/runtime/helpers/nonIterableRest.js":
|
519 |
+
/*!****************************************************************!*\
|
520 |
+
!*** ./node_modules/@babel/runtime/helpers/nonIterableRest.js ***!
|
521 |
+
\****************************************************************/
|
522 |
+
/*! no static exports found */
|
523 |
+
/***/ (function(module, exports) {
|
524 |
+
|
525 |
+
eval("function _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\nmodule.exports = _nonIterableRest;\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/nonIterableRest.js?");
|
526 |
+
|
527 |
+
/***/ }),
|
528 |
+
|
529 |
+
/***/ "./node_modules/@babel/runtime/helpers/nonIterableSpread.js":
|
530 |
+
/*!******************************************************************!*\
|
531 |
+
!*** ./node_modules/@babel/runtime/helpers/nonIterableSpread.js ***!
|
532 |
+
\******************************************************************/
|
533 |
+
/*! no static exports found */
|
534 |
+
/***/ (function(module, exports) {
|
535 |
+
|
536 |
+
eval("function _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\nmodule.exports = _nonIterableSpread;\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/nonIterableSpread.js?");
|
537 |
+
|
538 |
+
/***/ }),
|
539 |
+
|
540 |
+
/***/ "./node_modules/@babel/runtime/helpers/objectWithoutProperties.js":
|
541 |
+
/*!************************************************************************!*\
|
542 |
+
!*** ./node_modules/@babel/runtime/helpers/objectWithoutProperties.js ***!
|
543 |
+
\************************************************************************/
|
544 |
+
/*! no static exports found */
|
545 |
+
/***/ (function(module, exports, __webpack_require__) {
|
546 |
+
|
547 |
+
eval("var objectWithoutPropertiesLoose = __webpack_require__(/*! ./objectWithoutPropertiesLoose */ \"./node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js\");\n\nfunction _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n var target = objectWithoutPropertiesLoose(source, excluded);\n var key, i;\n\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n\n return target;\n}\n\nmodule.exports = _objectWithoutProperties;\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/objectWithoutProperties.js?");
|
548 |
+
|
549 |
+
/***/ }),
|
550 |
+
|
551 |
+
/***/ "./node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js":
|
552 |
+
/*!*****************************************************************************!*\
|
553 |
+
!*** ./node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js ***!
|
554 |
+
\*****************************************************************************/
|
555 |
+
/*! no static exports found */
|
556 |
+
/***/ (function(module, exports) {
|
557 |
+
|
558 |
+
eval("function _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n\nmodule.exports = _objectWithoutPropertiesLoose;\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js?");
|
559 |
+
|
560 |
+
/***/ }),
|
561 |
+
|
562 |
+
/***/ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js":
|
563 |
+
/*!**************************************************************************!*\
|
564 |
+
!*** ./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js ***!
|
565 |
+
\**************************************************************************/
|
566 |
+
/*! no static exports found */
|
567 |
+
/***/ (function(module, exports, __webpack_require__) {
|
568 |
+
|
569 |
+
eval("var _typeof = __webpack_require__(/*! ../helpers/typeof */ \"./node_modules/@babel/runtime/helpers/typeof.js\");\n\nvar assertThisInitialized = __webpack_require__(/*! ./assertThisInitialized */ \"./node_modules/@babel/runtime/helpers/assertThisInitialized.js\");\n\nfunction _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n }\n\n return assertThisInitialized(self);\n}\n\nmodule.exports = _possibleConstructorReturn;\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js?");
|
570 |
+
|
571 |
+
/***/ }),
|
572 |
+
|
573 |
+
/***/ "./node_modules/@babel/runtime/helpers/setPrototypeOf.js":
|
574 |
+
/*!***************************************************************!*\
|
575 |
+
!*** ./node_modules/@babel/runtime/helpers/setPrototypeOf.js ***!
|
576 |
+
\***************************************************************/
|
577 |
+
/*! no static exports found */
|
578 |
+
/***/ (function(module, exports) {
|
579 |
+
|
580 |
+
eval("function _setPrototypeOf(o, p) {\n module.exports = _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nmodule.exports = _setPrototypeOf;\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/setPrototypeOf.js?");
|
581 |
+
|
582 |
+
/***/ }),
|
583 |
+
|
584 |
+
/***/ "./node_modules/@babel/runtime/helpers/slicedToArray.js":
|
585 |
+
/*!**************************************************************!*\
|
586 |
+
!*** ./node_modules/@babel/runtime/helpers/slicedToArray.js ***!
|
587 |
+
\**************************************************************/
|
588 |
+
/*! no static exports found */
|
589 |
+
/***/ (function(module, exports, __webpack_require__) {
|
590 |
+
|
591 |
+
eval("var arrayWithHoles = __webpack_require__(/*! ./arrayWithHoles */ \"./node_modules/@babel/runtime/helpers/arrayWithHoles.js\");\n\nvar iterableToArrayLimit = __webpack_require__(/*! ./iterableToArrayLimit */ \"./node_modules/@babel/runtime/helpers/iterableToArrayLimit.js\");\n\nvar unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray */ \"./node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js\");\n\nvar nonIterableRest = __webpack_require__(/*! ./nonIterableRest */ \"./node_modules/@babel/runtime/helpers/nonIterableRest.js\");\n\nfunction _slicedToArray(arr, i) {\n return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();\n}\n\nmodule.exports = _slicedToArray;\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/slicedToArray.js?");
|
592 |
+
|
593 |
+
/***/ }),
|
594 |
+
|
595 |
+
/***/ "./node_modules/@babel/runtime/helpers/toConsumableArray.js":
|
596 |
+
/*!******************************************************************!*\
|
597 |
+
!*** ./node_modules/@babel/runtime/helpers/toConsumableArray.js ***!
|
598 |
+
\******************************************************************/
|
599 |
+
/*! no static exports found */
|
600 |
+
/***/ (function(module, exports, __webpack_require__) {
|
601 |
+
|
602 |
+
eval("var arrayWithoutHoles = __webpack_require__(/*! ./arrayWithoutHoles */ \"./node_modules/@babel/runtime/helpers/arrayWithoutHoles.js\");\n\nvar iterableToArray = __webpack_require__(/*! ./iterableToArray */ \"./node_modules/@babel/runtime/helpers/iterableToArray.js\");\n\nvar unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray */ \"./node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js\");\n\nvar nonIterableSpread = __webpack_require__(/*! ./nonIterableSpread */ \"./node_modules/@babel/runtime/helpers/nonIterableSpread.js\");\n\nfunction _toConsumableArray(arr) {\n return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();\n}\n\nmodule.exports = _toConsumableArray;\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/toConsumableArray.js?");
|
603 |
+
|
604 |
+
/***/ }),
|
605 |
+
|
606 |
+
/***/ "./node_modules/@babel/runtime/helpers/typeof.js":
|
607 |
+
/*!*******************************************************!*\
|
608 |
+
!*** ./node_modules/@babel/runtime/helpers/typeof.js ***!
|
609 |
+
\*******************************************************/
|
610 |
+
/*! no static exports found */
|
611 |
+
/***/ (function(module, exports) {
|
612 |
+
|
613 |
+
eval("function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n module.exports = _typeof = function _typeof(obj) {\n return typeof obj;\n };\n } else {\n module.exports = _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}\n\nmodule.exports = _typeof;\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/typeof.js?");
|
614 |
+
|
615 |
+
/***/ }),
|
616 |
+
|
617 |
+
/***/ "./node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js":
|
618 |
+
/*!***************************************************************************!*\
|
619 |
+
!*** ./node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js ***!
|
620 |
+
\***************************************************************************/
|
621 |
+
/*! no static exports found */
|
622 |
+
/***/ (function(module, exports, __webpack_require__) {
|
623 |
+
|
624 |
+
eval("var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray */ \"./node_modules/@babel/runtime/helpers/arrayLikeToArray.js\");\n\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(n);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);\n}\n\nmodule.exports = _unsupportedIterableToArray;\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js?");
|
625 |
+
|
626 |
+
/***/ }),
|
627 |
+
|
628 |
+
/***/ "./node_modules/@babel/runtime/helpers/wrapNativeSuper.js":
|
629 |
+
/*!****************************************************************!*\
|
630 |
+
!*** ./node_modules/@babel/runtime/helpers/wrapNativeSuper.js ***!
|
631 |
+
\****************************************************************/
|
632 |
+
/*! no static exports found */
|
633 |
+
/***/ (function(module, exports, __webpack_require__) {
|
634 |
+
|
635 |
+
eval("var getPrototypeOf = __webpack_require__(/*! ./getPrototypeOf */ \"./node_modules/@babel/runtime/helpers/getPrototypeOf.js\");\n\nvar setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf */ \"./node_modules/@babel/runtime/helpers/setPrototypeOf.js\");\n\nvar isNativeFunction = __webpack_require__(/*! ./isNativeFunction */ \"./node_modules/@babel/runtime/helpers/isNativeFunction.js\");\n\nvar construct = __webpack_require__(/*! ./construct */ \"./node_modules/@babel/runtime/helpers/construct.js\");\n\nfunction _wrapNativeSuper(Class) {\n var _cache = typeof Map === \"function\" ? new Map() : undefined;\n\n module.exports = _wrapNativeSuper = function _wrapNativeSuper(Class) {\n if (Class === null || !isNativeFunction(Class)) return Class;\n\n if (typeof Class !== \"function\") {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n if (typeof _cache !== \"undefined\") {\n if (_cache.has(Class)) return _cache.get(Class);\n\n _cache.set(Class, Wrapper);\n }\n\n function Wrapper() {\n return construct(Class, arguments, getPrototypeOf(this).constructor);\n }\n\n Wrapper.prototype = Object.create(Class.prototype, {\n constructor: {\n value: Wrapper,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n return setPrototypeOf(Wrapper, Class);\n };\n\n return _wrapNativeSuper(Class);\n}\n\nmodule.exports = _wrapNativeSuper;\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/wrapNativeSuper.js?");
|
636 |
+
|
637 |
+
/***/ }),
|
638 |
+
|
639 |
+
/***/ "./node_modules/classnames/index.js":
|
640 |
+
/*!******************************************!*\
|
641 |
+
!*** ./node_modules/classnames/index.js ***!
|
642 |
+
\******************************************/
|
643 |
+
/*! no static exports found */
|
644 |
+
/***/ (function(module, exports, __webpack_require__) {
|
645 |
+
|
646 |
+
eval("var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!\n Copyright (c) 2017 Jed Watson.\n Licensed under the MIT License (MIT), see\n http://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames () {\n\t\tvar classes = [];\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (!arg) continue;\n\n\t\t\tvar argType = typeof arg;\n\n\t\t\tif (argType === 'string' || argType === 'number') {\n\t\t\t\tclasses.push(arg);\n\t\t\t} else if (Array.isArray(arg) && arg.length) {\n\t\t\t\tvar inner = classNames.apply(null, arg);\n\t\t\t\tif (inner) {\n\t\t\t\t\tclasses.push(inner);\n\t\t\t\t}\n\t\t\t} else if (argType === 'object') {\n\t\t\t\tfor (var key in arg) {\n\t\t\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\t\t\tclasses.push(key);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn classes.join(' ');\n\t}\n\n\tif ( true && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (true) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\t!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () {\n\t\t\treturn classNames;\n\t\t}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\t} else {}\n}());\n\n\n//# sourceURL=webpack:///./node_modules/classnames/index.js?");
|
647 |
+
|
648 |
+
/***/ }),
|
649 |
+
|
650 |
+
/***/ "./node_modules/dom-helpers/esm/addClass.js":
|
651 |
+
/*!**************************************************!*\
|
652 |
+
!*** ./node_modules/dom-helpers/esm/addClass.js ***!
|
653 |
+
\**************************************************/
|
654 |
+
/*! exports provided: default */
|
655 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
656 |
+
|
657 |
+
"use strict";
|
658 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return addClass; });\n/* harmony import */ var _hasClass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./hasClass */ \"./node_modules/dom-helpers/esm/hasClass.js\");\n\nfunction addClass(element, className) {\n if (element.classList) element.classList.add(className);else if (!Object(_hasClass__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(element, className)) if (typeof element.className === 'string') element.className = element.className + \" \" + className;else element.setAttribute('class', (element.className && element.className.baseVal || '') + \" \" + className);\n}\n\n//# sourceURL=webpack:///./node_modules/dom-helpers/esm/addClass.js?");
|
659 |
+
|
660 |
+
/***/ }),
|
661 |
+
|
662 |
+
/***/ "./node_modules/dom-helpers/esm/hasClass.js":
|
663 |
+
/*!**************************************************!*\
|
664 |
+
!*** ./node_modules/dom-helpers/esm/hasClass.js ***!
|
665 |
+
\**************************************************/
|
666 |
+
/*! exports provided: default */
|
667 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
668 |
+
|
669 |
+
"use strict";
|
670 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return hasClass; });\nfunction hasClass(element, className) {\n if (element.classList) return !!className && element.classList.contains(className);\n return (\" \" + (element.className.baseVal || element.className) + \" \").indexOf(\" \" + className + \" \") !== -1;\n}\n\n//# sourceURL=webpack:///./node_modules/dom-helpers/esm/hasClass.js?");
|
671 |
+
|
672 |
+
/***/ }),
|
673 |
+
|
674 |
+
/***/ "./node_modules/dom-helpers/esm/removeClass.js":
|
675 |
+
/*!*****************************************************!*\
|
676 |
+
!*** ./node_modules/dom-helpers/esm/removeClass.js ***!
|
677 |
+
\*****************************************************/
|
678 |
+
/*! exports provided: default */
|
679 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
680 |
+
|
681 |
+
"use strict";
|
682 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return removeClass; });\nfunction replaceClassName(origClass, classToRemove) {\n return origClass.replace(new RegExp(\"(^|\\\\s)\" + classToRemove + \"(?:\\\\s|$)\", 'g'), '$1').replace(/\\s+/g, ' ').replace(/^\\s*|\\s*$/g, '');\n}\n\nfunction removeClass(element, className) {\n if (element.classList) {\n element.classList.remove(className);\n } else if (typeof element.className === 'string') {\n ;\n element.className = replaceClassName(element.className, className);\n } else {\n element.setAttribute('class', replaceClassName(element.className && element.className.baseVal || '', className));\n }\n}\n\n//# sourceURL=webpack:///./node_modules/dom-helpers/esm/removeClass.js?");
|
683 |
+
|
684 |
+
/***/ }),
|
685 |
+
|
686 |
+
/***/ "./node_modules/js-cookie/src/js.cookie.js":
|
687 |
+
/*!*************************************************!*\
|
688 |
+
!*** ./node_modules/js-cookie/src/js.cookie.js ***!
|
689 |
+
\*************************************************/
|
690 |
+
/*! no static exports found */
|
691 |
+
/***/ (function(module, exports, __webpack_require__) {
|
692 |
+
|
693 |
+
eval("var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!\n * JavaScript Cookie v2.2.1\n * https://github.com/js-cookie/js-cookie\n *\n * Copyright 2006, 2015 Klaus Hartl & Fagner Brack\n * Released under the MIT license\n */\n;(function (factory) {\n\tvar registeredInModuleLoader;\n\tif (true) {\n\t\t!(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?\n\t\t\t\t(__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) :\n\t\t\t\t__WEBPACK_AMD_DEFINE_FACTORY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\t\tregisteredInModuleLoader = true;\n\t}\n\tif (true) {\n\t\tmodule.exports = factory();\n\t\tregisteredInModuleLoader = true;\n\t}\n\tif (!registeredInModuleLoader) {\n\t\tvar OldCookies = window.Cookies;\n\t\tvar api = window.Cookies = factory();\n\t\tapi.noConflict = function () {\n\t\t\twindow.Cookies = OldCookies;\n\t\t\treturn api;\n\t\t};\n\t}\n}(function () {\n\tfunction extend () {\n\t\tvar i = 0;\n\t\tvar result = {};\n\t\tfor (; i < arguments.length; i++) {\n\t\t\tvar attributes = arguments[ i ];\n\t\t\tfor (var key in attributes) {\n\t\t\t\tresult[key] = attributes[key];\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}\n\n\tfunction decode (s) {\n\t\treturn s.replace(/(%[0-9A-Z]{2})+/g, decodeURIComponent);\n\t}\n\n\tfunction init (converter) {\n\t\tfunction api() {}\n\n\t\tfunction set (key, value, attributes) {\n\t\t\tif (typeof document === 'undefined') {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tattributes = extend({\n\t\t\t\tpath: '/'\n\t\t\t}, api.defaults, attributes);\n\n\t\t\tif (typeof attributes.expires === 'number') {\n\t\t\t\tattributes.expires = new Date(new Date() * 1 + attributes.expires * 864e+5);\n\t\t\t}\n\n\t\t\t// We're using \"expires\" because \"max-age\" is not supported by IE\n\t\t\tattributes.expires = attributes.expires ? attributes.expires.toUTCString() : '';\n\n\t\t\ttry {\n\t\t\t\tvar result = JSON.stringify(value);\n\t\t\t\tif (/^[\\{\\[]/.test(result)) {\n\t\t\t\t\tvalue = result;\n\t\t\t\t}\n\t\t\t} catch (e) {}\n\n\t\t\tvalue = converter.write ?\n\t\t\t\tconverter.write(value, key) :\n\t\t\t\tencodeURIComponent(String(value))\n\t\t\t\t\t.replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent);\n\n\t\t\tkey = encodeURIComponent(String(key))\n\t\t\t\t.replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent)\n\t\t\t\t.replace(/[\\(\\)]/g, escape);\n\n\t\t\tvar stringifiedAttributes = '';\n\t\t\tfor (var attributeName in attributes) {\n\t\t\t\tif (!attributes[attributeName]) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tstringifiedAttributes += '; ' + attributeName;\n\t\t\t\tif (attributes[attributeName] === true) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Considers RFC 6265 section 5.2:\n\t\t\t\t// ...\n\t\t\t\t// 3. If the remaining unparsed-attributes contains a %x3B (\";\")\n\t\t\t\t// character:\n\t\t\t\t// Consume the characters of the unparsed-attributes up to,\n\t\t\t\t// not including, the first %x3B (\";\") character.\n\t\t\t\t// ...\n\t\t\t\tstringifiedAttributes += '=' + attributes[attributeName].split(';')[0];\n\t\t\t}\n\n\t\t\treturn (document.cookie = key + '=' + value + stringifiedAttributes);\n\t\t}\n\n\t\tfunction get (key, json) {\n\t\t\tif (typeof document === 'undefined') {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar jar = {};\n\t\t\t// To prevent the for loop in the first place assign an empty array\n\t\t\t// in case there are no cookies at all.\n\t\t\tvar cookies = document.cookie ? document.cookie.split('; ') : [];\n\t\t\tvar i = 0;\n\n\t\t\tfor (; i < cookies.length; i++) {\n\t\t\t\tvar parts = cookies[i].split('=');\n\t\t\t\tvar cookie = parts.slice(1).join('=');\n\n\t\t\t\tif (!json && cookie.charAt(0) === '\"') {\n\t\t\t\t\tcookie = cookie.slice(1, -1);\n\t\t\t\t}\n\n\t\t\t\ttry {\n\t\t\t\t\tvar name = decode(parts[0]);\n\t\t\t\t\tcookie = (converter.read || converter)(cookie, name) ||\n\t\t\t\t\t\tdecode(cookie);\n\n\t\t\t\t\tif (json) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tcookie = JSON.parse(cookie);\n\t\t\t\t\t\t} catch (e) {}\n\t\t\t\t\t}\n\n\t\t\t\t\tjar[name] = cookie;\n\n\t\t\t\t\tif (key === name) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t} catch (e) {}\n\t\t\t}\n\n\t\t\treturn key ? jar[key] : jar;\n\t\t}\n\n\t\tapi.set = set;\n\t\tapi.get = function (key) {\n\t\t\treturn get(key, false /* read as raw */);\n\t\t};\n\t\tapi.getJSON = function (key) {\n\t\t\treturn get(key, true /* read as json */);\n\t\t};\n\t\tapi.remove = function (key, attributes) {\n\t\t\tset(key, '', extend(attributes, {\n\t\t\t\texpires: -1\n\t\t\t}));\n\t\t};\n\n\t\tapi.defaults = {};\n\n\t\tapi.withConverter = init;\n\n\t\treturn api;\n\t}\n\n\treturn init(function () {});\n}));\n\n\n//# sourceURL=webpack:///./node_modules/js-cookie/src/js.cookie.js?");
|
694 |
+
|
695 |
+
/***/ }),
|
696 |
+
|
697 |
+
/***/ "./node_modules/object-assign/index.js":
|
698 |
+
/*!*********************************************!*\
|
699 |
+
!*** ./node_modules/object-assign/index.js ***!
|
700 |
+
\*********************************************/
|
701 |
+
/*! no static exports found */
|
702 |
+
/***/ (function(module, exports, __webpack_require__) {
|
703 |
+
|
704 |
+
"use strict";
|
705 |
+
eval("/*\nobject-assign\n(c) Sindre Sorhus\n@license MIT\n*/\n\n\n/* eslint-disable no-unused-vars */\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nvar propIsEnumerable = Object.prototype.propertyIsEnumerable;\n\nfunction toObject(val) {\n\tif (val === null || val === undefined) {\n\t\tthrow new TypeError('Object.assign cannot be called with null or undefined');\n\t}\n\n\treturn Object(val);\n}\n\nfunction shouldUseNative() {\n\ttry {\n\t\tif (!Object.assign) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Detect buggy property enumeration order in older V8 versions.\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=4118\n\t\tvar test1 = new String('abc'); // eslint-disable-line no-new-wrappers\n\t\ttest1[5] = 'de';\n\t\tif (Object.getOwnPropertyNames(test1)[0] === '5') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test2 = {};\n\t\tfor (var i = 0; i < 10; i++) {\n\t\t\ttest2['_' + String.fromCharCode(i)] = i;\n\t\t}\n\t\tvar order2 = Object.getOwnPropertyNames(test2).map(function (n) {\n\t\t\treturn test2[n];\n\t\t});\n\t\tif (order2.join('') !== '0123456789') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test3 = {};\n\t\t'abcdefghijklmnopqrst'.split('').forEach(function (letter) {\n\t\t\ttest3[letter] = letter;\n\t\t});\n\t\tif (Object.keys(Object.assign({}, test3)).join('') !==\n\t\t\t\t'abcdefghijklmnopqrst') {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t} catch (err) {\n\t\t// We don't expect any of the above to throw, but better to be safe.\n\t\treturn false;\n\t}\n}\n\nmodule.exports = shouldUseNative() ? Object.assign : function (target, source) {\n\tvar from;\n\tvar to = toObject(target);\n\tvar symbols;\n\n\tfor (var s = 1; s < arguments.length; s++) {\n\t\tfrom = Object(arguments[s]);\n\n\t\tfor (var key in from) {\n\t\t\tif (hasOwnProperty.call(from, key)) {\n\t\t\t\tto[key] = from[key];\n\t\t\t}\n\t\t}\n\n\t\tif (getOwnPropertySymbols) {\n\t\t\tsymbols = getOwnPropertySymbols(from);\n\t\t\tfor (var i = 0; i < symbols.length; i++) {\n\t\t\t\tif (propIsEnumerable.call(from, symbols[i])) {\n\t\t\t\t\tto[symbols[i]] = from[symbols[i]];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn to;\n};\n\n\n//# sourceURL=webpack:///./node_modules/object-assign/index.js?");
|
706 |
+
|
707 |
+
/***/ }),
|
708 |
+
|
709 |
+
/***/ "./node_modules/prop-types/checkPropTypes.js":
|
710 |
+
/*!***************************************************!*\
|
711 |
+
!*** ./node_modules/prop-types/checkPropTypes.js ***!
|
712 |
+
\***************************************************/
|
713 |
+
/*! no static exports found */
|
714 |
+
/***/ (function(module, exports, __webpack_require__) {
|
715 |
+
|
716 |
+
"use strict";
|
717 |
+
eval("/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\n\nvar printWarning = function() {};\n\nif (undefined !== 'production') {\n var ReactPropTypesSecret = __webpack_require__(/*! ./lib/ReactPropTypesSecret */ \"./node_modules/prop-types/lib/ReactPropTypesSecret.js\");\n var loggedTypeFailures = {};\n var has = Function.call.bind(Object.prototype.hasOwnProperty);\n\n printWarning = function(text) {\n var message = 'Warning: ' + text;\n if (typeof console !== 'undefined') {\n console.error(message);\n }\n try {\n // --- Welcome to debugging React ---\n // This error was thrown as a convenience so that you can use this stack\n // to find the callsite that caused this warning to fire.\n throw new Error(message);\n } catch (x) {}\n };\n}\n\n/**\n * Assert that the values match with the type specs.\n * Error messages are memorized and will only be shown once.\n *\n * @param {object} typeSpecs Map of name to a ReactPropType\n * @param {object} values Runtime values that need to be type-checked\n * @param {string} location e.g. \"prop\", \"context\", \"child context\"\n * @param {string} componentName Name of the component for error messages.\n * @param {?Function} getStack Returns the component stack.\n * @private\n */\nfunction checkPropTypes(typeSpecs, values, location, componentName, getStack) {\n if (undefined !== 'production') {\n for (var typeSpecName in typeSpecs) {\n if (has(typeSpecs, typeSpecName)) {\n var error;\n // Prop type validation may throw. In case they do, we don't want to\n // fail the render phase where it didn't fail before. So we log it.\n // After these have been cleaned up, we'll let them throw.\n try {\n // This is intentionally an invariant that gets caught. It's the same\n // behavior as without this statement except with a better message.\n if (typeof typeSpecs[typeSpecName] !== 'function') {\n var err = Error(\n (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +\n 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.'\n );\n err.name = 'Invariant Violation';\n throw err;\n }\n error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);\n } catch (ex) {\n error = ex;\n }\n if (error && !(error instanceof Error)) {\n printWarning(\n (componentName || 'React class') + ': type specification of ' +\n location + ' `' + typeSpecName + '` is invalid; the type checker ' +\n 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +\n 'You may have forgotten to pass an argument to the type checker ' +\n 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +\n 'shape all require an argument).'\n );\n }\n if (error instanceof Error && !(error.message in loggedTypeFailures)) {\n // Only monitor this failure once because there tends to be a lot of the\n // same error.\n loggedTypeFailures[error.message] = true;\n\n var stack = getStack ? getStack() : '';\n\n printWarning(\n 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')\n );\n }\n }\n }\n }\n}\n\n/**\n * Resets warning cache when testing.\n *\n * @private\n */\ncheckPropTypes.resetWarningCache = function() {\n if (undefined !== 'production') {\n loggedTypeFailures = {};\n }\n}\n\nmodule.exports = checkPropTypes;\n\n\n//# sourceURL=webpack:///./node_modules/prop-types/checkPropTypes.js?");
|
718 |
+
|
719 |
+
/***/ }),
|
720 |
+
|
721 |
+
/***/ "./node_modules/prop-types/factoryWithThrowingShims.js":
|
722 |
+
/*!*************************************************************!*\
|
723 |
+
!*** ./node_modules/prop-types/factoryWithThrowingShims.js ***!
|
724 |
+
\*************************************************************/
|
725 |
+
/*! no static exports found */
|
726 |
+
/***/ (function(module, exports, __webpack_require__) {
|
727 |
+
|
728 |
+
"use strict";
|
729 |
+
eval("/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\n\nvar ReactPropTypesSecret = __webpack_require__(/*! ./lib/ReactPropTypesSecret */ \"./node_modules/prop-types/lib/ReactPropTypesSecret.js\");\n\nfunction emptyFunction() {}\nfunction emptyFunctionWithReset() {}\nemptyFunctionWithReset.resetWarningCache = emptyFunction;\n\nmodule.exports = function() {\n function shim(props, propName, componentName, location, propFullName, secret) {\n if (secret === ReactPropTypesSecret) {\n // It is still safe when called from React.\n return;\n }\n var err = new Error(\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use PropTypes.checkPropTypes() to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n err.name = 'Invariant Violation';\n throw err;\n };\n shim.isRequired = shim;\n function getShim() {\n return shim;\n };\n // Important!\n // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.\n var ReactPropTypes = {\n array: shim,\n bool: shim,\n func: shim,\n number: shim,\n object: shim,\n string: shim,\n symbol: shim,\n\n any: shim,\n arrayOf: getShim,\n element: shim,\n elementType: shim,\n instanceOf: getShim,\n node: shim,\n objectOf: getShim,\n oneOf: getShim,\n oneOfType: getShim,\n shape: getShim,\n exact: getShim,\n\n checkPropTypes: emptyFunctionWithReset,\n resetWarningCache: emptyFunction\n };\n\n ReactPropTypes.PropTypes = ReactPropTypes;\n\n return ReactPropTypes;\n};\n\n\n//# sourceURL=webpack:///./node_modules/prop-types/factoryWithThrowingShims.js?");
|
730 |
+
|
731 |
+
/***/ }),
|
732 |
+
|
733 |
+
/***/ "./node_modules/prop-types/factoryWithTypeCheckers.js":
|
734 |
+
/*!************************************************************!*\
|
735 |
+
!*** ./node_modules/prop-types/factoryWithTypeCheckers.js ***!
|
736 |
+
\************************************************************/
|
737 |
+
/*! no static exports found */
|
738 |
+
/***/ (function(module, exports, __webpack_require__) {
|
739 |
+
|
740 |
+
"use strict";
|
741 |
+
eval("/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\n\nvar ReactIs = __webpack_require__(/*! react-is */ \"./node_modules/react-is/index.js\");\nvar assign = __webpack_require__(/*! object-assign */ \"./node_modules/object-assign/index.js\");\n\nvar ReactPropTypesSecret = __webpack_require__(/*! ./lib/ReactPropTypesSecret */ \"./node_modules/prop-types/lib/ReactPropTypesSecret.js\");\nvar checkPropTypes = __webpack_require__(/*! ./checkPropTypes */ \"./node_modules/prop-types/checkPropTypes.js\");\n\nvar has = Function.call.bind(Object.prototype.hasOwnProperty);\nvar printWarning = function() {};\n\nif (undefined !== 'production') {\n printWarning = function(text) {\n var message = 'Warning: ' + text;\n if (typeof console !== 'undefined') {\n console.error(message);\n }\n try {\n // --- Welcome to debugging React ---\n // This error was thrown as a convenience so that you can use this stack\n // to find the callsite that caused this warning to fire.\n throw new Error(message);\n } catch (x) {}\n };\n}\n\nfunction emptyFunctionThatReturnsNull() {\n return null;\n}\n\nmodule.exports = function(isValidElement, throwOnDirectAccess) {\n /* global Symbol */\n var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;\n var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.\n\n /**\n * Returns the iterator method function contained on the iterable object.\n *\n * Be sure to invoke the function with the iterable as context:\n *\n * var iteratorFn = getIteratorFn(myIterable);\n * if (iteratorFn) {\n * var iterator = iteratorFn.call(myIterable);\n * ...\n * }\n *\n * @param {?object} maybeIterable\n * @return {?function}\n */\n function getIteratorFn(maybeIterable) {\n var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);\n if (typeof iteratorFn === 'function') {\n return iteratorFn;\n }\n }\n\n /**\n * Collection of methods that allow declaration and validation of props that are\n * supplied to React components. Example usage:\n *\n * var Props = require('ReactPropTypes');\n * var MyArticle = React.createClass({\n * propTypes: {\n * // An optional string prop named \"description\".\n * description: Props.string,\n *\n * // A required enum prop named \"category\".\n * category: Props.oneOf(['News','Photos']).isRequired,\n *\n * // A prop named \"dialog\" that requires an instance of Dialog.\n * dialog: Props.instanceOf(Dialog).isRequired\n * },\n * render: function() { ... }\n * });\n *\n * A more formal specification of how these methods are used:\n *\n * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)\n * decl := ReactPropTypes.{type}(.isRequired)?\n *\n * Each and every declaration produces a function with the same signature. This\n * allows the creation of custom validation functions. For example:\n *\n * var MyLink = React.createClass({\n * propTypes: {\n * // An optional string or URI prop named \"href\".\n * href: function(props, propName, componentName) {\n * var propValue = props[propName];\n * if (propValue != null && typeof propValue !== 'string' &&\n * !(propValue instanceof URI)) {\n * return new Error(\n * 'Expected a string or an URI for ' + propName + ' in ' +\n * componentName\n * );\n * }\n * }\n * },\n * render: function() {...}\n * });\n *\n * @internal\n */\n\n var ANONYMOUS = '<<anonymous>>';\n\n // Important!\n // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.\n var ReactPropTypes = {\n array: createPrimitiveTypeChecker('array'),\n bool: createPrimitiveTypeChecker('boolean'),\n func: createPrimitiveTypeChecker('function'),\n number: createPrimitiveTypeChecker('number'),\n object: createPrimitiveTypeChecker('object'),\n string: createPrimitiveTypeChecker('string'),\n symbol: createPrimitiveTypeChecker('symbol'),\n\n any: createAnyTypeChecker(),\n arrayOf: createArrayOfTypeChecker,\n element: createElementTypeChecker(),\n elementType: createElementTypeTypeChecker(),\n instanceOf: createInstanceTypeChecker,\n node: createNodeChecker(),\n objectOf: createObjectOfTypeChecker,\n oneOf: createEnumTypeChecker,\n oneOfType: createUnionTypeChecker,\n shape: createShapeTypeChecker,\n exact: createStrictShapeTypeChecker,\n };\n\n /**\n * inlined Object.is polyfill to avoid requiring consumers ship their own\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\n */\n /*eslint-disable no-self-compare*/\n function is(x, y) {\n // SameValue algorithm\n if (x === y) {\n // Steps 1-5, 7-10\n // Steps 6.b-6.e: +0 != -0\n return x !== 0 || 1 / x === 1 / y;\n } else {\n // Step 6.a: NaN == NaN\n return x !== x && y !== y;\n }\n }\n /*eslint-enable no-self-compare*/\n\n /**\n * We use an Error-like object for backward compatibility as people may call\n * PropTypes directly and inspect their output. However, we don't use real\n * Errors anymore. We don't inspect their stack anyway, and creating them\n * is prohibitively expensive if they are created too often, such as what\n * happens in oneOfType() for any type before the one that matched.\n */\n function PropTypeError(message) {\n this.message = message;\n this.stack = '';\n }\n // Make `instanceof Error` still work for returned errors.\n PropTypeError.prototype = Error.prototype;\n\n function createChainableTypeChecker(validate) {\n if (undefined !== 'production') {\n var manualPropTypeCallCache = {};\n var manualPropTypeWarningCount = 0;\n }\n function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {\n componentName = componentName || ANONYMOUS;\n propFullName = propFullName || propName;\n\n if (secret !== ReactPropTypesSecret) {\n if (throwOnDirectAccess) {\n // New behavior only for users of `prop-types` package\n var err = new Error(\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use `PropTypes.checkPropTypes()` to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n err.name = 'Invariant Violation';\n throw err;\n } else if (undefined !== 'production' && typeof console !== 'undefined') {\n // Old behavior for people using React.PropTypes\n var cacheKey = componentName + ':' + propName;\n if (\n !manualPropTypeCallCache[cacheKey] &&\n // Avoid spamming the console because they are often not actionable except for lib authors\n manualPropTypeWarningCount < 3\n ) {\n printWarning(\n 'You are manually calling a React.PropTypes validation ' +\n 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +\n 'and will throw in the standalone `prop-types` package. ' +\n 'You may be seeing this warning due to a third-party PropTypes ' +\n 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'\n );\n manualPropTypeCallCache[cacheKey] = true;\n manualPropTypeWarningCount++;\n }\n }\n }\n if (props[propName] == null) {\n if (isRequired) {\n if (props[propName] === null) {\n return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));\n }\n return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));\n }\n return null;\n } else {\n return validate(props, propName, componentName, location, propFullName);\n }\n }\n\n var chainedCheckType = checkType.bind(null, false);\n chainedCheckType.isRequired = checkType.bind(null, true);\n\n return chainedCheckType;\n }\n\n function createPrimitiveTypeChecker(expectedType) {\n function validate(props, propName, componentName, location, propFullName, secret) {\n var propValue = props[propName];\n var propType = getPropType(propValue);\n if (propType !== expectedType) {\n // `propValue` being instance of, say, date/regexp, pass the 'object'\n // check, but we can offer a more precise error message here rather than\n // 'of type `object`'.\n var preciseType = getPreciseType(propValue);\n\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createAnyTypeChecker() {\n return createChainableTypeChecker(emptyFunctionThatReturnsNull);\n }\n\n function createArrayOfTypeChecker(typeChecker) {\n function validate(props, propName, componentName, location, propFullName) {\n if (typeof typeChecker !== 'function') {\n return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');\n }\n var propValue = props[propName];\n if (!Array.isArray(propValue)) {\n var propType = getPropType(propValue);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));\n }\n for (var i = 0; i < propValue.length; i++) {\n var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);\n if (error instanceof Error) {\n return error;\n }\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createElementTypeChecker() {\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n if (!isValidElement(propValue)) {\n var propType = getPropType(propValue);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createElementTypeTypeChecker() {\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n if (!ReactIs.isValidElementType(propValue)) {\n var propType = getPropType(propValue);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createInstanceTypeChecker(expectedClass) {\n function validate(props, propName, componentName, location, propFullName) {\n if (!(props[propName] instanceof expectedClass)) {\n var expectedClassName = expectedClass.name || ANONYMOUS;\n var actualClassName = getClassName(props[propName]);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createEnumTypeChecker(expectedValues) {\n if (!Array.isArray(expectedValues)) {\n if (undefined !== 'production') {\n if (arguments.length > 1) {\n printWarning(\n 'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' +\n 'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).'\n );\n } else {\n printWarning('Invalid argument supplied to oneOf, expected an array.');\n }\n }\n return emptyFunctionThatReturnsNull;\n }\n\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n for (var i = 0; i < expectedValues.length; i++) {\n if (is(propValue, expectedValues[i])) {\n return null;\n }\n }\n\n var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {\n var type = getPreciseType(value);\n if (type === 'symbol') {\n return String(value);\n }\n return value;\n });\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));\n }\n return createChainableTypeChecker(validate);\n }\n\n function createObjectOfTypeChecker(typeChecker) {\n function validate(props, propName, componentName, location, propFullName) {\n if (typeof typeChecker !== 'function') {\n return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');\n }\n var propValue = props[propName];\n var propType = getPropType(propValue);\n if (propType !== 'object') {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));\n }\n for (var key in propValue) {\n if (has(propValue, key)) {\n var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);\n if (error instanceof Error) {\n return error;\n }\n }\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createUnionTypeChecker(arrayOfTypeCheckers) {\n if (!Array.isArray(arrayOfTypeCheckers)) {\n undefined !== 'production' ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;\n return emptyFunctionThatReturnsNull;\n }\n\n for (var i = 0; i < arrayOfTypeCheckers.length; i++) {\n var checker = arrayOfTypeCheckers[i];\n if (typeof checker !== 'function') {\n printWarning(\n 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' +\n 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.'\n );\n return emptyFunctionThatReturnsNull;\n }\n }\n\n function validate(props, propName, componentName, location, propFullName) {\n for (var i = 0; i < arrayOfTypeCheckers.length; i++) {\n var checker = arrayOfTypeCheckers[i];\n if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) {\n return null;\n }\n }\n\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));\n }\n return createChainableTypeChecker(validate);\n }\n\n function createNodeChecker() {\n function validate(props, propName, componentName, location, propFullName) {\n if (!isNode(props[propName])) {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createShapeTypeChecker(shapeTypes) {\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n var propType = getPropType(propValue);\n if (propType !== 'object') {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));\n }\n for (var key in shapeTypes) {\n var checker = shapeTypes[key];\n if (!checker) {\n continue;\n }\n var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);\n if (error) {\n return error;\n }\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createStrictShapeTypeChecker(shapeTypes) {\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n var propType = getPropType(propValue);\n if (propType !== 'object') {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));\n }\n // We need to check all keys in case some are required but missing from\n // props.\n var allKeys = assign({}, props[propName], shapeTypes);\n for (var key in allKeys) {\n var checker = shapeTypes[key];\n if (!checker) {\n return new PropTypeError(\n 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +\n '\\nBad object: ' + JSON.stringify(props[propName], null, ' ') +\n '\\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')\n );\n }\n var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);\n if (error) {\n return error;\n }\n }\n return null;\n }\n\n return createChainableTypeChecker(validate);\n }\n\n function isNode(propValue) {\n switch (typeof propValue) {\n case 'number':\n case 'string':\n case 'undefined':\n return true;\n case 'boolean':\n return !propValue;\n case 'object':\n if (Array.isArray(propValue)) {\n return propValue.every(isNode);\n }\n if (propValue === null || isValidElement(propValue)) {\n return true;\n }\n\n var iteratorFn = getIteratorFn(propValue);\n if (iteratorFn) {\n var iterator = iteratorFn.call(propValue);\n var step;\n if (iteratorFn !== propValue.entries) {\n while (!(step = iterator.next()).done) {\n if (!isNode(step.value)) {\n return false;\n }\n }\n } else {\n // Iterator will provide entry [k,v] tuples rather than values.\n while (!(step = iterator.next()).done) {\n var entry = step.value;\n if (entry) {\n if (!isNode(entry[1])) {\n return false;\n }\n }\n }\n }\n } else {\n return false;\n }\n\n return true;\n default:\n return false;\n }\n }\n\n function isSymbol(propType, propValue) {\n // Native Symbol.\n if (propType === 'symbol') {\n return true;\n }\n\n // falsy value can't be a Symbol\n if (!propValue) {\n return false;\n }\n\n // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'\n if (propValue['@@toStringTag'] === 'Symbol') {\n return true;\n }\n\n // Fallback for non-spec compliant Symbols which are polyfilled.\n if (typeof Symbol === 'function' && propValue instanceof Symbol) {\n return true;\n }\n\n return false;\n }\n\n // Equivalent of `typeof` but with special handling for array and regexp.\n function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }\n\n // This handles more types than `getPropType`. Only used for error messages.\n // See `createPrimitiveTypeChecker`.\n function getPreciseType(propValue) {\n if (typeof propValue === 'undefined' || propValue === null) {\n return '' + propValue;\n }\n var propType = getPropType(propValue);\n if (propType === 'object') {\n if (propValue instanceof Date) {\n return 'date';\n } else if (propValue instanceof RegExp) {\n return 'regexp';\n }\n }\n return propType;\n }\n\n // Returns a string that is postfixed to a warning about an invalid type.\n // For example, \"undefined\" or \"of type array\"\n function getPostfixForTypeWarning(value) {\n var type = getPreciseType(value);\n switch (type) {\n case 'array':\n case 'object':\n return 'an ' + type;\n case 'boolean':\n case 'date':\n case 'regexp':\n return 'a ' + type;\n default:\n return type;\n }\n }\n\n // Returns class name of the object, if any.\n function getClassName(propValue) {\n if (!propValue.constructor || !propValue.constructor.name) {\n return ANONYMOUS;\n }\n return propValue.constructor.name;\n }\n\n ReactPropTypes.checkPropTypes = checkPropTypes;\n ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;\n ReactPropTypes.PropTypes = ReactPropTypes;\n\n return ReactPropTypes;\n};\n\n\n//# sourceURL=webpack:///./node_modules/prop-types/factoryWithTypeCheckers.js?");
|
742 |
+
|
743 |
+
/***/ }),
|
744 |
+
|
745 |
+
/***/ "./node_modules/prop-types/index.js":
|
746 |
+
/*!******************************************!*\
|
747 |
+
!*** ./node_modules/prop-types/index.js ***!
|
748 |
+
\******************************************/
|
749 |
+
/*! no static exports found */
|
750 |
+
/***/ (function(module, exports, __webpack_require__) {
|
751 |
+
|
752 |
+
eval("/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nif (undefined !== 'production') {\n var ReactIs = __webpack_require__(/*! react-is */ \"./node_modules/react-is/index.js\");\n\n // By explicitly using `prop-types` you are opting into new development behavior.\n // http://fb.me/prop-types-in-prod\n var throwOnDirectAccess = true;\n module.exports = __webpack_require__(/*! ./factoryWithTypeCheckers */ \"./node_modules/prop-types/factoryWithTypeCheckers.js\")(ReactIs.isElement, throwOnDirectAccess);\n} else {\n // By explicitly using `prop-types` you are opting into new production behavior.\n // http://fb.me/prop-types-in-prod\n module.exports = __webpack_require__(/*! ./factoryWithThrowingShims */ \"./node_modules/prop-types/factoryWithThrowingShims.js\")();\n}\n\n\n//# sourceURL=webpack:///./node_modules/prop-types/index.js?");
|
753 |
+
|
754 |
+
/***/ }),
|
755 |
+
|
756 |
+
/***/ "./node_modules/prop-types/lib/ReactPropTypesSecret.js":
|
757 |
+
/*!*************************************************************!*\
|
758 |
+
!*** ./node_modules/prop-types/lib/ReactPropTypesSecret.js ***!
|
759 |
+
\*************************************************************/
|
760 |
+
/*! no static exports found */
|
761 |
+
/***/ (function(module, exports, __webpack_require__) {
|
762 |
+
|
763 |
+
"use strict";
|
764 |
+
eval("/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\n\nvar ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\n\nmodule.exports = ReactPropTypesSecret;\n\n\n//# sourceURL=webpack:///./node_modules/prop-types/lib/ReactPropTypesSecret.js?");
|
765 |
+
|
766 |
+
/***/ }),
|
767 |
+
|
768 |
+
/***/ "./node_modules/react-is/cjs/react-is.development.js":
|
769 |
+
/*!***********************************************************!*\
|
770 |
+
!*** ./node_modules/react-is/cjs/react-is.development.js ***!
|
771 |
+
\***********************************************************/
|
772 |
+
/*! no static exports found */
|
773 |
+
/***/ (function(module, exports, __webpack_require__) {
|
774 |
+
|
775 |
+
"use strict";
|
776 |
+
eval("/** @license React v16.13.1\n * react-is.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\n\n\n\nif (undefined !== \"production\") {\n (function() {\n'use strict';\n\n// The Symbol used to tag the ReactElement-like types. If there is no native Symbol\n// nor polyfill, then a plain number is used for performance.\nvar hasSymbol = typeof Symbol === 'function' && Symbol.for;\nvar REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;\nvar REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;\nvar REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;\nvar REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;\nvar REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;\nvar REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;\nvar REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary\n// (unstable) APIs that have been removed. Can we remove the symbols?\n\nvar REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;\nvar REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;\nvar REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;\nvar REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;\nvar REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;\nvar REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;\nvar REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;\nvar REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;\nvar REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;\nvar REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;\nvar REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;\n\nfunction isValidElementType(type) {\n return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.\n type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);\n}\n\nfunction typeOf(object) {\n if (typeof object === 'object' && object !== null) {\n var $$typeof = object.$$typeof;\n\n switch ($$typeof) {\n case REACT_ELEMENT_TYPE:\n var type = object.type;\n\n switch (type) {\n case REACT_ASYNC_MODE_TYPE:\n case REACT_CONCURRENT_MODE_TYPE:\n case REACT_FRAGMENT_TYPE:\n case REACT_PROFILER_TYPE:\n case REACT_STRICT_MODE_TYPE:\n case REACT_SUSPENSE_TYPE:\n return type;\n\n default:\n var $$typeofType = type && type.$$typeof;\n\n switch ($$typeofType) {\n case REACT_CONTEXT_TYPE:\n case REACT_FORWARD_REF_TYPE:\n case REACT_LAZY_TYPE:\n case REACT_MEMO_TYPE:\n case REACT_PROVIDER_TYPE:\n return $$typeofType;\n\n default:\n return $$typeof;\n }\n\n }\n\n case REACT_PORTAL_TYPE:\n return $$typeof;\n }\n }\n\n return undefined;\n} // AsyncMode is deprecated along with isAsyncMode\n\nvar AsyncMode = REACT_ASYNC_MODE_TYPE;\nvar ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;\nvar ContextConsumer = REACT_CONTEXT_TYPE;\nvar ContextProvider = REACT_PROVIDER_TYPE;\nvar Element = REACT_ELEMENT_TYPE;\nvar ForwardRef = REACT_FORWARD_REF_TYPE;\nvar Fragment = REACT_FRAGMENT_TYPE;\nvar Lazy = REACT_LAZY_TYPE;\nvar Memo = REACT_MEMO_TYPE;\nvar Portal = REACT_PORTAL_TYPE;\nvar Profiler = REACT_PROFILER_TYPE;\nvar StrictMode = REACT_STRICT_MODE_TYPE;\nvar Suspense = REACT_SUSPENSE_TYPE;\nvar hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated\n\nfunction isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint\n\n console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}\nfunction isConcurrentMode(object) {\n return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;\n}\nfunction isContextConsumer(object) {\n return typeOf(object) === REACT_CONTEXT_TYPE;\n}\nfunction isContextProvider(object) {\n return typeOf(object) === REACT_PROVIDER_TYPE;\n}\nfunction isElement(object) {\n return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;\n}\nfunction isForwardRef(object) {\n return typeOf(object) === REACT_FORWARD_REF_TYPE;\n}\nfunction isFragment(object) {\n return typeOf(object) === REACT_FRAGMENT_TYPE;\n}\nfunction isLazy(object) {\n return typeOf(object) === REACT_LAZY_TYPE;\n}\nfunction isMemo(object) {\n return typeOf(object) === REACT_MEMO_TYPE;\n}\nfunction isPortal(object) {\n return typeOf(object) === REACT_PORTAL_TYPE;\n}\nfunction isProfiler(object) {\n return typeOf(object) === REACT_PROFILER_TYPE;\n}\nfunction isStrictMode(object) {\n return typeOf(object) === REACT_STRICT_MODE_TYPE;\n}\nfunction isSuspense(object) {\n return typeOf(object) === REACT_SUSPENSE_TYPE;\n}\n\nexports.AsyncMode = AsyncMode;\nexports.ConcurrentMode = ConcurrentMode;\nexports.ContextConsumer = ContextConsumer;\nexports.ContextProvider = ContextProvider;\nexports.Element = Element;\nexports.ForwardRef = ForwardRef;\nexports.Fragment = Fragment;\nexports.Lazy = Lazy;\nexports.Memo = Memo;\nexports.Portal = Portal;\nexports.Profiler = Profiler;\nexports.StrictMode = StrictMode;\nexports.Suspense = Suspense;\nexports.isAsyncMode = isAsyncMode;\nexports.isConcurrentMode = isConcurrentMode;\nexports.isContextConsumer = isContextConsumer;\nexports.isContextProvider = isContextProvider;\nexports.isElement = isElement;\nexports.isForwardRef = isForwardRef;\nexports.isFragment = isFragment;\nexports.isLazy = isLazy;\nexports.isMemo = isMemo;\nexports.isPortal = isPortal;\nexports.isProfiler = isProfiler;\nexports.isStrictMode = isStrictMode;\nexports.isSuspense = isSuspense;\nexports.isValidElementType = isValidElementType;\nexports.typeOf = typeOf;\n })();\n}\n\n\n//# sourceURL=webpack:///./node_modules/react-is/cjs/react-is.development.js?");
|
777 |
+
|
778 |
+
/***/ }),
|
779 |
+
|
780 |
+
/***/ "./node_modules/react-is/cjs/react-is.production.min.js":
|
781 |
+
/*!**************************************************************!*\
|
782 |
+
!*** ./node_modules/react-is/cjs/react-is.production.min.js ***!
|
783 |
+
\**************************************************************/
|
784 |
+
/*! no static exports found */
|
785 |
+
/***/ (function(module, exports, __webpack_require__) {
|
786 |
+
|
787 |
+
"use strict";
|
788 |
+
eval("/** @license React v16.13.1\n * react-is.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nvar b=\"function\"===typeof Symbol&&Symbol.for,c=b?Symbol.for(\"react.element\"):60103,d=b?Symbol.for(\"react.portal\"):60106,e=b?Symbol.for(\"react.fragment\"):60107,f=b?Symbol.for(\"react.strict_mode\"):60108,g=b?Symbol.for(\"react.profiler\"):60114,h=b?Symbol.for(\"react.provider\"):60109,k=b?Symbol.for(\"react.context\"):60110,l=b?Symbol.for(\"react.async_mode\"):60111,m=b?Symbol.for(\"react.concurrent_mode\"):60111,n=b?Symbol.for(\"react.forward_ref\"):60112,p=b?Symbol.for(\"react.suspense\"):60113,q=b?\nSymbol.for(\"react.suspense_list\"):60120,r=b?Symbol.for(\"react.memo\"):60115,t=b?Symbol.for(\"react.lazy\"):60116,v=b?Symbol.for(\"react.block\"):60121,w=b?Symbol.for(\"react.fundamental\"):60117,x=b?Symbol.for(\"react.responder\"):60118,y=b?Symbol.for(\"react.scope\"):60119;\nfunction z(a){if(\"object\"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}exports.AsyncMode=l;exports.ConcurrentMode=m;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=n;exports.Fragment=e;exports.Lazy=t;exports.Memo=r;exports.Portal=d;\nexports.Profiler=g;exports.StrictMode=f;exports.Suspense=p;exports.isAsyncMode=function(a){return A(a)||z(a)===l};exports.isConcurrentMode=A;exports.isContextConsumer=function(a){return z(a)===k};exports.isContextProvider=function(a){return z(a)===h};exports.isElement=function(a){return\"object\"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return z(a)===n};exports.isFragment=function(a){return z(a)===e};exports.isLazy=function(a){return z(a)===t};\nexports.isMemo=function(a){return z(a)===r};exports.isPortal=function(a){return z(a)===d};exports.isProfiler=function(a){return z(a)===g};exports.isStrictMode=function(a){return z(a)===f};exports.isSuspense=function(a){return z(a)===p};\nexports.isValidElementType=function(a){return\"string\"===typeof a||\"function\"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||\"object\"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};exports.typeOf=z;\n\n\n//# sourceURL=webpack:///./node_modules/react-is/cjs/react-is.production.min.js?");
|
789 |
+
|
790 |
+
/***/ }),
|
791 |
+
|
792 |
+
/***/ "./node_modules/react-is/index.js":
|
793 |
+
/*!****************************************!*\
|
794 |
+
!*** ./node_modules/react-is/index.js ***!
|
795 |
+
\****************************************/
|
796 |
+
/*! no static exports found */
|
797 |
+
/***/ (function(module, exports, __webpack_require__) {
|
798 |
+
|
799 |
+
"use strict";
|
800 |
+
eval("\n\nif (undefined === 'production') {\n module.exports = __webpack_require__(/*! ./cjs/react-is.production.min.js */ \"./node_modules/react-is/cjs/react-is.production.min.js\");\n} else {\n module.exports = __webpack_require__(/*! ./cjs/react-is.development.js */ \"./node_modules/react-is/cjs/react-is.development.js\");\n}\n\n\n//# sourceURL=webpack:///./node_modules/react-is/index.js?");
|
801 |
+
|
802 |
+
/***/ }),
|
803 |
+
|
804 |
+
/***/ "./node_modules/react-transition-group/esm/CSSTransition.js":
|
805 |
+
/*!******************************************************************!*\
|
806 |
+
!*** ./node_modules/react-transition-group/esm/CSSTransition.js ***!
|
807 |
+
\******************************************************************/
|
808 |
+
/*! exports provided: default */
|
809 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
810 |
+
|
811 |
+
"use strict";
|
812 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ \"./node_modules/@babel/runtime/helpers/esm/extends.js\");\n/* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ \"./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js\");\n/* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ \"./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js\");\n/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\");\n/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var dom_helpers_addClass__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! dom-helpers/addClass */ \"./node_modules/dom-helpers/esm/addClass.js\");\n/* harmony import */ var dom_helpers_removeClass__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! dom-helpers/removeClass */ \"./node_modules/dom-helpers/esm/removeClass.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var _Transition__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./Transition */ \"./node_modules/react-transition-group/esm/Transition.js\");\n/* harmony import */ var _utils_PropTypes__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./utils/PropTypes */ \"./node_modules/react-transition-group/esm/utils/PropTypes.js\");\n\n\n\n\n\n\n\n\n\n\nvar _addClass = function addClass(node, classes) {\n return node && classes && classes.split(' ').forEach(function (c) {\n return Object(dom_helpers_addClass__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(node, c);\n });\n};\n\nvar removeClass = function removeClass(node, classes) {\n return node && classes && classes.split(' ').forEach(function (c) {\n return Object(dom_helpers_removeClass__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(node, c);\n });\n};\n/**\n * A transition component inspired by the excellent\n * [ng-animate](https://docs.angularjs.org/api/ngAnimate) library, you should\n * use it if you're using CSS transitions or animations. It's built upon the\n * [`Transition`](https://reactcommunity.org/react-transition-group/transition)\n * component, so it inherits all of its props.\n *\n * `CSSTransition` applies a pair of class names during the `appear`, `enter`,\n * and `exit` states of the transition. The first class is applied and then a\n * second `*-active` class in order to activate the CSS transition. After the\n * transition, matching `*-done` class names are applied to persist the\n * transition state.\n *\n * ```jsx\n * function App() {\n * const [inProp, setInProp] = useState(false);\n * return (\n * <div>\n * <CSSTransition in={inProp} timeout={200} classNames=\"my-node\">\n * <div>\n * {\"I'll receive my-node-* classes\"}\n * </div>\n * </CSSTransition>\n * <button type=\"button\" onClick={() => setInProp(true)}>\n * Click to Enter\n * </button>\n * </div>\n * );\n * }\n * ```\n *\n * When the `in` prop is set to `true`, the child component will first receive\n * the class `example-enter`, then the `example-enter-active` will be added in\n * the next tick. `CSSTransition` [forces a\n * reflow](https://github.com/reactjs/react-transition-group/blob/5007303e729a74be66a21c3e2205e4916821524b/src/CSSTransition.js#L208-L215)\n * between before adding the `example-enter-active`. This is an important trick\n * because it allows us to transition between `example-enter` and\n * `example-enter-active` even though they were added immediately one after\n * another. Most notably, this is what makes it possible for us to animate\n * _appearance_.\n *\n * ```css\n * .my-node-enter {\n * opacity: 0;\n * }\n * .my-node-enter-active {\n * opacity: 1;\n * transition: opacity 200ms;\n * }\n * .my-node-exit {\n * opacity: 1;\n * }\n * .my-node-exit-active {\n * opacity: 0;\n * transition: opacity 200ms;\n * }\n * ```\n *\n * `*-active` classes represent which styles you want to animate **to**, so it's\n * important to add `transition` declaration only to them, otherwise transitions\n * might not behave as intended! This might not be obvious when the transitions\n * are symmetrical, i.e. when `*-enter-active` is the same as `*-exit`, like in\n * the example above (minus `transition`), but it becomes apparent in more\n * complex transitions.\n *\n * **Note**: If you're using the\n * [`appear`](http://reactcommunity.org/react-transition-group/transition#Transition-prop-appear)\n * prop, make sure to define styles for `.appear-*` classes as well.\n */\n\n\nvar CSSTransition = /*#__PURE__*/function (_React$Component) {\n Object(_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(CSSTransition, _React$Component);\n\n function CSSTransition() {\n var _this;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;\n _this.appliedClasses = {\n appear: {},\n enter: {},\n exit: {}\n };\n\n _this.onEnter = function (maybeNode, maybeAppearing) {\n var _this$resolveArgument = _this.resolveArguments(maybeNode, maybeAppearing),\n node = _this$resolveArgument[0],\n appearing = _this$resolveArgument[1];\n\n _this.removeClasses(node, 'exit');\n\n _this.addClass(node, appearing ? 'appear' : 'enter', 'base');\n\n if (_this.props.onEnter) {\n _this.props.onEnter(maybeNode, maybeAppearing);\n }\n };\n\n _this.onEntering = function (maybeNode, maybeAppearing) {\n var _this$resolveArgument2 = _this.resolveArguments(maybeNode, maybeAppearing),\n node = _this$resolveArgument2[0],\n appearing = _this$resolveArgument2[1];\n\n var type = appearing ? 'appear' : 'enter';\n\n _this.addClass(node, type, 'active');\n\n if (_this.props.onEntering) {\n _this.props.onEntering(maybeNode, maybeAppearing);\n }\n };\n\n _this.onEntered = function (maybeNode, maybeAppearing) {\n var _this$resolveArgument3 = _this.resolveArguments(maybeNode, maybeAppearing),\n node = _this$resolveArgument3[0],\n appearing = _this$resolveArgument3[1];\n\n var type = appearing ? 'appear' : 'enter';\n\n _this.removeClasses(node, type);\n\n _this.addClass(node, type, 'done');\n\n if (_this.props.onEntered) {\n _this.props.onEntered(maybeNode, maybeAppearing);\n }\n };\n\n _this.onExit = function (maybeNode) {\n var _this$resolveArgument4 = _this.resolveArguments(maybeNode),\n node = _this$resolveArgument4[0];\n\n _this.removeClasses(node, 'appear');\n\n _this.removeClasses(node, 'enter');\n\n _this.addClass(node, 'exit', 'base');\n\n if (_this.props.onExit) {\n _this.props.onExit(maybeNode);\n }\n };\n\n _this.onExiting = function (maybeNode) {\n var _this$resolveArgument5 = _this.resolveArguments(maybeNode),\n node = _this$resolveArgument5[0];\n\n _this.addClass(node, 'exit', 'active');\n\n if (_this.props.onExiting) {\n _this.props.onExiting(maybeNode);\n }\n };\n\n _this.onExited = function (maybeNode) {\n var _this$resolveArgument6 = _this.resolveArguments(maybeNode),\n node = _this$resolveArgument6[0];\n\n _this.removeClasses(node, 'exit');\n\n _this.addClass(node, 'exit', 'done');\n\n if (_this.props.onExited) {\n _this.props.onExited(maybeNode);\n }\n };\n\n _this.resolveArguments = function (maybeNode, maybeAppearing) {\n return _this.props.nodeRef ? [_this.props.nodeRef.current, maybeNode] // here `maybeNode` is actually `appearing`\n : [maybeNode, maybeAppearing];\n };\n\n _this.getClassNames = function (type) {\n var classNames = _this.props.classNames;\n var isStringClassNames = typeof classNames === 'string';\n var prefix = isStringClassNames && classNames ? classNames + \"-\" : '';\n var baseClassName = isStringClassNames ? \"\" + prefix + type : classNames[type];\n var activeClassName = isStringClassNames ? baseClassName + \"-active\" : classNames[type + \"Active\"];\n var doneClassName = isStringClassNames ? baseClassName + \"-done\" : classNames[type + \"Done\"];\n return {\n baseClassName: baseClassName,\n activeClassName: activeClassName,\n doneClassName: doneClassName\n };\n };\n\n return _this;\n }\n\n var _proto = CSSTransition.prototype;\n\n _proto.addClass = function addClass(node, type, phase) {\n var className = this.getClassNames(type)[phase + \"ClassName\"];\n\n var _this$getClassNames = this.getClassNames('enter'),\n doneClassName = _this$getClassNames.doneClassName;\n\n if (type === 'appear' && phase === 'done' && doneClassName) {\n className += \" \" + doneClassName;\n } // This is for to force a repaint,\n // which is necessary in order to transition styles when adding a class name.\n\n\n if (phase === 'active') {\n /* eslint-disable no-unused-expressions */\n node && node.scrollTop;\n }\n\n if (className) {\n this.appliedClasses[type][phase] = className;\n\n _addClass(node, className);\n }\n };\n\n _proto.removeClasses = function removeClasses(node, type) {\n var _this$appliedClasses$ = this.appliedClasses[type],\n baseClassName = _this$appliedClasses$.base,\n activeClassName = _this$appliedClasses$.active,\n doneClassName = _this$appliedClasses$.done;\n this.appliedClasses[type] = {};\n\n if (baseClassName) {\n removeClass(node, baseClassName);\n }\n\n if (activeClassName) {\n removeClass(node, activeClassName);\n }\n\n if (doneClassName) {\n removeClass(node, doneClassName);\n }\n };\n\n _proto.render = function render() {\n var _this$props = this.props,\n _ = _this$props.classNames,\n props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(_this$props, [\"classNames\"]);\n\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_6___default.a.createElement(_Transition__WEBPACK_IMPORTED_MODULE_7__[\"default\"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({}, props, {\n onEnter: this.onEnter,\n onEntered: this.onEntered,\n onEntering: this.onEntering,\n onExit: this.onExit,\n onExiting: this.onExiting,\n onExited: this.onExited\n }));\n };\n\n return CSSTransition;\n}(react__WEBPACK_IMPORTED_MODULE_6___default.a.Component);\n\nCSSTransition.defaultProps = {\n classNames: ''\n};\nCSSTransition.propTypes = undefined !== \"production\" ? Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({}, _Transition__WEBPACK_IMPORTED_MODULE_7__[\"default\"].propTypes, {\n /**\n * The animation classNames applied to the component as it appears, enters,\n * exits or has finished the transition. A single name can be provided, which\n * will be suffixed for each stage, e.g. `classNames=\"fade\"` applies:\n *\n * - `fade-appear`, `fade-appear-active`, `fade-appear-done`\n * - `fade-enter`, `fade-enter-active`, `fade-enter-done`\n * - `fade-exit`, `fade-exit-active`, `fade-exit-done`\n *\n * A few details to note about how these classes are applied:\n *\n * 1. They are _joined_ with the ones that are already defined on the child\n * component, so if you want to add some base styles, you can use\n * `className` without worrying that it will be overridden.\n *\n * 2. If the transition component mounts with `in={false}`, no classes are\n * applied yet. You might be expecting `*-exit-done`, but if you think\n * about it, a component cannot finish exiting if it hasn't entered yet.\n *\n * 2. `fade-appear-done` and `fade-enter-done` will _both_ be applied. This\n * allows you to define different behavior for when appearing is done and\n * when regular entering is done, using selectors like\n * `.fade-enter-done:not(.fade-appear-done)`. For example, you could apply\n * an epic entrance animation when element first appears in the DOM using\n * [Animate.css](https://daneden.github.io/animate.css/). Otherwise you can\n * simply use `fade-enter-done` for defining both cases.\n *\n * Each individual classNames can also be specified independently like:\n *\n * ```js\n * classNames={{\n * appear: 'my-appear',\n * appearActive: 'my-active-appear',\n * appearDone: 'my-done-appear',\n * enter: 'my-enter',\n * enterActive: 'my-active-enter',\n * enterDone: 'my-done-enter',\n * exit: 'my-exit',\n * exitActive: 'my-active-exit',\n * exitDone: 'my-done-exit',\n * }}\n * ```\n *\n * If you want to set these classes using CSS Modules:\n *\n * ```js\n * import styles from './styles.css';\n * ```\n *\n * you might want to use camelCase in your CSS file, that way could simply\n * spread them instead of listing them one by one:\n *\n * ```js\n * classNames={{ ...styles }}\n * ```\n *\n * @type {string | {\n * appear?: string,\n * appearActive?: string,\n * appearDone?: string,\n * enter?: string,\n * enterActive?: string,\n * enterDone?: string,\n * exit?: string,\n * exitActive?: string,\n * exitDone?: string,\n * }}\n */\n classNames: _utils_PropTypes__WEBPACK_IMPORTED_MODULE_8__[\"classNamesShape\"],\n\n /**\n * A `<Transition>` callback fired immediately after the 'enter' or 'appear' class is\n * applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement, isAppearing: bool)\n */\n onEnter: prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.func,\n\n /**\n * A `<Transition>` callback fired immediately after the 'enter-active' or\n * 'appear-active' class is applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement, isAppearing: bool)\n */\n onEntering: prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.func,\n\n /**\n * A `<Transition>` callback fired immediately after the 'enter' or\n * 'appear' classes are **removed** and the `done` class is added to the DOM node.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement, isAppearing: bool)\n */\n onEntered: prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.func,\n\n /**\n * A `<Transition>` callback fired immediately after the 'exit' class is\n * applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed\n *\n * @type Function(node: HtmlElement)\n */\n onExit: prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.func,\n\n /**\n * A `<Transition>` callback fired immediately after the 'exit-active' is applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed\n *\n * @type Function(node: HtmlElement)\n */\n onExiting: prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.func,\n\n /**\n * A `<Transition>` callback fired immediately after the 'exit' classes\n * are **removed** and the `exit-done` class is added to the DOM node.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed\n *\n * @type Function(node: HtmlElement)\n */\n onExited: prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.func\n}) : {};\n/* harmony default export */ __webpack_exports__[\"default\"] = (CSSTransition);\n\n//# sourceURL=webpack:///./node_modules/react-transition-group/esm/CSSTransition.js?");
|
813 |
+
|
814 |
+
/***/ }),
|
815 |
+
|
816 |
+
/***/ "./node_modules/react-transition-group/esm/ReplaceTransition.js":
|
817 |
+
/*!**********************************************************************!*\
|
818 |
+
!*** ./node_modules/react-transition-group/esm/ReplaceTransition.js ***!
|
819 |
+
\**********************************************************************/
|
820 |
+
/*! exports provided: default */
|
821 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
822 |
+
|
823 |
+
"use strict";
|
824 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ \"./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js\");\n/* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ \"./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js\");\n/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\");\n/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react-dom */ \"react-dom\");\n/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _TransitionGroup__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./TransitionGroup */ \"./node_modules/react-transition-group/esm/TransitionGroup.js\");\n\n\n\n\n\n\n/**\n * The `<ReplaceTransition>` component is a specialized `Transition` component\n * that animates between two children.\n *\n * ```jsx\n * <ReplaceTransition in>\n * <Fade><div>I appear first</div></Fade>\n * <Fade><div>I replace the above</div></Fade>\n * </ReplaceTransition>\n * ```\n */\n\nvar ReplaceTransition = /*#__PURE__*/function (_React$Component) {\n Object(_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(ReplaceTransition, _React$Component);\n\n function ReplaceTransition() {\n var _this;\n\n for (var _len = arguments.length, _args = new Array(_len), _key = 0; _key < _len; _key++) {\n _args[_key] = arguments[_key];\n }\n\n _this = _React$Component.call.apply(_React$Component, [this].concat(_args)) || this;\n\n _this.handleEnter = function () {\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n return _this.handleLifecycle('onEnter', 0, args);\n };\n\n _this.handleEntering = function () {\n for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n args[_key3] = arguments[_key3];\n }\n\n return _this.handleLifecycle('onEntering', 0, args);\n };\n\n _this.handleEntered = function () {\n for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {\n args[_key4] = arguments[_key4];\n }\n\n return _this.handleLifecycle('onEntered', 0, args);\n };\n\n _this.handleExit = function () {\n for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {\n args[_key5] = arguments[_key5];\n }\n\n return _this.handleLifecycle('onExit', 1, args);\n };\n\n _this.handleExiting = function () {\n for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {\n args[_key6] = arguments[_key6];\n }\n\n return _this.handleLifecycle('onExiting', 1, args);\n };\n\n _this.handleExited = function () {\n for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {\n args[_key7] = arguments[_key7];\n }\n\n return _this.handleLifecycle('onExited', 1, args);\n };\n\n return _this;\n }\n\n var _proto = ReplaceTransition.prototype;\n\n _proto.handleLifecycle = function handleLifecycle(handler, idx, originalArgs) {\n var _child$props;\n\n var children = this.props.children;\n var child = react__WEBPACK_IMPORTED_MODULE_3___default.a.Children.toArray(children)[idx];\n if (child.props[handler]) (_child$props = child.props)[handler].apply(_child$props, originalArgs);\n\n if (this.props[handler]) {\n var maybeNode = child.props.nodeRef ? undefined : react_dom__WEBPACK_IMPORTED_MODULE_4___default.a.findDOMNode(this);\n this.props[handler](maybeNode);\n }\n };\n\n _proto.render = function render() {\n var _this$props = this.props,\n children = _this$props.children,\n inProp = _this$props.in,\n props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(_this$props, [\"children\", \"in\"]);\n\n var _React$Children$toArr = react__WEBPACK_IMPORTED_MODULE_3___default.a.Children.toArray(children),\n first = _React$Children$toArr[0],\n second = _React$Children$toArr[1];\n\n delete props.onEnter;\n delete props.onEntering;\n delete props.onEntered;\n delete props.onExit;\n delete props.onExiting;\n delete props.onExited;\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_TransitionGroup__WEBPACK_IMPORTED_MODULE_5__[\"default\"], props, inProp ? react__WEBPACK_IMPORTED_MODULE_3___default.a.cloneElement(first, {\n key: 'first',\n onEnter: this.handleEnter,\n onEntering: this.handleEntering,\n onEntered: this.handleEntered\n }) : react__WEBPACK_IMPORTED_MODULE_3___default.a.cloneElement(second, {\n key: 'second',\n onEnter: this.handleExit,\n onEntering: this.handleExiting,\n onEntered: this.handleExited\n }));\n };\n\n return ReplaceTransition;\n}(react__WEBPACK_IMPORTED_MODULE_3___default.a.Component);\n\nReplaceTransition.propTypes = undefined !== \"production\" ? {\n in: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool.isRequired,\n children: function children(props, propName) {\n if (react__WEBPACK_IMPORTED_MODULE_3___default.a.Children.count(props[propName]) !== 2) return new Error(\"\\\"\" + propName + \"\\\" must be exactly two transition components.\");\n return null;\n }\n} : {};\n/* harmony default export */ __webpack_exports__[\"default\"] = (ReplaceTransition);\n\n//# sourceURL=webpack:///./node_modules/react-transition-group/esm/ReplaceTransition.js?");
|
825 |
+
|
826 |
+
/***/ }),
|
827 |
+
|
828 |
+
/***/ "./node_modules/react-transition-group/esm/SwitchTransition.js":
|
829 |
+
/*!*********************************************************************!*\
|
830 |
+
!*** ./node_modules/react-transition-group/esm/SwitchTransition.js ***!
|
831 |
+
\*********************************************************************/
|
832 |
+
/*! exports provided: modes, default */
|
833 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
834 |
+
|
835 |
+
"use strict";
|
836 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"modes\", function() { return modes; });\n/* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ \"./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\");\n/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _Transition__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Transition */ \"./node_modules/react-transition-group/esm/Transition.js\");\n/* harmony import */ var _TransitionGroupContext__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./TransitionGroupContext */ \"./node_modules/react-transition-group/esm/TransitionGroupContext.js\");\n\n\nvar _leaveRenders, _enterRenders;\n\n\n\n\n\n\nfunction areChildrenDifferent(oldChildren, newChildren) {\n if (oldChildren === newChildren) return false;\n\n if (react__WEBPACK_IMPORTED_MODULE_1___default.a.isValidElement(oldChildren) && react__WEBPACK_IMPORTED_MODULE_1___default.a.isValidElement(newChildren) && oldChildren.key != null && oldChildren.key === newChildren.key) {\n return false;\n }\n\n return true;\n}\n/**\n * Enum of modes for SwitchTransition component\n * @enum { string }\n */\n\n\nvar modes = {\n out: 'out-in',\n in: 'in-out'\n};\n\nvar callHook = function callHook(element, name, cb) {\n return function () {\n var _element$props;\n\n element.props[name] && (_element$props = element.props)[name].apply(_element$props, arguments);\n cb();\n };\n};\n\nvar leaveRenders = (_leaveRenders = {}, _leaveRenders[modes.out] = function (_ref) {\n var current = _ref.current,\n changeState = _ref.changeState;\n return react__WEBPACK_IMPORTED_MODULE_1___default.a.cloneElement(current, {\n in: false,\n onExited: callHook(current, 'onExited', function () {\n changeState(_Transition__WEBPACK_IMPORTED_MODULE_3__[\"ENTERING\"], null);\n })\n });\n}, _leaveRenders[modes.in] = function (_ref2) {\n var current = _ref2.current,\n changeState = _ref2.changeState,\n children = _ref2.children;\n return [current, react__WEBPACK_IMPORTED_MODULE_1___default.a.cloneElement(children, {\n in: true,\n onEntered: callHook(children, 'onEntered', function () {\n changeState(_Transition__WEBPACK_IMPORTED_MODULE_3__[\"ENTERING\"]);\n })\n })];\n}, _leaveRenders);\nvar enterRenders = (_enterRenders = {}, _enterRenders[modes.out] = function (_ref3) {\n var children = _ref3.children,\n changeState = _ref3.changeState;\n return react__WEBPACK_IMPORTED_MODULE_1___default.a.cloneElement(children, {\n in: true,\n onEntered: callHook(children, 'onEntered', function () {\n changeState(_Transition__WEBPACK_IMPORTED_MODULE_3__[\"ENTERED\"], react__WEBPACK_IMPORTED_MODULE_1___default.a.cloneElement(children, {\n in: true\n }));\n })\n });\n}, _enterRenders[modes.in] = function (_ref4) {\n var current = _ref4.current,\n children = _ref4.children,\n changeState = _ref4.changeState;\n return [react__WEBPACK_IMPORTED_MODULE_1___default.a.cloneElement(current, {\n in: false,\n onExited: callHook(current, 'onExited', function () {\n changeState(_Transition__WEBPACK_IMPORTED_MODULE_3__[\"ENTERED\"], react__WEBPACK_IMPORTED_MODULE_1___default.a.cloneElement(children, {\n in: true\n }));\n })\n }), react__WEBPACK_IMPORTED_MODULE_1___default.a.cloneElement(children, {\n in: true\n })];\n}, _enterRenders);\n/**\n * A transition component inspired by the [vue transition modes](https://vuejs.org/v2/guide/transitions.html#Transition-Modes).\n * You can use it when you want to control the render between state transitions.\n * Based on the selected mode and the child's key which is the `Transition` or `CSSTransition` component, the `SwitchTransition` makes a consistent transition between them.\n *\n * If the `out-in` mode is selected, the `SwitchTransition` waits until the old child leaves and then inserts a new child.\n * If the `in-out` mode is selected, the `SwitchTransition` inserts a new child first, waits for the new child to enter and then removes the old child.\n *\n * **Note**: If you want the animation to happen simultaneously\n * (that is, to have the old child removed and a new child inserted **at the same time**),\n * you should use\n * [`TransitionGroup`](https://reactcommunity.org/react-transition-group/transition-group)\n * instead.\n *\n * ```jsx\n * function App() {\n * const [state, setState] = useState(false);\n * return (\n * <SwitchTransition>\n * <CSSTransition\n * key={state ? \"Goodbye, world!\" : \"Hello, world!\"}\n * addEndListener={(node, done) => node.addEventListener(\"transitionend\", done, false)}\n * classNames='fade'\n * >\n * <button onClick={() => setState(state => !state)}>\n * {state ? \"Goodbye, world!\" : \"Hello, world!\"}\n * </button>\n * </CSSTransition>\n * </SwitchTransition>\n * );\n * }\n * ```\n *\n * ```css\n * .fade-enter{\n * opacity: 0;\n * }\n * .fade-exit{\n * opacity: 1;\n * }\n * .fade-enter-active{\n * opacity: 1;\n * }\n * .fade-exit-active{\n * opacity: 0;\n * }\n * .fade-enter-active,\n * .fade-exit-active{\n * transition: opacity 500ms;\n * }\n * ```\n */\n\nvar SwitchTransition = /*#__PURE__*/function (_React$Component) {\n Object(_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(SwitchTransition, _React$Component);\n\n function SwitchTransition() {\n var _this;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;\n _this.state = {\n status: _Transition__WEBPACK_IMPORTED_MODULE_3__[\"ENTERED\"],\n current: null\n };\n _this.appeared = false;\n\n _this.changeState = function (status, current) {\n if (current === void 0) {\n current = _this.state.current;\n }\n\n _this.setState({\n status: status,\n current: current\n });\n };\n\n return _this;\n }\n\n var _proto = SwitchTransition.prototype;\n\n _proto.componentDidMount = function componentDidMount() {\n this.appeared = true;\n };\n\n SwitchTransition.getDerivedStateFromProps = function getDerivedStateFromProps(props, state) {\n if (props.children == null) {\n return {\n current: null\n };\n }\n\n if (state.status === _Transition__WEBPACK_IMPORTED_MODULE_3__[\"ENTERING\"] && props.mode === modes.in) {\n return {\n status: _Transition__WEBPACK_IMPORTED_MODULE_3__[\"ENTERING\"]\n };\n }\n\n if (state.current && areChildrenDifferent(state.current, props.children)) {\n return {\n status: _Transition__WEBPACK_IMPORTED_MODULE_3__[\"EXITING\"]\n };\n }\n\n return {\n current: react__WEBPACK_IMPORTED_MODULE_1___default.a.cloneElement(props.children, {\n in: true\n })\n };\n };\n\n _proto.render = function render() {\n var _this$props = this.props,\n children = _this$props.children,\n mode = _this$props.mode,\n _this$state = this.state,\n status = _this$state.status,\n current = _this$state.current;\n var data = {\n children: children,\n current: current,\n changeState: this.changeState,\n status: status\n };\n var component;\n\n switch (status) {\n case _Transition__WEBPACK_IMPORTED_MODULE_3__[\"ENTERING\"]:\n component = enterRenders[mode](data);\n break;\n\n case _Transition__WEBPACK_IMPORTED_MODULE_3__[\"EXITING\"]:\n component = leaveRenders[mode](data);\n break;\n\n case _Transition__WEBPACK_IMPORTED_MODULE_3__[\"ENTERED\"]:\n component = current;\n }\n\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_TransitionGroupContext__WEBPACK_IMPORTED_MODULE_4__[\"default\"].Provider, {\n value: {\n isMounting: !this.appeared\n }\n }, component);\n };\n\n return SwitchTransition;\n}(react__WEBPACK_IMPORTED_MODULE_1___default.a.Component);\n\nSwitchTransition.propTypes = undefined !== \"production\" ? {\n /**\n * Transition modes.\n * `out-in`: Current element transitions out first, then when complete, the new element transitions in.\n * `in-out`: New element transitions in first, then when complete, the current element transitions out.\n *\n * @type {'out-in'|'in-out'}\n */\n mode: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.oneOf([modes.in, modes.out]),\n\n /**\n * Any `Transition` or `CSSTransition` component.\n */\n children: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.element.isRequired])\n} : {};\nSwitchTransition.defaultProps = {\n mode: modes.out\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (SwitchTransition);\n\n//# sourceURL=webpack:///./node_modules/react-transition-group/esm/SwitchTransition.js?");
|
837 |
+
|
838 |
+
/***/ }),
|
839 |
+
|
840 |
+
/***/ "./node_modules/react-transition-group/esm/Transition.js":
|
841 |
+
/*!***************************************************************!*\
|
842 |
+
!*** ./node_modules/react-transition-group/esm/Transition.js ***!
|
843 |
+
\***************************************************************/
|
844 |
+
/*! exports provided: UNMOUNTED, EXITED, ENTERING, ENTERED, EXITING, default */
|
845 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
846 |
+
|
847 |
+
"use strict";
|
848 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"UNMOUNTED\", function() { return UNMOUNTED; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"EXITED\", function() { return EXITED; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ENTERING\", function() { return ENTERING; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ENTERED\", function() { return ENTERED; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"EXITING\", function() { return EXITING; });\n/* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ \"./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js\");\n/* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ \"./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js\");\n/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\");\n/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react-dom */ \"react-dom\");\n/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./config */ \"./node_modules/react-transition-group/esm/config.js\");\n/* harmony import */ var _utils_PropTypes__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./utils/PropTypes */ \"./node_modules/react-transition-group/esm/utils/PropTypes.js\");\n/* harmony import */ var _TransitionGroupContext__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./TransitionGroupContext */ \"./node_modules/react-transition-group/esm/TransitionGroupContext.js\");\n\n\n\n\n\n\n\n\nvar UNMOUNTED = 'unmounted';\nvar EXITED = 'exited';\nvar ENTERING = 'entering';\nvar ENTERED = 'entered';\nvar EXITING = 'exiting';\n/**\n * The Transition component lets you describe a transition from one component\n * state to another _over time_ with a simple declarative API. Most commonly\n * it's used to animate the mounting and unmounting of a component, but can also\n * be used to describe in-place transition states as well.\n *\n * ---\n *\n * **Note**: `Transition` is a platform-agnostic base component. If you're using\n * transitions in CSS, you'll probably want to use\n * [`CSSTransition`](https://reactcommunity.org/react-transition-group/css-transition)\n * instead. It inherits all the features of `Transition`, but contains\n * additional features necessary to play nice with CSS transitions (hence the\n * name of the component).\n *\n * ---\n *\n * By default the `Transition` component does not alter the behavior of the\n * component it renders, it only tracks \"enter\" and \"exit\" states for the\n * components. It's up to you to give meaning and effect to those states. For\n * example we can add styles to a component when it enters or exits:\n *\n * ```jsx\n * import { Transition } from 'react-transition-group';\n *\n * const duration = 300;\n *\n * const defaultStyle = {\n * transition: `opacity ${duration}ms ease-in-out`,\n * opacity: 0,\n * }\n *\n * const transitionStyles = {\n * entering: { opacity: 1 },\n * entered: { opacity: 1 },\n * exiting: { opacity: 0 },\n * exited: { opacity: 0 },\n * };\n *\n * const Fade = ({ in: inProp }) => (\n * <Transition in={inProp} timeout={duration}>\n * {state => (\n * <div style={{\n * ...defaultStyle,\n * ...transitionStyles[state]\n * }}>\n * I'm a fade Transition!\n * </div>\n * )}\n * </Transition>\n * );\n * ```\n *\n * There are 4 main states a Transition can be in:\n * - `'entering'`\n * - `'entered'`\n * - `'exiting'`\n * - `'exited'`\n *\n * Transition state is toggled via the `in` prop. When `true` the component\n * begins the \"Enter\" stage. During this stage, the component will shift from\n * its current transition state, to `'entering'` for the duration of the\n * transition and then to the `'entered'` stage once it's complete. Let's take\n * the following example (we'll use the\n * [useState](https://reactjs.org/docs/hooks-reference.html#usestate) hook):\n *\n * ```jsx\n * function App() {\n * const [inProp, setInProp] = useState(false);\n * return (\n * <div>\n * <Transition in={inProp} timeout={500}>\n * {state => (\n * // ...\n * )}\n * </Transition>\n * <button onClick={() => setInProp(true)}>\n * Click to Enter\n * </button>\n * </div>\n * );\n * }\n * ```\n *\n * When the button is clicked the component will shift to the `'entering'` state\n * and stay there for 500ms (the value of `timeout`) before it finally switches\n * to `'entered'`.\n *\n * When `in` is `false` the same thing happens except the state moves from\n * `'exiting'` to `'exited'`.\n */\n\nvar Transition = /*#__PURE__*/function (_React$Component) {\n Object(_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(Transition, _React$Component);\n\n function Transition(props, context) {\n var _this;\n\n _this = _React$Component.call(this, props, context) || this;\n var parentGroup = context; // In the context of a TransitionGroup all enters are really appears\n\n var appear = parentGroup && !parentGroup.isMounting ? props.enter : props.appear;\n var initialStatus;\n _this.appearStatus = null;\n\n if (props.in) {\n if (appear) {\n initialStatus = EXITED;\n _this.appearStatus = ENTERING;\n } else {\n initialStatus = ENTERED;\n }\n } else {\n if (props.unmountOnExit || props.mountOnEnter) {\n initialStatus = UNMOUNTED;\n } else {\n initialStatus = EXITED;\n }\n }\n\n _this.state = {\n status: initialStatus\n };\n _this.nextCallback = null;\n return _this;\n }\n\n Transition.getDerivedStateFromProps = function getDerivedStateFromProps(_ref, prevState) {\n var nextIn = _ref.in;\n\n if (nextIn && prevState.status === UNMOUNTED) {\n return {\n status: EXITED\n };\n }\n\n return null;\n } // getSnapshotBeforeUpdate(prevProps) {\n // let nextStatus = null\n // if (prevProps !== this.props) {\n // const { status } = this.state\n // if (this.props.in) {\n // if (status !== ENTERING && status !== ENTERED) {\n // nextStatus = ENTERING\n // }\n // } else {\n // if (status === ENTERING || status === ENTERED) {\n // nextStatus = EXITING\n // }\n // }\n // }\n // return { nextStatus }\n // }\n ;\n\n var _proto = Transition.prototype;\n\n _proto.componentDidMount = function componentDidMount() {\n this.updateStatus(true, this.appearStatus);\n };\n\n _proto.componentDidUpdate = function componentDidUpdate(prevProps) {\n var nextStatus = null;\n\n if (prevProps !== this.props) {\n var status = this.state.status;\n\n if (this.props.in) {\n if (status !== ENTERING && status !== ENTERED) {\n nextStatus = ENTERING;\n }\n } else {\n if (status === ENTERING || status === ENTERED) {\n nextStatus = EXITING;\n }\n }\n }\n\n this.updateStatus(false, nextStatus);\n };\n\n _proto.componentWillUnmount = function componentWillUnmount() {\n this.cancelNextCallback();\n };\n\n _proto.getTimeouts = function getTimeouts() {\n var timeout = this.props.timeout;\n var exit, enter, appear;\n exit = enter = appear = timeout;\n\n if (timeout != null && typeof timeout !== 'number') {\n exit = timeout.exit;\n enter = timeout.enter; // TODO: remove fallback for next major\n\n appear = timeout.appear !== undefined ? timeout.appear : enter;\n }\n\n return {\n exit: exit,\n enter: enter,\n appear: appear\n };\n };\n\n _proto.updateStatus = function updateStatus(mounting, nextStatus) {\n if (mounting === void 0) {\n mounting = false;\n }\n\n if (nextStatus !== null) {\n // nextStatus will always be ENTERING or EXITING.\n this.cancelNextCallback();\n\n if (nextStatus === ENTERING) {\n this.performEnter(mounting);\n } else {\n this.performExit();\n }\n } else if (this.props.unmountOnExit && this.state.status === EXITED) {\n this.setState({\n status: UNMOUNTED\n });\n }\n };\n\n _proto.performEnter = function performEnter(mounting) {\n var _this2 = this;\n\n var enter = this.props.enter;\n var appearing = this.context ? this.context.isMounting : mounting;\n\n var _ref2 = this.props.nodeRef ? [appearing] : [react_dom__WEBPACK_IMPORTED_MODULE_4___default.a.findDOMNode(this), appearing],\n maybeNode = _ref2[0],\n maybeAppearing = _ref2[1];\n\n var timeouts = this.getTimeouts();\n var enterTimeout = appearing ? timeouts.appear : timeouts.enter; // no enter animation skip right to ENTERED\n // if we are mounting and running this it means appear _must_ be set\n\n if (!mounting && !enter || _config__WEBPACK_IMPORTED_MODULE_5__[\"default\"].disabled) {\n this.safeSetState({\n status: ENTERED\n }, function () {\n _this2.props.onEntered(maybeNode);\n });\n return;\n }\n\n this.props.onEnter(maybeNode, maybeAppearing);\n this.safeSetState({\n status: ENTERING\n }, function () {\n _this2.props.onEntering(maybeNode, maybeAppearing);\n\n _this2.onTransitionEnd(enterTimeout, function () {\n _this2.safeSetState({\n status: ENTERED\n }, function () {\n _this2.props.onEntered(maybeNode, maybeAppearing);\n });\n });\n });\n };\n\n _proto.performExit = function performExit() {\n var _this3 = this;\n\n var exit = this.props.exit;\n var timeouts = this.getTimeouts();\n var maybeNode = this.props.nodeRef ? undefined : react_dom__WEBPACK_IMPORTED_MODULE_4___default.a.findDOMNode(this); // no exit animation skip right to EXITED\n\n if (!exit || _config__WEBPACK_IMPORTED_MODULE_5__[\"default\"].disabled) {\n this.safeSetState({\n status: EXITED\n }, function () {\n _this3.props.onExited(maybeNode);\n });\n return;\n }\n\n this.props.onExit(maybeNode);\n this.safeSetState({\n status: EXITING\n }, function () {\n _this3.props.onExiting(maybeNode);\n\n _this3.onTransitionEnd(timeouts.exit, function () {\n _this3.safeSetState({\n status: EXITED\n }, function () {\n _this3.props.onExited(maybeNode);\n });\n });\n });\n };\n\n _proto.cancelNextCallback = function cancelNextCallback() {\n if (this.nextCallback !== null) {\n this.nextCallback.cancel();\n this.nextCallback = null;\n }\n };\n\n _proto.safeSetState = function safeSetState(nextState, callback) {\n // This shouldn't be necessary, but there are weird race conditions with\n // setState callbacks and unmounting in testing, so always make sure that\n // we can cancel any pending setState callbacks after we unmount.\n callback = this.setNextCallback(callback);\n this.setState(nextState, callback);\n };\n\n _proto.setNextCallback = function setNextCallback(callback) {\n var _this4 = this;\n\n var active = true;\n\n this.nextCallback = function (event) {\n if (active) {\n active = false;\n _this4.nextCallback = null;\n callback(event);\n }\n };\n\n this.nextCallback.cancel = function () {\n active = false;\n };\n\n return this.nextCallback;\n };\n\n _proto.onTransitionEnd = function onTransitionEnd(timeout, handler) {\n this.setNextCallback(handler);\n var node = this.props.nodeRef ? this.props.nodeRef.current : react_dom__WEBPACK_IMPORTED_MODULE_4___default.a.findDOMNode(this);\n var doesNotHaveTimeoutOrListener = timeout == null && !this.props.addEndListener;\n\n if (!node || doesNotHaveTimeoutOrListener) {\n setTimeout(this.nextCallback, 0);\n return;\n }\n\n if (this.props.addEndListener) {\n var _ref3 = this.props.nodeRef ? [this.nextCallback] : [node, this.nextCallback],\n maybeNode = _ref3[0],\n maybeNextCallback = _ref3[1];\n\n this.props.addEndListener(maybeNode, maybeNextCallback);\n }\n\n if (timeout != null) {\n setTimeout(this.nextCallback, timeout);\n }\n };\n\n _proto.render = function render() {\n var status = this.state.status;\n\n if (status === UNMOUNTED) {\n return null;\n }\n\n var _this$props = this.props,\n children = _this$props.children,\n _in = _this$props.in,\n _mountOnEnter = _this$props.mountOnEnter,\n _unmountOnExit = _this$props.unmountOnExit,\n _appear = _this$props.appear,\n _enter = _this$props.enter,\n _exit = _this$props.exit,\n _timeout = _this$props.timeout,\n _addEndListener = _this$props.addEndListener,\n _onEnter = _this$props.onEnter,\n _onEntering = _this$props.onEntering,\n _onEntered = _this$props.onEntered,\n _onExit = _this$props.onExit,\n _onExiting = _this$props.onExiting,\n _onExited = _this$props.onExited,\n _nodeRef = _this$props.nodeRef,\n childProps = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(_this$props, [\"children\", \"in\", \"mountOnEnter\", \"unmountOnExit\", \"appear\", \"enter\", \"exit\", \"timeout\", \"addEndListener\", \"onEnter\", \"onEntering\", \"onEntered\", \"onExit\", \"onExiting\", \"onExited\", \"nodeRef\"]);\n\n return (\n /*#__PURE__*/\n // allows for nested Transitions\n react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_TransitionGroupContext__WEBPACK_IMPORTED_MODULE_7__[\"default\"].Provider, {\n value: null\n }, typeof children === 'function' ? children(status, childProps) : react__WEBPACK_IMPORTED_MODULE_3___default.a.cloneElement(react__WEBPACK_IMPORTED_MODULE_3___default.a.Children.only(children), childProps))\n );\n };\n\n return Transition;\n}(react__WEBPACK_IMPORTED_MODULE_3___default.a.Component);\n\nTransition.contextType = _TransitionGroupContext__WEBPACK_IMPORTED_MODULE_7__[\"default\"];\nTransition.propTypes = undefined !== \"production\" ? {\n /**\n * A React reference to DOM element that need to transition:\n * https://stackoverflow.com/a/51127130/4671932\n *\n * - When `nodeRef` prop is used, `node` is not passed to callback functions\n * (e.g. `onEnter`) because user already has direct access to the node.\n * - When changing `key` prop of `Transition` in a `TransitionGroup` a new\n * `nodeRef` need to be provided to `Transition` with changed `key` prop\n * (see\n * [test/CSSTransition-test.js](https://github.com/reactjs/react-transition-group/blob/13435f897b3ab71f6e19d724f145596f5910581c/test/CSSTransition-test.js#L362-L437)).\n */\n nodeRef: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.shape({\n current: typeof Element === 'undefined' ? prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.any : prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.instanceOf(Element)\n }),\n\n /**\n * A `function` child can be used instead of a React element. This function is\n * called with the current transition status (`'entering'`, `'entered'`,\n * `'exiting'`, `'exited'`), which can be used to apply context\n * specific props to a component.\n *\n * ```jsx\n * <Transition in={this.state.in} timeout={150}>\n * {state => (\n * <MyComponent className={`fade fade-${state}`} />\n * )}\n * </Transition>\n * ```\n */\n children: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func.isRequired, prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.element.isRequired]).isRequired,\n\n /**\n * Show the component; triggers the enter or exit states\n */\n in: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool,\n\n /**\n * By default the child component is mounted immediately along with\n * the parent `Transition` component. If you want to \"lazy mount\" the component on the\n * first `in={true}` you can set `mountOnEnter`. After the first enter transition the component will stay\n * mounted, even on \"exited\", unless you also specify `unmountOnExit`.\n */\n mountOnEnter: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool,\n\n /**\n * By default the child component stays mounted after it reaches the `'exited'` state.\n * Set `unmountOnExit` if you'd prefer to unmount the component after it finishes exiting.\n */\n unmountOnExit: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool,\n\n /**\n * By default the child component does not perform the enter transition when\n * it first mounts, regardless of the value of `in`. If you want this\n * behavior, set both `appear` and `in` to `true`.\n *\n * > **Note**: there are no special appear states like `appearing`/`appeared`, this prop\n * > only adds an additional enter transition. However, in the\n * > `<CSSTransition>` component that first enter transition does result in\n * > additional `.appear-*` classes, that way you can choose to style it\n * > differently.\n */\n appear: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool,\n\n /**\n * Enable or disable enter transitions.\n */\n enter: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool,\n\n /**\n * Enable or disable exit transitions.\n */\n exit: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool,\n\n /**\n * The duration of the transition, in milliseconds.\n * Required unless `addEndListener` is provided.\n *\n * You may specify a single timeout for all transitions:\n *\n * ```jsx\n * timeout={500}\n * ```\n *\n * or individually:\n *\n * ```jsx\n * timeout={{\n * appear: 500,\n * enter: 300,\n * exit: 500,\n * }}\n * ```\n *\n * - `appear` defaults to the value of `enter`\n * - `enter` defaults to `0`\n * - `exit` defaults to `0`\n *\n * @type {number | { enter?: number, exit?: number, appear?: number }}\n */\n timeout: function timeout(props) {\n var pt = _utils_PropTypes__WEBPACK_IMPORTED_MODULE_6__[\"timeoutsShape\"];\n if (!props.addEndListener) pt = pt.isRequired;\n\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n return pt.apply(void 0, [props].concat(args));\n },\n\n /**\n * Add a custom transition end trigger. Called with the transitioning\n * DOM node and a `done` callback. Allows for more fine grained transition end\n * logic. Timeouts are still used as a fallback if provided.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * ```jsx\n * addEndListener={(node, done) => {\n * // use the css transitionend event to mark the finish of a transition\n * node.addEventListener('transitionend', done, false);\n * }}\n * ```\n */\n addEndListener: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func,\n\n /**\n * Callback fired before the \"entering\" status is applied. An extra parameter\n * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement, isAppearing: bool) -> void\n */\n onEnter: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func,\n\n /**\n * Callback fired after the \"entering\" status is applied. An extra parameter\n * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement, isAppearing: bool)\n */\n onEntering: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func,\n\n /**\n * Callback fired after the \"entered\" status is applied. An extra parameter\n * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement, isAppearing: bool) -> void\n */\n onEntered: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func,\n\n /**\n * Callback fired before the \"exiting\" status is applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement) -> void\n */\n onExit: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func,\n\n /**\n * Callback fired after the \"exiting\" status is applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement) -> void\n */\n onExiting: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func,\n\n /**\n * Callback fired after the \"exited\" status is applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed\n *\n * @type Function(node: HtmlElement) -> void\n */\n onExited: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func\n} : {}; // Name the function so it is clearer in the documentation\n\nfunction noop() {}\n\nTransition.defaultProps = {\n in: false,\n mountOnEnter: false,\n unmountOnExit: false,\n appear: false,\n enter: true,\n exit: true,\n onEnter: noop,\n onEntering: noop,\n onEntered: noop,\n onExit: noop,\n onExiting: noop,\n onExited: noop\n};\nTransition.UNMOUNTED = UNMOUNTED;\nTransition.EXITED = EXITED;\nTransition.ENTERING = ENTERING;\nTransition.ENTERED = ENTERED;\nTransition.EXITING = EXITING;\n/* harmony default export */ __webpack_exports__[\"default\"] = (Transition);\n\n//# sourceURL=webpack:///./node_modules/react-transition-group/esm/Transition.js?");
|
849 |
+
|
850 |
+
/***/ }),
|
851 |
+
|
852 |
+
/***/ "./node_modules/react-transition-group/esm/TransitionGroup.js":
|
853 |
+
/*!********************************************************************!*\
|
854 |
+
!*** ./node_modules/react-transition-group/esm/TransitionGroup.js ***!
|
855 |
+
\********************************************************************/
|
856 |
+
/*! exports provided: default */
|
857 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
858 |
+
|
859 |
+
"use strict";
|
860 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ \"./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js\");\n/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ \"./node_modules/@babel/runtime/helpers/esm/extends.js\");\n/* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ \"./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js\");\n/* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ \"./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js\");\n/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\");\n/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _TransitionGroupContext__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./TransitionGroupContext */ \"./node_modules/react-transition-group/esm/TransitionGroupContext.js\");\n/* harmony import */ var _utils_ChildMapping__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./utils/ChildMapping */ \"./node_modules/react-transition-group/esm/utils/ChildMapping.js\");\n\n\n\n\n\n\n\n\n\nvar values = Object.values || function (obj) {\n return Object.keys(obj).map(function (k) {\n return obj[k];\n });\n};\n\nvar defaultProps = {\n component: 'div',\n childFactory: function childFactory(child) {\n return child;\n }\n};\n/**\n * The `<TransitionGroup>` component manages a set of transition components\n * (`<Transition>` and `<CSSTransition>`) in a list. Like with the transition\n * components, `<TransitionGroup>` is a state machine for managing the mounting\n * and unmounting of components over time.\n *\n * Consider the example below. As items are removed or added to the TodoList the\n * `in` prop is toggled automatically by the `<TransitionGroup>`.\n *\n * Note that `<TransitionGroup>` does not define any animation behavior!\n * Exactly _how_ a list item animates is up to the individual transition\n * component. This means you can mix and match animations across different list\n * items.\n */\n\nvar TransitionGroup = /*#__PURE__*/function (_React$Component) {\n Object(_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(TransitionGroup, _React$Component);\n\n function TransitionGroup(props, context) {\n var _this;\n\n _this = _React$Component.call(this, props, context) || this;\n\n var handleExited = _this.handleExited.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(_this)); // Initial children should all be entering, dependent on appear\n\n\n _this.state = {\n contextValue: {\n isMounting: true\n },\n handleExited: handleExited,\n firstRender: true\n };\n return _this;\n }\n\n var _proto = TransitionGroup.prototype;\n\n _proto.componentDidMount = function componentDidMount() {\n this.mounted = true;\n this.setState({\n contextValue: {\n isMounting: false\n }\n });\n };\n\n _proto.componentWillUnmount = function componentWillUnmount() {\n this.mounted = false;\n };\n\n TransitionGroup.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, _ref) {\n var prevChildMapping = _ref.children,\n handleExited = _ref.handleExited,\n firstRender = _ref.firstRender;\n return {\n children: firstRender ? Object(_utils_ChildMapping__WEBPACK_IMPORTED_MODULE_7__[\"getInitialChildMapping\"])(nextProps, handleExited) : Object(_utils_ChildMapping__WEBPACK_IMPORTED_MODULE_7__[\"getNextChildMapping\"])(nextProps, prevChildMapping, handleExited),\n firstRender: false\n };\n } // node is `undefined` when user provided `nodeRef` prop\n ;\n\n _proto.handleExited = function handleExited(child, node) {\n var currentChildMapping = Object(_utils_ChildMapping__WEBPACK_IMPORTED_MODULE_7__[\"getChildMapping\"])(this.props.children);\n if (child.key in currentChildMapping) return;\n\n if (child.props.onExited) {\n child.props.onExited(node);\n }\n\n if (this.mounted) {\n this.setState(function (state) {\n var children = Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__[\"default\"])({}, state.children);\n\n delete children[child.key];\n return {\n children: children\n };\n });\n }\n };\n\n _proto.render = function render() {\n var _this$props = this.props,\n Component = _this$props.component,\n childFactory = _this$props.childFactory,\n props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(_this$props, [\"component\", \"childFactory\"]);\n\n var contextValue = this.state.contextValue;\n var children = values(this.state.children).map(childFactory);\n delete props.appear;\n delete props.enter;\n delete props.exit;\n\n if (Component === null) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement(_TransitionGroupContext__WEBPACK_IMPORTED_MODULE_6__[\"default\"].Provider, {\n value: contextValue\n }, children);\n }\n\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement(_TransitionGroupContext__WEBPACK_IMPORTED_MODULE_6__[\"default\"].Provider, {\n value: contextValue\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement(Component, props, children));\n };\n\n return TransitionGroup;\n}(react__WEBPACK_IMPORTED_MODULE_5___default.a.Component);\n\nTransitionGroup.propTypes = undefined !== \"production\" ? {\n /**\n * `<TransitionGroup>` renders a `<div>` by default. You can change this\n * behavior by providing a `component` prop.\n * If you use React v16+ and would like to avoid a wrapping `<div>` element\n * you can pass in `component={null}`. This is useful if the wrapping div\n * borks your css styles.\n */\n component: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.any,\n\n /**\n * A set of `<Transition>` components, that are toggled `in` and out as they\n * leave. the `<TransitionGroup>` will inject specific transition props, so\n * remember to spread them through if you are wrapping the `<Transition>` as\n * with our `<Fade>` example.\n *\n * While this component is meant for multiple `Transition` or `CSSTransition`\n * children, sometimes you may want to have a single transition child with\n * content that you want to be transitioned out and in when you change it\n * (e.g. routes, images etc.) In that case you can change the `key` prop of\n * the transition child as you change its content, this will cause\n * `TransitionGroup` to transition the child out and back in.\n */\n children: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.node,\n\n /**\n * A convenience prop that enables or disables appear animations\n * for all children. Note that specifying this will override any defaults set\n * on individual children Transitions.\n */\n appear: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.bool,\n\n /**\n * A convenience prop that enables or disables enter animations\n * for all children. Note that specifying this will override any defaults set\n * on individual children Transitions.\n */\n enter: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.bool,\n\n /**\n * A convenience prop that enables or disables exit animations\n * for all children. Note that specifying this will override any defaults set\n * on individual children Transitions.\n */\n exit: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.bool,\n\n /**\n * You may need to apply reactive updates to a child as it is exiting.\n * This is generally done by using `cloneElement` however in the case of an exiting\n * child the element has already been removed and not accessible to the consumer.\n *\n * If you do need to update a child as it leaves you can provide a `childFactory`\n * to wrap every child, even the ones that are leaving.\n *\n * @type Function(child: ReactElement) -> ReactElement\n */\n childFactory: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.func\n} : {};\nTransitionGroup.defaultProps = defaultProps;\n/* harmony default export */ __webpack_exports__[\"default\"] = (TransitionGroup);\n\n//# sourceURL=webpack:///./node_modules/react-transition-group/esm/TransitionGroup.js?");
|
861 |
+
|
862 |
+
/***/ }),
|
863 |
+
|
864 |
+
/***/ "./node_modules/react-transition-group/esm/TransitionGroupContext.js":
|
865 |
+
/*!***************************************************************************!*\
|
866 |
+
!*** ./node_modules/react-transition-group/esm/TransitionGroupContext.js ***!
|
867 |
+
\***************************************************************************/
|
868 |
+
/*! exports provided: default */
|
869 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
870 |
+
|
871 |
+
"use strict";
|
872 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (react__WEBPACK_IMPORTED_MODULE_0___default.a.createContext(null));\n\n//# sourceURL=webpack:///./node_modules/react-transition-group/esm/TransitionGroupContext.js?");
|
873 |
+
|
874 |
+
/***/ }),
|
875 |
+
|
876 |
+
/***/ "./node_modules/react-transition-group/esm/config.js":
|
877 |
+
/*!***********************************************************!*\
|
878 |
+
!*** ./node_modules/react-transition-group/esm/config.js ***!
|
879 |
+
\***********************************************************/
|
880 |
+
/*! exports provided: default */
|
881 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
882 |
+
|
883 |
+
"use strict";
|
884 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n disabled: false\n});\n\n//# sourceURL=webpack:///./node_modules/react-transition-group/esm/config.js?");
|
885 |
+
|
886 |
+
/***/ }),
|
887 |
+
|
888 |
+
/***/ "./node_modules/react-transition-group/esm/index.js":
|
889 |
+
/*!**********************************************************!*\
|
890 |
+
!*** ./node_modules/react-transition-group/esm/index.js ***!
|
891 |
+
\**********************************************************/
|
892 |
+
/*! exports provided: CSSTransition, ReplaceTransition, SwitchTransition, TransitionGroup, Transition, config */
|
893 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
894 |
+
|
895 |
+
"use strict";
|
896 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _CSSTransition__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./CSSTransition */ \"./node_modules/react-transition-group/esm/CSSTransition.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"CSSTransition\", function() { return _CSSTransition__WEBPACK_IMPORTED_MODULE_0__[\"default\"]; });\n\n/* harmony import */ var _ReplaceTransition__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ReplaceTransition */ \"./node_modules/react-transition-group/esm/ReplaceTransition.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"ReplaceTransition\", function() { return _ReplaceTransition__WEBPACK_IMPORTED_MODULE_1__[\"default\"]; });\n\n/* harmony import */ var _SwitchTransition__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./SwitchTransition */ \"./node_modules/react-transition-group/esm/SwitchTransition.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"SwitchTransition\", function() { return _SwitchTransition__WEBPACK_IMPORTED_MODULE_2__[\"default\"]; });\n\n/* harmony import */ var _TransitionGroup__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./TransitionGroup */ \"./node_modules/react-transition-group/esm/TransitionGroup.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"TransitionGroup\", function() { return _TransitionGroup__WEBPACK_IMPORTED_MODULE_3__[\"default\"]; });\n\n/* harmony import */ var _Transition__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Transition */ \"./node_modules/react-transition-group/esm/Transition.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Transition\", function() { return _Transition__WEBPACK_IMPORTED_MODULE_4__[\"default\"]; });\n\n/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./config */ \"./node_modules/react-transition-group/esm/config.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"config\", function() { return _config__WEBPACK_IMPORTED_MODULE_5__[\"default\"]; });\n\n\n\n\n\n\n\n\n//# sourceURL=webpack:///./node_modules/react-transition-group/esm/index.js?");
|
897 |
+
|
898 |
+
/***/ }),
|
899 |
+
|
900 |
+
/***/ "./node_modules/react-transition-group/esm/utils/ChildMapping.js":
|
901 |
+
/*!***********************************************************************!*\
|
902 |
+
!*** ./node_modules/react-transition-group/esm/utils/ChildMapping.js ***!
|
903 |
+
\***********************************************************************/
|
904 |
+
/*! exports provided: getChildMapping, mergeChildMappings, getInitialChildMapping, getNextChildMapping */
|
905 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
906 |
+
|
907 |
+
"use strict";
|
908 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getChildMapping\", function() { return getChildMapping; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"mergeChildMappings\", function() { return mergeChildMappings; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getInitialChildMapping\", function() { return getInitialChildMapping; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getNextChildMapping\", function() { return getNextChildMapping; });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n\n/**\n * Given `this.props.children`, return an object mapping key to child.\n *\n * @param {*} children `this.props.children`\n * @return {object} Mapping of key to child\n */\n\nfunction getChildMapping(children, mapFn) {\n var mapper = function mapper(child) {\n return mapFn && Object(react__WEBPACK_IMPORTED_MODULE_0__[\"isValidElement\"])(child) ? mapFn(child) : child;\n };\n\n var result = Object.create(null);\n if (children) react__WEBPACK_IMPORTED_MODULE_0__[\"Children\"].map(children, function (c) {\n return c;\n }).forEach(function (child) {\n // run the map function here instead so that the key is the computed one\n result[child.key] = mapper(child);\n });\n return result;\n}\n/**\n * When you're adding or removing children some may be added or removed in the\n * same render pass. We want to show *both* since we want to simultaneously\n * animate elements in and out. This function takes a previous set of keys\n * and a new set of keys and merges them with its best guess of the correct\n * ordering. In the future we may expose some of the utilities in\n * ReactMultiChild to make this easy, but for now React itself does not\n * directly have this concept of the union of prevChildren and nextChildren\n * so we implement it here.\n *\n * @param {object} prev prev children as returned from\n * `ReactTransitionChildMapping.getChildMapping()`.\n * @param {object} next next children as returned from\n * `ReactTransitionChildMapping.getChildMapping()`.\n * @return {object} a key set that contains all keys in `prev` and all keys\n * in `next` in a reasonable order.\n */\n\nfunction mergeChildMappings(prev, next) {\n prev = prev || {};\n next = next || {};\n\n function getValueForKey(key) {\n return key in next ? next[key] : prev[key];\n } // For each key of `next`, the list of keys to insert before that key in\n // the combined list\n\n\n var nextKeysPending = Object.create(null);\n var pendingKeys = [];\n\n for (var prevKey in prev) {\n if (prevKey in next) {\n if (pendingKeys.length) {\n nextKeysPending[prevKey] = pendingKeys;\n pendingKeys = [];\n }\n } else {\n pendingKeys.push(prevKey);\n }\n }\n\n var i;\n var childMapping = {};\n\n for (var nextKey in next) {\n if (nextKeysPending[nextKey]) {\n for (i = 0; i < nextKeysPending[nextKey].length; i++) {\n var pendingNextKey = nextKeysPending[nextKey][i];\n childMapping[nextKeysPending[nextKey][i]] = getValueForKey(pendingNextKey);\n }\n }\n\n childMapping[nextKey] = getValueForKey(nextKey);\n } // Finally, add the keys which didn't appear before any key in `next`\n\n\n for (i = 0; i < pendingKeys.length; i++) {\n childMapping[pendingKeys[i]] = getValueForKey(pendingKeys[i]);\n }\n\n return childMapping;\n}\n\nfunction getProp(child, prop, props) {\n return props[prop] != null ? props[prop] : child.props[prop];\n}\n\nfunction getInitialChildMapping(props, onExited) {\n return getChildMapping(props.children, function (child) {\n return Object(react__WEBPACK_IMPORTED_MODULE_0__[\"cloneElement\"])(child, {\n onExited: onExited.bind(null, child),\n in: true,\n appear: getProp(child, 'appear', props),\n enter: getProp(child, 'enter', props),\n exit: getProp(child, 'exit', props)\n });\n });\n}\nfunction getNextChildMapping(nextProps, prevChildMapping, onExited) {\n var nextChildMapping = getChildMapping(nextProps.children);\n var children = mergeChildMappings(prevChildMapping, nextChildMapping);\n Object.keys(children).forEach(function (key) {\n var child = children[key];\n if (!Object(react__WEBPACK_IMPORTED_MODULE_0__[\"isValidElement\"])(child)) return;\n var hasPrev = (key in prevChildMapping);\n var hasNext = (key in nextChildMapping);\n var prevChild = prevChildMapping[key];\n var isLeaving = Object(react__WEBPACK_IMPORTED_MODULE_0__[\"isValidElement\"])(prevChild) && !prevChild.props.in; // item is new (entering)\n\n if (hasNext && (!hasPrev || isLeaving)) {\n // console.log('entering', key)\n children[key] = Object(react__WEBPACK_IMPORTED_MODULE_0__[\"cloneElement\"])(child, {\n onExited: onExited.bind(null, child),\n in: true,\n exit: getProp(child, 'exit', nextProps),\n enter: getProp(child, 'enter', nextProps)\n });\n } else if (!hasNext && hasPrev && !isLeaving) {\n // item is old (exiting)\n // console.log('leaving', key)\n children[key] = Object(react__WEBPACK_IMPORTED_MODULE_0__[\"cloneElement\"])(child, {\n in: false\n });\n } else if (hasNext && hasPrev && Object(react__WEBPACK_IMPORTED_MODULE_0__[\"isValidElement\"])(prevChild)) {\n // item hasn't changed transition states\n // copy over the last transition props;\n // console.log('unchanged', key)\n children[key] = Object(react__WEBPACK_IMPORTED_MODULE_0__[\"cloneElement\"])(child, {\n onExited: onExited.bind(null, child),\n in: prevChild.props.in,\n exit: getProp(child, 'exit', nextProps),\n enter: getProp(child, 'enter', nextProps)\n });\n }\n });\n return children;\n}\n\n//# sourceURL=webpack:///./node_modules/react-transition-group/esm/utils/ChildMapping.js?");
|
909 |
+
|
910 |
+
/***/ }),
|
911 |
+
|
912 |
+
/***/ "./node_modules/react-transition-group/esm/utils/PropTypes.js":
|
913 |
+
/*!********************************************************************!*\
|
914 |
+
!*** ./node_modules/react-transition-group/esm/utils/PropTypes.js ***!
|
915 |
+
\********************************************************************/
|
916 |
+
/*! exports provided: timeoutsShape, classNamesShape */
|
917 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
918 |
+
|
919 |
+
"use strict";
|
920 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"timeoutsShape\", function() { return timeoutsShape; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"classNamesShape\", function() { return classNamesShape; });\n/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\");\n/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_0__);\n\nvar timeoutsShape = undefined !== 'production' ? prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.number, prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.shape({\n enter: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.number,\n exit: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.number,\n appear: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.number\n}).isRequired]) : null;\nvar classNamesShape = undefined !== 'production' ? prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string, prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.shape({\n enter: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string,\n exit: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string,\n active: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string\n}), prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.shape({\n enter: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string,\n enterDone: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string,\n enterActive: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string,\n exit: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string,\n exitDone: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string,\n exitActive: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string\n})]) : null;\n\n//# sourceURL=webpack:///./node_modules/react-transition-group/esm/utils/PropTypes.js?");
|
921 |
+
|
922 |
+
/***/ }),
|
923 |
+
|
924 |
+
/***/ "@babel/runtime/regenerator":
|
925 |
+
/*!**********************************************!*\
|
926 |
+
!*** external {"this":"regeneratorRuntime"} ***!
|
927 |
+
\**********************************************/
|
928 |
+
/*! no static exports found */
|
929 |
+
/***/ (function(module, exports) {
|
930 |
+
|
931 |
+
eval("(function() { module.exports = this[\"regeneratorRuntime\"]; }());\n\n//# sourceURL=webpack:///external_%7B%22this%22:%22regeneratorRuntime%22%7D?");
|
932 |
+
|
933 |
+
/***/ }),
|
934 |
+
|
935 |
+
/***/ "@wordpress/api-fetch":
|
936 |
+
/*!*******************************************!*\
|
937 |
+
!*** external {"this":["wp","apiFetch"]} ***!
|
938 |
+
\*******************************************/
|
939 |
+
/*! no static exports found */
|
940 |
+
/***/ (function(module, exports) {
|
941 |
+
|
942 |
+
eval("(function() { module.exports = this[\"wp\"][\"apiFetch\"]; }());\n\n//# sourceURL=webpack:///external_%7B%22this%22:%5B%22wp%22,%22apiFetch%22%5D%7D?");
|
943 |
+
|
944 |
+
/***/ }),
|
945 |
+
|
946 |
+
/***/ "@wordpress/blocks":
|
947 |
+
/*!*****************************************!*\
|
948 |
+
!*** external {"this":["wp","blocks"]} ***!
|
949 |
+
\*****************************************/
|
950 |
+
/*! no static exports found */
|
951 |
+
/***/ (function(module, exports) {
|
952 |
+
|
953 |
+
eval("(function() { module.exports = this[\"wp\"][\"blocks\"]; }());\n\n//# sourceURL=webpack:///external_%7B%22this%22:%5B%22wp%22,%22blocks%22%5D%7D?");
|
954 |
+
|
955 |
+
/***/ }),
|
956 |
+
|
957 |
+
/***/ "@wordpress/components":
|
958 |
+
/*!*********************************************!*\
|
959 |
+
!*** external {"this":["wp","components"]} ***!
|
960 |
+
\*********************************************/
|
961 |
+
/*! no static exports found */
|
962 |
+
/***/ (function(module, exports) {
|
963 |
+
|
964 |
+
eval("(function() { module.exports = this[\"wp\"][\"components\"]; }());\n\n//# sourceURL=webpack:///external_%7B%22this%22:%5B%22wp%22,%22components%22%5D%7D?");
|
965 |
+
|
966 |
+
/***/ }),
|
967 |
+
|
968 |
+
/***/ "@wordpress/element":
|
969 |
+
/*!******************************************!*\
|
970 |
+
!*** external {"this":["wp","element"]} ***!
|
971 |
+
\******************************************/
|
972 |
+
/*! no static exports found */
|
973 |
+
/***/ (function(module, exports) {
|
974 |
+
|
975 |
+
eval("(function() { module.exports = this[\"wp\"][\"element\"]; }());\n\n//# sourceURL=webpack:///external_%7B%22this%22:%5B%22wp%22,%22element%22%5D%7D?");
|
976 |
+
|
977 |
+
/***/ }),
|
978 |
+
|
979 |
+
/***/ "@wordpress/i18n":
|
980 |
+
/*!***************************************!*\
|
981 |
+
!*** external {"this":["wp","i18n"]} ***!
|
982 |
+
\***************************************/
|
983 |
+
/*! no static exports found */
|
984 |
+
/***/ (function(module, exports) {
|
985 |
+
|
986 |
+
eval("(function() { module.exports = this[\"wp\"][\"i18n\"]; }());\n\n//# sourceURL=webpack:///external_%7B%22this%22:%5B%22wp%22,%22i18n%22%5D%7D?");
|
987 |
+
|
988 |
+
/***/ }),
|
989 |
+
|
990 |
+
/***/ "lodash":
|
991 |
+
/*!**********************************!*\
|
992 |
+
!*** external {"this":"lodash"} ***!
|
993 |
+
\**********************************/
|
994 |
+
/*! no static exports found */
|
995 |
+
/***/ (function(module, exports) {
|
996 |
+
|
997 |
+
eval("(function() { module.exports = this[\"lodash\"]; }());\n\n//# sourceURL=webpack:///external_%7B%22this%22:%22lodash%22%7D?");
|
998 |
+
|
999 |
+
/***/ }),
|
1000 |
+
|
1001 |
+
/***/ "react":
|
1002 |
+
/*!*********************************!*\
|
1003 |
+
!*** external {"this":"React"} ***!
|
1004 |
+
\*********************************/
|
1005 |
+
/*! no static exports found */
|
1006 |
+
/***/ (function(module, exports) {
|
1007 |
+
|
1008 |
+
eval("(function() { module.exports = this[\"React\"]; }());\n\n//# sourceURL=webpack:///external_%7B%22this%22:%22React%22%7D?");
|
1009 |
+
|
1010 |
+
/***/ }),
|
1011 |
+
|
1012 |
+
/***/ "react-dom":
|
1013 |
+
/*!************************************!*\
|
1014 |
+
!*** external {"this":"ReactDOM"} ***!
|
1015 |
+
\************************************/
|
1016 |
+
/*! no static exports found */
|
1017 |
+
/***/ (function(module, exports) {
|
1018 |
+
|
1019 |
+
eval("(function() { module.exports = this[\"ReactDOM\"]; }());\n\n//# sourceURL=webpack:///external_%7B%22this%22:%22ReactDOM%22%7D?");
|
1020 |
+
|
1021 |
+
/***/ })
|
1022 |
+
|
1023 |
+
/******/ })));
|
changelog.txt
CHANGED
@@ -1,3 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
= 1.1.1 =
|
2 |
* Don't Request User Code on Save if there is nothing to save (#284)
|
3 |
* Skip the setup screen if a user code is saved (#282)
|
1 |
+
= 1.2.0 =
|
2 |
+
* Add next-version-number placeholder for docblocks (#307)
|
3 |
+
* Show current account info on API key selection screen (#317)
|
4 |
+
* Vote Block: Handle User Colour On Hover (#312)
|
5 |
+
* refactor common code for poll based blocks (#311)
|
6 |
+
* set mappings for missing meta values (#309)
|
7 |
+
* Set a visible closed state (#301)
|
8 |
+
* Set a numbered default title (#304)
|
9 |
+
* Set vote count font to standard font, not based on theme (#300)
|
10 |
+
* Add checkmark icon to size dropdown so it is obvious what state you are in (#298)
|
11 |
+
* Fix empty brand link height (#294)
|
12 |
+
* conditionally call results endpoint if results are hidden (#293)
|
13 |
+
* leave focus on parent when vote block is inserted (#299)
|
14 |
+
* make styles a little more specific to overcome hostile themes (#297)
|
15 |
+
* allow gutenberg hover colour to work with custom toolbar icons (#296)
|
16 |
+
* refactor how up/down icons are decided on to cleanup addition of `className` property (#295)
|
17 |
+
* prevent icon height from changing when vote count is hidden (#291)
|
18 |
+
* Refactor Poll duplicate checker, add to vote block (#290)
|
19 |
+
* Update Vote block classnames to match Poll classname pattern (#289)
|
20 |
+
* only parse child elements that match the blocks we support (#288)
|
21 |
+
* Update the vote icons (#286)
|
22 |
+
* Auto detect theme colours (#285)
|
23 |
+
* Vote Item custom colours options (#283)
|
24 |
+
* refactored toolbar to use Toolbar instead of ToolbarButton for backwards compatibility (#281)
|
25 |
+
* Fixes for PropTypes on VoteItem (#280)
|
26 |
+
* Add a hideResults setting for the vote block (#279)
|
27 |
+
* Display Crowdsignal branding after voting (#276)
|
28 |
+
* Add toolbar button to change border size and radius (#273)
|
29 |
+
* Add voting animations (#274)
|
30 |
+
* Format large vote count numbers (#272)
|
31 |
+
* Add ability to change voting block size (#269)
|
32 |
+
* Fix indention of lines
|
33 |
+
* Cleaning up code, copying, and adding variables.
|
34 |
+
* Fix linting errors and remove unused constants
|
35 |
+
* Add "Open/Close" status to sidebar for vote block
|
36 |
+
* Add/show results on vote component (#259)
|
37 |
+
* Fix Default Title not syncing to platform (#253)
|
38 |
+
* Enable voting on the vote block (#251)
|
39 |
+
* Build The Public Vote Component (#249)
|
40 |
+
* Create poll model from vote block (#250)
|
41 |
+
* Consolidate Custom Mutation Observers Into Library Function (#244)
|
42 |
+
* Use Connect Placeholder For All Blocks (#247)
|
43 |
+
* change Block interface into abstract class, move common helpers there. (#243)
|
44 |
+
* Vote sidebar (#245)
|
45 |
+
* Add Crowdsignal block category to house all blocks within the plugin (#246)
|
46 |
+
* Vote block placeholders (#238)
|
47 |
+
* Update admin notices style (#305)
|
48 |
+
* Check API key is not empty before attempting to update connection settings
|
49 |
+
* Adding a slight opacity change when hovering a button that has a custom bg color set. (#303)
|
50 |
+
* Update/security fixes (#302)
|
51 |
+
|
52 |
= 1.1.1 =
|
53 |
* Don't Request User Code on Save if there is nothing to save (#284)
|
54 |
* Skip the setup screen if a user code is saved (#282)
|
crowdsignal-forms.php
CHANGED
@@ -15,7 +15,7 @@
|
|
15 |
* Plugin Name: Crowdsignal Forms
|
16 |
* Plugin URI: https://crowdsignal.com/crowdsignal-forms/
|
17 |
* Description: Crowdsignal Form Blocks
|
18 |
-
* Version: 1.
|
19 |
* Author: Automattic
|
20 |
* Author URI: https://automattic.com/
|
21 |
* License: GPL-2.0+
|
@@ -28,7 +28,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
28 |
die;
|
29 |
}
|
30 |
|
31 |
-
define( 'CROWDSIGNAL_FORMS_VERSION', '1.
|
32 |
define( 'CROWDSIGNAL_FORMS_PLUGIN_FILE', __FILE__ );
|
33 |
define( 'CROWDSIGNAL_FORMS_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
|
34 |
|
15 |
* Plugin Name: Crowdsignal Forms
|
16 |
* Plugin URI: https://crowdsignal.com/crowdsignal-forms/
|
17 |
* Description: Crowdsignal Form Blocks
|
18 |
+
* Version: 1.2.0
|
19 |
* Author: Automattic
|
20 |
* Author URI: https://automattic.com/
|
21 |
* License: GPL-2.0+
|
28 |
die;
|
29 |
}
|
30 |
|
31 |
+
define( 'CROWDSIGNAL_FORMS_VERSION', '1.2.0' );
|
32 |
define( 'CROWDSIGNAL_FORMS_PLUGIN_FILE', __FILE__ );
|
33 |
define( 'CROWDSIGNAL_FORMS_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
|
34 |
|
includes/admin/admin-styles.css
CHANGED
@@ -31,6 +31,11 @@
|
|
31 |
padding-left: 16px;
|
32 |
}
|
33 |
|
|
|
|
|
|
|
|
|
|
|
34 |
.crowdsignal-setup__logo-container {
|
35 |
flex-grow: 0;
|
36 |
flex-shrink: 0;
|
@@ -82,6 +87,7 @@
|
|
82 |
align-content: center;
|
83 |
margin: 24px auto 0;
|
84 |
border: 1px solid rgba(213, 213, 213, 0.5);
|
|
|
85 |
}
|
86 |
|
87 |
.crowdsignal-setup__main img {
|
@@ -194,8 +200,36 @@
|
|
194 |
}
|
195 |
|
196 |
|
197 |
-
.wrap .
|
198 |
-
margin
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
199 |
}
|
200 |
|
201 |
.crowdsignal-settings__main-content {
|
31 |
padding-left: 16px;
|
32 |
}
|
33 |
|
34 |
+
.crowdsignal-settings-wrap {
|
35 |
+
max-width: 960px;
|
36 |
+
margin: 0 auto;
|
37 |
+
}
|
38 |
+
|
39 |
.crowdsignal-setup__logo-container {
|
40 |
flex-grow: 0;
|
41 |
flex-shrink: 0;
|
87 |
align-content: center;
|
88 |
margin: 24px auto 0;
|
89 |
border: 1px solid rgba(213, 213, 213, 0.5);
|
90 |
+
max-width: 960px;
|
91 |
}
|
92 |
|
93 |
.crowdsignal-setup__main img {
|
200 |
}
|
201 |
|
202 |
|
203 |
+
.wrap div.crowdsignal-message {
|
204 |
+
margin: 24px auto 8px auto;
|
205 |
+
border: 0;
|
206 |
+
padding: 16px;
|
207 |
+
padding-left: 24px;
|
208 |
+
max-width: 960px;
|
209 |
+
box-sizing: border-box;
|
210 |
+
}
|
211 |
+
|
212 |
+
.wrap div.updated.crowdsignal-message {
|
213 |
+
background-color: #eff9f1;
|
214 |
+
}
|
215 |
+
.wrap div.error.crowdsignal-message {
|
216 |
+
background-color: #fbcfd2;
|
217 |
+
}
|
218 |
+
.wrap div.updated.crowdsignal-message p,
|
219 |
+
.wrap div.error.crowdsignal-message p {
|
220 |
+
padding: 0;
|
221 |
+
color: black;
|
222 |
+
font-size: 14px;
|
223 |
+
line-height: 22px;
|
224 |
+
margin: 4px 0px;
|
225 |
+
}
|
226 |
+
|
227 |
+
.crowdsignal-message .crowdsignal-notification-icon {
|
228 |
+
display: inline-block;
|
229 |
+
vertical-align: text-bottom;
|
230 |
+
margin-right: 16px;
|
231 |
+
line-height: 0;
|
232 |
+
height: 22px;
|
233 |
}
|
234 |
|
235 |
.crowdsignal-settings__main-content {
|
includes/admin/class-crowdsignal-forms-notice-icon.php
ADDED
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* File containing the class Crowdsignal_Forms\Admin\Crowdsignal_Forms_Admin_Icon.
|
4 |
+
*
|
5 |
+
* @package Crowdsignal_Forms\Admin
|
6 |
+
*/
|
7 |
+
|
8 |
+
namespace Crowdsignal_Forms\Admin;
|
9 |
+
|
10 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
11 |
+
exit;
|
12 |
+
}
|
13 |
+
|
14 |
+
/**
|
15 |
+
* Crowdsignal_Forms_Admin_Notices class.
|
16 |
+
*
|
17 |
+
* @since 1.2.0
|
18 |
+
*/
|
19 |
+
class Crowdsignal_Forms_Notice_Icon {
|
20 |
+
/**
|
21 |
+
* Returns the warning svg icon wrapped in a span tag
|
22 |
+
*/
|
23 |
+
public static function warning() {
|
24 |
+
return '<span class="crowdsignal-notification-icon">' . self::svg_icon_warning() . '</span>';
|
25 |
+
}
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Returns the success svg icon wrapped in a span tag
|
29 |
+
*/
|
30 |
+
public static function success() {
|
31 |
+
return '<span class="crowdsignal-notification-icon">' . self::svg_icon_success() . '</span>';
|
32 |
+
}
|
33 |
+
|
34 |
+
/**
|
35 |
+
* Returns the warning svg icon markup
|
36 |
+
*/
|
37 |
+
private static function svg_icon_warning() {
|
38 |
+
return '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
39 |
+
<mask id="mask0" mask-type="alpha" maskUnits="userSpaceOnUse" x="1" y="2" width="22" height="19">
|
40 |
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M23 21L12 2L1 21H23ZM11 18V16H13V18H11ZM11 14H13V10H11V14Z" fill="white"/>
|
41 |
+
</mask>
|
42 |
+
<g mask="url(#mask0)">
|
43 |
+
<rect width="24" height="24" fill="#EB5757"/>
|
44 |
+
</g>
|
45 |
+
</svg>';
|
46 |
+
}
|
47 |
+
|
48 |
+
/**
|
49 |
+
* Returns the success svg icon markup
|
50 |
+
*/
|
51 |
+
private static function svg_icon_success() {
|
52 |
+
return '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
53 |
+
<mask id="mask0" mask-type="alpha" maskUnits="userSpaceOnUse" x="2" y="2" width="20" height="20">
|
54 |
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M12 2C6.48 2 2 6.48 2 12C2 17.52 6.48 22 12 22C17.52 22 22 17.52 22 12C22 6.48 17.52 2 12 2ZM12 20C7.59 20 4 16.41 4 12C4 7.59 7.59 4 12 4C16.41 4 20 7.59 20 12C20 16.41 16.41 20 12 20ZM10 14.17L16.59 7.58L18 9L10 17L6 13L7.41 11.59L10 14.17Z" fill="white"/>
|
55 |
+
</mask>
|
56 |
+
<g mask="url(#mask0)">
|
57 |
+
<rect width="24" height="24" fill="#219653"/>
|
58 |
+
</g>
|
59 |
+
</svg>';
|
60 |
+
}
|
61 |
+
}
|
includes/admin/class-crowdsignal-forms-settings.php
CHANGED
@@ -42,7 +42,7 @@ class Crowdsignal_Forms_Settings {
|
|
42 |
* Enqueues scripts for setup page.
|
43 |
*/
|
44 |
public function admin_enqueue_scripts() {
|
45 |
-
wp_enqueue_style( 'admin-styles', plugin_dir_url( __FILE__ ) . '/admin-styles.css', array(), '1.
|
46 |
}
|
47 |
|
48 |
/**
|
@@ -106,6 +106,10 @@ class Crowdsignal_Forms_Settings {
|
|
106 |
return;
|
107 |
}
|
108 |
|
|
|
|
|
|
|
|
|
109 |
if (
|
110 |
isset( $_POST['action'] ) &&
|
111 |
isset( $_POST['crowdsignal_api_key'] ) &&
|
@@ -115,7 +119,7 @@ class Crowdsignal_Forms_Settings {
|
|
115 |
if ( 'update' === $_POST['action'] ) {
|
116 |
if ( wp_verify_nonce( sanitize_key( $_POST['_wpnonce'] ), 'add-api-key' ) ) {
|
117 |
$api_key = sanitize_key( wp_unslash( $_POST['crowdsignal_api_key'] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing -- got_api_key
|
118 |
-
if ( $api_auth_provider->get_user_code_for_key( $api_key ) ) {
|
119 |
$api_auth_provider->set_api_key( $api_key );
|
120 |
wp_safe_redirect( admin_url( 'admin.php?page=crowdsignal-forms-settings&msg=api-key-added' ) );
|
121 |
} else {
|
42 |
* Enqueues scripts for setup page.
|
43 |
*/
|
44 |
public function admin_enqueue_scripts() {
|
45 |
+
wp_enqueue_style( 'admin-styles', plugin_dir_url( __FILE__ ) . '/admin-styles.css', array(), '1.2.0' );
|
46 |
}
|
47 |
|
48 |
/**
|
106 |
return;
|
107 |
}
|
108 |
|
109 |
+
if ( ! current_user_can( 'manage_options' ) ) {
|
110 |
+
return;
|
111 |
+
}
|
112 |
+
|
113 |
if (
|
114 |
isset( $_POST['action'] ) &&
|
115 |
isset( $_POST['crowdsignal_api_key'] ) &&
|
119 |
if ( 'update' === $_POST['action'] ) {
|
120 |
if ( wp_verify_nonce( sanitize_key( $_POST['_wpnonce'] ), 'add-api-key' ) ) {
|
121 |
$api_key = sanitize_key( wp_unslash( $_POST['crowdsignal_api_key'] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing -- got_api_key
|
122 |
+
if ( ! empty( $api_key ) && $api_auth_provider->get_user_code_for_key( $api_key ) ) {
|
123 |
$api_auth_provider->set_api_key( $api_key );
|
124 |
wp_safe_redirect( admin_url( 'admin.php?page=crowdsignal-forms-settings&msg=api-key-added' ) );
|
125 |
} else {
|
includes/admin/class-crowdsignal-forms-setup.php
CHANGED
@@ -10,6 +10,7 @@ namespace Crowdsignal_Forms\Admin;
|
|
10 |
use Crowdsignal_Forms\Admin\Crowdsignal_Forms_Admin_Notices;
|
11 |
use Crowdsignal_Forms\Auth\Crowdsignal_Forms_Api_Authenticator;
|
12 |
use Crowdsignal_Forms\Crowdsignal_Forms;
|
|
|
13 |
|
14 |
if ( ! defined( 'ABSPATH' ) ) {
|
15 |
exit;
|
@@ -64,7 +65,7 @@ class Crowdsignal_Forms_Setup {
|
|
64 |
* Enqueues scripts for setup page.
|
65 |
*/
|
66 |
public function admin_enqueue_scripts() {
|
67 |
-
wp_enqueue_style( 'admin-styles', plugin_dir_url( __FILE__ ) . '/admin-styles.css', array(), '1.
|
68 |
wp_enqueue_script( 'videopress', 'https://videopress.com/videopress-iframe.js', array(), '1.0', false );
|
69 |
}
|
70 |
|
@@ -122,6 +123,22 @@ class Crowdsignal_Forms_Setup {
|
|
122 |
$this->output( $step );
|
123 |
}
|
124 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
125 |
/**
|
126 |
* Displays setup page.
|
127 |
*
|
10 |
use Crowdsignal_Forms\Admin\Crowdsignal_Forms_Admin_Notices;
|
11 |
use Crowdsignal_Forms\Auth\Crowdsignal_Forms_Api_Authenticator;
|
12 |
use Crowdsignal_Forms\Crowdsignal_Forms;
|
13 |
+
use Crowdsignal_Forms\Admin\Crowdsignal_Forms_Notice_Icon;
|
14 |
|
15 |
if ( ! defined( 'ABSPATH' ) ) {
|
16 |
exit;
|
65 |
* Enqueues scripts for setup page.
|
66 |
*/
|
67 |
public function admin_enqueue_scripts() {
|
68 |
+
wp_enqueue_style( 'admin-styles', plugin_dir_url( __FILE__ ) . '/admin-styles.css', array(), '1.2.0' );
|
69 |
wp_enqueue_script( 'videopress', 'https://videopress.com/videopress-iframe.js', array(), '1.0', false );
|
70 |
}
|
71 |
|
123 |
$this->output( $step );
|
124 |
}
|
125 |
|
126 |
+
/**
|
127 |
+
* Convenience method to get the icon markup from the Notice_Icon helper class
|
128 |
+
*
|
129 |
+
* @param string $icon The icon type: warning|success.
|
130 |
+
*/
|
131 |
+
public static function get_icon( $icon ) {
|
132 |
+
switch ( $icon ) {
|
133 |
+
case 'warning':
|
134 |
+
return Crowdsignal_Forms_Notice_Icon::warning();
|
135 |
+
case 'success':
|
136 |
+
return Crowdsignal_Forms_Notice_Icon::success();
|
137 |
+
default:
|
138 |
+
return '';
|
139 |
+
}
|
140 |
+
}
|
141 |
+
|
142 |
/**
|
143 |
* Displays setup page.
|
144 |
*
|
includes/admin/views/html-admin-setup-header.php
CHANGED
@@ -40,19 +40,39 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
40 |
// phpcs:ignore WordPress.Security.NonceVerification.Recommended
|
41 |
switch ( $_GET['msg'] ) {
|
42 |
case 'disconnect-fail':
|
43 |
-
echo '<div class="error fade crowdsignal-message"><p>' .
|
|
|
|
|
|
|
|
|
44 |
break;
|
45 |
case 'disconnected':
|
46 |
-
echo '<div class="updated fade crowdsignal-message"><p>' .
|
|
|
|
|
|
|
|
|
47 |
break;
|
48 |
case 'connected':
|
49 |
-
echo '<div class="updated crowdsignal-message"><p>' .
|
|
|
|
|
|
|
|
|
50 |
break;
|
51 |
case 'api-key-added':
|
52 |
-
echo '<div class="updated crowdsignal-message"><p>' .
|
|
|
|
|
|
|
|
|
53 |
break;
|
54 |
case 'api-key-not-added':
|
55 |
-
echo '<div class="error fade crowdsignal-message"><p>' .
|
|
|
|
|
|
|
|
|
56 |
break;
|
57 |
}
|
58 |
}
|
40 |
// phpcs:ignore WordPress.Security.NonceVerification.Recommended
|
41 |
switch ( $_GET['msg'] ) {
|
42 |
case 'disconnect-fail':
|
43 |
+
echo '<div class="error fade crowdsignal-message"><p>' .
|
44 |
+
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Content is svg from internal lib
|
45 |
+
Crowdsignal_Forms\Admin\Crowdsignal_Forms_Setup::get_icon( 'warning' ) .
|
46 |
+
esc_html__( 'Could not disconnect. Please try again.', 'crowdsignal-forms' ) .
|
47 |
+
'</p></div>';
|
48 |
break;
|
49 |
case 'disconnected':
|
50 |
+
echo '<div class="updated fade crowdsignal-message"><p>' .
|
51 |
+
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Content is svg from internal lib
|
52 |
+
Crowdsignal_Forms\Admin\Crowdsignal_Forms_Setup::get_icon( 'success' ) .
|
53 |
+
esc_html__( 'Successfully disconnected from Crowdsignal.', 'crowdsignal-forms' ) .
|
54 |
+
'</p></div>';
|
55 |
break;
|
56 |
case 'connected':
|
57 |
+
echo '<div class="updated crowdsignal-message"><p>' .
|
58 |
+
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Content is svg from internal lib
|
59 |
+
Crowdsignal_Forms\Admin\Crowdsignal_Forms_Setup::get_icon( 'success' ) .
|
60 |
+
esc_html__( 'Success! Your Crowdsignal account is successfully connected! You are ready!', 'crowdsignal-forms' ) .
|
61 |
+
'</p></div>';
|
62 |
break;
|
63 |
case 'api-key-added':
|
64 |
+
echo '<div class="updated crowdsignal-message"><p>' .
|
65 |
+
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Content is svg from internal lib
|
66 |
+
Crowdsignal_Forms\Admin\Crowdsignal_Forms_Setup::get_icon( 'success' ) .
|
67 |
+
esc_html__( 'You have been connected to Crowdsignal.', 'crowdsignal-forms' ) .
|
68 |
+
'</p></div>';
|
69 |
break;
|
70 |
case 'api-key-not-added':
|
71 |
+
echo '<div class="error fade crowdsignal-message"><p>' .
|
72 |
+
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Content is svg from internal lib
|
73 |
+
Crowdsignal_Forms\Admin\Crowdsignal_Forms_Setup::get_icon( 'warning' ) .
|
74 |
+
esc_html__( 'Your API key has not been updated, please try again.', 'crowdsignal-forms' ) .
|
75 |
+
'</p></div>';
|
76 |
break;
|
77 |
}
|
78 |
}
|
includes/admin/views/html-admin-setup-step-2.php
CHANGED
@@ -8,12 +8,20 @@
|
|
8 |
if ( ! defined( 'ABSPATH' ) ) {
|
9 |
exit;
|
10 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
?>
|
12 |
<script type='text/javascript'>
|
13 |
window.close();
|
14 |
if (window.opener && !window.opener.closed) {
|
15 |
var querystring = window.opener.location.search;
|
16 |
-
querystring += ( querystring ? '&' : '?' ) + 'msg
|
17 |
window.opener.location.search = querystring;
|
18 |
}
|
19 |
</script>
|
8 |
if ( ! defined( 'ABSPATH' ) ) {
|
9 |
exit;
|
10 |
}
|
11 |
+
use Crowdsignal_Forms\Auth\Crowdsignal_Forms_Api_Authenticator;
|
12 |
+
$crowdsignal_forms_api_auth_provider = new Crowdsignal_Forms_Api_Authenticator();
|
13 |
+
|
14 |
+
if ( $crowdsignal_forms_api_auth_provider->get_api_key() ) {
|
15 |
+
$crowdsignal_forms_msg = 'connected';
|
16 |
+
} else {
|
17 |
+
$crowdsignal_forms_msg = 'api-key-not-added';
|
18 |
+
}
|
19 |
?>
|
20 |
<script type='text/javascript'>
|
21 |
window.close();
|
22 |
if (window.opener && !window.opener.closed) {
|
23 |
var querystring = window.opener.location.search;
|
24 |
+
querystring += ( querystring ? '&' : '?' ) + 'msg=<?php echo esc_js( $crowdsignal_forms_msg ); ?>';
|
25 |
window.opener.location.search = querystring;
|
26 |
}
|
27 |
</script>
|
includes/class-crowdsignal-forms.php
CHANGED
@@ -222,6 +222,7 @@ final class Crowdsignal_Forms {
|
|
222 |
add_action( 'init', array( $this->blocks, 'register' ) );
|
223 |
add_action( 'rest_api_init', array( $this, 'register_rest_api_routes' ) );
|
224 |
|
|
|
225 |
add_filter( 'crowdsignal_forms_api_request_headers', array( $this, 'add_auth_request_headers' ) );
|
226 |
|
227 |
$this->admin_hooks->hook();
|
@@ -402,4 +403,22 @@ final class Crowdsignal_Forms {
|
|
402 |
$this->api_authenticator = $api_authenticator;
|
403 |
return $this;
|
404 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
405 |
}
|
222 |
add_action( 'init', array( $this->blocks, 'register' ) );
|
223 |
add_action( 'rest_api_init', array( $this, 'register_rest_api_routes' ) );
|
224 |
|
225 |
+
add_filter( 'block_categories', array( $this, 'add_block_category' ), 10, 2 );
|
226 |
add_filter( 'crowdsignal_forms_api_request_headers', array( $this, 'add_auth_request_headers' ) );
|
227 |
|
228 |
$this->admin_hooks->hook();
|
403 |
$this->api_authenticator = $api_authenticator;
|
404 |
return $this;
|
405 |
}
|
406 |
+
|
407 |
+
/**
|
408 |
+
* Adds the Crowdsignal block editor category.
|
409 |
+
*
|
410 |
+
* @param array $categories Array of existing categories.
|
411 |
+
* @param WP_Post $post The post being edited.
|
412 |
+
*/
|
413 |
+
public function add_block_category( $categories, $post ) {
|
414 |
+
return array_merge(
|
415 |
+
$categories,
|
416 |
+
array(
|
417 |
+
array(
|
418 |
+
'slug' => 'crowdsignal-forms',
|
419 |
+
'title' => __( 'Crowdsignal', 'crowdsignal-forms' ),
|
420 |
+
),
|
421 |
+
)
|
422 |
+
);
|
423 |
+
}
|
424 |
}
|
includes/frontend/blocks/class-crowdsignal-forms-poll-block.php
CHANGED
@@ -11,7 +11,6 @@ namespace Crowdsignal_Forms\Frontend\Blocks;
|
|
11 |
use Crowdsignal_Forms\Frontend\Crowdsignal_Forms_Blocks_Assets;
|
12 |
use Crowdsignal_Forms\Frontend\Crowdsignal_Forms_Block;
|
13 |
use Crowdsignal_Forms\Crowdsignal_Forms;
|
14 |
-
use Crowdsignal_Forms\Auth\Crowdsignal_Forms_Api_Authenticator;
|
15 |
|
16 |
if ( ! defined( 'ABSPATH' ) ) {
|
17 |
exit;
|
@@ -23,17 +22,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
23 |
* @package Crowdsignal_Forms\Frontend\Blocks
|
24 |
* @since 0.9.0
|
25 |
*/
|
26 |
-
class Crowdsignal_Forms_Poll_Block
|
27 |
-
const TRANSIENT_HIDE_BRANDING = 'cs-hide-branding';
|
28 |
-
const HIDE_BRANDING_YES = 'YES';
|
29 |
-
const HIDE_BRANDING_NO = 'NO';
|
30 |
-
|
31 |
-
/**
|
32 |
-
* Lazy-loaded state to determine if the api connection is set up.
|
33 |
-
*
|
34 |
-
* @var bool|null
|
35 |
-
*/
|
36 |
-
private static $is_cs_connected = null;
|
37 |
|
38 |
/**
|
39 |
* {@inheritDoc}
|
@@ -75,7 +64,7 @@ class Crowdsignal_Forms_Poll_Block implements Crowdsignal_Forms_Block {
|
|
75 |
* @return string
|
76 |
*/
|
77 |
public function render( $attributes ) {
|
78 |
-
if ( $this->
|
79 |
return '';
|
80 |
}
|
81 |
|
@@ -83,72 +72,30 @@ class Crowdsignal_Forms_Poll_Block implements Crowdsignal_Forms_Block {
|
|
83 |
wp_enqueue_style( $this->asset_identifier() );
|
84 |
|
85 |
$attributes['hideBranding'] = $this->should_hide_branding();
|
86 |
-
$
|
87 |
-
if (
|
88 |
-
$
|
89 |
-
->get_post_poll_meta_gateway()
|
90 |
-
->get_poll_data_for_poll_client_id( $post->ID, $attributes['pollId'] );
|
91 |
-
|
92 |
-
if ( ! empty( $platform_poll_data ) ) {
|
93 |
-
$attributes['apiPollData'] = $platform_poll_data;
|
94 |
-
}
|
95 |
}
|
96 |
|
97 |
return sprintf(
|
98 |
'<div class="align%s crowdsignal-poll-wrapper" data-crowdsignal-poll="%s"></div>',
|
99 |
-
$attributes['align'],
|
100 |
htmlentities( wp_json_encode( $attributes ) )
|
101 |
);
|
102 |
}
|
103 |
|
104 |
-
/**
|
105 |
-
* Determines if branding should be shown in the poll.
|
106 |
-
* Result is cached in a short-lived transient for performance.
|
107 |
-
*
|
108 |
-
* @return bool
|
109 |
-
*/
|
110 |
-
private function should_hide_branding() {
|
111 |
-
if ( get_transient( self::TRANSIENT_HIDE_BRANDING ) ) {
|
112 |
-
return self::HIDE_BRANDING_YES === get_transient( self::TRANSIENT_HIDE_BRANDING );
|
113 |
-
}
|
114 |
-
|
115 |
-
try {
|
116 |
-
$capabilities = Crowdsignal_Forms::instance()->get_api_gateway()->get_capabilities();
|
117 |
-
$hide_branding = false !== array_search( 'hide-branding', $capabilities, true )
|
118 |
-
? self::HIDE_BRANDING_YES
|
119 |
-
: self::HIDE_BRANDING_NO;
|
120 |
-
} catch ( \Exception $ex ) {
|
121 |
-
// ignore error, we'll get the updated value next time.
|
122 |
-
$hide_branding = self::HIDE_BRANDING_YES;
|
123 |
-
}
|
124 |
-
set_transient(
|
125 |
-
self::TRANSIENT_HIDE_BRANDING,
|
126 |
-
$hide_branding,
|
127 |
-
MINUTE_IN_SECONDS
|
128 |
-
);
|
129 |
-
return self::HIDE_BRANDING_YES === $hide_branding;
|
130 |
-
}
|
131 |
-
|
132 |
/**
|
133 |
* Determines if the poll should be rendered or not.
|
134 |
*
|
135 |
* @param array $attributes The poll's saved attributes.
|
136 |
* @return bool
|
137 |
*/
|
138 |
-
private function
|
139 |
if ( empty( $attributes['question'] ) ) {
|
140 |
return true;
|
141 |
}
|
142 |
|
143 |
-
|
144 |
-
return ! self::$is_cs_connected;
|
145 |
-
}
|
146 |
-
|
147 |
-
$api_auth_provider = Crowdsignal_Forms::instance()->get_api_authenticator();
|
148 |
-
self::$is_cs_connected = $api_auth_provider->get_user_code();
|
149 |
-
// purposely not doing the account is_verified check to avoid making a slow query on every page load.
|
150 |
-
|
151 |
-
return ! self::$is_cs_connected;
|
152 |
}
|
153 |
|
154 |
/**
|
@@ -171,7 +118,7 @@ class Crowdsignal_Forms_Poll_Block implements Crowdsignal_Forms_Block {
|
|
171 |
),
|
172 |
'title' => array(
|
173 |
'type' => 'string',
|
174 |
-
'default' =>
|
175 |
),
|
176 |
'question' => array(
|
177 |
'type' => 'string',
|
11 |
use Crowdsignal_Forms\Frontend\Crowdsignal_Forms_Blocks_Assets;
|
12 |
use Crowdsignal_Forms\Frontend\Crowdsignal_Forms_Block;
|
13 |
use Crowdsignal_Forms\Crowdsignal_Forms;
|
|
|
14 |
|
15 |
if ( ! defined( 'ABSPATH' ) ) {
|
16 |
exit;
|
22 |
* @package Crowdsignal_Forms\Frontend\Blocks
|
23 |
* @since 0.9.0
|
24 |
*/
|
25 |
+
class Crowdsignal_Forms_Poll_Block extends Crowdsignal_Forms_Block {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
|
27 |
/**
|
28 |
* {@inheritDoc}
|
64 |
* @return string
|
65 |
*/
|
66 |
public function render( $attributes ) {
|
67 |
+
if ( $this->should_hide_block( $attributes ) ) {
|
68 |
return '';
|
69 |
}
|
70 |
|
72 |
wp_enqueue_style( $this->asset_identifier() );
|
73 |
|
74 |
$attributes['hideBranding'] = $this->should_hide_branding();
|
75 |
+
$platform_poll_data = $this->get_platform_poll_data( $attributes['pollId'] );
|
76 |
+
if ( ! empty( $platform_poll_data ) ) {
|
77 |
+
$attributes['apiPollData'] = $platform_poll_data;
|
|
|
|
|
|
|
|
|
|
|
|
|
78 |
}
|
79 |
|
80 |
return sprintf(
|
81 |
'<div class="align%s crowdsignal-poll-wrapper" data-crowdsignal-poll="%s"></div>',
|
82 |
+
esc_attr( $attributes['align'] ),
|
83 |
htmlentities( wp_json_encode( $attributes ) )
|
84 |
);
|
85 |
}
|
86 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
87 |
/**
|
88 |
* Determines if the poll should be rendered or not.
|
89 |
*
|
90 |
* @param array $attributes The poll's saved attributes.
|
91 |
* @return bool
|
92 |
*/
|
93 |
+
private function should_hide_block( $attributes ) {
|
94 |
if ( empty( $attributes['question'] ) ) {
|
95 |
return true;
|
96 |
}
|
97 |
|
98 |
+
return ! parent::is_cs_connected();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
99 |
}
|
100 |
|
101 |
/**
|
118 |
),
|
119 |
'title' => array(
|
120 |
'type' => 'string',
|
121 |
+
'default' => null,
|
122 |
),
|
123 |
'question' => array(
|
124 |
'type' => 'string',
|
includes/frontend/blocks/class-crowdsignal-forms-vote-block.php
ADDED
@@ -0,0 +1,145 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Contains Crowdsignal_Forms\Frontend\Blocks\Crowdsignal_Forms_Vote_Block
|
4 |
+
*
|
5 |
+
* @package Crowdsignal_Forms\Frontend\Blocks
|
6 |
+
* @since 1.1.0
|
7 |
+
*/
|
8 |
+
|
9 |
+
namespace Crowdsignal_Forms\Frontend\Blocks;
|
10 |
+
|
11 |
+
use Crowdsignal_Forms\Frontend\Crowdsignal_Forms_Blocks_Assets;
|
12 |
+
use Crowdsignal_Forms\Frontend\Crowdsignal_Forms_Block;
|
13 |
+
use Crowdsignal_Forms\Crowdsignal_Forms;
|
14 |
+
|
15 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
16 |
+
exit;
|
17 |
+
}
|
18 |
+
|
19 |
+
/**
|
20 |
+
* Handles Crowdsignal Forms' Vote block.
|
21 |
+
*
|
22 |
+
* @package Crowdsignal_Forms\Frontend\Blocks
|
23 |
+
* @since 0.9.0
|
24 |
+
*/
|
25 |
+
class Crowdsignal_Forms_Vote_Block extends Crowdsignal_Forms_Block {
|
26 |
+
|
27 |
+
/**
|
28 |
+
* {@inheritDoc}
|
29 |
+
*/
|
30 |
+
public function asset_identifier() {
|
31 |
+
return 'crowdsignal-forms-vote';
|
32 |
+
}
|
33 |
+
|
34 |
+
/**
|
35 |
+
* {@inheritDoc}
|
36 |
+
*/
|
37 |
+
public function assets() {
|
38 |
+
return array(
|
39 |
+
'config' => '/build/vote.asset.php',
|
40 |
+
'script' => '/build/vote.js',
|
41 |
+
'style' => '/build/vote.css',
|
42 |
+
);
|
43 |
+
}
|
44 |
+
|
45 |
+
/**
|
46 |
+
* {@inheritDoc}
|
47 |
+
*/
|
48 |
+
public function register() {
|
49 |
+
register_block_type(
|
50 |
+
'crowdsignal-forms/vote',
|
51 |
+
array(
|
52 |
+
'attributes' => $this->attributes(),
|
53 |
+
'editor_script' => Crowdsignal_Forms_Blocks_Assets::EDITOR,
|
54 |
+
'editor_style' => Crowdsignal_Forms_Blocks_Assets::EDITOR,
|
55 |
+
'render_callback' => array( $this, 'render' ),
|
56 |
+
)
|
57 |
+
);
|
58 |
+
}
|
59 |
+
|
60 |
+
/**
|
61 |
+
* Renders the Vote dynamic block
|
62 |
+
*
|
63 |
+
* @param array $attributes The block's attributes.
|
64 |
+
* @param string $rendered_inner_blocks The server side rendered inner blocks.
|
65 |
+
* @return string
|
66 |
+
*/
|
67 |
+
public function render( $attributes, $rendered_inner_blocks ) {
|
68 |
+
if ( $this->should_hide_block() ) {
|
69 |
+
return '';
|
70 |
+
}
|
71 |
+
|
72 |
+
wp_enqueue_script( $this->asset_identifier() );
|
73 |
+
wp_enqueue_style( $this->asset_identifier() );
|
74 |
+
|
75 |
+
$attributes['hideBranding'] = $this->should_hide_branding();
|
76 |
+
$platform_poll_data = $this->get_platform_poll_data( $attributes['pollId'] );
|
77 |
+
if ( ! empty( $platform_poll_data ) ) {
|
78 |
+
$attributes['apiPollData'] = $platform_poll_data;
|
79 |
+
}
|
80 |
+
|
81 |
+
return sprintf(
|
82 |
+
'<div class="crowdsignal-vote-wrapper" data-crowdsignal-vote="%s">%s</div>',
|
83 |
+
htmlentities( wp_json_encode( $attributes ) ),
|
84 |
+
$rendered_inner_blocks
|
85 |
+
);
|
86 |
+
}
|
87 |
+
|
88 |
+
/**
|
89 |
+
* Determines if the vote block should be rendered or not.
|
90 |
+
*
|
91 |
+
* @return bool
|
92 |
+
*/
|
93 |
+
private function should_hide_block() {
|
94 |
+
return ! $this->is_cs_connected();
|
95 |
+
}
|
96 |
+
|
97 |
+
/**
|
98 |
+
* Returns the attributes definition array for register_block_type
|
99 |
+
*
|
100 |
+
* Note: Any changes to the array returned by this function need to be
|
101 |
+
* duplicated in client/blocks/vote/attributes.js.
|
102 |
+
*
|
103 |
+
* @return array
|
104 |
+
*/
|
105 |
+
private function attributes() {
|
106 |
+
return array(
|
107 |
+
'pollId' => array(
|
108 |
+
'type' => 'string',
|
109 |
+
'default' => null,
|
110 |
+
),
|
111 |
+
'hideBranding' => array(
|
112 |
+
'type' => 'boolean',
|
113 |
+
'default' => false,
|
114 |
+
),
|
115 |
+
'title' => array(
|
116 |
+
'type' => 'string',
|
117 |
+
'default' => null,
|
118 |
+
),
|
119 |
+
'pollStatus' => array(
|
120 |
+
'type' => 'string',
|
121 |
+
'default' => 'open',
|
122 |
+
),
|
123 |
+
'closedAfterDateTime' => array(
|
124 |
+
'type' => 'string',
|
125 |
+
'default' => null,
|
126 |
+
),
|
127 |
+
'size' => array(
|
128 |
+
'type' => 'string',
|
129 |
+
'default' => 'medium',
|
130 |
+
),
|
131 |
+
'borderWidth' => array(
|
132 |
+
'type' => 'number',
|
133 |
+
'default' => 1,
|
134 |
+
),
|
135 |
+
'borderRadius' => array(
|
136 |
+
'type' => 'number',
|
137 |
+
'default' => 5,
|
138 |
+
),
|
139 |
+
'hideResults' => array(
|
140 |
+
'type' => 'boolean',
|
141 |
+
'default' => false,
|
142 |
+
),
|
143 |
+
);
|
144 |
+
}
|
145 |
+
}
|
includes/frontend/blocks/class-crowdsignal-forms-vote-item-block.php
ADDED
@@ -0,0 +1,100 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Contains Crowdsignal_Forms\Frontend\Blocks\Crowdsignal_Forms_Vote_Item_Block
|
4 |
+
*
|
5 |
+
* @package Crowdsignal_Forms\Frontend\Blocks
|
6 |
+
* @since 1.1.0
|
7 |
+
*/
|
8 |
+
|
9 |
+
namespace Crowdsignal_Forms\Frontend\Blocks;
|
10 |
+
|
11 |
+
use Crowdsignal_Forms\Frontend\Crowdsignal_Forms_Blocks_Assets;
|
12 |
+
use Crowdsignal_Forms\Frontend\Crowdsignal_Forms_Block;
|
13 |
+
|
14 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
15 |
+
exit;
|
16 |
+
}
|
17 |
+
|
18 |
+
/**
|
19 |
+
* Handles Crowdsignal Forms' Vote Item child block.
|
20 |
+
* This block will never be rendered in the public view, but its definition needs to be registered on the server to ensure its attribute defaults are available.
|
21 |
+
*
|
22 |
+
* @package Crowdsignal_Forms\Frontend\Blocks
|
23 |
+
* @since 0.9.0
|
24 |
+
*/
|
25 |
+
class Crowdsignal_Forms_Vote_Item_Block extends Crowdsignal_Forms_Block {
|
26 |
+
|
27 |
+
/**
|
28 |
+
* {@inheritDoc}
|
29 |
+
*/
|
30 |
+
public function asset_identifier() {
|
31 |
+
return 'crowdsignal-forms-vote-item';
|
32 |
+
}
|
33 |
+
|
34 |
+
/**
|
35 |
+
* {@inheritDoc}
|
36 |
+
*/
|
37 |
+
public function assets() {
|
38 |
+
return array(
|
39 |
+
'config' => 'build/vote.asset.php', // same as vote block because they're compiled together.
|
40 |
+
);
|
41 |
+
}
|
42 |
+
|
43 |
+
/**
|
44 |
+
* {@inheritDoc}
|
45 |
+
*/
|
46 |
+
public function register() {
|
47 |
+
register_block_type(
|
48 |
+
'crowdsignal-forms/vote-item',
|
49 |
+
array(
|
50 |
+
'attributes' => $this->attributes(),
|
51 |
+
'editor_script' => Crowdsignal_Forms_Blocks_Assets::EDITOR,
|
52 |
+
'editor_style' => Crowdsignal_Forms_Blocks_Assets::EDITOR,
|
53 |
+
'render_callback' => array( $this, 'render' ),
|
54 |
+
)
|
55 |
+
);
|
56 |
+
}
|
57 |
+
|
58 |
+
/**
|
59 |
+
* Renders the Vote Item dynamic block
|
60 |
+
*
|
61 |
+
* @param array $attributes The block's attributes.
|
62 |
+
*
|
63 |
+
* @return string
|
64 |
+
*/
|
65 |
+
public function render( $attributes ) {
|
66 |
+
return sprintf(
|
67 |
+
'<div data-crowdsignal-vote-item="%s"></div>',
|
68 |
+
htmlentities( wp_json_encode( $attributes ) )
|
69 |
+
);
|
70 |
+
}
|
71 |
+
|
72 |
+
/**
|
73 |
+
* Returns the attributes definition array for register_block_type
|
74 |
+
*
|
75 |
+
* Note: Any changes to the array returned by this function need to be
|
76 |
+
* duplicated in client/blocks/vote-item/attributes.js.
|
77 |
+
*
|
78 |
+
* @return array
|
79 |
+
*/
|
80 |
+
private function attributes() {
|
81 |
+
return array(
|
82 |
+
'answerId' => array(
|
83 |
+
'type' => 'string',
|
84 |
+
'default' => null,
|
85 |
+
),
|
86 |
+
'type' => array(
|
87 |
+
'type' => 'string',
|
88 |
+
),
|
89 |
+
'textColor' => array(
|
90 |
+
'type' => 'string',
|
91 |
+
),
|
92 |
+
'backgroundColor' => array(
|
93 |
+
'type' => 'string',
|
94 |
+
),
|
95 |
+
'borderColor' => array(
|
96 |
+
'type' => 'string',
|
97 |
+
),
|
98 |
+
);
|
99 |
+
}
|
100 |
+
}
|
includes/frontend/class-crowdsignal-forms-block.php
CHANGED
@@ -8,6 +8,8 @@
|
|
8 |
|
9 |
namespace Crowdsignal_Forms\Frontend;
|
10 |
|
|
|
|
|
11 |
if ( ! defined( 'ABSPATH' ) ) {
|
12 |
exit;
|
13 |
}
|
@@ -18,19 +20,29 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
18 |
* @package Crowdsignal_Forms\Frontend
|
19 |
* @since 0.9.0
|
20 |
*/
|
21 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
|
23 |
/**
|
24 |
* Registers the Gutenberg block.
|
25 |
*/
|
26 |
-
public function register();
|
27 |
|
28 |
/**
|
29 |
* Returns a unique name for the block's registered assets.
|
30 |
*
|
31 |
* @return string The name for the registered assets.
|
32 |
*/
|
33 |
-
public function asset_identifier();
|
34 |
|
35 |
/**
|
36 |
* Configuration array for the assets of the block.
|
@@ -43,5 +55,73 @@ interface Crowdsignal_Forms_Block {
|
|
43 |
*
|
44 |
* @return array The config array.
|
45 |
*/
|
46 |
-
public function assets();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
}
|
8 |
|
9 |
namespace Crowdsignal_Forms\Frontend;
|
10 |
|
11 |
+
use Crowdsignal_Forms\Crowdsignal_Forms;
|
12 |
+
|
13 |
if ( ! defined( 'ABSPATH' ) ) {
|
14 |
exit;
|
15 |
}
|
20 |
* @package Crowdsignal_Forms\Frontend
|
21 |
* @since 0.9.0
|
22 |
*/
|
23 |
+
abstract class Crowdsignal_Forms_Block {
|
24 |
+
const TRANSIENT_HIDE_BRANDING = 'cs-hide-branding';
|
25 |
+
const HIDE_BRANDING_YES = 'YES';
|
26 |
+
const HIDE_BRANDING_NO = 'NO';
|
27 |
+
|
28 |
+
/**
|
29 |
+
* Lazy-loaded state to determine if the api connection is set up.
|
30 |
+
*
|
31 |
+
* @var bool|null
|
32 |
+
*/
|
33 |
+
private static $is_cs_connected = null;
|
34 |
|
35 |
/**
|
36 |
* Registers the Gutenberg block.
|
37 |
*/
|
38 |
+
abstract public function register();
|
39 |
|
40 |
/**
|
41 |
* Returns a unique name for the block's registered assets.
|
42 |
*
|
43 |
* @return string The name for the registered assets.
|
44 |
*/
|
45 |
+
abstract public function asset_identifier();
|
46 |
|
47 |
/**
|
48 |
* Configuration array for the assets of the block.
|
55 |
*
|
56 |
* @return array The config array.
|
57 |
*/
|
58 |
+
abstract public function assets();
|
59 |
+
|
60 |
+
/**
|
61 |
+
* Determines if branding should be shown in the poll.
|
62 |
+
* Result is cached in a short-lived transient for performance.
|
63 |
+
*
|
64 |
+
* @return bool
|
65 |
+
*/
|
66 |
+
protected function should_hide_branding() {
|
67 |
+
if ( get_transient( self::TRANSIENT_HIDE_BRANDING ) ) {
|
68 |
+
return self::HIDE_BRANDING_YES === get_transient( self::TRANSIENT_HIDE_BRANDING );
|
69 |
+
}
|
70 |
+
|
71 |
+
try {
|
72 |
+
$capabilities = Crowdsignal_Forms::instance()->get_api_gateway()->get_capabilities();
|
73 |
+
$hide_branding = false !== array_search( 'hide-branding', $capabilities, true )
|
74 |
+
? self::HIDE_BRANDING_YES
|
75 |
+
: self::HIDE_BRANDING_NO;
|
76 |
+
} catch ( \Exception $ex ) {
|
77 |
+
// ignore error, we'll get the updated value next time.
|
78 |
+
$hide_branding = self::HIDE_BRANDING_YES;
|
79 |
+
}
|
80 |
+
set_transient(
|
81 |
+
self::TRANSIENT_HIDE_BRANDING,
|
82 |
+
$hide_branding,
|
83 |
+
MINUTE_IN_SECONDS
|
84 |
+
);
|
85 |
+
return self::HIDE_BRANDING_YES === $hide_branding;
|
86 |
+
}
|
87 |
+
|
88 |
+
/**
|
89 |
+
* Determines if the plugin is connected to Crowdsignal.
|
90 |
+
*
|
91 |
+
* @return bool
|
92 |
+
*/
|
93 |
+
protected function is_cs_connected() {
|
94 |
+
if ( null !== self::$is_cs_connected ) {
|
95 |
+
return self::$is_cs_connected;
|
96 |
+
}
|
97 |
+
|
98 |
+
$api_auth_provider = Crowdsignal_Forms::instance()->get_api_authenticator();
|
99 |
+
self::$is_cs_connected = false !== $api_auth_provider->get_user_code();
|
100 |
+
|
101 |
+
// purposely not doing the account is_verified check to avoid making a slow query on every page load.
|
102 |
+
|
103 |
+
return self::$is_cs_connected;
|
104 |
+
}
|
105 |
+
|
106 |
+
/**
|
107 |
+
* Retrieves the saved crowdsignal poll data.
|
108 |
+
*
|
109 |
+
* @param string $poll_id The client id of the poll.
|
110 |
+
* @returns array|null
|
111 |
+
*/
|
112 |
+
protected function get_platform_poll_data( $poll_id ) {
|
113 |
+
if ( ! isset( $poll_id ) ) {
|
114 |
+
return null;
|
115 |
+
}
|
116 |
+
|
117 |
+
$post = get_post();
|
118 |
+
|
119 |
+
if ( null === $post ) {
|
120 |
+
return null;
|
121 |
+
}
|
122 |
+
|
123 |
+
return Crowdsignal_Forms::instance()
|
124 |
+
->get_post_poll_meta_gateway()
|
125 |
+
->get_poll_data_for_poll_client_id( $post->ID, $poll_id );
|
126 |
+
}
|
127 |
}
|
includes/frontend/class-crowdsignal-forms-blocks.php
CHANGED
@@ -41,6 +41,8 @@ class Crowdsignal_Forms_Blocks {
|
|
41 |
|
42 |
self::$blocks = array(
|
43 |
new Blocks\Crowdsignal_Forms_Poll_Block(),
|
|
|
|
|
44 |
);
|
45 |
|
46 |
return self::$blocks;
|
41 |
|
42 |
self::$blocks = array(
|
43 |
new Blocks\Crowdsignal_Forms_Poll_Block(),
|
44 |
+
new Blocks\Crowdsignal_Forms_Vote_Block(),
|
45 |
+
new Blocks\Crowdsignal_Forms_Vote_Item_Block(),
|
46 |
);
|
47 |
|
48 |
return self::$blocks;
|
includes/models/class-poll-settings.php
CHANGED
@@ -208,9 +208,7 @@ class Poll_Settings {
|
|
208 |
$settings_from_block = $attrs;
|
209 |
// These are not yet implemented.
|
210 |
$settings_data = array(
|
211 |
-
'
|
212 |
-
'redirect_url' => '',
|
213 |
-
'captcha' => false,
|
214 |
);
|
215 |
|
216 |
$block_attributes_to_object_props = array(
|
@@ -221,6 +219,8 @@ class Poll_Settings {
|
|
221 |
'isMultipleChoice' => 'multiple_choice',
|
222 |
'pollStatus' => 'close_status',
|
223 |
'closedAfterDateTime' => 'close_after',
|
|
|
|
|
224 |
);
|
225 |
|
226 |
foreach ( $block_attributes_to_object_props as $block_attr => $object_property_name ) {
|
208 |
$settings_from_block = $attrs;
|
209 |
// These are not yet implemented.
|
210 |
$settings_data = array(
|
211 |
+
'captcha' => false,
|
|
|
|
|
212 |
);
|
213 |
|
214 |
$block_attributes_to_object_props = array(
|
219 |
'isMultipleChoice' => 'multiple_choice',
|
220 |
'pollStatus' => 'close_status',
|
221 |
'closedAfterDateTime' => 'close_after',
|
222 |
+
'customConfirmMessage' => 'after_message',
|
223 |
+
'redirectAddress' => 'redirect_url',
|
224 |
);
|
225 |
|
226 |
foreach ( $block_attributes_to_object_props as $block_attr => $object_property_name ) {
|
includes/models/class-poll.php
CHANGED
@@ -78,6 +78,14 @@ class Poll {
|
|
78 |
*/
|
79 |
private $note = '';
|
80 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
81 |
/**
|
82 |
* Poll constructor.
|
83 |
*
|
@@ -131,20 +139,56 @@ class Poll {
|
|
131 |
return $poll;
|
132 |
}
|
133 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
134 |
/**
|
135 |
* Update this poll from the block attrs.
|
136 |
*
|
137 |
* @param array $attrs The block attrs.
|
|
|
138 |
* @return $this
|
139 |
*/
|
140 |
-
public function update_from_block_attrs( $attrs ) {
|
141 |
$this->client_id = $attrs['pollId'] ? $attrs['pollId'] : '';
|
142 |
-
$attribute_answers = isset( $
|
143 |
$this->question = isset( $attrs['question'] ) ? $attrs['question'] : '';
|
144 |
$this->note = isset( $attrs['note'] ) ? $attrs['note'] : '';
|
145 |
|
146 |
$block_answers_by_uuid = array();
|
147 |
foreach ( $attribute_answers as $attribute_answer ) {
|
|
|
|
|
|
|
|
|
148 |
$block_answers_by_uuid[ $attribute_answer['answerId'] ] = $attribute_answer;
|
149 |
}
|
150 |
|
@@ -233,6 +277,26 @@ class Poll {
|
|
233 |
return $this;
|
234 |
}
|
235 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
236 |
/**
|
237 |
* Transform the poll into an array for sending to the api or the frontend.
|
238 |
*
|
@@ -263,6 +327,10 @@ class Poll {
|
|
263 |
$data['client_id'] = $this->client_id;
|
264 |
}
|
265 |
|
|
|
|
|
|
|
|
|
266 |
return $data;
|
267 |
}
|
268 |
|
78 |
*/
|
79 |
private $note = '';
|
80 |
|
81 |
+
/**
|
82 |
+
* The poll based block type.
|
83 |
+
*
|
84 |
+
* @since 1.1.0
|
85 |
+
* @var string
|
86 |
+
*/
|
87 |
+
private $poll_type = '';
|
88 |
+
|
89 |
/**
|
90 |
* Poll constructor.
|
91 |
*
|
139 |
return $poll;
|
140 |
}
|
141 |
|
142 |
+
/**
|
143 |
+
* Processes the block data to convert a poll based block to a poll model.
|
144 |
+
*
|
145 |
+
* @param mixed $block
|
146 |
+
* @return $this
|
147 |
+
* @since 1.1.0
|
148 |
+
*/
|
149 |
+
public function update_from_block( $block ) {
|
150 |
+
$this->set_poll_type( str_replace( 'crowdsignal-forms/', '', $block['blockName'] ) );
|
151 |
+
|
152 |
+
$attrs = $block['attrs'];
|
153 |
+
|
154 |
+
if ( 'crowdsignal-forms/poll' === $block['blockName'] ) {
|
155 |
+
return $this->update_from_block_attrs( $attrs, $attrs['answers'] );
|
156 |
+
}
|
157 |
+
|
158 |
+
if ( 'crowdsignal-forms/vote' === $block['blockName'] ) {
|
159 |
+
$answers = array();
|
160 |
+
|
161 |
+
foreach ( $block['innerBlocks'] as $child ) {
|
162 |
+
$child_attrs = $child['attrs'];
|
163 |
+
$child_attrs['text'] = $child_attrs['type'];
|
164 |
+
$answers[] = $child_attrs;
|
165 |
+
}
|
166 |
+
|
167 |
+
return $this->update_from_block_attrs( $attrs, $answers );
|
168 |
+
}
|
169 |
+
|
170 |
+
return $this;
|
171 |
+
}
|
172 |
+
|
173 |
/**
|
174 |
* Update this poll from the block attrs.
|
175 |
*
|
176 |
* @param array $attrs The block attrs.
|
177 |
+
* @param array $answers The answer attributes.
|
178 |
* @return $this
|
179 |
*/
|
180 |
+
public function update_from_block_attrs( $attrs, $answers ) {
|
181 |
$this->client_id = $attrs['pollId'] ? $attrs['pollId'] : '';
|
182 |
+
$attribute_answers = isset( $answers ) ? $answers : array();
|
183 |
$this->question = isset( $attrs['question'] ) ? $attrs['question'] : '';
|
184 |
$this->note = isset( $attrs['note'] ) ? $attrs['note'] : '';
|
185 |
|
186 |
$block_answers_by_uuid = array();
|
187 |
foreach ( $attribute_answers as $attribute_answer ) {
|
188 |
+
if ( gettype( $attribute_answer ) === 'object' ) {
|
189 |
+
// if answer is an object, then it is still a default value, so there are no answer ids set.
|
190 |
+
continue;
|
191 |
+
}
|
192 |
$block_answers_by_uuid[ $attribute_answer['answerId'] ] = $attribute_answer;
|
193 |
}
|
194 |
|
277 |
return $this;
|
278 |
}
|
279 |
|
280 |
+
/**
|
281 |
+
* Get the poll type.
|
282 |
+
*
|
283 |
+
* @return string
|
284 |
+
*/
|
285 |
+
public function get_poll_type() {
|
286 |
+
return $this->poll_type;
|
287 |
+
}
|
288 |
+
|
289 |
+
/**
|
290 |
+
* Set the poll type.
|
291 |
+
*
|
292 |
+
* @param string $poll_type The poll type.
|
293 |
+
* @return $this
|
294 |
+
*/
|
295 |
+
public function set_poll_type( $poll_type ) {
|
296 |
+
$this->poll_type = $poll_type;
|
297 |
+
return $this;
|
298 |
+
}
|
299 |
+
|
300 |
/**
|
301 |
* Transform the poll into an array for sending to the api or the frontend.
|
302 |
*
|
327 |
$data['client_id'] = $this->client_id;
|
328 |
}
|
329 |
|
330 |
+
if ( ! empty( $this->poll_type ) ) {
|
331 |
+
$data['poll_type'] = $this->poll_type;
|
332 |
+
}
|
333 |
+
|
334 |
return $data;
|
335 |
}
|
336 |
|
includes/synchronization/class-comment-sync-entity.php
CHANGED
@@ -129,7 +129,10 @@ class Comment_Sync_Entity implements Synchronizable_Entity {
|
|
129 |
*/
|
130 |
public function has_crowdsignal_forms_blocks() {
|
131 |
$content = $this->comment->comment_content;
|
132 |
-
return has_blocks( $content ) &&
|
|
|
|
|
|
|
133 |
}
|
134 |
|
135 |
/**
|
129 |
*/
|
130 |
public function has_crowdsignal_forms_blocks() {
|
131 |
$content = $this->comment->comment_content;
|
132 |
+
return has_blocks( $content ) && (
|
133 |
+
has_block( 'crowdsignal-forms/poll', $content ) ||
|
134 |
+
has_block( 'crowdsignal-forms/vote', $content )
|
135 |
+
);
|
136 |
}
|
137 |
|
138 |
/**
|
includes/synchronization/class-poll-block-synchronizer.php
CHANGED
@@ -10,6 +10,7 @@ namespace Crowdsignal_Forms\Synchronization;
|
|
10 |
|
11 |
use Crowdsignal_Forms\Crowdsignal_Forms;
|
12 |
use Crowdsignal_Forms\Models\Poll;
|
|
|
13 |
|
14 |
if ( ! defined( 'ABSPATH' ) ) {
|
15 |
exit;
|
@@ -146,7 +147,7 @@ class Poll_Block_Synchronizer {
|
|
146 |
$blocks_to_process_next_iteration = array();
|
147 |
|
148 |
foreach ( $blocks_to_process as $block ) {
|
149 |
-
if ( 'crowdsignal-forms/poll'
|
150 |
$poll_blocks[] = $block;
|
151 |
continue;
|
152 |
}
|
@@ -173,7 +174,9 @@ class Poll_Block_Synchronizer {
|
|
173 |
|
174 |
$poll = Poll::from_array( $platform_poll_data );
|
175 |
|
176 |
-
$
|
|
|
|
|
177 |
if ( $poll->get_id() < 1 ) {
|
178 |
$result = $this->gateway->create_poll( $poll );
|
179 |
} else {
|
@@ -193,6 +196,23 @@ class Poll_Block_Synchronizer {
|
|
193 |
return $poll_ids_present_in_content;
|
194 |
}
|
195 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
196 |
/**
|
197 |
* Fire any exception handling code here.
|
198 |
*
|
10 |
|
11 |
use Crowdsignal_Forms\Crowdsignal_Forms;
|
12 |
use Crowdsignal_Forms\Models\Poll;
|
13 |
+
use \WP_Block_Type_Registry;
|
14 |
|
15 |
if ( ! defined( 'ABSPATH' ) ) {
|
16 |
exit;
|
147 |
$blocks_to_process_next_iteration = array();
|
148 |
|
149 |
foreach ( $blocks_to_process as $block ) {
|
150 |
+
if ( in_array( $block['blockName'], array( 'crowdsignal-forms/poll', 'crowdsignal-forms/vote' ), true ) ) {
|
151 |
$poll_blocks[] = $block;
|
152 |
continue;
|
153 |
}
|
174 |
|
175 |
$poll = Poll::from_array( $platform_poll_data );
|
176 |
|
177 |
+
$this->apply_block_attribute_defaults( $poll_block );
|
178 |
+
|
179 |
+
$poll->update_from_block( $poll_block );
|
180 |
if ( $poll->get_id() < 1 ) {
|
181 |
$result = $this->gateway->create_poll( $poll );
|
182 |
} else {
|
196 |
return $poll_ids_present_in_content;
|
197 |
}
|
198 |
|
199 |
+
/**
|
200 |
+
* Sets block attribute default values on the provided block object.
|
201 |
+
*
|
202 |
+
* @param array $block
|
203 |
+
* @return void
|
204 |
+
*/
|
205 |
+
private function apply_block_attribute_defaults( &$block ) {
|
206 |
+
$block_type = WP_Block_Type_Registry::get_instance()->get_registered( $block['blockName'] );
|
207 |
+
$default_attributes = $block_type->attributes;
|
208 |
+
|
209 |
+
foreach ( $default_attributes as $attribute_name => $attribute ) {
|
210 |
+
if ( ! isset( $block['attrs'][ $attribute_name ] ) ) {
|
211 |
+
$block['attrs'][ $attribute_name ] = $attribute['default'];
|
212 |
+
}
|
213 |
+
}
|
214 |
+
}
|
215 |
+
|
216 |
/**
|
217 |
* Fire any exception handling code here.
|
218 |
*
|
includes/synchronization/class-post-sync-entity.php
CHANGED
@@ -106,7 +106,10 @@ class Post_Sync_Entity implements Synchronizable_Entity {
|
|
106 |
* @return bool
|
107 |
*/
|
108 |
public function has_crowdsignal_forms_blocks() {
|
109 |
-
return has_blocks( $this->post ) &&
|
|
|
|
|
|
|
110 |
}
|
111 |
|
112 |
/**
|
106 |
* @return bool
|
107 |
*/
|
108 |
public function has_crowdsignal_forms_blocks() {
|
109 |
+
return has_blocks( $this->post ) && (
|
110 |
+
has_block( 'crowdsignal-forms/poll', $this->post ) ||
|
111 |
+
has_block( 'crowdsignal-forms/vote', $this->post )
|
112 |
+
);
|
113 |
}
|
114 |
|
115 |
/**
|
languages/crowdsignal-forms.pot
CHANGED
@@ -2,14 +2,14 @@
|
|
2 |
# This file is distributed under the GPL-2.0+.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: Crowdsignal Forms 1.
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/crowdsignal-forms\n"
|
7 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
8 |
"Language-Team: LANGUAGE <LL@li.org>\n"
|
9 |
"MIME-Version: 1.0\n"
|
10 |
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
"Content-Transfer-Encoding: 8bit\n"
|
12 |
-
"POT-Creation-Date: 2020-
|
13 |
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
14 |
"X-Generator: WP-CLI 2.5.0-alpha-75cb7e3\n"
|
15 |
"X-Domain: crowdsignal-forms\n"
|
@@ -43,6 +43,7 @@ msgid "You don’t have permission to do this."
|
|
43 |
msgstr ""
|
44 |
|
45 |
#: includes/admin/class-crowdsignal-forms-admin.php:70
|
|
|
46 |
msgid "Crowdsignal"
|
47 |
msgstr ""
|
48 |
|
@@ -61,32 +62,32 @@ msgid "General"
|
|
61 |
msgstr ""
|
62 |
|
63 |
#: includes/admin/class-crowdsignal-forms-settings.php:76
|
64 |
-
#: includes/admin/class-crowdsignal-forms-settings.php:
|
65 |
msgid "Enter Crowdsignal API Key"
|
66 |
msgstr ""
|
67 |
|
68 |
#. translators: %s is a link to the Crowdsignal connection page.
|
69 |
-
#: includes/admin/class-crowdsignal-forms-settings.php:
|
70 |
msgid "To collect responses and data with Crowdsignal Forms you need to <a href=\"%s\" target=\"_blank\">connect the plugin with a Crowdsignal account.</a>"
|
71 |
msgstr ""
|
72 |
|
73 |
-
#: includes/admin/class-crowdsignal-forms-settings.php:
|
74 |
msgid "You can do this by entering an API key below:"
|
75 |
msgstr ""
|
76 |
|
77 |
-
#: includes/admin/class-crowdsignal-forms-settings.php:
|
78 |
msgid "Settings successfully saved"
|
79 |
msgstr ""
|
80 |
|
81 |
-
#: includes/admin/class-crowdsignal-forms-settings.php:
|
82 |
msgid "Disconnect"
|
83 |
msgstr ""
|
84 |
|
85 |
-
#: includes/admin/class-crowdsignal-forms-settings.php:
|
86 |
msgid "Connect"
|
87 |
msgstr ""
|
88 |
|
89 |
-
#: includes/admin/class-crowdsignal-forms-settings.php:
|
90 |
msgid "If you don't have an API key we can help you here: "
|
91 |
msgstr ""
|
92 |
|
@@ -126,24 +127,24 @@ msgstr ""
|
|
126 |
msgid "Privacy"
|
127 |
msgstr ""
|
128 |
|
129 |
-
#: includes/admin/views/html-admin-setup-header.php:
|
130 |
msgid "Could not disconnect. Please try again."
|
131 |
msgstr ""
|
132 |
|
133 |
-
#: includes/admin/views/html-admin-setup-header.php:
|
134 |
msgid "Successfully disconnected from Crowdsignal."
|
135 |
msgstr ""
|
136 |
|
137 |
-
#: includes/admin/views/html-admin-setup-header.php:
|
138 |
msgid "Success! Your Crowdsignal account is successfully connected! You are ready!"
|
139 |
msgstr ""
|
140 |
|
141 |
-
#: includes/admin/views/html-admin-setup-header.php:
|
142 |
msgid "You have been connected to Crowdsignal."
|
143 |
msgstr ""
|
144 |
|
145 |
-
#: includes/admin/views/html-admin-setup-header.php:
|
146 |
-
msgid "Your API key has not been updated."
|
147 |
msgstr ""
|
148 |
|
149 |
#: includes/admin/views/html-admin-setup-step-1.php:14
|
@@ -154,7 +155,7 @@ msgstr ""
|
|
154 |
msgid "Let’s get started"
|
155 |
msgstr ""
|
156 |
|
157 |
-
#: includes/admin/views/html-admin-setup-step-2.php:
|
158 |
msgid "You're ready to start using Crowdsignal!"
|
159 |
msgstr ""
|
160 |
|
@@ -180,11 +181,7 @@ msgstr ""
|
|
180 |
msgid "<a href=\"%1s\" target=\"_blank\">Read more about us here.</a>"
|
181 |
msgstr ""
|
182 |
|
183 |
-
#: includes/frontend/blocks/class-crowdsignal-forms-poll-block.php:
|
184 |
-
msgid "Untitled Poll"
|
185 |
-
msgstr ""
|
186 |
-
|
187 |
-
#: includes/frontend/blocks/class-crowdsignal-forms-poll-block.php:203
|
188 |
msgid "Submit"
|
189 |
msgstr ""
|
190 |
|
2 |
# This file is distributed under the GPL-2.0+.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: Crowdsignal Forms 1.2.0\n"
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/crowdsignal-forms\n"
|
7 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
8 |
"Language-Team: LANGUAGE <LL@li.org>\n"
|
9 |
"MIME-Version: 1.0\n"
|
10 |
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
"Content-Transfer-Encoding: 8bit\n"
|
12 |
+
"POT-Creation-Date: 2020-10-01T20:46:23+00:00\n"
|
13 |
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
14 |
"X-Generator: WP-CLI 2.5.0-alpha-75cb7e3\n"
|
15 |
"X-Domain: crowdsignal-forms\n"
|
43 |
msgstr ""
|
44 |
|
45 |
#: includes/admin/class-crowdsignal-forms-admin.php:70
|
46 |
+
#: includes/class-crowdsignal-forms.php:419
|
47 |
msgid "Crowdsignal"
|
48 |
msgstr ""
|
49 |
|
62 |
msgstr ""
|
63 |
|
64 |
#: includes/admin/class-crowdsignal-forms-settings.php:76
|
65 |
+
#: includes/admin/class-crowdsignal-forms-settings.php:188
|
66 |
msgid "Enter Crowdsignal API Key"
|
67 |
msgstr ""
|
68 |
|
69 |
#. translators: %s is a link to the Crowdsignal connection page.
|
70 |
+
#: includes/admin/class-crowdsignal-forms-settings.php:167
|
71 |
msgid "To collect responses and data with Crowdsignal Forms you need to <a href=\"%s\" target=\"_blank\">connect the plugin with a Crowdsignal account.</a>"
|
72 |
msgstr ""
|
73 |
|
74 |
+
#: includes/admin/class-crowdsignal-forms-settings.php:173
|
75 |
msgid "You can do this by entering an API key below:"
|
76 |
msgstr ""
|
77 |
|
78 |
+
#: includes/admin/class-crowdsignal-forms-settings.php:180
|
79 |
msgid "Settings successfully saved"
|
80 |
msgstr ""
|
81 |
|
82 |
+
#: includes/admin/class-crowdsignal-forms-settings.php:208
|
83 |
msgid "Disconnect"
|
84 |
msgstr ""
|
85 |
|
86 |
+
#: includes/admin/class-crowdsignal-forms-settings.php:214
|
87 |
msgid "Connect"
|
88 |
msgstr ""
|
89 |
|
90 |
+
#: includes/admin/class-crowdsignal-forms-settings.php:225
|
91 |
msgid "If you don't have an API key we can help you here: "
|
92 |
msgstr ""
|
93 |
|
127 |
msgid "Privacy"
|
128 |
msgstr ""
|
129 |
|
130 |
+
#: includes/admin/views/html-admin-setup-header.php:46
|
131 |
msgid "Could not disconnect. Please try again."
|
132 |
msgstr ""
|
133 |
|
134 |
+
#: includes/admin/views/html-admin-setup-header.php:53
|
135 |
msgid "Successfully disconnected from Crowdsignal."
|
136 |
msgstr ""
|
137 |
|
138 |
+
#: includes/admin/views/html-admin-setup-header.php:60
|
139 |
msgid "Success! Your Crowdsignal account is successfully connected! You are ready!"
|
140 |
msgstr ""
|
141 |
|
142 |
+
#: includes/admin/views/html-admin-setup-header.php:67
|
143 |
msgid "You have been connected to Crowdsignal."
|
144 |
msgstr ""
|
145 |
|
146 |
+
#: includes/admin/views/html-admin-setup-header.php:74
|
147 |
+
msgid "Your API key has not been updated, please try again."
|
148 |
msgstr ""
|
149 |
|
150 |
#: includes/admin/views/html-admin-setup-step-1.php:14
|
155 |
msgid "Let’s get started"
|
156 |
msgstr ""
|
157 |
|
158 |
+
#: includes/admin/views/html-admin-setup-step-2.php:28
|
159 |
msgid "You're ready to start using Crowdsignal!"
|
160 |
msgstr ""
|
161 |
|
181 |
msgid "<a href=\"%1s\" target=\"_blank\">Read more about us here.</a>"
|
182 |
msgstr ""
|
183 |
|
184 |
+
#: includes/frontend/blocks/class-crowdsignal-forms-poll-block.php:150
|
|
|
|
|
|
|
|
|
185 |
msgid "Submit"
|
186 |
msgstr ""
|
187 |
|