Version Description
- 20-12-2020 =
Fixed: Search bar not working properly inside Elementor Editor Fixed: Item Previews not working properly Fixed: Items insertion failure from Preview page Few minor bug fix and improvements
Download this release
Release Info
Developer | Asif2BD |
Plugin | Templately – Templates Cloud for Elementor & Gutenberg : 2500+ Free & Premium Designs! |
Version | 1.1.6 |
Comparing to | |
See all releases |
Code changes from version 1.1.5 to 1.1.6
- README.txt +14 -3
- assets/css/templately.css +6 -0
- assets/images/export.svg +41 -41
- assets/images/not-found.svg +11 -11
- assets/js/templately.min.js +1 -1
- core/api/class-api.php +8 -1
- templately.php +3 -3
README.txt
CHANGED
@@ -5,15 +5,15 @@ Tags: templates, elementor, template-cloud, template, clouds, elementor template
|
|
5 |
Requires at least: 5.0
|
6 |
Tested up to: 5.6
|
7 |
Requires PHP: 5.6
|
8 |
-
Stable tag: 1.1.
|
9 |
License: GPLv3 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
11 |
|
12 |
-
Ultimate Templates Cloud for WordPress
|
13 |
|
14 |
== Description ==
|
15 |
|
16 |
-
|
17 |
|
18 |
Take your favourite Page Builders to a whole new level & manage all your designs in one place with [Templately](https://templately.com)
|
19 |
|
@@ -35,6 +35,10 @@ Save your design templates in MyCloud storage and access all your Saved Template
|
|
35 |
|
36 |
Create landing pages with Elementor, Gutenberg and boost up your page building experience to the next level.
|
37 |
|
|
|
|
|
|
|
|
|
38 |
### 👨💻 Super Friendly Support ###
|
39 |
|
40 |
Get help and assistance from our dedicated forum support and create stunning landing pages with Templately.
|
@@ -108,6 +112,13 @@ Yes, it will work with any standard WordPress theme.
|
|
108 |
|
109 |
== Changelog ==
|
110 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
111 |
= 1.1.5 - 09-12-2020 =
|
112 |
|
113 |
Added: Global Login option
|
5 |
Requires at least: 5.0
|
6 |
Tested up to: 5.6
|
7 |
Requires PHP: 5.6
|
8 |
+
Stable tag: 1.1.6
|
9 |
License: GPLv3 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
11 |
|
12 |
+
Ultimate Free Templates Cloud for WordPress - Elementor & Gutenberg! 1000+ Free Designs!
|
13 |
|
14 |
== Description ==
|
15 |
|
16 |
+
= Ultimate Free Templates Cloud for WordPress - Elementor & Gutenberg Supported =
|
17 |
|
18 |
Take your favourite Page Builders to a whole new level & manage all your designs in one place with [Templately](https://templately.com)
|
19 |
|
35 |
|
36 |
Create landing pages with Elementor, Gutenberg and boost up your page building experience to the next level.
|
37 |
|
38 |
+
### 🔥 Nearly 1000 Elementor Templates Available Already ###
|
39 |
+
|
40 |
+
Elementor Template are easiest way to build website fast with te most popular pagebuilder, we have 1000 available already.
|
41 |
+
|
42 |
### 👨💻 Super Friendly Support ###
|
43 |
|
44 |
Get help and assistance from our dedicated forum support and create stunning landing pages with Templately.
|
112 |
|
113 |
== Changelog ==
|
114 |
|
115 |
+
= 1.1.6 - 20-12-2020 =
|
116 |
+
|
117 |
+
Fixed: Search bar not working properly inside Elementor Editor
|
118 |
+
Fixed: Item Previews not working properly
|
119 |
+
Fixed: Items insertion failure from Preview page
|
120 |
+
Few minor bug fix and improvements
|
121 |
+
|
122 |
= 1.1.5 - 09-12-2020 =
|
123 |
|
124 |
Added: Global Login option
|
assets/css/templately.css
CHANGED
@@ -573,6 +573,12 @@ div.templately-manage-accounts h1 {
|
|
573 |
padding: 20px 30px;
|
574 |
background-color: #ffffff;
|
575 |
border-top: 2px solid #f2f5f7; }
|
|
|
|
|
|
|
|
|
|
|
|
|
576 |
.templately-modal-sidebar .templately-sidebar-dependency-filter.templately-tags-filter .templately-tags__menu {
|
577 |
position: relative;
|
578 |
z-index: 9; }
|
573 |
padding: 20px 30px;
|
574 |
background-color: #ffffff;
|
575 |
border-top: 2px solid #f2f5f7; }
|
576 |
+
.templately-modal-sidebar .templately-sidebar-dependency-filter.templately-tags-filter > label {
|
577 |
+
font-size: 14px;
|
578 |
+
font-weight: 500;
|
579 |
+
color: #031d3c; }
|
580 |
+
.templately-modal-sidebar .templately-sidebar-dependency-filter.templately-tags-filter > label + div {
|
581 |
+
margin-top: 10px; }
|
582 |
.templately-modal-sidebar .templately-sidebar-dependency-filter.templately-tags-filter .templately-tags__menu {
|
583 |
position: relative;
|
584 |
z-index: 9; }
|
assets/images/export.svg
CHANGED
@@ -1,41 +1,41 @@
|
|
1 |
-
<?xml version="1.0" encoding="iso-8859-1"?>
|
2 |
-
<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
3 |
-
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
4 |
-
viewBox="0 0 512 512" style="enable-background:new 0 0 512 512;" xml:space="preserve">
|
5 |
-
<path style="fill:#607D8B;" d="M352,416.002H64v-288h96v-64H32c-17.664,0-32,14.336-32,32v352c0,17.696,14.336,32,32,32h352
|
6 |
-
c17.696,0,32-14.304,32-32V288.994h-64V416.002z"/>
|
7 |
-
<path style="fill:#2196F3;" d="M505.6,131.202l-128-96c-4.8-3.648-11.328-4.224-16.736-1.504c-5.44,2.72-8.864,8.256-8.864,14.304
|
8 |
-
v48h-48c-97.056,0-176,78.944-176,176c0,7.424,5.12,13.888,12.32,15.584c1.216,0.288,2.464,0.416,3.68,0.416
|
9 |
-
c5.952,0,11.552-3.328,14.304-8.832l3.776-7.52c24.544-49.12,73.888-79.648,128.8-79.648H352v48c0,6.048,3.424,11.584,8.832,14.304
|
10 |
-
s11.936,2.144,16.768-1.504l128-96c4.032-3.008,6.4-7.776,6.4-12.8S509.632,134.21,505.6,131.202z"/>
|
11 |
-
<g>
|
12 |
-
</g>
|
13 |
-
<g>
|
14 |
-
</g>
|
15 |
-
<g>
|
16 |
-
</g>
|
17 |
-
<g>
|
18 |
-
</g>
|
19 |
-
<g>
|
20 |
-
</g>
|
21 |
-
<g>
|
22 |
-
</g>
|
23 |
-
<g>
|
24 |
-
</g>
|
25 |
-
<g>
|
26 |
-
</g>
|
27 |
-
<g>
|
28 |
-
</g>
|
29 |
-
<g>
|
30 |
-
</g>
|
31 |
-
<g>
|
32 |
-
</g>
|
33 |
-
<g>
|
34 |
-
</g>
|
35 |
-
<g>
|
36 |
-
</g>
|
37 |
-
<g>
|
38 |
-
</g>
|
39 |
-
<g>
|
40 |
-
</g>
|
41 |
-
</svg>
|
1 |
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2 |
+
<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
3 |
+
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
4 |
+
viewBox="0 0 512 512" style="enable-background:new 0 0 512 512;" xml:space="preserve">
|
5 |
+
<path style="fill:#607D8B;" d="M352,416.002H64v-288h96v-64H32c-17.664,0-32,14.336-32,32v352c0,17.696,14.336,32,32,32h352
|
6 |
+
c17.696,0,32-14.304,32-32V288.994h-64V416.002z"/>
|
7 |
+
<path style="fill:#2196F3;" d="M505.6,131.202l-128-96c-4.8-3.648-11.328-4.224-16.736-1.504c-5.44,2.72-8.864,8.256-8.864,14.304
|
8 |
+
v48h-48c-97.056,0-176,78.944-176,176c0,7.424,5.12,13.888,12.32,15.584c1.216,0.288,2.464,0.416,3.68,0.416
|
9 |
+
c5.952,0,11.552-3.328,14.304-8.832l3.776-7.52c24.544-49.12,73.888-79.648,128.8-79.648H352v48c0,6.048,3.424,11.584,8.832,14.304
|
10 |
+
s11.936,2.144,16.768-1.504l128-96c4.032-3.008,6.4-7.776,6.4-12.8S509.632,134.21,505.6,131.202z"/>
|
11 |
+
<g>
|
12 |
+
</g>
|
13 |
+
<g>
|
14 |
+
</g>
|
15 |
+
<g>
|
16 |
+
</g>
|
17 |
+
<g>
|
18 |
+
</g>
|
19 |
+
<g>
|
20 |
+
</g>
|
21 |
+
<g>
|
22 |
+
</g>
|
23 |
+
<g>
|
24 |
+
</g>
|
25 |
+
<g>
|
26 |
+
</g>
|
27 |
+
<g>
|
28 |
+
</g>
|
29 |
+
<g>
|
30 |
+
</g>
|
31 |
+
<g>
|
32 |
+
</g>
|
33 |
+
<g>
|
34 |
+
</g>
|
35 |
+
<g>
|
36 |
+
</g>
|
37 |
+
<g>
|
38 |
+
</g>
|
39 |
+
<g>
|
40 |
+
</g>
|
41 |
+
</svg>
|
assets/images/not-found.svg
CHANGED
@@ -1,11 +1,11 @@
|
|
1 |
-
<svg id="not" xmlns="http://www.w3.org/2000/svg" width="60.1" height="60.1" viewBox="0 0 60.1 60.1">
|
2 |
-
<path id="Path_1" data-name="Path 1" d="M53.2,0H6.9A6.914,6.914,0,0,0,0,6.9V38.2a1.9,1.9,0,1,0,3.8,0V12.5H56.3V38.1a1.9,1.9,0,0,0,3.8,0V6.9A7.046,7.046,0,0,0,53.2,0ZM3.8,8.7V6.9A3.116,3.116,0,0,1,6.9,3.8H53.2a3.116,3.116,0,0,1,3.1,3.1V8.8H3.8Z" fill="#c6cbd2"/>
|
3 |
-
<path id="Path_2" data-name="Path 2" d="M20.7,25a1.9,1.9,0,0,0-1.9,1.9v4L16,26a1.951,1.951,0,0,0-2.1-.9,1.921,1.921,0,0,0-1.4,1.8V38.2a1.9,1.9,0,1,0,3.8,0v-4L19,39a1.9,1.9,0,0,0,1.6,1,.9.9,0,0,0,.5-.1,1.921,1.921,0,0,0,1.4-1.8V26.9A1.817,1.817,0,0,0,20.7,25Z" fill="#c6cbd2"/>
|
4 |
-
<path id="Path_3" data-name="Path 3" d="M30.7,25H29.4A4.439,4.439,0,0,0,25,29.4v6.3a4.439,4.439,0,0,0,4.4,4.4h1.3a4.439,4.439,0,0,0,4.4-4.4V29.4A4.507,4.507,0,0,0,30.7,25Zm.6,10.6a.645.645,0,0,1-.6.6H29.4a.645.645,0,0,1-.6-.6V29.3a.645.645,0,0,1,.6-.6h1.3a.645.645,0,0,1,.6.6Z" fill="#c6cbd2"/>
|
5 |
-
<path id="Path_4" data-name="Path 4" d="M45.7,25H39.4a1.9,1.9,0,1,0,0,3.8h1.2v9.4a1.9,1.9,0,0,0,3.8,0V28.8h1.3a1.9,1.9,0,0,0,1.9-1.9A1.965,1.965,0,0,0,45.7,25Z" fill="#c6cbd2"/>
|
6 |
-
<path id="Path_5" data-name="Path 5" d="M55.7,45H51.9A1.9,1.9,0,0,0,50,46.9V58.1A1.9,1.9,0,0,0,51.9,60h3.8a4.439,4.439,0,0,0,4.4-4.4V49.3A4.489,4.489,0,0,0,55.7,45Zm.6,10.6a.645.645,0,0,1-.6.6H53.8V48.7h1.9a.645.645,0,0,1,.6.6Z" fill="#c6cbd2"/>
|
7 |
-
<path id="Path_6" data-name="Path 6" d="M4.4,48.7H8.1a1.9,1.9,0,0,0,0-3.8H4.4A4.6,4.6,0,0,0,0,49.4v8.7a1.9,1.9,0,1,0,3.8,0V55H8.2a1.9,1.9,0,0,0,1.9-1.9,1.839,1.839,0,0,0-1.9-1.9H3.8V49.3A.645.645,0,0,1,4.4,48.7Z" fill="#c6cbd2"/>
|
8 |
-
<path id="Path_7" data-name="Path 7" d="M45.7,45a1.9,1.9,0,0,0-1.9,1.9v4L41,46a1.951,1.951,0,0,0-2.1-.9,1.921,1.921,0,0,0-1.4,1.8V58.1a1.9,1.9,0,1,0,3.8,0v-4L44,59a1.9,1.9,0,0,0,1.6,1,.9.9,0,0,0,.5-.1,1.921,1.921,0,0,0,1.4-1.8V46.9A1.817,1.817,0,0,0,45.7,45Z" fill="#c6cbd2"/>
|
9 |
-
<path id="Path_8" data-name="Path 8" d="M18.2,45H17a4.439,4.439,0,0,0-4.4,4.4v6.3A4.439,4.439,0,0,0,17,60.1h1.2a4.439,4.439,0,0,0,4.4-4.4V49.4A4.507,4.507,0,0,0,18.2,45Zm.6,10.6a.645.645,0,0,1-.6.6H17a.645.645,0,0,1-.6-.6V49.3a.645.645,0,0,1,.6-.6h1.2a.645.645,0,0,1,.6.6Z" fill="#c6cbd2"/>
|
10 |
-
<path id="Path_9" data-name="Path 9" d="M33.2,45a1.9,1.9,0,0,0-1.9,1.9v8.7a.645.645,0,0,1-.6.6H29.4a.645.645,0,0,1-.6-.6V46.9a1.9,1.9,0,1,0-3.8,0v8.7A4.439,4.439,0,0,0,29.4,60h1.3a4.439,4.439,0,0,0,4.4-4.4V46.9A1.965,1.965,0,0,0,33.2,45Z" fill="#c6cbd2"/>
|
11 |
-
</svg>
|
1 |
+
<svg id="not" xmlns="http://www.w3.org/2000/svg" width="60.1" height="60.1" viewBox="0 0 60.1 60.1">
|
2 |
+
<path id="Path_1" data-name="Path 1" d="M53.2,0H6.9A6.914,6.914,0,0,0,0,6.9V38.2a1.9,1.9,0,1,0,3.8,0V12.5H56.3V38.1a1.9,1.9,0,0,0,3.8,0V6.9A7.046,7.046,0,0,0,53.2,0ZM3.8,8.7V6.9A3.116,3.116,0,0,1,6.9,3.8H53.2a3.116,3.116,0,0,1,3.1,3.1V8.8H3.8Z" fill="#c6cbd2"/>
|
3 |
+
<path id="Path_2" data-name="Path 2" d="M20.7,25a1.9,1.9,0,0,0-1.9,1.9v4L16,26a1.951,1.951,0,0,0-2.1-.9,1.921,1.921,0,0,0-1.4,1.8V38.2a1.9,1.9,0,1,0,3.8,0v-4L19,39a1.9,1.9,0,0,0,1.6,1,.9.9,0,0,0,.5-.1,1.921,1.921,0,0,0,1.4-1.8V26.9A1.817,1.817,0,0,0,20.7,25Z" fill="#c6cbd2"/>
|
4 |
+
<path id="Path_3" data-name="Path 3" d="M30.7,25H29.4A4.439,4.439,0,0,0,25,29.4v6.3a4.439,4.439,0,0,0,4.4,4.4h1.3a4.439,4.439,0,0,0,4.4-4.4V29.4A4.507,4.507,0,0,0,30.7,25Zm.6,10.6a.645.645,0,0,1-.6.6H29.4a.645.645,0,0,1-.6-.6V29.3a.645.645,0,0,1,.6-.6h1.3a.645.645,0,0,1,.6.6Z" fill="#c6cbd2"/>
|
5 |
+
<path id="Path_4" data-name="Path 4" d="M45.7,25H39.4a1.9,1.9,0,1,0,0,3.8h1.2v9.4a1.9,1.9,0,0,0,3.8,0V28.8h1.3a1.9,1.9,0,0,0,1.9-1.9A1.965,1.965,0,0,0,45.7,25Z" fill="#c6cbd2"/>
|
6 |
+
<path id="Path_5" data-name="Path 5" d="M55.7,45H51.9A1.9,1.9,0,0,0,50,46.9V58.1A1.9,1.9,0,0,0,51.9,60h3.8a4.439,4.439,0,0,0,4.4-4.4V49.3A4.489,4.489,0,0,0,55.7,45Zm.6,10.6a.645.645,0,0,1-.6.6H53.8V48.7h1.9a.645.645,0,0,1,.6.6Z" fill="#c6cbd2"/>
|
7 |
+
<path id="Path_6" data-name="Path 6" d="M4.4,48.7H8.1a1.9,1.9,0,0,0,0-3.8H4.4A4.6,4.6,0,0,0,0,49.4v8.7a1.9,1.9,0,1,0,3.8,0V55H8.2a1.9,1.9,0,0,0,1.9-1.9,1.839,1.839,0,0,0-1.9-1.9H3.8V49.3A.645.645,0,0,1,4.4,48.7Z" fill="#c6cbd2"/>
|
8 |
+
<path id="Path_7" data-name="Path 7" d="M45.7,45a1.9,1.9,0,0,0-1.9,1.9v4L41,46a1.951,1.951,0,0,0-2.1-.9,1.921,1.921,0,0,0-1.4,1.8V58.1a1.9,1.9,0,1,0,3.8,0v-4L44,59a1.9,1.9,0,0,0,1.6,1,.9.9,0,0,0,.5-.1,1.921,1.921,0,0,0,1.4-1.8V46.9A1.817,1.817,0,0,0,45.7,45Z" fill="#c6cbd2"/>
|
9 |
+
<path id="Path_8" data-name="Path 8" d="M18.2,45H17a4.439,4.439,0,0,0-4.4,4.4v6.3A4.439,4.439,0,0,0,17,60.1h1.2a4.439,4.439,0,0,0,4.4-4.4V49.4A4.507,4.507,0,0,0,18.2,45Zm.6,10.6a.645.645,0,0,1-.6.6H17a.645.645,0,0,1-.6-.6V49.3a.645.645,0,0,1,.6-.6h1.2a.645.645,0,0,1,.6.6Z" fill="#c6cbd2"/>
|
10 |
+
<path id="Path_9" data-name="Path 9" d="M33.2,45a1.9,1.9,0,0,0-1.9,1.9v8.7a.645.645,0,0,1-.6.6H29.4a.645.645,0,0,1-.6-.6V46.9a1.9,1.9,0,1,0-3.8,0v8.7A4.439,4.439,0,0,0,29.4,60h1.3a4.439,4.439,0,0,0,4.4-4.4V46.9A1.965,1.965,0,0,0,33.2,45Z" fill="#c6cbd2"/>
|
11 |
+
</svg>
|
assets/js/templately.min.js
CHANGED
@@ -71,4 +71,4 @@ e.exports=function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw
|
|
71 |
*
|
72 |
* This source code is licensed under the MIT license found in the
|
73 |
* LICENSE file in the root directory of this source tree.
|
74 |
-
*/var r,a,o,i,l;if("undefined"==typeof window||"function"!=typeof MessageChannel){var c=null,u=null,s=function(){if(null!==c)try{var e=t.unstable_now();c(!0,e),c=null}catch(e){throw setTimeout(s,0),e}},f=Date.now();t.unstable_now=function(){return Date.now()-f},r=function(e){null!==c?setTimeout(r,0,e):(c=e,setTimeout(s,0))},a=function(e,t){u=setTimeout(e,t)},o=function(){clearTimeout(u)},i=function(){return!1},l=t.unstable_forceFrameRate=function(){}}else{var p=window.performance,d=window.Date,m=window.setTimeout,h=window.clearTimeout;if("undefined"!=typeof console){var y=window.cancelAnimationFrame;"function"!=typeof window.requestAnimationFrame&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills"),"function"!=typeof y&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills")}if("object"==typeof p&&"function"==typeof p.now)t.unstable_now=function(){return p.now()};else{var g=d.now();t.unstable_now=function(){return d.now()-g}}var v=!1,b=null,w=-1,E=5,O=0;i=function(){return t.unstable_now()>=O},l=function(){},t.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing framerates higher than 125 fps is not unsupported"):E=0<e?Math.floor(1e3/e):5};var k=new MessageChannel,S=k.port2;k.port1.onmessage=function(){if(null!==b){var e=t.unstable_now();O=e+E;try{b(!0,e)?S.postMessage(null):(v=!1,b=null)}catch(e){throw S.postMessage(null),e}}else v=!1},r=function(e){b=e,v||(v=!0,S.postMessage(null))},a=function(e,n){w=m((function(){e(t.unstable_now())}),n)},o=function(){h(w),w=-1}}function x(e,t){var n=e.length;e.push(t);e:for(;;){var r=n-1>>>1,a=e[r];if(!(void 0!==a&&0<P(a,t)))break e;e[r]=t,e[n]=a,n=r}}function _(e){return void 0===(e=e[0])?null:e}function j(e){var t=e[0];if(void 0!==t){var n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,a=e.length;r<a;){var o=2*(r+1)-1,i=e[o],l=o+1,c=e[l];if(void 0!==i&&0>P(i,n))void 0!==c&&0>P(c,i)?(e[r]=c,e[l]=n,r=l):(e[r]=i,e[o]=n,r=o);else{if(!(void 0!==c&&0>P(c,n)))break e;e[r]=c,e[l]=n,r=l}}}return t}return null}function P(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}var C=[],T=[],A=1,N=null,I=3,L=!1,D=!1,R=!1;function M(e){for(var t=_(T);null!==t;){if(null===t.callback)j(T);else{if(!(t.startTime<=e))break;j(T),t.sortIndex=t.expirationTime,x(C,t)}t=_(T)}}function F(e){if(R=!1,M(e),!D)if(null!==_(C))D=!0,r(z);else{var t=_(T);null!==t&&a(F,t.startTime-e)}}function z(e,n){D=!1,R&&(R=!1,o()),L=!0;var r=I;try{for(M(n),N=_(C);null!==N&&(!(N.expirationTime>n)||e&&!i());){var l=N.callback;if(null!==l){N.callback=null,I=N.priorityLevel;var c=l(N.expirationTime<=n);n=t.unstable_now(),"function"==typeof c?N.callback=c:N===_(C)&&j(C),M(n)}else j(C);N=_(C)}if(null!==N)var u=!0;else{var s=_(T);null!==s&&a(F,s.startTime-n),u=!1}return u}finally{N=null,I=r,L=!1}}function U(e){switch(e){case 1:return-1;case 2:return 250;case 5:return 1073741823;case 4:return 1e4;default:return 5e3}}var B=l;t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){D||L||(D=!0,r(z))},t.unstable_getCurrentPriorityLevel=function(){return I},t.unstable_getFirstCallbackNode=function(){return _(C)},t.unstable_next=function(e){switch(I){case 1:case 2:case 3:var t=3;break;default:t=I}var n=I;I=t;try{return e()}finally{I=n}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=B,t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=I;I=e;try{return t()}finally{I=n}},t.unstable_scheduleCallback=function(e,n,i){var l=t.unstable_now();if("object"==typeof i&&null!==i){var c=i.delay;c="number"==typeof c&&0<c?l+c:l,i="number"==typeof i.timeout?i.timeout:U(e)}else i=U(e),c=l;return e={id:A++,callback:n,priorityLevel:e,startTime:c,expirationTime:i=c+i,sortIndex:-1},c>l?(e.sortIndex=c,x(T,e),null===_(C)&&e===_(T)&&(R?o():R=!0,a(F,c-l))):(e.sortIndex=i,x(C,e),D||L||(D=!0,r(z))),e},t.unstable_shouldYield=function(){var e=t.unstable_now();M(e);var n=_(C);return n!==N&&null!==N&&null!==n&&null!==n.callback&&n.startTime<=e&&n.expirationTime<N.expirationTime||i()},t.unstable_wrapCallback=function(e){var t=I;return function(){var n=I;I=t;try{return e.apply(this,arguments)}finally{I=n}}}},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},,function(e,t,n){"use strict";n.r(t);var r={};n.r(r),n.d(r,"find",(function(){return al}));var a={};n.r(a),n.d(a,"isTabbableIndex",(function(){return il})),n.d(a,"find",(function(){return fl})),n.d(a,"findPrevious",(function(){return pl})),n.d(a,"findNext",(function(){return dl}));var o=n(0),i=n.n(o),l=n(9),c=n.n(l),u=n(10);n(17);function s(){return(s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function f(e){return"/"===e.charAt(0)}function p(e,t){for(var n=t,r=n+1,a=e.length;r<a;n+=1,r+=1)e[n]=e[r];e.pop()}var d=function(e,t){void 0===t&&(t="");var n,r=e&&e.split("/")||[],a=t&&t.split("/")||[],o=e&&f(e),i=t&&f(t),l=o||i;if(e&&f(e)?a=r:r.length&&(a.pop(),a=a.concat(r)),!a.length)return"/";if(a.length){var c=a[a.length-1];n="."===c||".."===c||""===c}else n=!1;for(var u=0,s=a.length;s>=0;s--){var d=a[s];"."===d?p(a,s):".."===d?(p(a,s),u++):u&&(p(a,s),u--)}if(!l)for(;u--;u)a.unshift("..");!l||""===a[0]||a[0]&&f(a[0])||a.unshift("");var m=a.join("/");return n&&"/"!==m.substr(-1)&&(m+="/"),m};function m(e){return e.valueOf?e.valueOf():Object.prototype.valueOf.call(e)}var h=function e(t,n){if(t===n)return!0;if(null==t||null==n)return!1;if(Array.isArray(t))return Array.isArray(n)&&t.length===n.length&&t.every((function(t,r){return e(t,n[r])}));if("object"==typeof t||"object"==typeof n){var r=m(t),a=m(n);return r!==t||a!==n?e(r,a):Object.keys(Object.assign({},t,n)).every((function(r){return e(t[r],n[r])}))}return!1};var y=function(e,t){if(!e)throw new Error("Invariant failed")};function g(e){return"/"===e.charAt(0)?e:"/"+e}function v(e){return"/"===e.charAt(0)?e.substr(1):e}function b(e,t){return function(e,t){return 0===e.toLowerCase().indexOf(t.toLowerCase())&&-1!=="/?#".indexOf(e.charAt(t.length))}(e,t)?e.substr(t.length):e}function w(e){return"/"===e.charAt(e.length-1)?e.slice(0,-1):e}function E(e){var t=e.pathname,n=e.search,r=e.hash,a=t||"/";return n&&"?"!==n&&(a+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(a+="#"===r.charAt(0)?r:"#"+r),a}function O(e,t,n,r){var a;"string"==typeof e?(a=function(e){var t=e||"/",n="",r="",a=t.indexOf("#");-1!==a&&(r=t.substr(a),t=t.substr(0,a));var o=t.indexOf("?");return-1!==o&&(n=t.substr(o),t=t.substr(0,o)),{pathname:t,search:"?"===n?"":n,hash:"#"===r?"":r}}(e)).state=t:(void 0===(a=s({},e)).pathname&&(a.pathname=""),a.search?"?"!==a.search.charAt(0)&&(a.search="?"+a.search):a.search="",a.hash?"#"!==a.hash.charAt(0)&&(a.hash="#"+a.hash):a.hash="",void 0!==t&&void 0===a.state&&(a.state=t));try{a.pathname=decodeURI(a.pathname)}catch(e){throw e instanceof URIError?new URIError('Pathname "'+a.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):e}return n&&(a.key=n),r?a.pathname?"/"!==a.pathname.charAt(0)&&(a.pathname=d(a.pathname,r.pathname)):a.pathname=r.pathname:a.pathname||(a.pathname="/"),a}function k(){var e=null;var t=[];return{setPrompt:function(t){return e=t,function(){e===t&&(e=null)}},confirmTransitionTo:function(t,n,r,a){if(null!=e){var o="function"==typeof e?e(t,n):e;"string"==typeof o?"function"==typeof r?r(o,a):a(!0):a(!1!==o)}else a(!0)},appendListener:function(e){var n=!0;function r(){n&&e.apply(void 0,arguments)}return t.push(r),function(){n=!1,t=t.filter((function(e){return e!==r}))}},notifyListeners:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];t.forEach((function(e){return e.apply(void 0,n)}))}}}var S=!("undefined"==typeof window||!window.document||!window.document.createElement);function x(e,t){t(window.confirm(e))}function _(){try{return window.history.state||{}}catch(e){return{}}}function j(e){void 0===e&&(e={}),S||y(!1);var t,n=window.history,r=(-1===(t=window.navigator.userAgent).indexOf("Android 2.")&&-1===t.indexOf("Android 4.0")||-1===t.indexOf("Mobile Safari")||-1!==t.indexOf("Chrome")||-1!==t.indexOf("Windows Phone"))&&window.history&&"pushState"in window.history,a=!(-1===window.navigator.userAgent.indexOf("Trident")),o=e,i=o.forceRefresh,l=void 0!==i&&i,c=o.getUserConfirmation,u=void 0===c?x:c,f=o.keyLength,p=void 0===f?6:f,d=e.basename?w(g(e.basename)):"";function m(e){var t=e||{},n=t.key,r=t.state,a=window.location,o=a.pathname+a.search+a.hash;return d&&(o=b(o,d)),O(o,r,n)}function h(){return Math.random().toString(36).substr(2,p)}var v=k();function j(e){s(z,e),z.length=n.length,v.notifyListeners(z.location,z.action)}function P(e){(function(e){return void 0===e.state&&-1===navigator.userAgent.indexOf("CriOS")})(e)||A(m(e.state))}function C(){A(m(_()))}var T=!1;function A(e){if(T)T=!1,j();else{v.confirmTransitionTo(e,"POP",u,(function(t){t?j({action:"POP",location:e}):function(e){var t=z.location,n=I.indexOf(t.key);-1===n&&(n=0);var r=I.indexOf(e.key);-1===r&&(r=0);var a=n-r;a&&(T=!0,D(a))}(e)}))}}var N=m(_()),I=[N.key];function L(e){return d+E(e)}function D(e){n.go(e)}var R=0;function M(e){1===(R+=e)&&1===e?(window.addEventListener("popstate",P),a&&window.addEventListener("hashchange",C)):0===R&&(window.removeEventListener("popstate",P),a&&window.removeEventListener("hashchange",C))}var F=!1;var z={length:n.length,action:"POP",location:N,createHref:L,push:function(e,t){var a=O(e,t,h(),z.location);v.confirmTransitionTo(a,"PUSH",u,(function(e){if(e){var t=L(a),o=a.key,i=a.state;if(r)if(n.pushState({key:o,state:i},null,t),l)window.location.href=t;else{var c=I.indexOf(z.location.key),u=I.slice(0,c+1);u.push(a.key),I=u,j({action:"PUSH",location:a})}else window.location.href=t}}))},replace:function(e,t){var a=O(e,t,h(),z.location);v.confirmTransitionTo(a,"REPLACE",u,(function(e){if(e){var t=L(a),o=a.key,i=a.state;if(r)if(n.replaceState({key:o,state:i},null,t),l)window.location.replace(t);else{var c=I.indexOf(z.location.key);-1!==c&&(I[c]=a.key),j({action:"REPLACE",location:a})}else window.location.replace(t)}}))},go:D,goBack:function(){D(-1)},goForward:function(){D(1)},block:function(e){void 0===e&&(e=!1);var t=v.setPrompt(e);return F||(M(1),F=!0),function(){return F&&(F=!1,M(-1)),t()}},listen:function(e){var t=v.appendListener(e);return M(1),function(){M(-1),t()}}};return z}var P={hashbang:{encodePath:function(e){return"!"===e.charAt(0)?e:"!/"+v(e)},decodePath:function(e){return"!"===e.charAt(0)?e.substr(1):e}},noslash:{encodePath:v,decodePath:g},slash:{encodePath:g,decodePath:g}};function C(e){var t=e.indexOf("#");return-1===t?e:e.slice(0,t)}function T(){var e=window.location.href,t=e.indexOf("#");return-1===t?"":e.substring(t+1)}function A(e){window.location.replace(C(window.location.href)+"#"+e)}function N(e){void 0===e&&(e={}),S||y(!1);var t=window.history,n=(window.navigator.userAgent.indexOf("Firefox"),e),r=n.getUserConfirmation,a=void 0===r?x:r,o=n.hashType,i=void 0===o?"slash":o,l=e.basename?w(g(e.basename)):"",c=P[i],u=c.encodePath,f=c.decodePath;function p(){var e=f(T());return l&&(e=b(e,l)),O(e)}var d=k();function m(e){s(z,e),z.length=t.length,d.notifyListeners(z.location,z.action)}var h=!1,v=null;function _(){var e,t,n=T(),r=u(n);if(n!==r)A(r);else{var o=p(),i=z.location;if(!h&&(t=o,(e=i).pathname===t.pathname&&e.search===t.search&&e.hash===t.hash))return;if(v===E(o))return;v=null,function(e){if(h)h=!1,m();else{d.confirmTransitionTo(e,"POP",a,(function(t){t?m({action:"POP",location:e}):function(e){var t=z.location,n=L.lastIndexOf(E(t));-1===n&&(n=0);var r=L.lastIndexOf(E(e));-1===r&&(r=0);var a=n-r;a&&(h=!0,D(a))}(e)}))}}(o)}}var j=T(),N=u(j);j!==N&&A(N);var I=p(),L=[E(I)];function D(e){t.go(e)}var R=0;function M(e){1===(R+=e)&&1===e?window.addEventListener("hashchange",_):0===R&&window.removeEventListener("hashchange",_)}var F=!1;var z={length:t.length,action:"POP",location:I,createHref:function(e){var t=document.querySelector("base"),n="";return t&&t.getAttribute("href")&&(n=C(window.location.href)),n+"#"+u(l+E(e))},push:function(e,t){var n=O(e,void 0,void 0,z.location);d.confirmTransitionTo(n,"PUSH",a,(function(e){if(e){var t=E(n),r=u(l+t);if(T()!==r){v=t,function(e){window.location.hash=e}(r);var a=L.lastIndexOf(E(z.location)),o=L.slice(0,a+1);o.push(t),L=o,m({action:"PUSH",location:n})}else m()}}))},replace:function(e,t){var n=O(e,void 0,void 0,z.location);d.confirmTransitionTo(n,"REPLACE",a,(function(e){if(e){var t=E(n),r=u(l+t);T()!==r&&(v=t,A(r));var a=L.indexOf(E(z.location));-1!==a&&(L[a]=t),m({action:"REPLACE",location:n})}}))},go:D,goBack:function(){D(-1)},goForward:function(){D(1)},block:function(e){void 0===e&&(e=!1);var t=d.setPrompt(e);return F||(M(1),F=!0),function(){return F&&(F=!1,M(-1)),t()}},listen:function(e){var t=d.appendListener(e);return M(1),function(){M(-1),t()}}};return z}function I(e,t,n){return Math.min(Math.max(e,t),n)}function L(e){void 0===e&&(e={});var t=e,n=t.getUserConfirmation,r=t.initialEntries,a=void 0===r?["/"]:r,o=t.initialIndex,i=void 0===o?0:o,l=t.keyLength,c=void 0===l?6:l,u=k();function f(e){s(g,e),g.length=g.entries.length,u.notifyListeners(g.location,g.action)}function p(){return Math.random().toString(36).substr(2,c)}var d=I(i,0,a.length-1),m=a.map((function(e){return O(e,void 0,"string"==typeof e?p():e.key||p())})),h=E;function y(e){var t=I(g.index+e,0,g.entries.length-1),r=g.entries[t];u.confirmTransitionTo(r,"POP",n,(function(e){e?f({action:"POP",location:r,index:t}):f()}))}var g={length:m.length,action:"POP",location:m[d],index:d,entries:m,createHref:h,push:function(e,t){var r=O(e,t,p(),g.location);u.confirmTransitionTo(r,"PUSH",n,(function(e){if(e){var t=g.index+1,n=g.entries.slice(0);n.length>t?n.splice(t,n.length-t,r):n.push(r),f({action:"PUSH",location:r,index:t,entries:n})}}))},replace:function(e,t){var r=O(e,t,p(),g.location);u.confirmTransitionTo(r,"REPLACE",n,(function(e){e&&(g.entries[g.index]=r,f({action:"REPLACE",location:r}))}))},go:y,goBack:function(){y(-1)},goForward:function(){y(1)},canGo:function(e){var t=g.index+e;return t>=0&&t<g.entries.length},block:function(e){return void 0===e&&(e=!1),u.setPrompt(e)},listen:function(e){return u.appendListener(e)}};return g}var D=n(33),R=n(34),M=n.n(R),F=n(24);function z(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}var U=n(21),B=n.n(U),V=function(e){var t=Object(D.a)();return t.displayName=e,t}("Router-History"),W=function(e){var t=Object(D.a)();return t.displayName=e,t}("Router"),H=function(e){function t(t){var n;return(n=e.call(this,t)||this).state={location:t.history.location},n._isMounted=!1,n._pendingLocation=null,t.staticContext||(n.unlisten=t.history.listen((function(e){n._isMounted?n.setState({location:e}):n._pendingLocation=e}))),n}Object(u.a)(t,e),t.computeRootMatch=function(e){return{path:"/",url:"/",params:{},isExact:"/"===e}};var n=t.prototype;return n.componentDidMount=function(){this._isMounted=!0,this._pendingLocation&&this.setState({location:this._pendingLocation})},n.componentWillUnmount=function(){this.unlisten&&this.unlisten()},n.render=function(){return i.a.createElement(W.Provider,{value:{history:this.props.history,location:this.state.location,match:t.computeRootMatch(this.state.location.pathname),staticContext:this.props.staticContext}},i.a.createElement(V.Provider,{children:this.props.children||null,value:this.props.history}))},t}(i.a.Component);i.a.Component;var $=function(e){function t(){return e.apply(this,arguments)||this}Object(u.a)(t,e);var n=t.prototype;return n.componentDidMount=function(){this.props.onMount&&this.props.onMount.call(this,this)},n.componentDidUpdate=function(e){this.props.onUpdate&&this.props.onUpdate.call(this,this,e)},n.componentWillUnmount=function(){this.props.onUnmount&&this.props.onUnmount.call(this,this)},n.render=function(){return null},t}(i.a.Component);var q={},K=0;function Q(e,t){return void 0===e&&(e="/"),void 0===t&&(t={}),"/"===e?e:function(e){if(q[e])return q[e];var t=M.a.compile(e);return K<1e4&&(q[e]=t,K++),t}(e)(t,{pretty:!0})}function G(e){var t=e.computedMatch,n=e.to,r=e.push,a=void 0!==r&&r;return i.a.createElement(W.Consumer,null,(function(e){e||y(!1);var r=e.history,o=e.staticContext,l=a?r.push:r.replace,c=O(t?"string"==typeof n?Q(n,t.params):s({},n,{pathname:Q(n.pathname,t.params)}):n);return o?(l(c),null):i.a.createElement($,{onMount:function(){l(c)},onUpdate:function(e,t){var n,r,a=O(t.to);n=a,r=s({},c,{key:a.key}),n.pathname===r.pathname&&n.search===r.search&&n.hash===r.hash&&n.key===r.key&&h(n.state,r.state)||l(c)},to:n})}))}var Y={},X=0;function J(e,t){void 0===t&&(t={}),("string"==typeof t||Array.isArray(t))&&(t={path:t});var n=t,r=n.path,a=n.exact,o=void 0!==a&&a,i=n.strict,l=void 0!==i&&i,c=n.sensitive,u=void 0!==c&&c;return[].concat(r).reduce((function(t,n){if(!n&&""!==n)return null;if(t)return t;var r=function(e,t){var n=""+t.end+t.strict+t.sensitive,r=Y[n]||(Y[n]={});if(r[e])return r[e];var a=[],o={regexp:M()(e,a,t),keys:a};return X<1e4&&(r[e]=o,X++),o}(n,{end:o,strict:l,sensitive:u}),a=r.regexp,i=r.keys,c=a.exec(e);if(!c)return null;var s=c[0],f=c.slice(1),p=e===s;return o&&!p?null:{path:n,url:"/"===n&&""===s?"/":s,isExact:p,params:i.reduce((function(e,t,n){return e[t.name]=f[n],e}),{})}}),null)}var Z=function(e){function t(){return e.apply(this,arguments)||this}return Object(u.a)(t,e),t.prototype.render=function(){var e=this;return i.a.createElement(W.Consumer,null,(function(t){t||y(!1);var n=e.props.location||t.location,r=s({},t,{location:n,match:e.props.computedMatch?e.props.computedMatch:e.props.path?J(n.pathname,e.props):t.match}),a=e.props,o=a.children,l=a.component,c=a.render;return Array.isArray(o)&&0===o.length&&(o=null),i.a.createElement(W.Provider,{value:r},r.match?o?"function"==typeof o?o(r):o:l?i.a.createElement(l,r):c?c(r):null:"function"==typeof o?o(r):null)}))},t}(i.a.Component);function ee(e){return"/"===e.charAt(0)?e:"/"+e}function te(e,t){if(!e)return t;var n=ee(e);return 0!==t.pathname.indexOf(n)?t:s({},t,{pathname:t.pathname.substr(n.length)})}function ne(e){return"string"==typeof e?e:E(e)}function re(e){return function(){y(!1)}}function ae(){}i.a.Component;var oe=function(e){function t(){return e.apply(this,arguments)||this}return Object(u.a)(t,e),t.prototype.render=function(){var e=this;return i.a.createElement(W.Consumer,null,(function(t){t||y(!1);var n,r,a=e.props.location||t.location;return i.a.Children.forEach(e.props.children,(function(e){if(null==r&&i.a.isValidElement(e)){n=e;var o=e.props.path||e.props.from;r=o?J(a.pathname,s({},e.props,{path:o})):t.match}})),r?i.a.cloneElement(n,{location:a,computedMatch:r}):null}))},t}(i.a.Component);var ie=i.a.useContext;function le(){return ie(W).location}function ce(){var e=ie(W).match;return e?e.params:{}}i.a.Component;var ue=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return(t=e.call.apply(e,[this].concat(r))||this).history=N(t.props),t}return Object(u.a)(t,e),t.prototype.render=function(){return i.a.createElement(H,{history:this.history,children:this.props.children})},t}(i.a.Component);var se=function(e,t){return"function"==typeof e?e(t):e},fe=function(e,t){return"string"==typeof e?O(e,null,null,t):e},pe=function(e){return e},de=i.a.forwardRef;void 0===de&&(de=pe);var me=de((function(e,t){var n=e.innerRef,r=e.navigate,a=e.onClick,o=z(e,["innerRef","navigate","onClick"]),l=o.target,c=s({},o,{onClick:function(e){try{a&&a(e)}catch(t){throw e.preventDefault(),t}e.defaultPrevented||0!==e.button||l&&"_self"!==l||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e)||(e.preventDefault(),r())}});return c.ref=pe!==de&&t||n,i.a.createElement("a",c)}));var he=de((function(e,t){var n=e.component,r=void 0===n?me:n,a=e.replace,o=e.to,l=e.innerRef,c=z(e,["component","replace","to","innerRef"]);return i.a.createElement(W.Consumer,null,(function(e){e||y(!1);var n=e.history,u=fe(se(o,e.location),e.location),f=u?n.createHref(u):"",p=s({},c,{href:f,navigate:function(){var t=se(o,e.location);(a?n.replace:n.push)(t)}});return pe!==de?p.ref=t||l:p.innerRef=l,i.a.createElement(r,p)}))})),ye=function(e){return e},ge=i.a.forwardRef;void 0===ge&&(ge=ye);ge((function(e,t){var n=e["aria-current"],r=void 0===n?"page":n,a=e.activeClassName,o=void 0===a?"active":a,l=e.activeStyle,c=e.className,u=e.exact,f=e.isActive,p=e.location,d=e.sensitive,m=e.strict,h=e.style,g=e.to,v=e.innerRef,b=z(e,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return i.a.createElement(W.Consumer,null,(function(e){e||y(!1);var n=p||e.location,a=fe(se(g,n),n),w=a.pathname,E=w&&w.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),O=E?J(n.pathname,{path:E,exact:u,sensitive:d,strict:m}):null,k=!!(f?f(O,n):O),S=k?function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.filter((function(e){return e})).join(" ")}(c,o):c,x=k?s({},h,{},l):h,_=s({"aria-current":k&&r||null,className:S,style:x,to:a},b);return ye!==ge?_.ref=t||v:_.innerRef=v,i.a.createElement(he,_)}))}));var ve=i.a.createContext(null);var be=function(e){e()},we={notify:function(){}};function Ee(){var e=be,t=null,n=null;return{clear:function(){t=null,n=null},notify:function(){e((function(){for(var e=t;e;)e.callback(),e=e.next}))},get:function(){for(var e=[],n=t;n;)e.push(n),n=n.next;return e},subscribe:function(e){var r=!0,a=n={callback:e,next:null,prev:n};return a.prev?a.prev.next=a:t=a,function(){r&&null!==t&&(r=!1,a.next?a.next.prev=a.prev:n=a.prev,a.prev?a.prev.next=a.next:t=a.next)}}}}var Oe=function(){function e(e,t){this.store=e,this.parentSub=t,this.unsubscribe=null,this.listeners=we,this.handleChangeWrapper=this.handleChangeWrapper.bind(this)}var t=e.prototype;return t.addNestedSub=function(e){return this.trySubscribe(),this.listeners.subscribe(e)},t.notifyNestedSubs=function(){this.listeners.notify()},t.handleChangeWrapper=function(){this.onStateChange&&this.onStateChange()},t.isSubscribed=function(){return Boolean(this.unsubscribe)},t.trySubscribe=function(){this.unsubscribe||(this.unsubscribe=this.parentSub?this.parentSub.addNestedSub(this.handleChangeWrapper):this.store.subscribe(this.handleChangeWrapper),this.listeners=Ee())},t.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null,this.listeners.clear(),this.listeners=we)},e}();var ke=function(e){var t=e.store,n=e.context,r=e.children,a=Object(o.useMemo)((function(){var e=new Oe(t);return e.onStateChange=e.notifyNestedSubs,{store:t,subscription:e}}),[t]),l=Object(o.useMemo)((function(){return t.getState()}),[t]);Object(o.useEffect)((function(){var e=a.subscription;return e.trySubscribe(),l!==t.getState()&&e.notifyNestedSubs(),function(){e.tryUnsubscribe(),e.onStateChange=null}}),[a,l]);var c=n||ve;return i.a.createElement(c.Provider,{value:a},r)},Se="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?o.useLayoutEffect:o.useEffect,xe=[],_e=[null,null];function je(e,t){var n=e[1];return[t.payload,n+1]}function Pe(e,t,n){Se((function(){return e.apply(void 0,t)}),n)}function Ce(e,t,n,r,a,o,i){e.current=r,t.current=a,n.current=!1,o.current&&(o.current=null,i())}function Te(e,t,n,r,a,o,i,l,c,u){if(e){var s=!1,f=null,p=function(){if(!s){var e,n,p=t.getState();try{e=r(p,a.current)}catch(e){n=e,f=e}n||(f=null),e===o.current?i.current||c():(o.current=e,l.current=e,i.current=!0,u({type:"STORE_UPDATED",payload:{error:n}}))}};n.onStateChange=p,n.trySubscribe(),p();return function(){if(s=!0,n.tryUnsubscribe(),n.onStateChange=null,f)throw f}}}var Ae=function(){return[null,0]};function Ne(e,t){void 0===t&&(t={});var n=t,r=n.getDisplayName,a=void 0===r?function(e){return"ConnectAdvanced("+e+")"}:r,l=n.methodName,c=void 0===l?"connectAdvanced":l,u=n.renderCountProp,f=void 0===u?void 0:u,p=n.shouldHandleStateChanges,d=void 0===p||p,m=n.storeKey,h=void 0===m?"store":m,y=(n.withRef,n.forwardRef),g=void 0!==y&&y,v=n.context,b=void 0===v?ve:v,w=z(n,["getDisplayName","methodName","renderCountProp","shouldHandleStateChanges","storeKey","withRef","forwardRef","context"]),E=b;return function(t){var n=t.displayName||t.name||"Component",r=a(n),l=s({},w,{getDisplayName:a,methodName:c,renderCountProp:f,shouldHandleStateChanges:d,storeKey:h,displayName:r,wrappedComponentName:n,WrappedComponent:t}),u=w.pure;var p=u?o.useMemo:function(e){return e()};function m(n){var r=Object(o.useMemo)((function(){var e=n.reactReduxForwardedRef,t=z(n,["reactReduxForwardedRef"]);return[n.context,e,t]}),[n]),a=r[0],c=r[1],u=r[2],f=Object(o.useMemo)((function(){return a&&a.Consumer&&Object(F.isContextConsumer)(i.a.createElement(a.Consumer,null))?a:E}),[a,E]),m=Object(o.useContext)(f),h=Boolean(n.store)&&Boolean(n.store.getState)&&Boolean(n.store.dispatch);Boolean(m)&&Boolean(m.store);var y=h?n.store:m.store,g=Object(o.useMemo)((function(){return function(t){return e(t.dispatch,l)}(y)}),[y]),v=Object(o.useMemo)((function(){if(!d)return _e;var e=new Oe(y,h?null:m.subscription),t=e.notifyNestedSubs.bind(e);return[e,t]}),[y,h,m]),b=v[0],w=v[1],O=Object(o.useMemo)((function(){return h?m:s({},m,{subscription:b})}),[h,m,b]),k=Object(o.useReducer)(je,xe,Ae),S=k[0][0],x=k[1];if(S&&S.error)throw S.error;var _=Object(o.useRef)(),j=Object(o.useRef)(u),P=Object(o.useRef)(),C=Object(o.useRef)(!1),T=p((function(){return P.current&&u===j.current?P.current:g(y.getState(),u)}),[y,S,u]);Pe(Ce,[j,_,C,u,T,P,w]),Pe(Te,[d,y,b,g,j,_,C,P,w,x],[y,b,g]);var A=Object(o.useMemo)((function(){return i.a.createElement(t,s({},T,{ref:c}))}),[c,t,T]);return Object(o.useMemo)((function(){return d?i.a.createElement(f.Provider,{value:O},A):A}),[f,A,O])}var y=u?i.a.memo(m):m;if(y.WrappedComponent=t,y.displayName=r,g){var v=i.a.forwardRef((function(e,t){return i.a.createElement(y,s({},e,{reactReduxForwardedRef:t}))}));return v.displayName=r,v.WrappedComponent=t,B()(v,t)}return B()(y,t)}}function Ie(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function Le(e,t){if(Ie(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var a=0;a<n.length;a++)if(!Object.prototype.hasOwnProperty.call(t,n[a])||!Ie(e[n[a]],t[n[a]]))return!1;return!0}var De=n(32),Re=function(){return Math.random().toString(36).substring(7).split("").join(".")},Me={INIT:"@@redux/INIT"+Re(),REPLACE:"@@redux/REPLACE"+Re(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+Re()}};function Fe(e){if("object"!=typeof e||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function ze(e,t){var n=t&&t.type;return"Given "+(n&&'action "'+String(n)+'"'||"an action")+', reducer "'+e+'" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.'}function Ue(e,t){return function(){return t(e.apply(this,arguments))}}function Be(e){return function(t,n){var r=e(t,n);function a(){return r}return a.dependsOnOwnProps=!1,a}}function Ve(e){return null!==e.dependsOnOwnProps&&void 0!==e.dependsOnOwnProps?Boolean(e.dependsOnOwnProps):1!==e.length}function We(e,t){return function(t,n){n.displayName;var r=function(e,t){return r.dependsOnOwnProps?r.mapToProps(e,t):r.mapToProps(e)};return r.dependsOnOwnProps=!0,r.mapToProps=function(t,n){r.mapToProps=e,r.dependsOnOwnProps=Ve(e);var a=r(t,n);return"function"==typeof a&&(r.mapToProps=a,r.dependsOnOwnProps=Ve(a),a=r(t,n)),a},r}}var He=[function(e){return"function"==typeof e?We(e):void 0},function(e){return e?void 0:Be((function(e){return{dispatch:e}}))},function(e){return e&&"object"==typeof e?Be((function(t){return function(e,t){if("function"==typeof e)return Ue(e,t);if("object"!=typeof e||null===e)throw new Error("bindActionCreators expected an object or a function, instead received "+(null===e?"null":typeof e)+'. Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?');var n={};for(var r in e){var a=e[r];"function"==typeof a&&(n[r]=Ue(a,t))}return n}(e,t)})):void 0}];var qe=[function(e){return"function"==typeof e?We(e):void 0},function(e){return e?void 0:Be((function(){return{}}))}];function Ke(e,t,n){return s({},n,e,t)}var Qe=[function(e){return"function"==typeof e?function(e){return function(t,n){n.displayName;var r,a=n.pure,o=n.areMergedPropsEqual,i=!1;return function(t,n,l){var c=e(t,n,l);return i?a&&o(c,r)||(r=c):(i=!0,r=c),r}}}(e):void 0},function(e){return e?void 0:function(){return Ke}}];function Ge(e,t,n,r){return function(a,o){return n(e(a,o),t(r,o),o)}}function Ye(e,t,n,r,a){var o,i,l,c,u,s=a.areStatesEqual,f=a.areOwnPropsEqual,p=a.areStatePropsEqual,d=!1;function m(a,d){var m,h,y=!f(d,i),g=!s(a,o);return o=a,i=d,y&&g?(l=e(o,i),t.dependsOnOwnProps&&(c=t(r,i)),u=n(l,c,i)):y?(e.dependsOnOwnProps&&(l=e(o,i)),t.dependsOnOwnProps&&(c=t(r,i)),u=n(l,c,i)):g?(m=e(o,i),h=!p(m,l),l=m,h&&(u=n(l,c,i)),u):u}return function(a,s){return d?m(a,s):(l=e(o=a,i=s),c=t(r,i),u=n(l,c,i),d=!0,u)}}function Xe(e,t){var n=t.initMapStateToProps,r=t.initMapDispatchToProps,a=t.initMergeProps,o=z(t,["initMapStateToProps","initMapDispatchToProps","initMergeProps"]),i=n(e,o),l=r(e,o),c=a(e,o);return(o.pure?Ye:Ge)(i,l,c,e,o)}function Je(e,t,n){for(var r=t.length-1;r>=0;r--){var a=t[r](e);if(a)return a}return function(t,r){throw new Error("Invalid value of type "+typeof e+" for "+n+" argument when connecting component "+r.wrappedComponentName+".")}}function Ze(e,t){return e===t}function et(e){var t=void 0===e?{}:e,n=t.connectHOC,r=void 0===n?Ne:n,a=t.mapStateToPropsFactories,o=void 0===a?qe:a,i=t.mapDispatchToPropsFactories,l=void 0===i?He:i,c=t.mergePropsFactories,u=void 0===c?Qe:c,f=t.selectorFactory,p=void 0===f?Xe:f;return function(e,t,n,a){void 0===a&&(a={});var i=a,c=i.pure,f=void 0===c||c,d=i.areStatesEqual,m=void 0===d?Ze:d,h=i.areOwnPropsEqual,y=void 0===h?Le:h,g=i.areStatePropsEqual,v=void 0===g?Le:g,b=i.areMergedPropsEqual,w=void 0===b?Le:b,E=z(i,["pure","areStatesEqual","areOwnPropsEqual","areStatePropsEqual","areMergedPropsEqual"]),O=Je(e,o,"mapStateToProps"),k=Je(t,l,"mapDispatchToProps"),S=Je(n,u,"mergeProps");return r(p,s({methodName:"connect",getDisplayName:function(e){return"Connect("+e+")"},shouldHandleStateChanges:Boolean(e),initMapStateToProps:O,initMapDispatchToProps:k,initMergeProps:S,pure:f,areStatesEqual:m,areOwnPropsEqual:y,areStatePropsEqual:v,areMergedPropsEqual:w},E))}}var tt=et();var nt;nt=l.unstable_batchedUpdates,be=nt;function rt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function at(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?rt(Object(n),!0).forEach((function(t){ot(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ot(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var it={},lt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:it,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ALL_ITEMS":var n=t.payload,r=n.current_page,a=n.data,o=n.platform,i=n.total_page,l=n.plan,c=at({},e);return c.hasOwnProperty(l)?(c[l]={},c[l][o]={}):(c[l]={},c[l][o]={},c[l][o].total_page=i,c[l][o].current_page=r),c[l][o][r]=a,c;case"ALL_CATEGORY_ITEMS":var u=t.payload,s=u.categoryID,f=u.current_page,p=u.data,d=u.platform,m=u.total_page,h=u.plan,y=at({},e),g={};return g.current_page=f,g.total_page=m,g[f]=p,y.hasOwnProperty(h)?y[h].hasOwnProperty(d)?y[h][d].hasOwnProperty("categoryData")?y[h][d].categoryData.hasOwnProperty(s)?y[h][d].categoryData[s][f]=p:y[h][d].categoryData[s]=g:(y[h][d].categoryData={},y[h][d].categoryData[s]=g):(y[h][d]={},y[h][d].categoryData={},y[h][d].categoryData[s]=g):(y[h]={},y[h][d]={},y[h][d].categoryData={},y[h][d].categoryData[s]=g),y;case"BLOCKS_TOTAL_PAGES":var v=t.payload,b=v.current_page,w=v.total_page,E=v.platform,O=b,k=w,S=at({},e);return S.hasOwnProperty(E)?S=at(at({},S[E]),{},{currentPage:O,totalPages:k}):S[E]={currentPage:O,totalPages:k},S;case"BLOCKS_CURRENT_PAGE":var x=t.payload,_=at(at({},e),{},{currentPage:x});return _;default:return e}};function ct(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ut(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ct(Object(n),!0).forEach((function(t){st(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ct(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function st(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ft={},pt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ft,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ALL_PAGES":var n=t.payload,r=n.current_page,a=n.data,o=n.platform,i=n.total_page,l=n.plan,c=ut({},e);return c.hasOwnProperty(l)||(c[l]={},c[l][o]={},c[l][o].total_page=i,c[l][o].current_page=r),c[l][o][r]=a,c;case"ALL_CATEGORY_PAGES":var u=t.payload,s=u.categoryID,f=u.current_page,p=u.data,d=u.platform,m=u.total_page,h=u.plan,y=ut({},e),g={};return g.current_page=f,g.total_page=m,g[f]=p,y.hasOwnProperty(h)?y[h].hasOwnProperty(d)?y[h][d].hasOwnProperty("categoryData")?y[h][d].categoryData.hasOwnProperty(s)?y[h][d].categoryData[s][f]=p:y[h][d].categoryData[s]=g:(y[h][d].categoryData={},y[h][d].categoryData[s]=g):(y[h][d]={},y[h][d].categoryData={},y[h][d].categoryData[s]=g):(y[h]={},y[h][d]={},y[h][d].categoryData={},y[h][d].categoryData[s]=g),y;case"PAGES_TOTAL_PAGES":var v=t.payload,b=v.current_page,w=v.total_page,E=ut(ut({},e),{},{totalPages:w,currentPage:b});return E;case"PAGES_CURRENT_PAGE":var O=t.payload,k=ut(ut({},e),{},{currentPage:O});return k;default:return e}};function dt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function mt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?dt(Object(n),!0).forEach((function(t){ht(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ht(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var yt={},gt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:yt,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ALL_PACKS":var n=t.payload,r=n.current_page,a=n.data,o=n.platform,i=n.total_page,l=n.plan,c=mt({},e);return c.hasOwnProperty(l)||(c[l]={},c[l][o]={},c[l][o].total_page=i,c[l][o].current_page=r),c[l][o][r]=a,c;case"ALL_CATEGORY_PACKS":var u=t.payload,s=u.categoryID,f=u.current_page,p=u.data,d=u.platform,m=u.total_page,h=u.plan,y=mt({},e),g={};return g.current_page=f,g.total_page=m,g[f]=p,y.hasOwnProperty(h)?y[h].hasOwnProperty(d)?y[h][d].hasOwnProperty("categoryData")?y[h][d].categoryData.hasOwnProperty(s)?y[h][d].categoryData[s][f]=p:y[h][d].categoryData[s]=g:(y[h][d].categoryData={},y[h][d].categoryData[s]=g):(y[h][d]={},y[h][d].categoryData={},y[h][d].categoryData[s]=g):(y[h]={},y[h][d]={},y[h][d].categoryData={},y[h][d].categoryData[s]=g),y;case"PACKS_TOTAL_PAGES":var v=t.payload,b=v.current_page,w=v.total_page,E=mt(mt({},e),{},{totalPages:w,currentPage:b});return E;case"PACKS_CURRENT_PAGE":var O=t.payload,k=mt(mt({},e),{},{currentPage:O});return k;default:return e}};function vt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function bt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?vt(Object(n),!0).forEach((function(t){wt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function wt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Et={isOpen:!1,type:!1,deep:0},Ot=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Et,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"PREVIEW":var n=e;n.previousType=n.type;var r=bt(bt({},n),t.payload);return r;default:return e}};function kt(e){return function(e){if(Array.isArray(e))return St(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return St(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return St(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function St(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function xt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _t(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?xt(Object(n),!0).forEach((function(t){jt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function jt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Pt=TemplatelyAdmin,Ct=Pt.cloud_map,Tt=Pt.platform,At={platforms:Pt.platform_exists,platform:"templately"===Tt?"elementor":Tt,plan:"all",current_route:null,previous_route:null,next_route:null,isLoggedIn:!1,isTemplate:!1,successText:null,loading:!1,itemLoading:!1,templates:{current_page:1,total_page:null},cloud_files:{search:{}},cloud_map:Ct||[],activeSidebar:{activeSidebarMenu:"all",activeParentSidebarMenu:""},dependencyFilter:{filterActive:!1,filtersID:[],filtersResults:{}},all_items:[],filtered_items:[],activeBlockOrPage:{type:"all",ulActive:!1,id:null},pagination:1,need_pagination:!1,pagination_loading:!1,pushed_time:null,searchQuery:{query:"",results:[]},cloud_usage_limit:{limit:10,files:0},workspace_slug:!1,retry:!1,retryMessage:"",tags:[],is_global_login:!1,user_can_logout:!1,is_linked_login:!1},Nt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:At,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_RETRY":var n=t.payload,r=_t(_t({},e),{},{retry:n});return r;case"SET_RETRY_MSG":var a=t.payload,o=_t(_t({},e),{},{retryMessage:a});return o;case"ADD_PLATFORMS":var i=t.payload,l=_t(_t({},e),{},{platforms:i});return l;case"SET_PLATFORM":var c=t.payload,u=_t(_t({},e),{},{platform:c});return u;case"SET_PLAN":var s=t.payload,f=_t(_t({},e),{},{plan:s});return f;case"ALL_TEMPLATES":var p=t.payload,d=p.current_page,m=p.total_page,h=p.items,y=_t({},e.templates);y.hasOwnProperty(d)||(y[d]=h,y.current_page=d,y.total_page=m);var g=_t(_t({},e),{},{templates:y});return g;case"REMOVE_TEMPLATE":var v=t.payload,b=v.id,w=v.page,E=e.templates[w].filter((function(e){return e.id!=b})),O=_t({},e.templates);O[w]=E;var k=_t(_t({},e),{},{templates:O});return k;case"TEMPLATE_TRIGGER":var S=_t(_t({},e),t.payload);return S;case"ALL_CLOUDS":var x=t.payload,_=x.current_page,j=x.data,P=x.total_page,C=x.platform,T=_t({},e);return T.cloud_files.hasOwnProperty(C)||(T.cloud_files[C]={}),T.cloud_files[C][_]=j,T.cloud_files[C].total_page=P,T.cloud_files[C].current_page=_,T;case"REMOVE_CLOUD_FILE":var A=t.payload,N=A.id,I=A.page,L=A.platform,D=_t({},e),R={};R[L]={},R[L].current_page=D.cloud_files[L].current_page,R[L].total_page=D.cloud_files[L].total_page;var M=D.cloud_files[L][I].filter((function(e){return e.id!=N}));return R[L][I]=M,D.cloud_files=R,D;case"ALL_CLOUDS_MAP":var F=_t({},t.payload),z=_t(_t({},e),{},{cloud_map:F});return z;case"ACTIVE_SIDEBAR":var U=_t(_t({},e.activeSidebar),t.payload),B=_t(_t({},e),{},{activeSidebar:U});return B;case"FILTER_DEPENDENCIES_RESULTS":var V=t.payload,W=V.current_page,H=V.data,$=V.platform,q=V.total_page,K=V.plan,Q=_t({},e.dependencyFilter),G=_t({},Q.filtersResults);G.hasOwnProperty(K)||(G[K]={},G[K][$]={},G[K][$].total_page=q,G[K][$].current_page=W),G[K][$][W]=H,Q=_t(_t({},Q),{},{filtersResults:G});var Y=_t(_t({},e),{},{dependencyFilter:Q});return Y;case"FILTER_DEPENDENCIES_ACTIVE":var X=_t({},e.dependencyFilter),J=t.payload;X=_t(_t({},X),{},{filterActive:J});var Z=_t(_t({},e),{},{dependencyFilter:X});return Z;case"FILTER_DEPENDENCIES_ID":var ee=_t({},e.dependencyFilter),te=kt(t.payload);ee=_t(_t({},ee),{},{filtersID:te});var ne=_t(_t({},e),{},{dependencyFilter:ee});return ne;case"USER_CAN_LOGOUT":return _t(_t({},e),{},{user_can_logout:t.payload});case"IS_LINKED_LOGIN":return _t(_t({},e),{},{is_linked_login:t.payload});case"SET_GLOBAL_SIGN_IN":return _t(_t({},e),{},{is_global_login:t.payload});case"FILTERED_TAGS":return _t(_t({},e),{},{tags:kt(t.payload)});case"COMMON_ALL_ITEMS":var re=e;if(!1!==t.payload){var ae=kt(t.payload);re=_t(_t({},e),{},{all_items:ae})}return re;case"COMMON_FILTERED_ITEMS":var oe=e;if(!1!==t.payload){var ie=kt(t.payload);oe=_t(_t({},e),{},{filtered_items:ie})}return oe;case"PACK_BLOCK_OR_PAGE":var le=_t(_t({},e.activeBlockOrPage),t.payload),ce=_t(_t({},e),{},{activeBlockOrPage:le});return ce;case"SET_SUCCESS_TEXT":var ue=t.payload,se=_t(_t({},e),{},{successText:ue});return se;case"SET_PAGINATION":var fe=t.payload,pe=_t(_t({},e),{},{pagination:fe});return pe;case"NEED_PAGINATION":var de=t.payload,me=_t(_t({},e),{},{need_pagination:de});return me;case"PAGINATION_LOADING":var he=t.payload,ye=_t(_t({},e),{},{pagination_loading:he});return ye;case"SET_LOADING":var ge=t.payload,ve=_t(_t({},e),{},{loading:ge});return ve;case"SET_ITEM_LOADING":var be=t.payload,we=_t(_t({},e),{},{itemLoading:be});return we;case"SET_LOGGED_IN":var Ee=t.payload,Oe=_t(_t({},e),{},{isLoggedIn:Ee});return Oe;case"SET_CURRENT_ROUTE":var ke=t.payload,Se=_t(_t({},e),{},{current_route:ke});return Se;case"SET_PREV_ROUTE":var xe=t.payload,_e=_t(_t({},e),{},{previous_route:xe});return _e;case"SET_NEXT_ROUTE":var je=t.payload,Pe=_t(_t({},e),{},{next_route:je});return Pe;case"SET_PUSHED_TIME":var Ce=t.payload,Te=_t(_t({},e),{},{pushed_time:Ce});return Te;case"SEARCH_QUERY":var Ae=t.payload,Ne=_t(_t({},e),{},{searchQuery:Ae});return Ne;case"CLOUD_USAGE_LIMIT":var Ie=t.payload,Le=_t(_t({},e),{},{cloud_usage_limit:Ie});return Le;case"WORKSPACE_SLUG":var De=t.payload,Re=_t(_t({},e),{},{workspace_slug:De});return Re;default:return e}};function It(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Lt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?It(Object(n),!0).forEach((function(t){Dt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):It(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Dt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Rt={user:TemplatelyAdmin.admin||{},errorText:null,successText:null};function Mt(e){return function(e){if(Array.isArray(e))return Ft(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Ft(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ft(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ft(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function zt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ut(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?zt(Object(n),!0).forEach((function(t){Bt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Bt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Vt={current_page:1,total_page:1,workspacesList:[]};function Wt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ht(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Wt(Object(n),!0).forEach((function(t){$t(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Wt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function $t(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var qt={current_page:1,total_page:1,sharedWorkspaceList:[]};function Kt(e){return function(e){if(Array.isArray(e))return Qt(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Qt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Qt(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Qt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Gt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Yt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Gt(Object(n),!0).forEach((function(t){Xt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Gt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Xt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Jt={filesList:{},searchFiles:{current_page:1,total_page:1,files:[]}},Zt=function e(t,n,r){var a;if("function"==typeof n&&"function"==typeof r||"function"==typeof r&&"function"==typeof arguments[3])throw new Error("It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function.");if("function"==typeof n&&void 0===r&&(r=n,n=void 0),void 0!==r){if("function"!=typeof r)throw new Error("Expected the enhancer to be a function.");return r(e)(t,n)}if("function"!=typeof t)throw new Error("Expected the reducer to be a function.");var o=t,i=n,l=[],c=l,u=!1;function s(){c===l&&(c=l.slice())}function f(){if(u)throw new Error("You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return i}function p(e){if("function"!=typeof e)throw new Error("Expected the listener to be a function.");if(u)throw new Error("You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api-reference/store#subscribelistener for more details.");var t=!0;return s(),c.push(e),function(){if(t){if(u)throw new Error("You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api-reference/store#subscribelistener for more details.");t=!1,s();var n=c.indexOf(e);c.splice(n,1),l=null}}}function d(e){if(!Fe(e))throw new Error("Actions must be plain objects. Use custom middleware for async actions.");if(void 0===e.type)throw new Error('Actions may not have an undefined "type" property. Have you misspelled a constant?');if(u)throw new Error("Reducers may not dispatch actions.");try{u=!0,i=o(i,e)}finally{u=!1}for(var t=l=c,n=0;n<t.length;n++){(0,t[n])()}return e}function m(e){if("function"!=typeof e)throw new Error("Expected the nextReducer to be a function.");o=e,d({type:Me.REPLACE})}function h(){var e,t=p;return(e={subscribe:function(e){if("object"!=typeof e||null===e)throw new TypeError("Expected the observer to be an object.");function n(){e.next&&e.next(f())}return n(),{unsubscribe:t(n)}}})[De.a]=function(){return this},e}return d({type:Me.INIT}),(a={dispatch:d,subscribe:p,getState:f,replaceReducer:m})[De.a]=h,a}(function(e){for(var t=Object.keys(e),n={},r=0;r<t.length;r++){var a=t[r];0,"function"==typeof e[a]&&(n[a]=e[a])}var o,i=Object.keys(n);try{!function(e){Object.keys(e).forEach((function(t){var n=e[t];if(void 0===n(void 0,{type:Me.INIT}))throw new Error('Reducer "'+t+"\" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.");if(void 0===n(void 0,{type:Me.PROBE_UNKNOWN_ACTION()}))throw new Error('Reducer "'+t+"\" returned undefined when probed with a random type. Don't try to handle "+Me.INIT+' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.')}))}(n)}catch(e){o=e}return function(e,t){if(void 0===e&&(e={}),o)throw o;for(var r=!1,a={},l=0;l<i.length;l++){var c=i[l],u=n[c],s=e[c],f=u(s,t);if(void 0===f){var p=ze(c,t);throw new Error(p)}a[c]=f,r=r||f!==s}return(r=r||i.length!==Object.keys(e).length)?a:e}}({admin:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Rt,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_USER":var n=t.payload,r=Lt(Lt({},e),{},{user:n});return r;case"ERROR_TEXT":var a=t.payload,o=Lt(Lt({},e),{},{errorText:a});return o;case"SUCCESS_TEXT":var i=t.payload,l=Lt(Lt({},e),{},{successText:i});return l;default:return e}},blocks:lt,pages:pt,packs:gt,preview:Ot,common:Nt,workspaces:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Vt,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ALL_WORKSPACE_QUERY":var n=t.payload,r=n.current_page,a=n.data,o=n.total_page,i=Ut(Ut({},e),{},{current_page:r,total_page:o});return null!==r&&(i[r]=a),i;case"ALL_WORKSPACE_LIST":var l=t.payload;return null!==l?Ut(Ut({},e),{},{workspacesList:l}):Ut({},e);case"ADD_WORKSPACE_IN_LIST":var c=t.payload,u=[].concat(Mt(c),Mt(e.workspacesList)),s=Ut(Ut({},e),{},{workspacesList:u});return s;case"EDIT_WORKSPACE":var f=t.payload.page,p=t.payload.data,d=Ut({},e);if(d.hasOwnProperty(f)){var m=Mt(d[f]).filter((function(e){return e.id!=p.id}));m=[p].concat(Mt(m)),d[f]=m}return d;case"DELETE_WORKSPACE":var h=t.payload.page,y=t.payload.data,g=Ut({},e);if(g.hasOwnProperty(h)){var v=Mt(g[h]).filter((function(e){return e.id!=y}));g[h]=v}return g;case"CREATE_WORKSPACE":var b=t.payload.page,w=t.payload.data,E=Ut({},e),O=[];return E.hasOwnProperty(b)?(O=[w].concat(Mt(E[b])),E[b]=O):E[b]=[w],E;case"WORKSPACES_TOTAL_PAGES":var k=t.payload,S=k.current_page,x=k.total_page,_=Ut(Ut({},e),{},{totalPages:x,currentPage:S});return _;case"WORKSPACES_CURRENT_PAGE":var j=t.payload,P=Ut(Ut({},e),{},{currentPage:j});return P;default:return e}},sharedWorkspaces:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:qt,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SHARED_WORKSPACE_QUERY":var n=t.payload,r=n.current_page,a=n.data,o=n.total_page,i=Ht(Ht({},e),{},{current_page:r,total_page:o});return null!==r&&(i[r]=a),i;case"SHARED_WORKSPACE_LIST":var l=t.payload;return null!=l&&l.length>0?Ht(Ht({},e),{},{sharedWorkspaceList:l}):Ht({},e);case"SHARED_WORKSPACES_TOTAL_PAGES":var c=t.payload,u=c.current_page,s=c.total_page,f=Ht(Ht({},e),{},{totalPages:s,currentPage:u});return f;case"SHARED_WORKSPACES_CURRENT_PAGE":var p=t.payload,d=Ht(Ht({},e),{},{currentPage:p});return d;default:return e}},workspacesDetails:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Jt,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ADD_WORKSPACE_WITH_DETAILS":var n=t.payload,r=n.slug,a=n.data,o=n.page,i=n.platform,l=Yt({},e),c={},u={};return a.hasOwnProperty("files")&&null!==a.files&&(a.files.hasOwnProperty("data")&&(c=a.files.data),u.total_page=a.files.total_page,u.current_page=a.files.current_page,u[o]=c),l.hasOwnProperty(r)?l[r].hasOwnProperty("files")&&null!==l[r].files?l[r].files.hasOwnProperty(i)?l[r].files[i]=Yt(Yt({},l[r].files[i]),u):l[r].files[i]=u:(l[r].files={},l[r].files[i]=u):(delete a.file,l[r]=a,l[r].files={},l[r].files[i]=u),l;case"ADD_FILES_PAGE_FOR_A_WORKSPACE":var s=t.payload,f=s.slug,p=s.data,d=s.page,m=s.platform,h=s.total_page,y=Yt({},e);return y.hasOwnProperty(f)&&y[f].hasOwnProperty("files")&&y[f].files.hasOwnProperty(m)&&(y[f].files[m][d]=p,y[f].files[m].total_page=h),y;case"REMOVE_FILES_PAGE_FOR_A_WORKSPACE":var g=t.payload,v=g.page,b=g.slug,w=g.platform,E=g.fileAdded,O=Yt({},e);if(O.hasOwnProperty(b)&&O[b].hasOwnProperty("files"))if(!0===E){var k={};k.total_page=O[b].files[w].total_page,k.current_page=O[b].files[w].current_page,delete O[b].files[w],O[b].files[w]=k}else O[b].files.hasOwnProperty(w)&&delete O[b].files[w][v];return O;case"ALL_CLOUDS_FILE_LIST":var S=t.payload,x=S.slug,_=S.data,j=S.platform,P=Yt({},e),C=Yt({},P.filesList);return C.hasOwnProperty(j)||(C[j]={}),C[j][x]=_,P=Yt(Yt({},P),{},{filesList:C});case"EDIT_WORKSPACE_DETAILS":var T=t.payload,A=T.slug,N=T.data,I=T.page,L=T.platform,D=Yt({},e),R={},M={};return N.hasOwnProperty("files")&&null!==N.files&&(N.files.hasOwnProperty("data")&&(R=N.files.data),M.total_page=N.files.total_page,M.current_page=N.files.current_page,M[I]=R),D.hasOwnProperty(A)?D[A].hasOwnProperty("files")&&null!==D[A].files?D[A].files.hasOwnProperty(L)?D[A].files[L]=Yt(Yt({},D[A].files[L]),M):D[A].files[L]=M:(D[A].files={},D[A].files[L]=M):(delete N.file,D[A]=N,D[A].files={},D[A].files[L]=M),D;case"ADD_FILE_TO_WORKSPACE":var F=t.payload,z=F.slug,U=F.data,B=Yt({},e),V=null;return B.hasOwnProperty(z)&&B[z].hasOwnProperty("files")&&B[z].files.hasOwnProperty("data")?(V=[].concat(Kt(B[z].files.data),Kt(U)),B[z].files.data=V):(V=U,B[z].files.data=V),B;case"DELETE_FILE_FROM_WORKSPACE":var W=t.payload,H=W.fileFrom,$=W.id,q=W.page,K=Yt({},e),Q=[];return K.hasOwnProperty(H)&&K[H].hasOwnProperty("files")&&null!=K[H].files&&K[H].files.hasOwnProperty(q)&&K[H].files[q]&&K[H].files[q].length>0&&(Q=K[H].files[q].filter((function(e){return e.id!==$})),K[H].files[q]=Q),K;default:return e}}}),!1),en={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},tn=o.createContext&&o.createContext(en),nn=function(){return(nn=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)},rn=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&(n[r[a]]=e[r[a]])}return n};function an(e){return function(t){return o.createElement(on,nn({attr:nn({},e.attr)},t),function e(t){return t&&t.map((function(t,n){return o.createElement(t.tag,nn({key:n},t.attr),e(t.child))}))}(e.child))}}function on(e){var t=function(t){var n,r=e.size||t.size||"1em";t.className&&(n=t.className),e.className&&(n=(n?n+" ":"")+e.className);var a=e.attr,i=e.title,l=rn(e,["attr","title"]);return o.createElement("svg",nn({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},t.attr,a,l,{className:n,style:nn({color:e.color||t.color},t.style,e.style),height:r,width:r,xmlns:"http://www.w3.org/2000/svg"}),i&&o.createElement("title",null,i),e.children)};return void 0!==tn?o.createElement(tn.Consumer,null,(function(e){return t(e)})):t(en)}function ln(e){return an({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M257.5 445.1l-22.2 22.2c-9.4 9.4-24.6 9.4-33.9 0L7 273c-9.4-9.4-9.4-24.6 0-33.9L201.4 44.7c9.4-9.4 24.6-9.4 33.9 0l22.2 22.2c9.5 9.5 9.3 25-.4 34.3L136.6 216H424c13.3 0 24 10.7 24 24v32c0 13.3-10.7 24-24 24H136.6l120.5 114.8c9.8 9.3 10 24.8.4 34.3z"}}]})(e)}function cn(e){return an({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M31.3 192h257.3c17.8 0 26.7 21.5 14.1 34.1L174.1 354.8c-7.8 7.8-20.5 7.8-28.3 0L17.2 226.1C4.6 213.5 13.5 192 31.3 192z"}}]})(e)}function un(e){return an({tag:"svg",attr:{viewBox:"0 0 192 512"},child:[{tag:"path",attr:{d:"M192 127.338v257.324c0 17.818-21.543 26.741-34.142 14.142L29.196 270.142c-7.81-7.81-7.81-20.474 0-28.284l128.662-128.662c12.599-12.6 34.142-3.676 34.142 14.142z"}}]})(e)}function sn(e){return an({tag:"svg",attr:{viewBox:"0 0 192 512"},child:[{tag:"path",attr:{d:"M0 384.662V127.338c0-17.818 21.543-26.741 34.142-14.142l128.662 128.662c7.81 7.81 7.81 20.474 0 28.284L34.142 398.804C21.543 411.404 0 402.48 0 384.662z"}}]})(e)}function fn(e){return an({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M288.662 352H31.338c-17.818 0-26.741-21.543-14.142-34.142l128.662-128.662c7.81-7.81 20.474-7.81 28.284 0l128.662 128.662c12.6 12.599 3.676 34.142-14.142 34.142z"}}]})(e)}function pn(e){return an({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M537.6 226.6c4.1-10.7 6.4-22.4 6.4-34.6 0-53-43-96-96-96-19.7 0-38.1 6-53.3 16.2C367 64.2 315.3 32 256 32c-88.4 0-160 71.6-160 160 0 2.7.1 5.4.2 8.1C40.2 219.8 0 273.2 0 336c0 79.5 64.5 144 144 144h368c70.7 0 128-57.3 128-128 0-61.9-44-113.6-102.4-125.4z"}}]})(e)}function dn(e){return an({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M528 0H48C21.5 0 0 21.5 0 48v320c0 26.5 21.5 48 48 48h192l-16 48h-72c-13.3 0-24 10.7-24 24s10.7 24 24 24h272c13.3 0 24-10.7 24-24s-10.7-24-24-24h-72l-16-48h192c26.5 0 48-21.5 48-48V48c0-26.5-21.5-48-48-48zm-16 352H64V64h448v288z"}}]})(e)}function mn(e){return an({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M216 0h80c13.3 0 24 10.7 24 24v168h87.7c17.8 0 26.7 21.5 14.1 34.1L269.7 378.3c-7.5 7.5-19.8 7.5-27.3 0L90.1 226.1c-12.6-12.6-3.7-34.1 14.1-34.1H192V24c0-13.3 10.7-24 24-24zm296 376v112c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V376c0-13.3 10.7-24 24-24h146.7l49 49c20.1 20.1 52.5 20.1 72.6 0l49-49H488c13.3 0 24 10.7 24 24zm-124 88c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20zm64 0c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20z"}}]})(e)}function hn(e){return an({tag:"svg",attr:{viewBox:"0 0 192 512"},child:[{tag:"path",attr:{d:"M96 184c39.8 0 72 32.2 72 72s-32.2 72-72 72-72-32.2-72-72 32.2-72 72-72zM24 80c0 39.8 32.2 72 72 72s72-32.2 72-72S135.8 8 96 8 24 40.2 24 80zm0 352c0 39.8 32.2 72 72 72s72-32.2 72-72-32.2-72-72-72-72 32.2-72 72z"}}]})(e)}function yn(e){return an({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M572.52 241.4C518.29 135.59 410.93 64 288 64S57.68 135.64 3.48 241.41a32.35 32.35 0 0 0 0 29.19C57.71 376.41 165.07 448 288 448s230.32-71.64 284.52-177.41a32.35 32.35 0 0 0 0-29.19zM288 400a144 144 0 1 1 144-144 143.93 143.93 0 0 1-144 144zm0-240a95.31 95.31 0 0 0-25.31 3.79 47.85 47.85 0 0 1-66.9 66.9A95.78 95.78 0 1 0 288 160z"}}]})(e)}function gn(e){return an({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M572.694 292.093L500.27 416.248A63.997 63.997 0 0 1 444.989 448H45.025c-18.523 0-30.064-20.093-20.731-36.093l72.424-124.155A64 64 0 0 1 152 256h399.964c18.523 0 30.064 20.093 20.73 36.093zM152 224h328v-48c0-26.51-21.49-48-48-48H272l-64-64H48C21.49 64 0 85.49 0 112v278.046l69.077-118.418C86.214 242.25 117.989 224 152 224z"}}]})(e)}function vn(e){return an({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M462.3 62.6C407.5 15.9 326 24.3 275.7 76.2L256 96.5l-19.7-20.3C186.1 24.3 104.5 15.9 49.7 62.6c-62.8 53.6-66.1 149.8-9.9 207.9l193.5 199.8c12.5 12.9 32.8 12.9 45.3 0l193.5-199.8c56.3-58.1 53-154.3-9.8-207.9z"}}]})(e)}function bn(e){return an({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M272 0H48C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h224c26.5 0 48-21.5 48-48V48c0-26.5-21.5-48-48-48zM160 480c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm112-108c0 6.6-5.4 12-12 12H60c-6.6 0-12-5.4-12-12V60c0-6.6 5.4-12 12-12h200c6.6 0 12 5.4 12 12v312z"}}]})(e)}function wn(e){return an({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z"}}]})(e)}function En(e){return an({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M505 442.7L405.3 343c-4.5-4.5-10.6-7-17-7H372c27.6-35.3 44-79.7 44-128C416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c48.3 0 92.7-16.4 128-44v16.3c0 6.4 2.5 12.5 7 17l99.7 99.7c9.4 9.4 24.6 9.4 33.9 0l28.3-28.3c9.4-9.4 9.4-24.6.1-34zM208 336c-70.7 0-128-57.2-128-128 0-70.7 57.2-128 128-128 70.7 0 128 57.2 128 128 0 70.7-57.2 128-128 128z"}}]})(e)}function On(e){return an({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M352 320c-22.608 0-43.387 7.819-59.79 20.895l-102.486-64.054a96.551 96.551 0 0 0 0-41.683l102.486-64.054C308.613 184.181 329.392 192 352 192c53.019 0 96-42.981 96-96S405.019 0 352 0s-96 42.981-96 96c0 7.158.79 14.13 2.276 20.841L155.79 180.895C139.387 167.819 118.608 160 96 160c-53.019 0-96 42.981-96 96s42.981 96 96 96c22.608 0 43.387-7.819 59.79-20.895l102.486 64.054A96.301 96.301 0 0 0 256 416c0 53.019 42.981 96 96 96s96-42.981 96-96-42.981-96-96-96z"}}]})(e)}function kn(e){return an({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M528.12 301.319l47.273-208C578.806 78.301 567.391 64 551.99 64H159.208l-9.166-44.81C147.758 8.021 137.93 0 126.529 0H24C10.745 0 0 10.745 0 24v16c0 13.255 10.745 24 24 24h69.883l70.248 343.435C147.325 417.1 136 435.222 136 456c0 30.928 25.072 56 56 56s56-25.072 56-56c0-15.674-6.447-29.835-16.824-40h209.647C430.447 426.165 424 440.326 424 456c0 30.928 25.072 56 56 56s56-25.072 56-56c0-22.172-12.888-41.332-31.579-50.405l5.517-24.276c3.413-15.018-8.002-29.319-23.403-29.319H218.117l-6.545-32h293.145c11.206 0 20.92-7.754 23.403-18.681z"}}]})(e)}function Sn(e){return an({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M259.3 17.8L194 150.2 47.9 171.5c-26.2 3.8-36.7 36.1-17.7 54.6l105.7 103-25 145.5c-4.5 26.3 23.2 46 46.4 33.7L288 439.6l130.7 68.7c23.2 12.2 50.9-7.4 46.4-33.7l-25-145.5 105.7-103c19-18.5 8.5-50.8-17.7-54.6L382 150.2 316.7 17.8c-11.7-23.6-45.6-23.9-57.4 0z"}}]})(e)}function xn(e){return an({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M400 0H48C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V48c0-26.5-21.5-48-48-48zM224 480c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm176-108c0 6.6-5.4 12-12 12H60c-6.6 0-12-5.4-12-12V60c0-6.6 5.4-12 12-12h328c6.6 0 12 5.4 12 12v312z"}}]})(e)}function _n(e){return an({tag:"svg",attr:{viewBox:"0 0 352 512"},child:[{tag:"path",attr:{d:"M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"}}]})(e)}function jn(e){return an({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 288c79.5 0 144-64.5 144-144S335.5 0 256 0 112 64.5 112 144s64.5 144 144 144zm128 32h-55.1c-22.2 10.2-46.9 16-72.9 16s-50.6-5.8-72.9-16H128C57.3 320 0 377.3 0 448v16c0 26.5 21.5 48 48 48h416c26.5 0 48-21.5 48-48v-16c0-70.7-57.3-128-128-128z"}}]})(e)}function Pn(e){return an({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M224 256c70.7 0 128-57.3 128-128S294.7 0 224 0 96 57.3 96 128s57.3 128 128 128zm89.6 32h-16.7c-22.2 10.2-46.9 16-72.9 16s-50.6-5.8-72.9-16h-16.7C60.2 288 0 348.2 0 422.4V464c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48v-41.6c0-74.2-60.2-134.4-134.4-134.4z"}}]})(e)}var Cn=function(e){return{type:"SET_RETRY",payload:e}},Tn=function(e){return{type:"USER_CAN_LOGOUT",payload:e}},An=function(e){return{type:"SET_GLOBAL_SIGN_IN",payload:e}},Nn=function(e){return{type:"IS_LINKED_LOGIN",payload:e}},In=function(e){return{type:"SET_RETRY_MSG",payload:e}},Ln=function(e){return{type:"ADD_PLATFORMS",payload:e}},Dn=function(e){return{type:"ALL_ITEMS",payload:e}},Rn=function(e){return{type:"ALL_PACKS",payload:e}},Mn=function(e){return{type:"ALL_TEMPLATES",payload:e}},Fn=function(e){return{type:"ALL_CLOUDS",payload:e}},zn=function(e){return{type:"PREVIEW",payload:e}},Un=function(e){return{type:"SET_LOADING",payload:e}},Bn=function(e){return{type:"SET_ITEM_LOADING",payload:e}},Vn=function(e){return{type:"SET_LOGGED_IN",payload:e}},Wn=function(e){return{type:"ERRORS",payload:e}},Hn=function(e){return{type:"ACTIVE_SIDEBAR",payload:e}},$n=function(e){return{type:"COMMON_ALL_ITEMS",payload:e}},qn=function(e){return{type:"COMMON_FILTERED_ITEMS",payload:e}},Kn=function(e){return{type:"PACK_BLOCK_OR_PAGE",payload:e}},Qn=function(e){return{type:"SET_PAGINATION",payload:e}},Gn=function(e){return{type:"NEED_PAGINATION",payload:e}},Yn=function(e){return{type:"PAGINATION_LOADING",payload:e}},Xn=function(e){return{type:"SET_USER",payload:e}},Jn=function(e){return{type:"SUCCESS_TEXT",payload:e}},Zn=function(e){return{type:"SET_CURRENT_ROUTE",payload:e}},er=function(e){return{type:"SET_PUSHED_TIME",payload:e}},tr=function(e){return{type:"ERROR_TEXT",payload:e}},nr=function(e){return{type:"SEARCH_QUERY",payload:e}},rr=function(e){return{type:"REMOVE_FILES_PAGE_FOR_A_WORKSPACE",payload:e}},ar=function(e){return{type:"ALL_WORKSPACE_LIST",payload:e}},or=function(e){return{type:"SHARED_WORKSPACE_LIST",payload:e}};function ir(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function lr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ir(Object(n),!0).forEach((function(t){cr(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ir(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function cr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ur(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return sr(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return sr(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function sr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var fr=wp.i18n.__,pr=tt((function(e){return{preview:e.preview}}))((function(e){var t=ur(Object(o.useState)(0),2),n=t[0],r=t[1];return Object(o.useEffect)((function(){var t=lr({deep:n},e.preview);n<=0&&(t=lr(lr({},t),{isOpen:!1,deep:0})),1===n&&(t=lr(lr({},t),{type:e.preview.previousType})),e.dispatch(zn(t))}),[n]),i.a.createElement("div",{className:"templately-logo"},i.a.createElement("svg",{width:"40px",enableBackground:"new 0 0 512 512",viewBox:"0 0 512 512",xmlns:"http://www.w3.org/2000/svg"},i.a.createElement("circle",{cx:"90.5",cy:"454.8",fill:"#ffb45a",r:"57.2"}),i.a.createElement("circle",{cx:"256",cy:"454.8",fill:"#ff7b8e",r:"57.2"}),i.a.createElement("circle",{cx:"421.5",cy:"454.8",fill:"#5ac0ff",r:"57.2"}),i.a.createElement("path",{d:"m356.5 94.5c-3.1 0-6.1.2-9.1.4-12.4-54.3-61-94.9-119.1-94.9-15.3 0-29.9 2.8-43.4 8 0 15.3.1 32.9.2 40.4 15.6.1 45.8.2 59.1.2v57.8c-19.9 0-39.2 0-58.8 0v97.7h60.5c-1.7 4.3-4.3 10.7-5.4 13.2-11 26.5-38.3 41.3-66.6 36.2-26.9-4.9-46.9-27.8-48.4-55.9-.4-8.2-.2-16.5-.2-24.7 0-12.6 0-54 0-66.9-7.1 0-13.9 0-20.7 0-41.8 19.4-70.9 61.7-70.9 110.8 0 67.5 54.7 122.2 122.2 122.2h202c66.9-.7 120.8-55.1 120.8-122.2 0-67.5-54.7-122.3-122.2-122.3z",fill:"#5633d1"})),!e.preview.isOpen&&i.a.createElement(i.a.Fragment,null,i.a.createElement("svg",{height:"28",viewBox:"0 0 143 28",width:"143",xmlns:"http://www.w3.org/2000/svg"},i.a.createElement("g",{fill:"#424c5e"},i.a.createElement("path",{d:"m6.6 18.5c-1.2 0-1.9-.7-1.9-2.1v-7h3.4v-3.1h-3.8l-.6-3h-2.9v14.2c0 2.8 1.3 4.1 3.8 4.1h3.4v-3.1z"}),i.a.createElement("path",{d:"m17.3 6.3c-4.8 0-7.2 2.5-7.2 7.5 0 5.2 2.8 7.8 8.3 7.8 1.9 0 3.6-.1 4.9-.4v-3.1c-1.5.3-3.1.4-4.6.4-3.2 0-4.8-1.1-4.8-3.2h10.2c.1-.6.1-1.3.1-1.9.1-4.7-2.3-7.1-6.9-7.1zm-3.3 6.3c.2-2.2 1.3-3.3 3.3-3.3 2.1 0 3.2 1.1 3.2 3.2v.1z"}),i.a.createElement("path",{d:"m44.4 6.3c-1.7 0-3.3.7-4.9 2.1-.7-1.4-2-2.1-4-2.1-1.9 0-3.6.7-4.9 2.2l-.5-2.2h-3v15.3h3.9v-10.6c1-1 2.1-1.5 3.2-1.5 1.4 0 2.1.9 2.1 2.6v9.6h3.9v-10.6c1.1-1 2.2-1.5 3.3-1.5 1.5 0 2.3.8 2.3 2.6v9.6h3.9v-9.5c0-4.1-1.8-6-5.3-6z"}),i.a.createElement("path",{d:"m59.8 6.3c-2.3 0-4.4.2-6.4.6v21.1h3.9v-7.1c1 .5 2.1.7 3.1.7 4.8 0 7.3-2.7 7.3-8-.1-4.9-2.7-7.3-7.9-7.3zm.5 12.1c-1.1 0-2.1-.3-3.1-.8v-8c.7-.1 1.6-.2 2.7-.2 2.5 0 3.8 1.4 3.8 4.1.1 3.3-1.1 4.9-3.4 4.9z"}),i.a.createElement("path",{d:"m70.5.7h3.9v20.8h-3.9z"}),i.a.createElement("path",{d:"m84.1 6.3c-1.7 0-3.5.2-5.6.7v3.1c2-.5 3.9-.7 5.6-.7 2 0 3 .7 3 2.1v1.2c-1-.2-2.1-.3-3.1-.3-4.4 0-6.6 1.5-6.6 4.6 0 3.2 1.9 4.8 5.6 4.8 1.6 0 3.1-.5 4.4-1.4l1.4 1.4h2.2v-10.3c-.1-3.6-2.4-5.2-6.9-5.2zm-.6 12.5c-1.6 0-2.3-.7-2.3-2s.9-1.9 2.8-1.9c1.1 0 2.1.1 3.1.3v2.4c-1.2.8-2.4 1.2-3.6 1.2z"}),i.a.createElement("path",{d:"m100 18.5c-1.2 0-1.9-.7-1.9-2.1v-7h3.4v-3.1h-3.8l-.6-3h-2.9v14.2c0 2.8 1.3 4.1 3.8 4.1h3.4v-3.1z"}),i.a.createElement("path",{d:"m110.7 6.3c-4.8 0-7.2 2.5-7.2 7.5 0 5.2 2.8 7.8 8.3 7.8 1.9 0 3.6-.1 4.9-.4v-3.1c-1.5.3-3.1.4-4.6.4-3.2 0-4.8-1.1-4.8-3.2h10.2c.1-.6.1-1.3.1-1.9.1-4.8-2.3-7.1-6.9-7.1zm-3.3 6.3c.2-2.2 1.3-3.3 3.3-3.3 2.1 0 3.2 1.1 3.2 3.2v.1z"}),i.a.createElement("path",{d:"m120.6.7h3.9v20.8h-3.9z"}),i.a.createElement("path",{d:"m138 6.2-3.8 11-3.9-11h-4.1l5.9 15.4c-.8 1.7-2 2.9-3.7 3.7l1.9 2.6c2.5-1.2 4.3-3.2 5.4-5.9l6.3-15.8z"}))),i.a.createElement("span",{className:"templately-beta-text"},"Beta")),e.preview.isOpen&&i.a.createElement("span",{className:"templately-back-2-library",onClick:function(){return r(--e.preview.deep)}},i.a.createElement(ln,{color:"#000"}),fr("Back to Library","templately")))})),dr=tt((function(e){return{preview:e.preview}}))((function(e){return i.a.createElement(Z,{exact:e.exact||!0,path:e.to,children:function(t){var n=t.match;return i.a.createElement("li",{className:n||e.active?"templately-active":""},i.a.createElement(he,{className:e.className,onClick:function(){e.dispatch(Wn(null)),e.dispatch(Bn(!0)),e.dispatch(tr(null)),e.dispatch(Zn(e.to)),e.dispatch(zn({isOpen:!1,deep:0})),e.dispatch(Hn({activeSidebarMenu:"all",activeParentSidebarMenu:""})),e.dispatch(qn([])),e.dispatch($n([])),e.dispatch(Qn(1)),e.dispatch(Gn(!1))},to:e.to},e.children,e.name))}})}));n(69),n(71),n(72),n(76),n(80);function mr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function hr(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function yr(e,t,n){return t&&hr(e.prototype,t),n&&hr(e,n),e}n(81);function gr(e,t){return(gr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function vr(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&gr(e,t)}var br=n(13);function wr(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Er(e,t){return!t||"object"!==Object(br.a)(t)&&"function"!=typeof t?wr(e):t}function Or(e){return(Or=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function kr(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}var Sr=function(e,t){var n;void 0===t&&(t=kr);var r,a=[],o=!1;return function(){for(var i=[],l=0;l<arguments.length;l++)i[l]=arguments[l];return o&&n===this&&t(i,a)||(r=e.apply(this,i),o=!0,n=this,a=i),r}},xr=n(3);n(83);function _r(e,t){if(null==e)return{};var n,r,a=z(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var jr=n(26);function Pr(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}}(e,t)||Object(jr.a)(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var Cr=n(7),Tr=n(2),Ar=n(15);var Nr=n(31),Ir=n.n(Nr),Lr=function(){};function Dr(e,t){return t?"-"===t[0]?e+t:e+"__"+t:e}function Rr(e,t,n){var r=[n];if(t&&e)for(var a in t)t.hasOwnProperty(a)&&t[a]&&r.push("".concat(Dr(e,a)));return r.filter((function(e){return e})).map((function(e){return String(e).trim()})).join(" ")}var Mr=function(e){return Array.isArray(e)?e.filter(Boolean):"object"===Object(br.a)(e)&&null!==e?[e]:[]};function Fr(e){return[document.documentElement,document.body,window].indexOf(e)>-1}function zr(e){return Fr(e)?window.pageYOffset:e.scrollTop}function Ur(e,t){Fr(e)?window.scrollTo(0,t):e.scrollTop=t}function Br(e,t,n,r){return n*((e=e/r-1)*e*e+1)+t}function Vr(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:200,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Lr,a=zr(e),o=t-a,i=10,l=0;function c(){var t=Br(l+=i,a,o,n);Ur(e,t),l<n?window.requestAnimationFrame(c):r(e)}c()}function Wr(){try{return document.createEvent("TouchEvent"),!0}catch(e){return!1}}function Hr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function $r(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Hr(Object(n),!0).forEach((function(t){Object(Tr.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Hr(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function qr(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Or(e);if(t){var a=Or(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Er(this,n)}}function Kr(e){var t=e.maxHeight,n=e.menuEl,r=e.minHeight,a=e.placement,o=e.shouldScroll,i=e.isFixedPosition,l=e.theme.spacing,c=function(e){var t=getComputedStyle(e),n="absolute"===t.position,r=/(auto|scroll)/,a=document.documentElement;if("fixed"===t.position)return a;for(var o=e;o=o.parentElement;)if(t=getComputedStyle(o),(!n||"static"!==t.position)&&r.test(t.overflow+t.overflowY+t.overflowX))return o;return a}(n),u={placement:"bottom",maxHeight:t};if(!n||!n.offsetParent)return u;var s=c.getBoundingClientRect().height,f=n.getBoundingClientRect(),p=f.bottom,d=f.height,m=f.top,h=n.offsetParent.getBoundingClientRect().top,y=window.innerHeight,g=zr(c),v=parseInt(getComputedStyle(n).marginBottom,10),b=parseInt(getComputedStyle(n).marginTop,10),w=h-b,E=y-m,O=w+g,k=s-g-m,S=p-y+g+v,x=g+m-b;switch(a){case"auto":case"bottom":if(E>=d)return{placement:"bottom",maxHeight:t};if(k>=d&&!i)return o&&Vr(c,S,160),{placement:"bottom",maxHeight:t};if(!i&&k>=r||i&&E>=r)return o&&Vr(c,S,160),{placement:"bottom",maxHeight:i?E-v:k-v};if("auto"===a||i){var _=t,j=i?w:O;return j>=r&&(_=Math.min(j-v-l.controlHeight,t)),{placement:"top",maxHeight:_}}if("bottom"===a)return Ur(c,S),{placement:"bottom",maxHeight:t};break;case"top":if(w>=d)return{placement:"top",maxHeight:t};if(O>=d&&!i)return o&&Vr(c,x,160),{placement:"top",maxHeight:t};if(!i&&O>=r||i&&w>=r){var P=t;return(!i&&O>=r||i&&w>=r)&&(P=i?w-b:O-b),o&&Vr(c,x,160),{placement:"top",maxHeight:P}}return{placement:"bottom",maxHeight:t};default:throw new Error('Invalid placement provided "'.concat(a,'".'))}return u}var Qr=function(e){return"auto"===e?"bottom":e},Gr=Object(o.createContext)({getPortalPlacement:null}),Yr=function(e){vr(n,e);var t=qr(n);function n(){var e;mr(this,n);for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];return(e=t.call.apply(t,[this].concat(a))).state={maxHeight:e.props.maxMenuHeight,placement:null},e.getPlacement=function(t){var n=e.props,r=n.minMenuHeight,a=n.maxMenuHeight,o=n.menuPlacement,i=n.menuPosition,l=n.menuShouldScrollIntoView,c=n.theme;if(t){var u="fixed"===i,s=Kr({maxHeight:a,menuEl:t,minHeight:r,placement:o,shouldScroll:l&&!u,isFixedPosition:u,theme:c}),f=e.context.getPortalPlacement;f&&f(s),e.setState(s)}},e.getUpdatedProps=function(){var t=e.props.menuPlacement,n=e.state.placement||Qr(t);return $r($r({},e.props),{},{placement:n,maxHeight:e.state.maxHeight})},e}return yr(n,[{key:"render",value:function(){return(0,this.props.children)({ref:this.getPlacement,placerProps:this.getUpdatedProps()})}}]),n}(o.Component);Yr.contextType=Gr;var Xr=function(e){var t=e.theme,n=t.spacing.baseUnit;return{color:t.colors.neutral40,padding:"".concat(2*n,"px ").concat(3*n,"px"),textAlign:"center"}},Jr=Xr,Zr=Xr,ea=function(e){var t=e.children,n=e.className,r=e.cx,a=e.getStyles,o=e.innerProps;return Object(xr.c)("div",s({css:a("noOptionsMessage",e),className:r({"menu-notice":!0,"menu-notice--no-options":!0},n)},o),t)};ea.defaultProps={children:"No options"};var ta=function(e){var t=e.children,n=e.className,r=e.cx,a=e.getStyles,o=e.innerProps;return Object(xr.c)("div",s({css:a("loadingMessage",e),className:r({"menu-notice":!0,"menu-notice--loading":!0},n)},o),t)};ta.defaultProps={children:"Loading..."};var na=function(e){vr(n,e);var t=qr(n);function n(){var e;mr(this,n);for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];return(e=t.call.apply(t,[this].concat(a))).state={placement:null},e.getPortalPlacement=function(t){var n=t.placement;n!==Qr(e.props.menuPlacement)&&e.setState({placement:n})},e}return yr(n,[{key:"render",value:function(){var e=this.props,t=e.appendTo,n=e.children,r=e.controlElement,a=e.menuPlacement,o=e.menuPosition,i=e.getStyles,c="fixed"===o;if(!t&&!c||!r)return null;var u=this.state.placement||Qr(a),s=function(e){var t=e.getBoundingClientRect();return{bottom:t.bottom,height:t.height,left:t.left,right:t.right,top:t.top,width:t.width}}(r),f=c?0:window.pageYOffset,p={offset:s[u]+f,position:o,rect:s},d=Object(xr.c)("div",{css:i("menuPortal",p)},n);return Object(xr.c)(Gr.Provider,{value:{getPortalPlacement:this.getPortalPlacement}},t?Object(l.createPortal)(d,t):d)}}]),n}(o.Component),ra=Array.isArray,aa=Object.keys,oa=Object.prototype.hasOwnProperty;function ia(e,t){try{return function e(t,n){if(t===n)return!0;if(t&&n&&"object"==Object(br.a)(t)&&"object"==Object(br.a)(n)){var r,a,o,i=ra(t),l=ra(n);if(i&&l){if((a=t.length)!=n.length)return!1;for(r=a;0!=r--;)if(!e(t[r],n[r]))return!1;return!0}if(i!=l)return!1;var c=t instanceof Date,u=n instanceof Date;if(c!=u)return!1;if(c&&u)return t.getTime()==n.getTime();var s=t instanceof RegExp,f=n instanceof RegExp;if(s!=f)return!1;if(s&&f)return t.toString()==n.toString();var p=aa(t);if((a=p.length)!==aa(n).length)return!1;for(r=a;0!=r--;)if(!oa.call(n,p[r]))return!1;for(r=a;0!=r--;)if(!("_owner"===(o=p[r])&&t.$$typeof||e(t[o],n[o])))return!1;return!0}return t!=t&&n!=n}(e,t)}catch(e){if(e.message&&e.message.match(/stack|recursion/i))return console.warn("Warning: react-fast-compare does not handle circular references.",e.name,e.message),!1;throw e}}function la(){var e,t,n=(e=["\n 0%, 80%, 100% { opacity: 0; }\n 40% { opacity: 1; }\n"],t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}})));return la=function(){return n},n}var ca={name:"19bqh2r",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0;"},ua=function(e){var t=e.size,n=_r(e,["size"]);return Object(xr.c)("svg",s({height:t,width:t,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:ca},n))},sa=function(e){return Object(xr.c)(ua,s({size:20},e),Object(xr.c)("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},fa=function(e){return Object(xr.c)(ua,s({size:20},e),Object(xr.c)("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},pa=function(e){var t=e.isFocused,n=e.theme,r=n.spacing.baseUnit,a=n.colors;return{label:"indicatorContainer",color:t?a.neutral60:a.neutral20,display:"flex",padding:2*r,transition:"color 150ms",":hover":{color:t?a.neutral80:a.neutral40}}},da=pa,ma=pa,ha=Object(xr.d)(la()),ya=function(e){var t=e.delay,n=e.offset;return Object(xr.c)("span",{css:Object(Ar.a)({animation:"".concat(ha," 1s ease-in-out ").concat(t,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:n?"1em":null,height:"1em",verticalAlign:"top",width:"1em"},"")})},ga=function(e){var t=e.className,n=e.cx,r=e.getStyles,a=e.innerProps,o=e.isRtl;return Object(xr.c)("div",s({},a,{css:r("loadingIndicator",e),className:n({indicator:!0,"loading-indicator":!0},t)}),Object(xr.c)(ya,{delay:0,offset:o}),Object(xr.c)(ya,{delay:160,offset:!0}),Object(xr.c)(ya,{delay:320,offset:!o}))};ga.defaultProps={size:4};function va(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ba(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?va(Object(n),!0).forEach((function(t){Object(Tr.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):va(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function wa(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ea(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?wa(Object(n),!0).forEach((function(t){Object(Tr.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wa(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Oa=function(e){return{label:"input",background:0,border:0,fontSize:"inherit",opacity:e?0:1,outline:0,padding:0,color:"inherit"}};function ka(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Sa(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ka(Object(n),!0).forEach((function(t){Object(Tr.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ka(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var xa=function(e){var t=e.children,n=e.innerProps;return Object(xr.c)("div",n,t)},_a=xa,ja=xa;var Pa=function(e){var t=e.children,n=e.className,r=e.components,a=e.cx,o=e.data,i=e.getStyles,l=e.innerProps,c=e.isDisabled,u=e.removeProps,s=e.selectProps,f=r.Container,p=r.Label,d=r.Remove;return Object(xr.c)(xr.b,null,(function(r){var m=r.css,h=r.cx;return Object(xr.c)(f,{data:o,innerProps:Sa(Sa({},l),{},{className:h(m(i("multiValue",e)),a({"multi-value":!0,"multi-value--is-disabled":c},n))}),selectProps:s},Object(xr.c)(p,{data:o,innerProps:{className:h(m(i("multiValueLabel",e)),a({"multi-value__label":!0},n))},selectProps:s},t),Object(xr.c)(d,{data:o,innerProps:Sa({className:h(m(i("multiValueRemove",e)),a({"multi-value__remove":!0},n))},u),selectProps:s}))}))};Pa.defaultProps={cropWithEllipsis:!0};function Ca(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ta(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ca(Object(n),!0).forEach((function(t){Object(Tr.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ca(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}for(var Aa={ClearIndicator:function(e){var t=e.children,n=e.className,r=e.cx,a=e.getStyles,o=e.innerProps;return Object(xr.c)("div",s({},o,{css:a("clearIndicator",e),className:r({indicator:!0,"clear-indicator":!0},n)}),t||Object(xr.c)(sa,null))},Control:function(e){var t=e.children,n=e.cx,r=e.getStyles,a=e.className,o=e.isDisabled,i=e.isFocused,l=e.innerRef,c=e.innerProps,u=e.menuIsOpen;return Object(xr.c)("div",s({ref:l,css:r("control",e),className:n({control:!0,"control--is-disabled":o,"control--is-focused":i,"control--menu-is-open":u},a)},c),t)},DropdownIndicator:function(e){var t=e.children,n=e.className,r=e.cx,a=e.getStyles,o=e.innerProps;return Object(xr.c)("div",s({},o,{css:a("dropdownIndicator",e),className:r({indicator:!0,"dropdown-indicator":!0},n)}),t||Object(xr.c)(fa,null))},DownChevron:fa,CrossIcon:sa,Group:function(e){var t=e.children,n=e.className,r=e.cx,a=e.getStyles,o=e.Heading,i=e.headingProps,l=e.label,c=e.theme,u=e.selectProps;return Object(xr.c)("div",{css:a("group",e),className:r({group:!0},n)},Object(xr.c)(o,s({},i,{selectProps:u,theme:c,getStyles:a,cx:r}),l),Object(xr.c)("div",null,t))},GroupHeading:function(e){var t=e.className,n=e.cx,r=e.getStyles,a=e.theme,o=(e.selectProps,_r(e,["className","cx","getStyles","theme","selectProps"]));return Object(xr.c)("div",s({css:r("groupHeading",ba({theme:a},o)),className:n({"group-heading":!0},t)},o))},IndicatorsContainer:function(e){var t=e.children,n=e.className,r=e.cx,a=e.getStyles;return Object(xr.c)("div",{css:a("indicatorsContainer",e),className:r({indicators:!0},n)},t)},IndicatorSeparator:function(e){var t=e.className,n=e.cx,r=e.getStyles,a=e.innerProps;return Object(xr.c)("span",s({},a,{css:r("indicatorSeparator",e),className:n({"indicator-separator":!0},t)}))},Input:function(e){var t=e.className,n=e.cx,r=e.getStyles,a=e.innerRef,o=e.isHidden,i=e.isDisabled,l=e.theme,c=(e.selectProps,_r(e,["className","cx","getStyles","innerRef","isHidden","isDisabled","theme","selectProps"]));return Object(xr.c)("div",{css:r("input",Ea({theme:l},c))},Object(xr.c)(Ir.a,s({className:n({input:!0},t),inputRef:a,inputStyle:Oa(o),disabled:i},c)))},LoadingIndicator:ga,Menu:function(e){var t=e.children,n=e.className,r=e.cx,a=e.getStyles,o=e.innerRef,i=e.innerProps;return Object(xr.c)("div",s({css:a("menu",e),className:r({menu:!0},n)},i,{ref:o}),t)},MenuList:function(e){var t=e.children,n=e.className,r=e.cx,a=e.getStyles,o=e.isMulti,i=e.innerRef;return Object(xr.c)("div",{css:a("menuList",e),className:r({"menu-list":!0,"menu-list--is-multi":o},n),ref:i},t)},MenuPortal:na,LoadingMessage:ta,NoOptionsMessage:ea,MultiValue:Pa,MultiValueContainer:_a,MultiValueLabel:ja,MultiValueRemove:function(e){var t=e.children,n=e.innerProps;return Object(xr.c)("div",n,t||Object(xr.c)(sa,{size:14}))},Option:function(e){var t=e.children,n=e.className,r=e.cx,a=e.getStyles,o=e.isDisabled,i=e.isFocused,l=e.isSelected,c=e.innerRef,u=e.innerProps;return Object(xr.c)("div",s({css:a("option",e),className:r({option:!0,"option--is-disabled":o,"option--is-focused":i,"option--is-selected":l},n),ref:c},u),t)},Placeholder:function(e){var t=e.children,n=e.className,r=e.cx,a=e.getStyles,o=e.innerProps;return Object(xr.c)("div",s({css:a("placeholder",e),className:r({placeholder:!0},n)},o),t)},SelectContainer:function(e){var t=e.children,n=e.className,r=e.cx,a=e.getStyles,o=e.innerProps,i=e.isDisabled,l=e.isRtl;return Object(xr.c)("div",s({css:a("container",e),className:r({"--is-disabled":i,"--is-rtl":l},n)},o),t)},SingleValue:function(e){var t=e.children,n=e.className,r=e.cx,a=e.getStyles,o=e.isDisabled,i=e.innerProps;return Object(xr.c)("div",s({css:a("singleValue",e),className:r({"single-value":!0,"single-value--is-disabled":o},n)},i),t)},ValueContainer:function(e){var t=e.children,n=e.className,r=e.cx,a=e.isMulti,o=e.getStyles,i=e.hasValue;return Object(xr.c)("div",{css:o("valueContainer",e),className:r({"value-container":!0,"value-container--is-multi":a,"value-container--has-value":i},n)},t)}},Na=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],Ia=new RegExp("["+Na.map((function(e){return e.letters})).join("")+"]","g"),La={},Da=0;Da<Na.length;Da++)for(var Ra=Na[Da],Ma=0;Ma<Ra.letters.length;Ma++)La[Ra.letters[Ma]]=Ra.base;var Fa=function(e){return e.replace(Ia,(function(e){return La[e]}))};function za(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var Ua=function(e){return e.replace(/^\s+|\s+$/g,"")},Ba=function(e){return"".concat(e.label," ").concat(e.value)};var Va={name:"1laao21-a11yText",styles:"label:a11yText;z-index:9999;border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0;white-space:nowrap;"},Wa=function(e){return Object(xr.c)("span",s({css:Va},e))};function Ha(e){e.in,e.out,e.onExited,e.appear,e.enter,e.exit;var t=e.innerRef,n=(e.emotion,_r(e,["in","out","onExited","appear","enter","exit","innerRef","emotion"]));return Object(xr.c)("input",s({ref:t},n,{css:Object(Ar.a)({label:"dummyInput",background:0,border:0,fontSize:"inherit",outline:0,padding:0,width:1,color:"transparent",left:-100,opacity:0,position:"relative",transform:"scale(0)"},"")}))}function $a(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Or(e);if(t){var a=Or(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Er(this,n)}}var qa=function(e){vr(n,e);var t=$a(n);function n(){return mr(this,n),t.apply(this,arguments)}return yr(n,[{key:"componentDidMount",value:function(){this.props.innerRef(Object(l.findDOMNode)(this))}},{key:"componentWillUnmount",value:function(){this.props.innerRef(null)}},{key:"render",value:function(){return this.props.children}}]),n}(o.Component),Ka=["boxSizing","height","overflow","paddingRight","position"],Qa={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function Ga(e){e.preventDefault()}function Ya(e){e.stopPropagation()}function Xa(){var e=this.scrollTop,t=this.scrollHeight,n=e+this.offsetHeight;0===e?this.scrollTop=1:n===t&&(this.scrollTop=e-1)}function Ja(){return"ontouchstart"in window||navigator.maxTouchPoints}function Za(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Or(e);if(t){var a=Or(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Er(this,n)}}var eo=!(!window.document||!window.document.createElement),to=0,no=function(e){vr(n,e);var t=Za(n);function n(){var e;mr(this,n);for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];return(e=t.call.apply(t,[this].concat(a))).originalStyles={},e.listenerOptions={capture:!1,passive:!1},e}return yr(n,[{key:"componentDidMount",value:function(){var e=this;if(eo){var t=this.props,n=t.accountForScrollbars,r=t.touchScrollTarget,a=document.body,o=a&&a.style;if(n&&Ka.forEach((function(t){var n=o&&o[t];e.originalStyles[t]=n})),n&&to<1){var i=parseInt(this.originalStyles.paddingRight,10)||0,l=document.body?document.body.clientWidth:0,c=window.innerWidth-l+i||0;Object.keys(Qa).forEach((function(e){var t=Qa[e];o&&(o[e]=t)})),o&&(o.paddingRight="".concat(c,"px"))}a&&Ja()&&(a.addEventListener("touchmove",Ga,this.listenerOptions),r&&(r.addEventListener("touchstart",Xa,this.listenerOptions),r.addEventListener("touchmove",Ya,this.listenerOptions))),to+=1}}},{key:"componentWillUnmount",value:function(){var e=this;if(eo){var t=this.props,n=t.accountForScrollbars,r=t.touchScrollTarget,a=document.body,o=a&&a.style;to=Math.max(to-1,0),n&&to<1&&Ka.forEach((function(t){var n=e.originalStyles[t];o&&(o[t]=n)})),a&&Ja()&&(a.removeEventListener("touchmove",Ga,this.listenerOptions),r&&(r.removeEventListener("touchstart",Xa,this.listenerOptions),r.removeEventListener("touchmove",Ya,this.listenerOptions)))}}},{key:"render",value:function(){return null}}]),n}(o.Component);function ro(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Or(e);if(t){var a=Or(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Er(this,n)}}no.defaultProps={accountForScrollbars:!0};var ao={name:"1dsbpcp",styles:"position:fixed;left:0;bottom:0;right:0;top:0;"},oo=function(e){vr(n,e);var t=ro(n);function n(){var e;mr(this,n);for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];return(e=t.call.apply(t,[this].concat(a))).state={touchScrollTarget:null},e.getScrollTarget=function(t){t!==e.state.touchScrollTarget&&e.setState({touchScrollTarget:t})},e.blurSelectInput=function(){document.activeElement&&document.activeElement.blur()},e}return yr(n,[{key:"render",value:function(){var e=this.props,t=e.children,n=e.isEnabled,r=this.state.touchScrollTarget;return n?Object(xr.c)("div",null,Object(xr.c)("div",{onClick:this.blurSelectInput,css:ao}),Object(xr.c)(qa,{innerRef:this.getScrollTarget},t),r?Object(xr.c)(no,{touchScrollTarget:r}):null):t}}]),n}(o.PureComponent);function io(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Or(e);if(t){var a=Or(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Er(this,n)}}var lo=function(e){vr(n,e);var t=io(n);function n(){var e;mr(this,n);for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];return(e=t.call.apply(t,[this].concat(a))).isBottom=!1,e.isTop=!1,e.scrollTarget=void 0,e.touchStart=void 0,e.cancelScroll=function(e){e.preventDefault(),e.stopPropagation()},e.handleEventDelta=function(t,n){var r=e.props,a=r.onBottomArrive,o=r.onBottomLeave,i=r.onTopArrive,l=r.onTopLeave,c=e.scrollTarget,u=c.scrollTop,s=c.scrollHeight,f=c.clientHeight,p=e.scrollTarget,d=n>0,m=s-f-u,h=!1;m>n&&e.isBottom&&(o&&o(t),e.isBottom=!1),d&&e.isTop&&(l&&l(t),e.isTop=!1),d&&n>m?(a&&!e.isBottom&&a(t),p.scrollTop=s,h=!0,e.isBottom=!0):!d&&-n>u&&(i&&!e.isTop&&i(t),p.scrollTop=0,h=!0,e.isTop=!0),h&&e.cancelScroll(t)},e.onWheel=function(t){e.handleEventDelta(t,t.deltaY)},e.onTouchStart=function(t){e.touchStart=t.changedTouches[0].clientY},e.onTouchMove=function(t){var n=e.touchStart-t.changedTouches[0].clientY;e.handleEventDelta(t,n)},e.getScrollTarget=function(t){e.scrollTarget=t},e}return yr(n,[{key:"componentDidMount",value:function(){this.startListening(this.scrollTarget)}},{key:"componentWillUnmount",value:function(){this.stopListening(this.scrollTarget)}},{key:"startListening",value:function(e){e&&("function"==typeof e.addEventListener&&e.addEventListener("wheel",this.onWheel,!1),"function"==typeof e.addEventListener&&e.addEventListener("touchstart",this.onTouchStart,!1),"function"==typeof e.addEventListener&&e.addEventListener("touchmove",this.onTouchMove,!1))}},{key:"stopListening",value:function(e){"function"==typeof e.removeEventListener&&e.removeEventListener("wheel",this.onWheel,!1),"function"==typeof e.removeEventListener&&e.removeEventListener("touchstart",this.onTouchStart,!1),"function"==typeof e.removeEventListener&&e.removeEventListener("touchmove",this.onTouchMove,!1)}},{key:"render",value:function(){return i.a.createElement(qa,{innerRef:this.getScrollTarget},this.props.children)}}]),n}(o.Component);function co(e){var t=e.isEnabled,n=void 0===t||t,r=_r(e,["isEnabled"]);return n?i.a.createElement(lo,r):r.children}var uo=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.isSearchable,r=t.isMulti,a=t.label,o=t.isDisabled;switch(e){case"menu":return"Use Up and Down to choose options".concat(o?"":", press Enter to select the currently focused option",", press Escape to exit the menu, press Tab to select the option and exit the menu.");case"input":return"".concat(a||"Select"," is focused ").concat(n?",type to refine list":"",", press Down to open the menu, ").concat(r?" press left to focus selected values":"");case"value":return"Use left and right to toggle between focused values, press Backspace to remove the currently focused value"}},so=function(e,t){var n=t.value,r=t.isDisabled;if(n)switch(e){case"deselect-option":case"pop-value":case"remove-value":return"option ".concat(n,", deselected.");case"select-option":return"option ".concat(n,r?" is disabled. Select another option.":", selected.")}},fo=function(e){return!!e.isDisabled};var po={clearIndicator:ma,container:function(e){var t=e.isDisabled;return{label:"container",direction:e.isRtl?"rtl":null,pointerEvents:t?"none":null,position:"relative"}},control:function(e){var t=e.isDisabled,n=e.isFocused,r=e.theme,a=r.colors,o=r.borderRadius,i=r.spacing;return{label:"control",alignItems:"center",backgroundColor:t?a.neutral5:a.neutral0,borderColor:t?a.neutral10:n?a.primary:a.neutral20,borderRadius:o,borderStyle:"solid",borderWidth:1,boxShadow:n?"0 0 0 1px ".concat(a.primary):null,cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:i.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms","&:hover":{borderColor:n?a.primary:a.neutral30}}},dropdownIndicator:da,group:function(e){var t=e.theme.spacing;return{paddingBottom:2*t.baseUnit,paddingTop:2*t.baseUnit}},groupHeading:function(e){var t=e.theme.spacing;return{label:"group",color:"#999",cursor:"default",display:"block",fontSize:"75%",fontWeight:"500",marginBottom:"0.25em",paddingLeft:3*t.baseUnit,paddingRight:3*t.baseUnit,textTransform:"uppercase"}},indicatorsContainer:function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},indicatorSeparator:function(e){var t=e.isDisabled,n=e.theme,r=n.spacing.baseUnit,a=n.colors;return{label:"indicatorSeparator",alignSelf:"stretch",backgroundColor:t?a.neutral10:a.neutral20,marginBottom:2*r,marginTop:2*r,width:1}},input:function(e){var t=e.isDisabled,n=e.theme,r=n.spacing,a=n.colors;return{margin:r.baseUnit/2,paddingBottom:r.baseUnit/2,paddingTop:r.baseUnit/2,visibility:t?"hidden":"visible",color:a.neutral80}},loadingIndicator:function(e){var t=e.isFocused,n=e.size,r=e.theme,a=r.colors,o=r.spacing.baseUnit;return{label:"loadingIndicator",color:t?a.neutral60:a.neutral20,display:"flex",padding:2*o,transition:"color 150ms",alignSelf:"center",fontSize:n,lineHeight:1,marginRight:n,textAlign:"center",verticalAlign:"middle"}},loadingMessage:Zr,menu:function(e){var t,n=e.placement,r=e.theme,a=r.borderRadius,o=r.spacing,i=r.colors;return t={label:"menu"},Object(Tr.a)(t,function(e){return e?{bottom:"top",top:"bottom"}[e]:"bottom"}(n),"100%"),Object(Tr.a)(t,"backgroundColor",i.neutral0),Object(Tr.a)(t,"borderRadius",a),Object(Tr.a)(t,"boxShadow","0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)"),Object(Tr.a)(t,"marginBottom",o.menuGutter),Object(Tr.a)(t,"marginTop",o.menuGutter),Object(Tr.a)(t,"position","absolute"),Object(Tr.a)(t,"width","100%"),Object(Tr.a)(t,"zIndex",1),t},menuList:function(e){var t=e.maxHeight,n=e.theme.spacing.baseUnit;return{maxHeight:t,overflowY:"auto",paddingBottom:n,paddingTop:n,position:"relative",WebkitOverflowScrolling:"touch"}},menuPortal:function(e){var t=e.rect,n=e.offset,r=e.position;return{left:t.left,position:r,top:n,width:t.width,zIndex:1}},multiValue:function(e){var t=e.theme,n=t.spacing,r=t.borderRadius;return{label:"multiValue",backgroundColor:t.colors.neutral10,borderRadius:r/2,display:"flex",margin:n.baseUnit/2,minWidth:0}},multiValueLabel:function(e){var t=e.theme,n=t.borderRadius,r=t.colors,a=e.cropWithEllipsis;return{borderRadius:n/2,color:r.neutral80,fontSize:"85%",overflow:"hidden",padding:3,paddingLeft:6,textOverflow:a?"ellipsis":null,whiteSpace:"nowrap"}},multiValueRemove:function(e){var t=e.theme,n=t.spacing,r=t.borderRadius,a=t.colors;return{alignItems:"center",borderRadius:r/2,backgroundColor:e.isFocused&&a.dangerLight,display:"flex",paddingLeft:n.baseUnit,paddingRight:n.baseUnit,":hover":{backgroundColor:a.dangerLight,color:a.danger}}},noOptionsMessage:Jr,option:function(e){var t=e.isDisabled,n=e.isFocused,r=e.isSelected,a=e.theme,o=a.spacing,i=a.colors;return{label:"option",backgroundColor:r?i.primary:n?i.primary25:"transparent",color:t?i.neutral20:r?i.neutral0:"inherit",cursor:"default",display:"block",fontSize:"inherit",padding:"".concat(2*o.baseUnit,"px ").concat(3*o.baseUnit,"px"),width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)",":active":{backgroundColor:!t&&(r?i.primary:i.primary50)}}},placeholder:function(e){var t=e.theme,n=t.spacing;return{label:"placeholder",color:t.colors.neutral50,marginLeft:n.baseUnit/2,marginRight:n.baseUnit/2,position:"absolute",top:"50%",transform:"translateY(-50%)"}},singleValue:function(e){var t=e.isDisabled,n=e.theme,r=n.spacing,a=n.colors;return{label:"singleValue",color:t?a.neutral40:a.neutral80,marginLeft:r.baseUnit/2,marginRight:r.baseUnit/2,maxWidth:"calc(100% - ".concat(2*r.baseUnit,"px)"),overflow:"hidden",position:"absolute",textOverflow:"ellipsis",whiteSpace:"nowrap",top:"50%",transform:"translateY(-50%)"}},valueContainer:function(e){var t=e.theme.spacing;return{alignItems:"center",display:"flex",flex:1,flexWrap:"wrap",padding:"".concat(t.baseUnit/2,"px ").concat(2*t.baseUnit,"px"),WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"}}};var mo={borderRadius:4,colors:{primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},spacing:{baseUnit:4,controlHeight:38,menuGutter:8}};function ho(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function yo(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ho(Object(n),!0).forEach((function(t){Object(Tr.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ho(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function go(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Or(e);if(t){var a=Or(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Er(this,n)}}var vo,bo={backspaceRemovesValue:!0,blurInputOnSelect:Wr(),captureMenuScroll:!Wr(),closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:function(e,t){var n=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?za(Object(n),!0).forEach((function(t){Object(Tr.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):za(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({ignoreCase:!0,ignoreAccents:!0,stringify:Ba,trim:!0,matchFrom:"any"},vo),r=n.ignoreCase,a=n.ignoreAccents,o=n.stringify,i=n.trim,l=n.matchFrom,c=i?Ua(t):t,u=i?Ua(o(e)):o(e);return r&&(c=c.toLowerCase(),u=u.toLowerCase()),a&&(c=Fa(c),u=Fa(u)),"start"===l?u.substr(0,c.length)===c:u.indexOf(c)>-1},formatGroupLabel:function(e){return e.label},getOptionLabel:function(e){return e.label},getOptionValue:function(e){return e.value},isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:fo,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!function(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch(e){return!1}}(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(e){var t=e.count;return"".concat(t," result").concat(1!==t?"s":""," available")},styles:{},tabIndex:"0",tabSelectsValue:!0},wo=1,Eo=function(e){vr(n,e);var t=go(n);function n(e){var r;mr(this,n),(r=t.call(this,e)).state={ariaLiveSelection:"",ariaLiveContext:"",focusedOption:null,focusedValue:null,inputIsHidden:!1,isFocused:!1,menuOptions:{render:[],focusable:[]},selectValue:[]},r.blockOptionHover=!1,r.isComposing=!1,r.clearFocusValueOnUpdate=!1,r.commonProps=void 0,r.components=void 0,r.hasGroups=!1,r.initialTouchX=0,r.initialTouchY=0,r.inputIsHiddenAfterUpdate=void 0,r.instancePrefix="",r.openAfterFocus=!1,r.scrollToFocusedOptionOnUpdate=!1,r.userIsDragging=void 0,r.controlRef=null,r.getControlRef=function(e){r.controlRef=e},r.focusedOptionRef=null,r.getFocusedOptionRef=function(e){r.focusedOptionRef=e},r.menuListRef=null,r.getMenuListRef=function(e){r.menuListRef=e},r.inputRef=null,r.getInputRef=function(e){r.inputRef=e},r.cacheComponents=function(e){var t;r.components=(t={components:e},Ta(Ta({},Aa),t.components))},r.focus=r.focusInput,r.blur=r.blurInput,r.onChange=function(e,t){var n=r.props,a=n.onChange,o=n.name;a(e,yo(yo({},t),{},{name:o}))},r.setValue=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"set-value",n=arguments.length>2?arguments[2]:void 0,a=r.props,o=a.closeMenuOnSelect,i=a.isMulti;r.onInputChange("",{action:"set-value"}),o&&(r.inputIsHiddenAfterUpdate=!i,r.onMenuClose()),r.clearFocusValueOnUpdate=!0,r.onChange(e,{action:t,option:n})},r.selectOption=function(e){var t=r.props,n=t.blurInputOnSelect,a=t.isMulti,o=r.state.selectValue;if(a)if(r.isOptionSelected(e,o)){var i=r.getOptionValue(e);r.setValue(o.filter((function(e){return r.getOptionValue(e)!==i})),"deselect-option",e),r.announceAriaLiveSelection({event:"deselect-option",context:{value:r.getOptionLabel(e)}})}else r.isOptionDisabled(e,o)?r.announceAriaLiveSelection({event:"select-option",context:{value:r.getOptionLabel(e),isDisabled:!0}}):(r.setValue([].concat(Object(Cr.a)(o),[e]),"select-option",e),r.announceAriaLiveSelection({event:"select-option",context:{value:r.getOptionLabel(e)}}));else r.isOptionDisabled(e,o)?r.announceAriaLiveSelection({event:"select-option",context:{value:r.getOptionLabel(e),isDisabled:!0}}):(r.setValue(e,"select-option"),r.announceAriaLiveSelection({event:"select-option",context:{value:r.getOptionLabel(e)}}));n&&r.blurInput()},r.removeValue=function(e){var t=r.state.selectValue,n=r.getOptionValue(e),a=t.filter((function(e){return r.getOptionValue(e)!==n}));r.onChange(a.length?a:null,{action:"remove-value",removedValue:e}),r.announceAriaLiveSelection({event:"remove-value",context:{value:e?r.getOptionLabel(e):""}}),r.focusInput()},r.clearValue=function(){var e=r.props.isMulti;r.onChange(e?[]:null,{action:"clear"})},r.popValue=function(){var e=r.state.selectValue,t=e[e.length-1],n=e.slice(0,e.length-1);r.announceAriaLiveSelection({event:"pop-value",context:{value:t?r.getOptionLabel(t):""}}),r.onChange(n.length?n:null,{action:"pop-value",removedValue:t})},r.getOptionLabel=function(e){return r.props.getOptionLabel(e)},r.getOptionValue=function(e){return r.props.getOptionValue(e)},r.getStyles=function(e,t){var n=po[e](t);n.boxSizing="border-box";var a=r.props.styles[e];return a?a(n,t):n},r.getElementId=function(e){return"".concat(r.instancePrefix,"-").concat(e)},r.getActiveDescendentId=function(){var e=r.props.menuIsOpen,t=r.state,n=t.menuOptions,a=t.focusedOption;if(a&&e){var o=n.focusable.indexOf(a),i=n.render[o];return i&&i.key}},r.announceAriaLiveSelection=function(e){var t=e.event,n=e.context;r.setState({ariaLiveSelection:so(t,n)})},r.announceAriaLiveContext=function(e){var t=e.event,n=e.context;r.setState({ariaLiveContext:uo(t,yo(yo({},n),{},{label:r.props["aria-label"]}))})},r.onMenuMouseDown=function(e){0===e.button&&(e.stopPropagation(),e.preventDefault(),r.focusInput())},r.onMenuMouseMove=function(e){r.blockOptionHover=!1},r.onControlMouseDown=function(e){var t=r.props.openMenuOnClick;r.state.isFocused?r.props.menuIsOpen?"INPUT"!==e.target.tagName&&"TEXTAREA"!==e.target.tagName&&r.onMenuClose():t&&r.openMenu("first"):(t&&(r.openAfterFocus=!0),r.focusInput()),"INPUT"!==e.target.tagName&&"TEXTAREA"!==e.target.tagName&&e.preventDefault()},r.onDropdownIndicatorMouseDown=function(e){if(!(e&&"mousedown"===e.type&&0!==e.button||r.props.isDisabled)){var t=r.props,n=t.isMulti,a=t.menuIsOpen;r.focusInput(),a?(r.inputIsHiddenAfterUpdate=!n,r.onMenuClose()):r.openMenu("first"),e.preventDefault(),e.stopPropagation()}},r.onClearIndicatorMouseDown=function(e){e&&"mousedown"===e.type&&0!==e.button||(r.clearValue(),e.stopPropagation(),r.openAfterFocus=!1,"touchend"===e.type?r.focusInput():setTimeout((function(){return r.focusInput()})))},r.onScroll=function(e){"boolean"==typeof r.props.closeMenuOnScroll?e.target instanceof HTMLElement&&Fr(e.target)&&r.props.onMenuClose():"function"==typeof r.props.closeMenuOnScroll&&r.props.closeMenuOnScroll(e)&&r.props.onMenuClose()},r.onCompositionStart=function(){r.isComposing=!0},r.onCompositionEnd=function(){r.isComposing=!1},r.onTouchStart=function(e){var t=e.touches,n=t&&t.item(0);n&&(r.initialTouchX=n.clientX,r.initialTouchY=n.clientY,r.userIsDragging=!1)},r.onTouchMove=function(e){var t=e.touches,n=t&&t.item(0);if(n){var a=Math.abs(n.clientX-r.initialTouchX),o=Math.abs(n.clientY-r.initialTouchY);r.userIsDragging=a>5||o>5}},r.onTouchEnd=function(e){r.userIsDragging||(r.controlRef&&!r.controlRef.contains(e.target)&&r.menuListRef&&!r.menuListRef.contains(e.target)&&r.blurInput(),r.initialTouchX=0,r.initialTouchY=0)},r.onControlTouchEnd=function(e){r.userIsDragging||r.onControlMouseDown(e)},r.onClearIndicatorTouchEnd=function(e){r.userIsDragging||r.onClearIndicatorMouseDown(e)},r.onDropdownIndicatorTouchEnd=function(e){r.userIsDragging||r.onDropdownIndicatorMouseDown(e)},r.handleInputChange=function(e){var t=e.currentTarget.value;r.inputIsHiddenAfterUpdate=!1,r.onInputChange(t,{action:"input-change"}),r.props.menuIsOpen||r.onMenuOpen()},r.onInputFocus=function(e){var t=r.props,n=t.isSearchable,a=t.isMulti;r.props.onFocus&&r.props.onFocus(e),r.inputIsHiddenAfterUpdate=!1,r.announceAriaLiveContext({event:"input",context:{isSearchable:n,isMulti:a}}),r.setState({isFocused:!0}),(r.openAfterFocus||r.props.openMenuOnFocus)&&r.openMenu("first"),r.openAfterFocus=!1},r.onInputBlur=function(e){r.menuListRef&&r.menuListRef.contains(document.activeElement)?r.inputRef.focus():(r.props.onBlur&&r.props.onBlur(e),r.onInputChange("",{action:"input-blur"}),r.onMenuClose(),r.setState({focusedValue:null,isFocused:!1}))},r.onOptionHover=function(e){r.blockOptionHover||r.state.focusedOption===e||r.setState({focusedOption:e})},r.shouldHideSelectedOptions=function(){var e=r.props,t=e.hideSelectedOptions,n=e.isMulti;return void 0===t?n:t},r.onKeyDown=function(e){var t=r.props,n=t.isMulti,a=t.backspaceRemovesValue,o=t.escapeClearsValue,i=t.inputValue,l=t.isClearable,c=t.isDisabled,u=t.menuIsOpen,s=t.onKeyDown,f=t.tabSelectsValue,p=t.openMenuOnFocus,d=r.state,m=d.focusedOption,h=d.focusedValue,y=d.selectValue;if(!(c||"function"==typeof s&&(s(e),e.defaultPrevented))){switch(r.blockOptionHover=!0,e.key){case"ArrowLeft":if(!n||i)return;r.focusValue("previous");break;case"ArrowRight":if(!n||i)return;r.focusValue("next");break;case"Delete":case"Backspace":if(i)return;if(h)r.removeValue(h);else{if(!a)return;n?r.popValue():l&&r.clearValue()}break;case"Tab":if(r.isComposing)return;if(e.shiftKey||!u||!f||!m||p&&r.isOptionSelected(m,y))return;r.selectOption(m);break;case"Enter":if(229===e.keyCode)break;if(u){if(!m)return;if(r.isComposing)return;r.selectOption(m);break}return;case"Escape":u?(r.inputIsHiddenAfterUpdate=!1,r.onInputChange("",{action:"menu-close"}),r.onMenuClose()):l&&o&&r.clearValue();break;case" ":if(i)return;if(!u){r.openMenu("first");break}if(!m)return;r.selectOption(m);break;case"ArrowUp":u?r.focusOption("up"):r.openMenu("last");break;case"ArrowDown":u?r.focusOption("down"):r.openMenu("first");break;case"PageUp":if(!u)return;r.focusOption("pageup");break;case"PageDown":if(!u)return;r.focusOption("pagedown");break;case"Home":if(!u)return;r.focusOption("first");break;case"End":if(!u)return;r.focusOption("last");break;default:return}e.preventDefault()}},r.buildMenuOptions=function(e,t){var n=e.inputValue,a=void 0===n?"":n,o=e.options,i=function(e,n){var o=r.isOptionDisabled(e,t),i=r.isOptionSelected(e,t),l=r.getOptionLabel(e),c=r.getOptionValue(e);if(!(r.shouldHideSelectedOptions()&&i||!r.filterOption({label:l,value:c,data:e},a))){var u=o?void 0:function(){return r.onOptionHover(e)},s=o?void 0:function(){return r.selectOption(e)},f="".concat(r.getElementId("option"),"-").concat(n);return{innerProps:{id:f,onClick:s,onMouseMove:u,onMouseOver:u,tabIndex:-1},data:e,isDisabled:o,isSelected:i,key:f,label:l,type:"option",value:c}}};return o.reduce((function(e,t,n){if(t.options){r.hasGroups||(r.hasGroups=!0);var a=t.options.map((function(t,r){var a=i(t,"".concat(n,"-").concat(r));return a&&e.focusable.push(t),a})).filter(Boolean);if(a.length){var o="".concat(r.getElementId("group"),"-").concat(n);e.render.push({type:"group",key:o,data:t,options:a})}}else{var l=i(t,"".concat(n));l&&(e.render.push(l),e.focusable.push(t))}return e}),{render:[],focusable:[]})};var a=e.value;r.cacheComponents=Sr(r.cacheComponents,ia).bind(wr(r)),r.cacheComponents(e.components),r.instancePrefix="react-select-"+(r.props.instanceId||++wo);var o=Mr(a);r.buildMenuOptions=Sr(r.buildMenuOptions,(function(e,t){var n=Pr(e,2),r=n[0],a=n[1],o=Pr(t,2),i=o[0];return ia(a,o[1])&&ia(r.inputValue,i.inputValue)&&ia(r.options,i.options)})).bind(wr(r));var i=e.menuIsOpen?r.buildMenuOptions(e,o):{render:[],focusable:[]};return r.state.menuOptions=i,r.state.selectValue=o,r}return yr(n,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput()}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){var t=this.props,n=t.options,r=t.value,a=t.menuIsOpen,o=t.inputValue;if(this.cacheComponents(e.components),e.value!==r||e.options!==n||e.menuIsOpen!==a||e.inputValue!==o){var i=Mr(e.value),l=e.menuIsOpen?this.buildMenuOptions(e,i):{render:[],focusable:[]},c=this.getNextFocusedValue(i),u=this.getNextFocusedOption(l.focusable);this.setState({menuOptions:l,selectValue:i,focusedOption:u,focusedValue:c})}null!=this.inputIsHiddenAfterUpdate&&(this.setState({inputIsHidden:this.inputIsHiddenAfterUpdate}),delete this.inputIsHiddenAfterUpdate)}},{key:"componentDidUpdate",value:function(e){var t,n,r,a,o,i=this.props,l=i.isDisabled,c=i.menuIsOpen,u=this.state.isFocused;(u&&!l&&e.isDisabled||u&&c&&!e.menuIsOpen)&&this.focusInput(),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(t=this.menuListRef,n=this.focusedOptionRef,r=t.getBoundingClientRect(),a=n.getBoundingClientRect(),o=n.offsetHeight/3,a.bottom+o>r.bottom?Ur(t,Math.min(n.offsetTop+n.clientHeight-t.offsetHeight+o,t.scrollHeight)):a.top-o<r.top&&Ur(t,Math.max(n.offsetTop-o,0)),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){var e=this.props,t=e.isSearchable,n=e.isMulti;this.announceAriaLiveContext({event:"input",context:{isSearchable:t,isMulti:n}}),this.onInputChange("",{action:"menu-close"}),this.props.onMenuClose()}},{key:"onInputChange",value:function(e,t){this.props.onInputChange(e,t)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(e){var t=this,n=this.state,r=n.selectValue,a=n.isFocused,o=this.buildMenuOptions(this.props,r),i=this.props.isMulti,l="first"===e?0:o.focusable.length-1;if(!i){var c=o.focusable.indexOf(r[0]);c>-1&&(l=c)}this.scrollToFocusedOptionOnUpdate=!(a&&this.menuListRef),this.inputIsHiddenAfterUpdate=!1,this.setState({menuOptions:o,focusedValue:null,focusedOption:o.focusable[l]},(function(){t.onMenuOpen(),t.announceAriaLiveContext({event:"menu"})}))}},{key:"focusValue",value:function(e){var t=this.props,n=t.isMulti,r=t.isSearchable,a=this.state,o=a.selectValue,i=a.focusedValue;if(n){this.setState({focusedOption:null});var l=o.indexOf(i);i||(l=-1,this.announceAriaLiveContext({event:"value"}));var c=o.length-1,u=-1;if(o.length){switch(e){case"previous":u=0===l?0:-1===l?c:l-1;break;case"next":l>-1&&l<c&&(u=l+1)}-1===u&&this.announceAriaLiveContext({event:"input",context:{isSearchable:r,isMulti:n}}),this.setState({inputIsHidden:-1!==u,focusedValue:o[u]})}}}},{key:"focusOption",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"first",t=this.props.pageSize,n=this.state,r=n.focusedOption,a=n.menuOptions,o=a.focusable;if(o.length){var i=0,l=o.indexOf(r);r||(l=-1,this.announceAriaLiveContext({event:"menu"})),"up"===e?i=l>0?l-1:o.length-1:"down"===e?i=(l+1)%o.length:"pageup"===e?(i=l-t)<0&&(i=0):"pagedown"===e?(i=l+t)>o.length-1&&(i=o.length-1):"last"===e&&(i=o.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:o[i],focusedValue:null}),this.announceAriaLiveContext({event:"menu",context:{isDisabled:fo(o[i])}})}}},{key:"getTheme",value:function(){return this.props.theme?"function"==typeof this.props.theme?this.props.theme(mo):yo(yo({},mo),this.props.theme):mo}},{key:"getCommonProps",value:function(){var e=this.clearValue,t=this.getStyles,n=this.setValue,r=this.selectOption,a=this.props,o=a.classNamePrefix,i=a.isMulti,l=a.isRtl,c=a.options,u=this.state.selectValue,s=this.hasValue();return{cx:Rr.bind(null,o),clearValue:e,getStyles:t,getValue:function(){return u},hasValue:s,isMulti:i,isRtl:l,options:c,selectOption:r,setValue:n,selectProps:a,theme:this.getTheme()}}},{key:"getNextFocusedValue",value:function(e){if(this.clearFocusValueOnUpdate)return this.clearFocusValueOnUpdate=!1,null;var t=this.state,n=t.focusedValue,r=t.selectValue.indexOf(n);if(r>-1){if(e.indexOf(n)>-1)return n;if(r<e.length)return e[r]}return null}},{key:"getNextFocusedOption",value:function(e){var t=this.state.focusedOption;return t&&e.indexOf(t)>-1?t:e[0]}},{key:"hasValue",value:function(){return this.state.selectValue.length>0}},{key:"hasOptions",value:function(){return!!this.state.menuOptions.render.length}},{key:"countOptions",value:function(){return this.state.menuOptions.focusable.length}},{key:"isClearable",value:function(){var e=this.props,t=e.isClearable,n=e.isMulti;return void 0===t?n:t}},{key:"isOptionDisabled",value:function(e,t){return"function"==typeof this.props.isOptionDisabled&&this.props.isOptionDisabled(e,t)}},{key:"isOptionSelected",value:function(e,t){var n=this;if(t.indexOf(e)>-1)return!0;if("function"==typeof this.props.isOptionSelected)return this.props.isOptionSelected(e,t);var r=this.getOptionValue(e);return t.some((function(e){return n.getOptionValue(e)===r}))}},{key:"filterOption",value:function(e,t){return!this.props.filterOption||this.props.filterOption(e,t)}},{key:"formatOptionLabel",value:function(e,t){if("function"==typeof this.props.formatOptionLabel){var n=this.props.inputValue,r=this.state.selectValue;return this.props.formatOptionLabel(e,{context:t,inputValue:n,selectValue:r})}return this.getOptionLabel(e)}},{key:"formatGroupLabel",value:function(e){return this.props.formatGroupLabel(e)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"constructAriaLiveMessage",value:function(){var e=this.state,t=e.ariaLiveContext,n=e.selectValue,r=e.focusedValue,a=e.focusedOption,o=this.props,i=o.options,l=o.menuIsOpen,c=o.inputValue,u=o.screenReaderStatus,s=r?function(e){var t=e.focusedValue,n=e.getOptionLabel,r=e.selectValue;return"value ".concat(n(t)," focused, ").concat(r.indexOf(t)+1," of ").concat(r.length,".")}({focusedValue:r,getOptionLabel:this.getOptionLabel,selectValue:n}):"",f=a&&l?function(e){var t=e.focusedOption,n=e.getOptionLabel,r=e.options;return"option ".concat(n(t)," focused").concat(t.isDisabled?" disabled":"",", ").concat(r.indexOf(t)+1," of ").concat(r.length,".")}({focusedOption:a,getOptionLabel:this.getOptionLabel,options:i}):"",p=function(e){var t=e.inputValue,n=e.screenReaderMessage;return"".concat(n).concat(t?" for search term "+t:"",".")}({inputValue:c,screenReaderMessage:u({count:this.countOptions()})});return"".concat(s," ").concat(f," ").concat(p," ").concat(t)}},{key:"renderInput",value:function(){var e=this.props,t=e.isDisabled,n=e.isSearchable,r=e.inputId,a=e.inputValue,o=e.tabIndex,l=e.form,c=this.components.Input,u=this.state.inputIsHidden,f=r||this.getElementId("input"),p={"aria-autocomplete":"list","aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"]};if(!n)return i.a.createElement(Ha,s({id:f,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:Lr,onFocus:this.onInputFocus,readOnly:!0,disabled:t,tabIndex:o,form:l,value:""},p));var d=this.commonProps,m=d.cx,h=d.theme,y=d.selectProps;return i.a.createElement(c,s({autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",cx:m,getStyles:this.getStyles,id:f,innerRef:this.getInputRef,isDisabled:t,isHidden:u,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,selectProps:y,spellCheck:"false",tabIndex:o,form:l,theme:h,type:"text",value:a},p))}},{key:"renderPlaceholderOrValue",value:function(){var e=this,t=this.components,n=t.MultiValue,r=t.MultiValueContainer,a=t.MultiValueLabel,o=t.MultiValueRemove,l=t.SingleValue,c=t.Placeholder,u=this.commonProps,f=this.props,p=f.controlShouldRenderValue,d=f.isDisabled,m=f.isMulti,h=f.inputValue,y=f.placeholder,g=this.state,v=g.selectValue,b=g.focusedValue,w=g.isFocused;if(!this.hasValue()||!p)return h?null:i.a.createElement(c,s({},u,{key:"placeholder",isDisabled:d,isFocused:w}),y);if(m)return v.map((function(t,l){var c=t===b;return i.a.createElement(n,s({},u,{components:{Container:r,Label:a,Remove:o},isFocused:c,isDisabled:d,key:e.getOptionValue(t),index:l,removeProps:{onClick:function(){return e.removeValue(t)},onTouchEnd:function(){return e.removeValue(t)},onMouseDown:function(e){e.preventDefault(),e.stopPropagation()}},data:t}),e.formatOptionLabel(t,"value"))}));if(h)return null;var E=v[0];return i.a.createElement(l,s({},u,{data:E,isDisabled:d}),this.formatOptionLabel(E,"value"))}},{key:"renderClearIndicator",value:function(){var e=this.components.ClearIndicator,t=this.commonProps,n=this.props,r=n.isDisabled,a=n.isLoading,o=this.state.isFocused;if(!this.isClearable()||!e||r||!this.hasValue()||a)return null;var l={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return i.a.createElement(e,s({},t,{innerProps:l,isFocused:o}))}},{key:"renderLoadingIndicator",value:function(){var e=this.components.LoadingIndicator,t=this.commonProps,n=this.props,r=n.isDisabled,a=n.isLoading,o=this.state.isFocused;if(!e||!a)return null;return i.a.createElement(e,s({},t,{innerProps:{"aria-hidden":"true"},isDisabled:r,isFocused:o}))}},{key:"renderIndicatorSeparator",value:function(){var e=this.components,t=e.DropdownIndicator,n=e.IndicatorSeparator;if(!t||!n)return null;var r=this.commonProps,a=this.props.isDisabled,o=this.state.isFocused;return i.a.createElement(n,s({},r,{isDisabled:a,isFocused:o}))}},{key:"renderDropdownIndicator",value:function(){var e=this.components.DropdownIndicator;if(!e)return null;var t=this.commonProps,n=this.props.isDisabled,r=this.state.isFocused,a={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return i.a.createElement(e,s({},t,{innerProps:a,isDisabled:n,isFocused:r}))}},{key:"renderMenu",value:function(){var e=this,t=this.components,n=t.Group,r=t.GroupHeading,a=t.Menu,o=t.MenuList,l=t.MenuPortal,c=t.LoadingMessage,u=t.NoOptionsMessage,f=t.Option,p=this.commonProps,d=this.state,m=d.focusedOption,h=d.menuOptions,y=this.props,g=y.captureMenuScroll,v=y.inputValue,b=y.isLoading,w=y.loadingMessage,E=y.minMenuHeight,O=y.maxMenuHeight,k=y.menuIsOpen,S=y.menuPlacement,x=y.menuPosition,_=y.menuPortalTarget,j=y.menuShouldBlockScroll,P=y.menuShouldScrollIntoView,C=y.noOptionsMessage,T=y.onMenuScrollToTop,A=y.onMenuScrollToBottom;if(!k)return null;var N,I=function(t){var n=m===t.data;return t.innerRef=n?e.getFocusedOptionRef:void 0,i.a.createElement(f,s({},p,t,{isFocused:n}),e.formatOptionLabel(t.data,"menu"))};if(this.hasOptions())N=h.render.map((function(t){if("group"===t.type){t.type;var a=_r(t,["type"]),o="".concat(t.key,"-heading");return i.a.createElement(n,s({},p,a,{Heading:r,headingProps:{id:o},label:e.formatGroupLabel(t.data)}),t.options.map((function(e){return I(e)})))}if("option"===t.type)return I(t)}));else if(b){var L=w({inputValue:v});if(null===L)return null;N=i.a.createElement(c,p,L)}else{var D=C({inputValue:v});if(null===D)return null;N=i.a.createElement(u,p,D)}var R={minMenuHeight:E,maxMenuHeight:O,menuPlacement:S,menuPosition:x,menuShouldScrollIntoView:P},M=i.a.createElement(Yr,s({},p,R),(function(t){var n=t.ref,r=t.placerProps,l=r.placement,c=r.maxHeight;return i.a.createElement(a,s({},p,R,{innerRef:n,innerProps:{onMouseDown:e.onMenuMouseDown,onMouseMove:e.onMenuMouseMove},isLoading:b,placement:l}),i.a.createElement(co,{isEnabled:g,onTopArrive:T,onBottomArrive:A},i.a.createElement(oo,{isEnabled:j},i.a.createElement(o,s({},p,{innerRef:e.getMenuListRef,isLoading:b,maxHeight:c}),N))))}));return _||"fixed"===x?i.a.createElement(l,s({},p,{appendTo:_,controlElement:this.controlRef,menuPlacement:S,menuPosition:x}),M):M}},{key:"renderFormField",value:function(){var e=this,t=this.props,n=t.delimiter,r=t.isDisabled,a=t.isMulti,o=t.name,l=this.state.selectValue;if(o&&!r){if(a){if(n){var c=l.map((function(t){return e.getOptionValue(t)})).join(n);return i.a.createElement("input",{name:o,type:"hidden",value:c})}var u=l.length>0?l.map((function(t,n){return i.a.createElement("input",{key:"i-".concat(n),name:o,type:"hidden",value:e.getOptionValue(t)})})):i.a.createElement("input",{name:o,type:"hidden"});return i.a.createElement("div",null,u)}var s=l[0]?this.getOptionValue(l[0]):"";return i.a.createElement("input",{name:o,type:"hidden",value:s})}}},{key:"renderLiveRegion",value:function(){return this.state.isFocused?i.a.createElement(Wa,{"aria-live":"polite"},i.a.createElement("span",{id:"aria-selection-event"}," ",this.state.ariaLiveSelection),i.a.createElement("span",{id:"aria-context"}," ",this.constructAriaLiveMessage())):null}},{key:"render",value:function(){var e=this.components,t=e.Control,n=e.IndicatorsContainer,r=e.SelectContainer,a=e.ValueContainer,o=this.props,l=o.className,c=o.id,u=o.isDisabled,f=o.menuIsOpen,p=this.state.isFocused,d=this.commonProps=this.getCommonProps();return i.a.createElement(r,s({},d,{className:l,innerProps:{id:c,onKeyDown:this.onKeyDown},isDisabled:u,isFocused:p}),this.renderLiveRegion(),i.a.createElement(t,s({},d,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:u,isFocused:p,menuIsOpen:f}),i.a.createElement(a,s({},d,{isDisabled:u}),this.renderPlaceholderOrValue(),this.renderInput()),i.a.createElement(n,s({},d,{isDisabled:u}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}]),n}(o.Component);Eo.defaultProps=bo;n(84);function Oo(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Or(e);if(t){var a=Or(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Er(this,n)}}var ko={defaultInputValue:"",defaultMenuIsOpen:!1,defaultValue:null},So=n(20);function xo(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Or(e);if(t){var a=Or(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Er(this,n)}}o.Component;var _o,jo,Po,Co=(_o=Eo,Po=jo=function(e){vr(n,e);var t=Oo(n);function n(){var e;mr(this,n);for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];return(e=t.call.apply(t,[this].concat(a))).select=void 0,e.state={inputValue:void 0!==e.props.inputValue?e.props.inputValue:e.props.defaultInputValue,menuIsOpen:void 0!==e.props.menuIsOpen?e.props.menuIsOpen:e.props.defaultMenuIsOpen,value:void 0!==e.props.value?e.props.value:e.props.defaultValue},e.onChange=function(t,n){e.callProp("onChange",t,n),e.setState({value:t})},e.onInputChange=function(t,n){var r=e.callProp("onInputChange",t,n);e.setState({inputValue:void 0!==r?r:t})},e.onMenuOpen=function(){e.callProp("onMenuOpen"),e.setState({menuIsOpen:!0})},e.onMenuClose=function(){e.callProp("onMenuClose"),e.setState({menuIsOpen:!1})},e}return yr(n,[{key:"focus",value:function(){this.select.focus()}},{key:"blur",value:function(){this.select.blur()}},{key:"getProp",value:function(e){return void 0!==this.props[e]?this.props[e]:this.state[e]}},{key:"callProp",value:function(e){if("function"==typeof this.props[e]){for(var t,n=arguments.length,r=new Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];return(t=this.props)[e].apply(t,r)}}},{key:"render",value:function(){var e=this,t=this.props,n=(t.defaultInputValue,t.defaultMenuIsOpen,t.defaultValue,_r(t,["defaultInputValue","defaultMenuIsOpen","defaultValue"]));return i.a.createElement(_o,s({},n,{ref:function(t){e.select=t},inputValue:this.getProp("inputValue"),menuIsOpen:this.getProp("menuIsOpen"),onChange:this.onChange,onInputChange:this.onInputChange,onMenuClose:this.onMenuClose,onMenuOpen:this.onMenuOpen,value:this.getProp("value")}))}}]),n}(o.Component),jo.defaultProps=ko,Po);function To(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Ao(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ao(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ao(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var No=wp.i18n.__,Io=tt((function(e){return{currentPath:e.common.currentPath,platform:e.common.platform}}))((function(e){var t=ie(V),n=[{value:"pages",label:i.a.createElement(i.a.Fragment,null,i.a.createElement("span",{className:"tswitcher-icon tswitch-pages"}),No("Pages","templately"))},{value:"blocks",label:i.a.createElement(i.a.Fragment,null,i.a.createElement("span",{className:"tswitcher-icon tswitch-blocks"}),No("Blocks","templately"))},{value:"",label:i.a.createElement(i.a.Fragment,null,i.a.createElement("span",{className:"tswitcher-icon tswitch-packs"}),No("Packs","templately"))},{value:"templates",label:i.a.createElement(i.a.Fragment,null,i.a.createElement("span",{className:"tswitcher-icon tswitch-templates"}),No("Templates","templately"))},{value:"clouds",label:i.a.createElement(i.a.Fragment,null,i.a.createElement("span",{className:"tswitcher-icon tswitch-myclouds"}),No("My Clouds","templately"))}],r=To(Object(o.useState)({value:"blocks",label:i.a.createElement(i.a.Fragment,null,i.a.createElement("span",{className:"tswitcher-icon tswitch-blocks"}),No("Blocks","templately"))}),2),a=r[0],l=r[1];Object(o.useEffect)((function(){for(var e=window.location.href.replace(/^.*\/+/,""),t=i.a.createElement(i.a.Fragment,null,i.a.createElement("span",{className:"tswitcher-icon tswitch-pages"}),No("Packs","templately")),r="",a=0;a<n.length;a++)if(n[a].value===e){r=n[a].value,t=n[a].label;break}l({value:r,label:t})}),[]);return i.a.createElement(i.a.Fragment,null,i.a.createElement("div",{className:"templately-modal-menu"},i.a.createElement("ul",null,"gutenberg"!==e.platform&&i.a.createElement(dr,{to:"/pages",name:No("Pages","templately")}),i.a.createElement(dr,{to:"gutenberg"===e.platform?"/":"/blocks",name:No("Blocks","templately")}),"gutenberg"!==e.platform&&i.a.createElement(dr,{to:"/",name:No("Packs","templately")}),"gutenberg"!==e.platform&&i.a.createElement(dr,{to:"/templates",name:No("Templates","templately")}),i.a.createElement(dr,{className:"efy-clouds-nav",to:"/clouds",name:No("My Cloud","templately")},i.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:"30",height:"30",viewBox:"0 0 30 30"},i.a.createElement("rect",{width:"30",height:"30",fill:"#2fc1e1",rx:"15"}),i.a.createElement("image",{width:"17",height:"12",x:"7",y:"9",xlinkHref:"data:img/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAMCAYAAACEJVa/AAAA4UlEQVQokZ3SsSuFcRTG8efKZJXU3QyY3MHkP7AoEwZlUTYZzP4Co0E2i3/AwiqlbMwGiUW3FCUy+OjNew2398177zOe8/y+nXOeX6qEddz51RN20Ko01wA20MUqJrCIe+wNAnnAUl+tg3eM/fd4Epv4wkhF/xFXWKkD7OKjNJ3UeBawhRcs9zfX8Iz5husWR74tgeO94k2RRhNA6Z/DAS7KADpF8fuPOKCKxHCZ8upTQ0LaxRBFCmdJtoeBJGkneW1hOsl1kuMkh0m6DQGzSY6SnPfGmsEpPsuv3kRv2MfoD02ICAa3FEOHAAAAAElFTkSuQmCC"}))))),i.a.createElement("div",{className:"templately-modal-mobile-menu"},i.a.createElement(Co,{options:n,classNamePrefix:"templately-switcher",onChange:function(n){return function(n){t.push("/"+n.value),l({value:n.value,label:n.label}),e.dispatch(Wn(null)),e.dispatch(Bn(!0)),e.dispatch(tr(null)),e.dispatch(Zn(e.to)),e.dispatch(zn({isOpen:!1,deep:0})),e.dispatch(Hn({activeSidebarMenu:"all",activeParentSidebarMenu:""})),e.dispatch(qn([])),e.dispatch($n([])),e.dispatch(Qn(1)),e.dispatch(Gn(!1))}(n)},value:a,isSearchable:!1})))})),Lo=n(4),Do=n.n(Lo),Ro={open:function(e){c.a.render(e,document.getElementById("templately-gutenberg"))},close:function(){c.a.unmountComponentAtNode(document.getElementById("templately-gutenberg"))}};function Mo(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Fo(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Fo(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Fo(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var zo=wp.i18n.__,Uo=tt((function(e){return{searchQuery:e.common.searchQuery.query,results:e.common.searchQuery.results}}))((function(e){ce().query;var t=Mo(Object(o.useState)(e.searchQuery),2),n=t[0],r=t[1],a=Mo(Object(o.useState)(!1),2),l=a[0],c=a[1];return Object(o.useEffect)((function(){l&&n.length>0&&(e.dispatch(Zn("/search/".concat(n))),e.dispatch(nr({query:n,isSearching:!0,results:e.results})),c(!1))}),[l]),Object(o.useEffect)((function(){e.dispatch(nr({query:n,isSearching:!1,results:e.results}))}),[n]),i.a.createElement("div",{className:"templately-search-action"},i.a.createElement("input",{type:"text",onKeyDown:function(e){return c(13===e.keyCode)},value:e.searchQuery,onChange:function(e){return r(e.currentTarget.value)},placeholder:zo("Search...","templately")}))}));function Bo(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Vo(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Vo(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Vo(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Wo=tt((function(e){return{platform:e.common.platform}}))((function(e){var t=Bo(Object(o.useState)([{value:"elementor",label:i.a.createElement(i.a.Fragment,null,i.a.createElement("span",{className:"tswitcher-icon tswitch-elementor"}),"Elementor")},{value:"gutenberg",label:i.a.createElement(i.a.Fragment,null,i.a.createElement("span",{className:"tswitcher-icon tswitch-gutenberg"}),"Gutenberg")}]),2),n=t[0],r=(t[1],Bo(Object(o.useState)({value:"elementor",label:i.a.createElement(i.a.Fragment,null,i.a.createElement("span",{className:"tswitcher-icon tswitch-elementor"}),"Elementor")}),2)),a=r[0],l=r[1];return Object(o.useEffect)((function(){e.dispatch({type:"SET_PLATFORM",payload:a.value}),e.dispatch(Qn(1))}),[a]),i.a.createElement(Co,{options:n,classNamePrefix:"templately-switcher",onChange:function(e){return l(e)},value:a,isSearchable:!1})})),Ho=n(8),$o=n.n(Ho),qo=n(52),Ko=n.n(qo);function Qo(e,t,n,r,a,o,i){try{var l=e[o](i),c=l.value}catch(e){return void n(e)}l.done?t(c):Promise.resolve(c).then(r,a)}function Go(e){return(Go="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Yo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Xo(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Yo(Object(n),!0).forEach((function(t){Jo(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Yo(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Jo(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Zo=n(101),ei=Ko()($o.a),ti=TemplatelyAdmin,ni=ti.platform,ri=ti.post_id,ai=ti.nonce,oi=ti.is_editor,ii=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={heightAuto:!1,customClass:{container:"templately-swal"},showConfirmButton:!1};if("string"==typeof e){var r=e;n=Xo(Xo({},n),{},{text:r})}else{var a=e;n=Xo(Xo({},n),{},{html:a})}return t=t!={}?Xo(Xo({},n),t):n,ei.fire(t)},li=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"remote",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r={fileType:"elementor"};n=Xo(Xo({},r),n);var a=new FormData;a.append("action","get_templately"),a.append("content_type","template_content"),a.append("nonce",ai),a.append("source",t),a.append("id",e),void 0!==n.fileType&&a.append("file_type",n.fileType),void 0!==n.is_editor&&a.append("is_editor",n.is_editor);var o=n.fileType;return Do.a.post(ajaxurl,a).then((function(e){if("elementor"===o){if(e.data.success&&e.data.hasOwnProperty("data")){if("undefined"!=typeof elementor){var t=window.TemplatelyIndex;if("undefined"!=typeof $e)for(var n=0;n<e.data.data.content.length;n++)$e.run("document/elements/create",{container:elementor.getPreviewContainer(),model:e.data.data.content[n],options:t>=0?{at:t++}:{}});else{var r=new Backbone.Model({getTitle:function(){return"Test"}});elementor.channels.data.trigger("template:before:insert",r);for(var a=window.TemplatelyIndex,i=0;i<e.data.data.content.length;i++)elementor.getPreviewView().addChildElement(e.data.data.content[i],a>=0?{at:a++}:null);elementor.channels.data.trigger("template:after:insert",{})}}return!0}return e}if("gutenberg"===o){var l=wp.blocks.parse,c=wp.data.dispatch("core/block-editor").insertBlocks;return e.data.success&&e.data.hasOwnProperty("data")?(c(l(e.data.data.content)),!0):e}})).catch((function(e){return console.error("Insert Error: ",e)}))},ci=function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=new FormData;o.append("action","get_templately"),o.append("content_type","save_template"),o.append("nonce",ai),n=r.model?r.model.get("elType"):elementor.config.document.library&&elementor.config.document.library.save_as_same_type?elementor.config.document.type:"page",t=r.hasOwnProperty("model")?[r.model.toJSON({remove:["default"]})]:elementor.elements.toJSON({remove:["default"]}),o.append("content",JSON.stringify(t)),o.append("source","local"),o.append("type",n),o.append("title",e),o.append("post_id",ri);var i="templately"===ni?"elementor":ni;return o.append("file_type",i),null!=a.thumbnail&&o.append("thumbnail",a.thumbnail),null!=a.workspace_id&&(o.append("workspace_id",a.workspace_id),o.append("workspaceActivity",a.workspaceActivity)),Do.a.post(ajaxurl,o).then((function(e){return e})).catch((function(e){return e}))},ui=function(e){window.open(e,"_blank"),window.focus()},si=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"set_favourite",r=new FormData;return r.append("action","get_templately"),r.append("content_type",n),r.append("nonce",ai),r.append("id",e),r.append("type",t),Do.a.post(ajaxurl,r).then((function(e){return e})).catch((function(e){return"Something went wrong."}))},fi=function(e,t){for(var n=0,r=0;r<t.length;r++)if(t[r].id===e){n=t[r].count;break}return n},pi=function(e,t){return t.filter((function(t){return t.id!=e}))},di=function(e,t){for(var n=!1,r=0;r<t.length;r++)if(t[r].template_id===e){n=!0;break}return n},mi=function(e){return/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(String(e).toLowerCase())},hi=function(e){var t={elementor:"https://assets.templately.com/frontend/Elementor.png",gutenberg:"https://assets.templately.com/frontend/Gutenberg.png"};return t.hasOwnProperty(e)&&t[e]},yi=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r={page:-1};n=Xo(Xo({},r),n);var a=new FormData;if(a.append("action","get_templately"),a.append("content_type","get_workspace"),void 0!==n.page&&a.append("pagenum",n.page),void 0!==n.per_page&&a.append("per_page",n.per_page),!0===e&&a.append("shared",!0),a.append("nonce",ai),t)return Do.a.post(ajaxurl,a).then((function(e){return e}));var o={};return null!=n.cancelToken&&(o.cancelToken=n.cancelToken),Do.a.post(ajaxurl,a,o).then((function(e){return e.data.success?e.data.data.data:e.data.data})).catch((function(e){return console.error("Error Getting WorkSpace List: ",e)}))},gi=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=[];return null!=e&&e.length>0&&"object"==Go(e)&&e.map((function(e){n.push({value:e.id,slug:e.slug,label:e.name,shared:t})})),n},vi=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=new FormData;return t.append("action","get_templately"),t.append("content_type","clouds_sync"),null!=e.per_page&&t.append("per_page",e.per_page),null!=e.page&&t.append("page",e.page),null!=e.platform&&t.append("fileType",e.platform),null!=e.search&&t.append("search",e.search),t.append("nonce",ai),Do.a.post(ajaxurl,t).then((function(e){return e})).catch((function(e){return e}))},bi=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=new FormData;return n.append("action","get_templately"),n.append("content_type","workspace_details"),n.append("slug",e),null!=t.per_page&&n.append("per_page",t.per_page),null!=t.page&&n.append("page",t.page),null!=t.search&&n.append("search",t.search),null!=t.platform&&n.append("file_type",t.platform),n.append("nonce",ai),Do.a.post(ajaxurl,n).then((function(e){return e})).catch((function(e){return e}))},wi=function(){var e,t=(e=regeneratorRuntime.mark((function e(){var t,n,r=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=r.length>0&&void 0!==r[0]?r[0]:{},r.length>1&&void 0!==r[1]&&r[1],null!=t.slug){e.next=4;break}return e.abrupt("return",{success:!1,loading:!1,error:!0,data:{errorMessage:"Something errormessage."}});case 4:return(n=new FormData).append("action","get_templately"),n.append("nonce",ai),n.append("content_type","install_requirements"),n.append("requirements",JSON.stringify(t)),e.next=11,Do.a.post(ajaxurl,n).then((function(e){return e.data.data.hasOwnProperty("success")&&e.data.data.success?{success:!0,loading:!1,error:!1}:{success:!1,loading:!1,error:!0,data:{errorMessage:"Something went wrong."}}})).catch((function(e){return{loading:!1,error:!0,data:{errorMessage:e.response}}}));case 11:return e.abrupt("return",e.sent);case 12:case"end":return e.stop()}}),e)})),function(){var t=this,n=arguments;return new Promise((function(r,a){var o=e.apply(t,n);function i(e){Qo(o,r,a,i,l,"next",e)}function l(e){Qo(o,r,a,i,l,"throw",e)}i(void 0)}))});return function(){return t.apply(this,arguments)}}(),Ei=function(e){if(e.length<8)return!1;return!!(/[A-Z]/g.test(e)&&/[a-z]/g.test(e)&&/[0-9]/g.test(e))};function Oi(e){return(Oi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var ki=function(e){return i.a.createElement("div",{className:"templately-modal-message ".concat(void 0!==e.className&&e.className)},e.icon&&e.icon,e.title&&i.a.createElement("h3",null," ",e.title," "),i.a.createElement("div",{className:"tmm-body"},"string"==typeof e.content&&i.a.createElement("p",null,e.content),"object"===Oi(e.content)&&e.content))};function Si(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return xi(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return xi(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function xi(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var _i=TemplatelyAdmin,ji=_i.nonce,Pi=_i.is_editor,Ci=_i.platform,Ti=wp.i18n.__,Ai=tt((function(e){return{preview:e.preview,items:e.items,packs:e.packs,errors:e.errors,successText:e.common.successText,user:e.admin.user}}))((function(e){var t=Si(Object(o.useState)(!1),2),n=t[0],r=t[1],a=Si(Object(o.useState)(!1),2),l=a[0],c=a[1],u=le();return Object(o.useEffect)((function(){n&&(e.dispatch(Dn([])),e.dispatch(Rn([])),e.dispatch(Fn([])),"elementor"===Ci&&window.TemplatelyModal.destroy(),"gutenberg"===Ci&&Ro.close(),r(!1))}),[n]),Object(o.useEffect)((function(){if(l){var t=new FormData;t.append("action","get_templately"),t.append("content_type","clouds_sync"),t.append("nonce",ji);var n="templately"===Ci?"elementor":Ci;Do.a.post(ajaxurl,t).then((function(t){if(200===t.status&&t.data.success){var r=t.data.data.data.filter((function(e){return n===e.file_type}));e.dispatch(Fn({current_page:t.data.data.current_page,data:r,total_page:t.data.data.total_page,platform:e.platform})),ii("",{icon:"success",timer:1500,html:i.a.createElement(ki,{title:"Successfully Synced",content:i.a.createElement("p",null,Ti("Your Cloud is Successfully Synced with Your Templately Account.","templately"))})})}})).catch((function(e){return console.error("Sync Error From Actions: ",e)})),c(!1)}}),[l]),i.a.createElement("div",{className:"templately-modal-action-button"},"templately"===Ci&&i.a.createElement(Wo,null),i.a.createElement(Uo,null),0!==e.user.length&&"/clouds"===u.pathname&&i.a.createElement("button",{className:"templately-button templately-cloud-sync",onClick:function(){return c(!0)}},i.a.createElement("svg",{width:"28px",viewBox:"0 0 512 338",xmlns:"http://www.w3.org/2000/svg"},i.a.createElement("g",{fill:"none"},i.a.createElement("path",{d:"m357.74 291.15c-85.88 0-155.499-69.619-155.499-155.499 0-47.336 21.156-89.725 54.523-118.245-20.397-11.367-43.345-17.35-66.911-17.35-75.901 0-137.65 61.75-137.65 137.65 0 3.896.167 7.81.497 11.709-32.323 17.257-52.7 50.784-52.7 88.042 0 55.056 44.792 99.848 99.848 99.848h259.212c49.056 0 89.963-35.561 98.296-82.259-26.981 22.537-61.712 36.104-99.616 36.104z",fill:"#a3b0c0"}),i.a.createElement("g",{id:"templatelySyncs",fill:"#6d7988",transform:"translate(260 22)"},i.a.createElement("path",{d:"m71.409 103.365c-5.149-.234-10.317-.044-16.028-.044.77-25.252 10.37-45.087 30.462-58.479 21.943-14.626 43.882-16.65 65.44-7.828l16.061-27.998c-19.512-8.663-43.811-11.42-64.794-5.614-49.805 13.781-75.191 48.182-79.428 99.25-2.572 0-4.796.005-7.02-.001-2.429-.007-4.861-.117-7.285-.02-7.518.303-10.035 4.264-6.208 10.621 9.825 16.317 19.826 32.532 30.05 48.601 4.071 6.399 9.574 6.356 13.822-.012 10.467-15.689 20.775-31.488 30.891-47.406 4.201-6.609 1.861-10.715-5.963-11.07z"}),i.a.createElement("path",{d:"m250.088 84.992c-9.643-15.988-19.451-31.88-29.423-47.666-4.464-7.066-9.893-7.168-14.476-.301-10.26 15.376-20.364 30.86-30.321 46.435-4.742 7.417-2.366 11.519 6.522 11.784 4.93.147 9.868.026 15.186.026-1.078 26.367-11.36 46.663-32.694 59.894-20.076 12.451-39.981 14.628-59.477 7.832l-16.036 27.955c19.301 8.094 39.797 9.856 61.332 4.011 49.675-13.483 74.817-48.093 79.01-98.99 4.881 0 9.533.111 14.178-.025 7.778-.228 10.221-4.288 6.199-10.955z"}))))),!Pi&&0!==e.user.length&&i.a.createElement(Z,{exact:e.exact||!0,path:"/settings",children:function(t){var n=t.match;return i.a.createElement("button",{className:n?"templately-active templately-button":"templately-button",onClick:function(e){return e.preventDefault()}},i.a.createElement(he,{className:e.className,onClick:function(){e.dispatch(zn({isOpen:!1,deep:0})),e.dispatch(Hn({activeSidebarMenu:"all",activeParentSidebarMenu:""})),e.dispatch(qn([])),e.dispatch($n([])),e.dispatch(Qn(1))},to:"/settings"},e.user.hasOwnProperty("profile_photo")&&""!=e.user.profile_photo?i.a.createElement("img",{src:e.user.profile_photo}):i.a.createElement(Pn,{color:"#a4b0c1"})))}}),("elementor"===Ci||"gutenberg"===Ci)&&i.a.createElement("button",{className:"templately-button templately-close",onClick:function(){return r(!0)}},i.a.createElement(_n,{color:"#a4b0c1"})))})),Ni=function(){return i.a.createElement("div",{className:"templately-modal-header"},i.a.createElement(pr,null),i.a.createElement(Io,null),i.a.createElement(Ai,null))},Ii=n(6),Li=n(12),Di=n.n(Li),Ri=n(1);var Mi=function(e){return"string"!=typeof e||""===e?(console.error("The namespace must be a non-empty string."),!1):!!/^[a-zA-Z][a-zA-Z0-9_.\-\/]*$/.test(e)||(console.error("The namespace can only contain numbers, letters, dashes, periods, underscores and slashes."),!1)};var Fi=function(e){return"string"!=typeof e||""===e?(console.error("The hook name must be a non-empty string."),!1):/^__/.test(e)?(console.error("The hook name cannot begin with `__`."),!1):!!/^[a-zA-Z][a-zA-Z0-9_.-]*$/.test(e)||(console.error("The hook name can only contain numbers, letters, dashes, periods and underscores."),!1)};var zi=function(e){return function(t,n,r){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:10;if(Fi(t)&&Mi(n))if("function"==typeof r)if("number"==typeof a){var o={callback:r,priority:a,namespace:n};if(e[t]){var i,l=e[t].handlers;for(i=l.length;i>0&&!(a>=l[i-1].priority);i--);i===l.length?l[i]=o:l.splice(i,0,o),(e.__current||[]).forEach((function(e){e.name===t&&e.currentIndex>=i&&e.currentIndex++}))}else e[t]={handlers:[o],runs:0};"hookAdded"!==t&&Ki("hookAdded",t,n,r,a)}else console.error("If specified, the hook priority must be a number.");else console.error("The hook callback must be a function.")}};var Ui=function(e,t){return function(n,r){if(Fi(n)&&(t||Mi(r))){if(!e[n])return 0;var a=0;if(t)a=e[n].handlers.length,e[n]={runs:e[n].runs,handlers:[]};else for(var o=e[n].handlers,i=function(t){o[t].namespace===r&&(o.splice(t,1),a++,(e.__current||[]).forEach((function(e){e.name===n&&e.currentIndex>=t&&e.currentIndex--})))},l=o.length-1;l>=0;l--)i(l);return"hookRemoved"!==n&&Ki("hookRemoved",n,r),a}}};var Bi=function(e){return function(t,n){return void 0!==n?t in e&&e[t].handlers.some((function(e){return e.namespace===n})):t in e}};var Vi=function(e,t){return function(n){e[n]||(e[n]={handlers:[],runs:0}),e[n].runs++;var r=e[n].handlers;for(var a=arguments.length,o=new Array(a>1?a-1:0),i=1;i<a;i++)o[i-1]=arguments[i];if(!r||!r.length)return t?o[0]:void 0;var l={name:n,currentIndex:0};for(e.__current.push(l);l.currentIndex<r.length;){var c=r[l.currentIndex],u=c.callback.apply(null,o);t&&(o[0]=u),l.currentIndex++}return e.__current.pop(),t?o[0]:void 0}};var Wi=function(e){return function(){return e.__current&&e.__current.length?e.__current[e.__current.length-1].name:null}};var Hi=function(e){return function(t){return void 0===t?void 0!==e.__current[0]:!!e.__current[0]&&t===e.__current[0].name}};var $i=function(e){return function(t){if(Fi(t))return e[t]&&e[t].runs?e[t].runs:0}};var qi=function(){var e=Object.create(null),t=Object.create(null);return e.__current=[],t.__current=[],{addAction:zi(e),addFilter:zi(t),removeAction:Ui(e),removeFilter:Ui(t),hasAction:Bi(e),hasFilter:Bi(t),removeAllActions:Ui(e,!0),removeAllFilters:Ui(t,!0),doAction:Vi(e),applyFilters:Vi(t,!0),currentAction:Wi(e),currentFilter:Wi(t),doingAction:Hi(e),doingFilter:Hi(t),didAction:$i(e),didFilter:$i(t),actions:e,filters:t}}(),Ki=(qi.addAction,qi.addFilter,qi.removeAction,qi.removeFilter,qi.hasAction,qi.hasFilter,qi.removeAllActions,qi.removeAllFilters,qi.doAction),Qi=(qi.applyFilters,qi.currentAction,qi.currentFilter,qi.doingAction,qi.doingFilter,qi.didAction,qi.didFilter,qi.actions,qi.filters,Object.create(null));function Gi(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.version,r=t.alternative,a=t.plugin,o=t.link,i=t.hint,l=a?" from ".concat(a):"",c=n?" and will be removed".concat(l," in version ").concat(n):"",u=r?" Please use ".concat(r," instead."):"",s=o?" See: ".concat(o):"",f=i?" Note: ".concat(i):"",p="".concat(e," is deprecated").concat(c,".").concat(u).concat(s).concat(f);p in Qi||(Ki("deprecated",e,t,p),console.warn(p),Qi[p]=!0)}function Yi(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.reduce((function(e,t,n){return Ii.Children.forEach(t,(function(t,r){t&&"string"!=typeof t&&(t=Object(Ii.cloneElement)(t,{key:[n,r].join()})),e.push(t)})),e}),[])}function Xi(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ji(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Xi(Object(n),!0).forEach((function(t){Object(Tr.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Xi(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Zi={strong:{},em:{},s:{},del:{},ins:{},a:{attributes:["href","target","rel"]},code:{},abbr:{attributes:["title"]},sub:{},sup:{},br:{},small:{},q:{attributes:["cite"]},dfn:{attributes:["title"]},data:{attributes:["value"]},time:{attributes:["datetime"]},var:{},samp:{},kbd:{},i:{},b:{},u:{},mark:{},ruby:{},rt:{},rp:{},bdi:{attributes:["dir"]},bdo:{attributes:["dir"]},wbr:{},"#text":{}};Object(Ri.without)(Object.keys(Zi),"#text","br").forEach((function(e){Zi[e].children=Object(Ri.omit)(Zi,e)}));Ji(Ji({},Zi),{audio:{attributes:["src","preload","autoplay","mediagroup","loop","muted"]},canvas:{attributes:["width","height"]},embed:{attributes:["src","type","width","height"]},img:{attributes:["alt","src","srcset","usemap","ismap","width","height"]},object:{attributes:["data","type","name","usemap","form","width","height"]},video:{attributes:["src","poster","preload","autoplay","mediagroup","loop","muted","controls","width","height"]}});function el(e){return e.ownerDocument.defaultView.getComputedStyle(e)}function tl(e){if(!e.collapsed)return e.getBoundingClientRect();var t=e.startContainer,n=t.ownerDocument;if("BR"===t.nodeName){var r=t.parentNode,a=Array.from(r.childNodes).indexOf(t);(e=n.createRange()).setStart(r,a),e.setEnd(r,a)}var o=e.getClientRects()[0];if(!o){var i=n.createTextNode("");(e=e.cloneRange()).insertNode(i),o=e.getClientRects()[0],i.parentNode.removeChild(i)}return o}var nl=["[tabindex]","a[href]","button:not([disabled])",'input:not([type="hidden"]):not([disabled])',"select:not([disabled])","textarea:not([disabled])","iframe","object","embed","area[href]","[contenteditable]:not([contenteditable=false])"].join(",");function rl(e){return e.offsetWidth>0||e.offsetHeight>0||e.getClientRects().length>0}function al(e){var t=e.querySelectorAll(nl);return Array.from(t).filter((function(e){return!(!rl(e)||function(e){return"iframe"===e.nodeName.toLowerCase()&&"-1"===e.getAttribute("tabindex")}(e))&&("AREA"!==e.nodeName||function(e){var t=e.closest("map[name]");if(!t)return!1;var n=e.ownerDocument.querySelector('img[usemap="#'+t.name+'"]');return!!n&&rl(n)}(e))}))}function ol(e){var t=e.getAttribute("tabindex");return null===t?0:parseInt(t,10)}function il(e){return-1!==ol(e)}function ll(e,t){return{element:e,index:t}}function cl(e){return e.element}function ul(e,t){var n=ol(e.element),r=ol(t.element);return n===r?e.index-t.index:n-r}function sl(e){return e.filter(il).map(ll).sort(ul).map(cl).reduce((t={},function(e,n){var r=n.nodeName,a=n.type,o=n.checked,i=n.name;if("INPUT"!==r||"radio"!==a||!i)return e.concat(n);var l=t.hasOwnProperty(i);if(!o&&l)return e;if(l){var c=t[i];e=Object(Ri.without)(e,c)}return t[i]=n,e.concat(n)}),[]);var t}function fl(e){return sl(al(e))}function pl(e){var t=al(e.ownerDocument.body),n=t.indexOf(e);return t.length=n,Object(Ri.last)(sl(t))}function dl(e){var t=al(e.ownerDocument.body),n=t.indexOf(e),r=t.slice(n+1).filter((function(t){return!e.contains(t)}));return Object(Ri.first)(sl(r))}var ml={focusable:r,tabbable:a},hl=n(27);function yl(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window,t=e.navigator.platform;return-1!==t.indexOf("Mac")||Object(Ri.includes)(["iPad","iPhone"],t)}var gl="alt",vl="ctrl",bl="meta",wl="shift",El={primary:function(e){return e()?[bl]:[vl]},primaryShift:function(e){return e()?[wl,bl]:[vl,wl]},primaryAlt:function(e){return e()?[gl,bl]:[vl,gl]},secondary:function(e){return e()?[wl,gl,bl]:[vl,wl,gl]},access:function(e){return e()?[vl,gl]:[wl,gl]},ctrl:function(){return[vl]},alt:function(){return[gl]},ctrlShift:function(){return[vl,wl]},shift:function(){return[wl]},shiftAlt:function(){return[wl,gl]}},Ol=(Object(Ri.mapValues)(El,(function(e){return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:yl;return[].concat(Object(Cr.a)(e(n)),[t.toLowerCase()]).join("+")}})),Object(Ri.mapValues)(El,(function(e){return function(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:yl,a=r(),o=(n={},Object(Tr.a)(n,gl,a?"⌥":"Alt"),Object(Tr.a)(n,vl,a?"⌃":"Ctrl"),Object(Tr.a)(n,bl,"⌘"),Object(Tr.a)(n,wl,a?"⇧":"Shift"),n),i=e(r).reduce((function(e,t){var n=Object(Ri.get)(o,t,t);return[].concat(Object(Cr.a)(e),a?[n]:[n,"+"])}),[]),l=Object(Ri.capitalize)(t);return[].concat(Object(Cr.a)(i),[l])}})));Object(Ri.mapValues)(Ol,(function(e){return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:yl;return e(t,n).join("")}})),Object(Ri.mapValues)(El,(function(e){return function(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:yl,a=r(),o=(n={},Object(Tr.a)(n,wl,"Shift"),Object(Tr.a)(n,bl,a?"Command":"Control"),Object(Tr.a)(n,vl,"Control"),Object(Tr.a)(n,gl,a?"Option":"Alt"),Object(Tr.a)(n,",",Object(hl.a)("Comma")),Object(Tr.a)(n,".",Object(hl.a)("Period")),Object(Tr.a)(n,"`",Object(hl.a)("Backtick")),n);return[].concat(Object(Cr.a)(e(r)),[t]).map((function(e){return Object(Ri.capitalize)(Object(Ri.get)(o,e,e))})).join(a?" ":" + ")}}));function kl(e){return[gl,vl,bl,wl].filter((function(t){return e["".concat(t,"Key")]}))}Object(Ri.mapValues)(El,(function(e){return function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:yl,a=e(r),o=kl(t);return!Object(Ri.xor)(a,o).length&&(n?t.key===n:Object(Ri.includes)(a,t.key.toLowerCase()))}}));function Sl(e){var t=Pr(Object(Ii.useState)(e&&window.matchMedia(e).matches),2),n=t[0],r=t[1];return Object(Ii.useEffect)((function(){if(e){var t=function(){return r(window.matchMedia(e).matches)};t();var n=window.matchMedia(e);return n.addListener(t),function(){n.removeListener(t)}}}),[e]),e&&n}var xl={huge:1440,wide:1280,large:960,medium:782,small:600,mobile:480},_l={">=":"min-width","<":"max-width"},jl={">=":function(e,t){return t>=e},"<":function(e,t){return t<e}},Pl=Object(Ii.createContext)(null),Cl=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:">=",n=Object(Ii.useContext)(Pl),r=!n&&"(".concat(_l[t],": ").concat(xl[e],"px)"),a=Sl(r);return n?jl[t](xl[e],n):a};Cl.__experimentalWidthProvider=Pl.Provider;var Tl=Cl,Al=n(55),Nl=n.n(Al).a;function Il(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ll(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Il(Object(n),!0).forEach((function(t){Object(Tr.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Il(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Dl=function(e){var t=e.className,n=e.isPressed,r=Ll(Ll({},_r(e,["className","isPressed"])),{},{className:Di()(t,{"is-pressed":n})||void 0,role:"img","aria-hidden":!0,focusable:!1});return Object(Ii.createElement)("svg",r)},Rl=Object(Ii.createElement)(Dl,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(Ii.createElement)((function(e){return Object(Ii.createElement)("path",e)}),{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"}));function Ml(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Fl(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ml(Object(n),!0).forEach((function(t){Object(Tr.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ml(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function zl(e,t,n,r,a,o,i){var l=t.width,c="rtl"===document.documentElement.dir;"left"===n&&c?n="right":"right"===n&&c&&(n="left"),"left"===r&&c?r="right":"right"===r&&c&&(r="left");var u=Math.round(e.left+e.width/2),s={popoverLeft:u,contentWidth:(u-l/2>0?l/2:u)+(u+l/2>window.innerWidth?window.innerWidth-u:l/2)},f=e.left;"right"===r?f=e.right:"middle"!==o&&(f=u);var p=e.right;"left"===r?p=e.left:"middle"!==o&&(p=u);var d,m={popoverLeft:f,contentWidth:f-l>0?l:f},h={popoverLeft:p,contentWidth:p+l>window.innerWidth?window.innerWidth-p:l},y=n,g=null;if(!a)if("center"===n&&s.contentWidth===l)y="center";else if("left"===n&&m.contentWidth===l)y="left";else if("right"===n&&h.contentWidth===l)y="right";else{var v="left"===(y=m.contentWidth>h.contentWidth?"left":"right")?m.contentWidth:h.contentWidth;g=v!==l?v:null}if(d="center"===y?s.popoverLeft:"left"===y?m.popoverLeft:h.popoverLeft,i){var b=i.getBoundingClientRect();d=Math.min(d,b.right-l)}return{xAxis:y,popoverLeft:d,contentWidth:g}}function Ul(e,t,n,r,a,o,i){var l=t.height;if(a){var c=(function e(t){if(t){if(t.scrollHeight>t.clientHeight){var n=el(t).overflowY;if(/(auto|scroll)/.test(n))return t}return e(t.parentNode)}}(o)||document.body).getBoundingClientRect().top+l-i;if(e.top<=c)return{yAxis:n,popoverTop:Math.min(e.bottom,c)}}var u=e.top+e.height/2;"bottom"===r?u=e.bottom:"top"===r&&(u=e.top);var s={popoverTop:u,contentHeight:(u-l/2>0?l/2:u)+(u+l/2>window.innerHeight?window.innerHeight-u:l/2)},f={popoverTop:e.top,contentHeight:e.top-10-l>0?l:e.top-10},p={popoverTop:e.bottom,contentHeight:e.bottom+10+l>window.innerHeight?window.innerHeight-10-e.bottom:l},d=n,m=null;if(!a)if("middle"===n&&s.contentHeight===l)d="middle";else if("top"===n&&f.contentHeight===l)d="top";else if("bottom"===n&&p.contentHeight===l)d="bottom";else{var h="top"===(d=f.contentHeight>p.contentHeight?"top":"bottom")?f.contentHeight:p.contentHeight;m=h!==l?h:null}return{yAxis:d,popoverTop:"middle"===d?s.popoverTop:"top"===d?f.popoverTop:p.popoverTop,contentHeight:m}}var Bl=function(e,t){return function(n){var r=e(n),a=n.displayName,o=void 0===a?n.name||"Component":a;return r.displayName="".concat(Object(Ri.upperFirst)(Object(Ri.camelCase)(t)),"(").concat(o,")"),r}};function Vl(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Or(e);if(t){var a=Or(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Er(this,n)}}var Wl=Object(Ii.createContext)({focusHistory:[]}),Hl=Wl.Provider,$l=Wl.Consumer;Hl.displayName="FocusReturnProvider",$l.displayName="FocusReturnConsumer";Ii.Component;function ql(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Or(e);if(t){var a=Or(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Er(this,n)}}var Kl=Bl((function e(t){if((r=t)instanceof Ii.Component||"function"==typeof r){var n=t;return e({})(n)}var r,a=t.onFocusReturn,o=void 0===a?Ri.stubTrue:a;return function(e){var t=function(t){vr(r,t);var n=ql(r);function r(){var e;return mr(this,r),(e=n.apply(this,arguments)).ownFocusedElements=new Set,e.activeElementOnMount=document.activeElement,e.setIsFocusedFalse=function(){return e.isFocused=!1},e.setIsFocusedTrue=function(t){e.ownFocusedElements.add(t.target),e.isFocused=!0},e}return yr(r,[{key:"componentWillUnmount",value:function(){var e=this.activeElementOnMount,t=this.isFocused,n=this.ownFocusedElements;if(t&&!1!==o())for(var r,a=[].concat(Object(Cr.a)(Ri.without.apply(void 0,[this.props.focus.focusHistory].concat(Object(Cr.a)(n)))),[e]);r=a.pop();)if(document.body.contains(r))return void r.focus()}},{key:"render",value:function(){return Object(Ii.createElement)("div",{onFocus:this.setIsFocusedTrue,onBlur:this.setIsFocusedFalse},Object(Ii.createElement)(e,this.props.childProps))}}]),r}(Ii.Component);return function(e){return Object(Ii.createElement)($l,null,(function(n){return Object(Ii.createElement)(t,{childProps:e,focus:n})}))}}}),"withFocusReturn");function Ql(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Or(e);if(t){var a=Or(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Er(this,n)}}var Gl=Bl((function(e){return function(t){vr(r,t);var n=Ql(r);function r(){var e;return mr(this,r),(e=n.apply(this,arguments)).focusContainRef=Object(Ii.createRef)(),e.handleTabBehaviour=e.handleTabBehaviour.bind(wr(e)),e}return yr(r,[{key:"handleTabBehaviour",value:function(e){if(9===e.keyCode){var t=ml.tabbable.find(this.focusContainRef.current);if(t.length){var n=t[0],r=t[t.length-1];e.shiftKey&&e.target===n?(e.preventDefault(),r.focus()):(e.shiftKey||e.target!==r)&&t.includes(e.target)||(e.preventDefault(),n.focus())}}}},{key:"render",value:function(){return Object(Ii.createElement)("div",{onKeyDown:this.handleTabBehaviour,ref:this.focusContainRef,tabIndex:"-1"},Object(Ii.createElement)(e,this.props))}}]),r}(Ii.Component)}),"withConstrainedTabbing");function Yl(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Or(e);if(t){var a=Or(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Er(this,n)}}var Xl=["button","submit"];function Jl(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Or(e);if(t){var a=Or(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Er(this,n)}}var Zl=Bl((function(e){return function(t){vr(r,t);var n=Yl(r);function r(){var e;return mr(this,r),(e=n.apply(this,arguments)).bindNode=e.bindNode.bind(wr(e)),e.cancelBlurCheck=e.cancelBlurCheck.bind(wr(e)),e.queueBlurCheck=e.queueBlurCheck.bind(wr(e)),e.normalizeButtonFocus=e.normalizeButtonFocus.bind(wr(e)),e}return yr(r,[{key:"componentWillUnmount",value:function(){this.cancelBlurCheck()}},{key:"bindNode",value:function(e){e?this.node=e:(delete this.node,this.cancelBlurCheck())}},{key:"queueBlurCheck",value:function(e){var t=this;e.persist(),this.preventBlurCheck||(this.blurCheckTimeout=setTimeout((function(){document.hasFocus()?"function"==typeof t.node.handleFocusOutside&&t.node.handleFocusOutside(e):e.preventDefault()}),0))}},{key:"cancelBlurCheck",value:function(){clearTimeout(this.blurCheckTimeout)}},{key:"normalizeButtonFocus",value:function(e){var t=e.type,n=e.target;Object(Ri.includes)(["mouseup","touchend"],t)?this.preventBlurCheck=!1:function(e){switch(e.nodeName){case"A":case"BUTTON":return!0;case"INPUT":return Object(Ri.includes)(Xl,e.type)}return!1}(n)&&(this.preventBlurCheck=!0)}},{key:"render",value:function(){return Object(Ii.createElement)("div",{onFocus:this.cancelBlurCheck,onMouseDown:this.normalizeButtonFocus,onMouseUp:this.normalizeButtonFocus,onTouchStart:this.normalizeButtonFocus,onTouchEnd:this.normalizeButtonFocus,onBlur:this.queueBlurCheck},Object(Ii.createElement)(e,s({ref:this.bindNode},this.props)))}}]),r}(Ii.Component)}),"withFocusOutside")(function(e){vr(n,e);var t=Jl(n);function n(){return mr(this,n),t.apply(this,arguments)}return yr(n,[{key:"handleFocusOutside",value:function(e){this.props.onFocusOutside(e)}},{key:"render",value:function(){return this.props.children}}]),n}(Ii.Component));function ec(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Or(e);if(t){var a=Or(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Er(this,n)}}var tc=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.htmlDocument,n=void 0===t?document:t,r=e.className,a=void 0===r?"lockscroll":r,o=0,i=0;function l(e){var t=n.scrollingElement||n.body;e&&(i=t.scrollTop);var r=e?"add":"remove";t.classList[r](a),n.documentElement.classList[r](a),e||(t.scrollTop=i)}function c(){0===o&&l(!0),++o}function u(){1===o&&l(!1),--o}return function(e){vr(n,e);var t=ec(n);function n(){return mr(this,n),t.apply(this,arguments)}return yr(n,[{key:"componentDidMount",value:function(){c()}},{key:"componentWillUnmount",value:function(){u()}},{key:"render",value:function(){return null}}]),n}(Ii.Component)}();function nc(e){e.stopPropagation()}var rc=Object(Ii.forwardRef)((function(e,t){var n=e.children,r=_r(e,["children"]);return Object(Ii.createElement)("div",s({},r,{ref:t,onMouseDown:nc}),n)})),ac=n(19);function oc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ic(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?oc(Object(n),!0).forEach((function(t){Object(Tr.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function lc(e){var t=Object(Ii.useContext)(ac.a),n=t.slots[e]||{},r=t.fills[e],a=Object(Ii.useMemo)((function(){return r||[]}),[r]),o=Object(Ii.useCallback)((function(n){t.updateSlot(e,n)}),[e,t.updateSlot]),i=Object(Ii.useCallback)((function(n){t.unregisterSlot(e,n)}),[e,t.unregisterSlot]),l=Object(Ii.useCallback)((function(n){t.registerFill(e,n)}),[e,t.registerFill]),c=Object(Ii.useCallback)((function(n){t.unregisterFill(e,n)}),[e,t.unregisterFill]);return ic(ic({},n),{},{updateSlot:o,unregisterSlot:i,fills:a,registerFill:l,unregisterFill:c})}function cc(e,t,n){return(cc="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Or(e)););return e}(e,t);if(r){var a=Object.getOwnPropertyDescriptor(r,t);return a.get?a.get.call(n):a.value}})(e,t,n||e)}var uc=function(e){return!Object(Ri.isNumber)(e)&&(Object(Ri.isString)(e)||Object(Ri.isArray)(e)?!e.length:!e)},sc=n(56),fc=n.n(sc);function pc(e){var t=function(e,t){if("object"!==Object(br.a)(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==Object(br.a)(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===Object(br.a)(t)?t:String(t)}function dc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function mc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?dc(Object(n),!0).forEach((function(t){Object(Tr.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function hc(e){var t,n,r,a,o,i,l,c,u,s,f,p=e.children,d=(t=Pr(Object(Ii.useState)({}),2),n=t[0],r=t[1],a=Pr(Object(Ii.useState)({}),2),o=a[0],i=a[1],l=Object(Ii.useCallback)((function(e,t,n){r((function(r){var a=r[e]||{};return mc(mc({},r),{},Object(Tr.a)({},e,mc(mc({},a),{},{ref:t||a.ref,fillProps:n||a.fillProps||{}})))}))}),[]),c=Object(Ii.useCallback)((function(e,t){r((function(n){var r=n[e],a=_r(n,[e].map(pc));return(null==r?void 0:r.ref)===t?a:n}))}),[]),u=Object(Ii.useCallback)((function(e,t){var r=n[e];if(r&&!fc()(r.fillProps,t)){r.fillProps=t;var a=o[e];a&&a.map((function(e){return e.current.rerender()}))}}),[n,o]),s=Object(Ii.useCallback)((function(e,t){i((function(n){return mc(mc({},n),{},Object(Tr.a)({},e,[].concat(Object(Cr.a)(n[e]||[]),[t])))}))}),[]),f=Object(Ii.useCallback)((function(e,t){i((function(n){return n[e]?mc(mc({},n),{},Object(Tr.a)({},e,n[e].filter((function(e){return e!==t})))):n}))}),[]),Object(Ii.useMemo)((function(){return{slots:n,fills:o,registerSlot:l,updateSlot:u,unregisterSlot:c,registerFill:s,unregisterFill:f}}),[n,o,l,u,c,s,f]));return Object(Ii.createElement)(ac.a.Provider,{value:d},p)}function yc(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Or(e);if(t){var a=Or(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Er(this,n)}}var gc=Object(Ii.createContext)({registerSlot:function(){},unregisterSlot:function(){},registerFill:function(){},unregisterFill:function(){},getSlot:function(){},getFills:function(){},subscribe:function(){}}),vc=gc.Provider,bc=gc.Consumer;Ii.Component;function wc(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Or(e);if(t){var a=Or(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Er(this,n)}}var Ec=function(e){vr(n,e);var t=wc(n);function n(){var e;return mr(this,n),(e=t.apply(this,arguments)).isUnmounted=!1,e.bindNode=e.bindNode.bind(wr(e)),e}return yr(n,[{key:"componentDidMount",value:function(){(0,this.props.registerSlot)(this.props.name,this)}},{key:"componentWillUnmount",value:function(){var e=this.props.unregisterSlot;this.isUnmounted=!0,e(this.props.name,this)}},{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.name,r=t.unregisterSlot,a=t.registerSlot;e.name!==n&&(r(e.name),a(n,this))}},{key:"bindNode",value:function(e){this.node=e}},{key:"forceUpdate",value:function(){this.isUnmounted||cc(Or(n.prototype),"forceUpdate",this).call(this)}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.name,r=e.fillProps,a=void 0===r?{}:r,o=e.getFills,i=Object(Ri.map)(o(n,this),(function(e){var t=e.occurrence,n=Object(Ri.isFunction)(e.children)?e.children(a):e.children;return Ii.Children.map(n,(function(e,n){if(!e||Object(Ri.isString)(e))return e;var r="".concat(t,"---").concat(e.key||n);return Object(Ii.cloneElement)(e,{key:r})}))})).filter(Object(Ri.negate)(uc));return Object(Ii.createElement)(Ii.Fragment,null,Object(Ri.isFunction)(t)?t(i):i)}}]),n}(Ii.Component),Oc=function(e){return Object(Ii.createElement)(bc,null,(function(t){var n=t.registerSlot,r=t.unregisterSlot,a=t.getFills;return Object(Ii.createElement)(Ec,s({},e,{registerSlot:n,unregisterSlot:r,getFills:a}))}))},kc=n(119),Sc=0;function xc(e){var t=e.name,n=e.children,r=e.registerFill,a=e.unregisterFill,o=function(e){var t=Object(Ii.useContext)(gc),n=t.getSlot,r=t.subscribe,a=Pr(Object(Ii.useState)(n(e)),2),o=a[0],i=a[1];return Object(Ii.useEffect)((function(){return i(n(e)),r((function(){i(n(e))}))}),[e]),o}(t),i=Object(Ii.useRef)({name:t,children:n});return i.current.occurrence||(i.current.occurrence=++Sc),Object(Ii.useLayoutEffect)((function(){return r(t,i.current),function(){return a(t,i.current)}}),[]),Object(Ii.useLayoutEffect)((function(){i.current.children=n,o&&o.forceUpdate()}),[n]),Object(Ii.useLayoutEffect)((function(){t!==i.current.name&&(a(i.current.name,i.current),i.current.name=t,r(t,i.current))}),[t]),o&&o.node?(Object(Ri.isFunction)(n)&&(n=n(o.props.fillProps)),Object(kc.createPortal)(n,o.node)):null}var _c=function(e){return Object(Ii.createElement)(bc,null,(function(t){var n=t.registerFill,r=t.unregisterFill;return Object(Ii.createElement)(xc,s({},e,{registerFill:n,unregisterFill:r}))}))};function jc(e){var t=e.name,n=e.fillProps,r=void 0===n?{}:n,a=e.as,o=void 0===a?"div":a,i=_r(e,["name","fillProps","as"]),l=Object(Ii.useContext)(ac.a),c=Object(Ii.useRef)();return Object(Ii.useLayoutEffect)((function(){return l.registerSlot(t,c,r),function(){l.unregisterSlot(t,c)}}),[l.registerSlot,l.unregisterSlot,t]),Object(Ii.useLayoutEffect)((function(){l.updateSlot(t,r)})),Object(Ii.createElement)(o,s({ref:c},i))}function Pc(e){var t,n=e.name,r=e.children,a=lc(n),o=Object(Ii.useRef)({rerender:(t=Pr(Object(Ii.useState)({}),2)[1],function(){return t({})})});return Object(Ii.useEffect)((function(){return a.registerFill(o),function(){a.unregisterFill(o)}}),[a.registerFill,a.unregisterFill]),a.ref&&a.ref.current?("function"==typeof r&&(r=r(a.fillProps)),Object(kc.createPortal)(r,a.ref.current)):null}function Cc(e){var t=e.bubblesVirtually,n=_r(e,["bubblesVirtually"]);return t?Object(Ii.createElement)(jc,n):Object(Ii.createElement)(Oc,n)}function Tc(e){return Object(Ii.createElement)(Ii.Fragment,null,Object(Ii.createElement)(_c,e),Object(Ii.createElement)(Pc,e))}function Ac(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Nc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ac(Object(n),!0).forEach((function(t){Object(Tr.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ac(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ic(e){var t=e.type,n=e.origin,r=void 0===n?function(e){return"appear"===e?"top":"left"}(t):n;if("appear"===t){var a,o=Pr(r.split(" "),2),i=o[0],l=o[1],c=void 0===l?"center":l;return Di()("components-animate__appear",(a={},Object(Tr.a)(a,"is-from-"+c,"center"!==c),Object(Tr.a)(a,"is-from-"+i,"middle"!==i),a))}return"slide-in"===t?Di()("components-animate__slide-in","is-from-"+r):"loading"===t?Di()("components-animate__loading"):void 0}function Lc(e){var t=e.type,n=e.options,r=void 0===n?{}:n;return(0,e.children)({className:Ic(Nc({type:t},r))})}var Dc=Gl(Kl((function(e){return e.children})));function Rc(e,t){var n,r=(n=t).ownerDocument.defaultView.getComputedStyle(n),a=r.paddingTop,o=r.paddingBottom,i=r.paddingLeft,l=r.paddingRight,c=a?parseInt(a,10):0,u=o?parseInt(o,10):0,s=i?parseInt(i,10):0,f=l?parseInt(l,10):0;return{x:e.left+s,y:e.top+c,width:e.width-s-f,height:e.height-c-u,left:e.left+s,right:e.right-f,top:e.top+c,bottom:e.bottom-u}}function Mc(e,t,n){n?e.getAttribute(t)!==n&&e.setAttribute(t,n):e.hasAttribute(t)&&e.removeAttribute(t)}function Fc(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";e.style[t]!==n&&(e.style[t]=n)}function zc(e,t,n){n?e.classList.contains(t)||e.classList.add(t):e.classList.contains(t)&&e.classList.remove(t)}var Uc=function(e){var t=e.headerTitle,n=e.onClose,r=e.onKeyDown,a=e.children,o=e.className,i=e.noArrow,l=void 0===i||i,c=e.isAlternate,u=e.position,f=void 0===u?"bottom right":u,p=(e.range,e.focusOnMount),d=void 0===p?"firstElement":p,m=e.anchorRef,h=e.shouldAnchorIncludePadding,y=e.anchorRect,g=e.getAnchorRect,v=e.expandOnMobile,b=e.animate,w=void 0===b||b,E=e.onClickOutside,O=e.onFocusOutside,k=e.__unstableSticky,S=e.__unstableSlotName,x=void 0===S?"Popover":S,_=e.__unstableObserveElement,j=e.__unstableBoundaryParent,P=_r(e,["headerTitle","onClose","onKeyDown","children","className","noArrow","isAlternate","position","range","focusOnMount","anchorRef","shouldAnchorIncludePadding","anchorRect","getAnchorRect","expandOnMobile","animate","onClickOutside","onFocusOutside","__unstableSticky","__unstableSlotName","__unstableObserveElement","__unstableBoundaryParent"]),C=Object(Ii.useRef)(null),T=Object(Ii.useRef)(null),A=Object(Ii.useRef)(),N=Tl("medium","<"),I=Pr(Object(Ii.useState)(),2),L=I[0],D=I[1],R=lc(x),M=v&&N,F=Pr(Nl(),2),z=F[0],U=F[1];l=M||l,Object(Ii.useLayoutEffect)((function(){if(M)return zc(A.current,"is-without-arrow",l),zc(A.current,"is-alternate",c),Mc(A.current,"data-x-axis"),Mc(A.current,"data-y-axis"),Fc(A.current,"top"),Fc(A.current,"left"),Fc(T.current,"maxHeight"),void Fc(T.current,"maxWidth");var e=function(){if(A.current&&T.current){var e=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=arguments.length>4?arguments[4]:void 0;if(t)return t;if(n){if(!e.current)return;return n(e.current)}if(!1!==r){if(!(r&&window.Range&&window.Element&&window.DOMRect))return;if(r instanceof window.Range)return tl(r);if(r instanceof window.Element){var o=r.getBoundingClientRect();return a?o:Rc(o,r)}var i=r.top,l=r.bottom,c=i.getBoundingClientRect(),u=l.getBoundingClientRect(),s=new window.DOMRect(c.left,c.top,c.width,u.bottom-c.top);return a?s:Rc(s,r)}if(e.current){var f=e.current.parentNode,p=f.getBoundingClientRect();return a?p:Rc(p,f)}}(C,y,g,m,h);if(e){var t,n,r=A.current,a=r.offsetParent,o=r.ownerDocument,i=0;if(a&&a!==o.body){var u=a.getBoundingClientRect();i=u.top,e=new window.DOMRect(e.left-u.left,e.top-u.top,e.width,e.height)}if(j)t=null===(n=A.current.closest(".popover-slot"))||void 0===n?void 0:n.parentNode;var s=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"top",r=arguments.length>3?arguments[3]:void 0,a=arguments.length>4?arguments[4]:void 0,o=arguments.length>5?arguments[5]:void 0,i=arguments.length>6?arguments[6]:void 0,l=n.split(" "),c=Pr(l,3),u=c[0],s=c[1],f=void 0===s?"center":s,p=c[2],d=Ul(e,t,u,p,r,a,o),m=zl(e,t,f,p,r,d.yAxis,i);return Fl(Fl({},m),d)}(e,U.height?U:T.current.getBoundingClientRect(),f,k,A.current,i,t),p=s.popoverTop,d=s.popoverLeft,v=s.xAxis,b=s.yAxis,w=s.contentHeight,E=s.contentWidth;"number"==typeof p&&"number"==typeof d&&(Fc(A.current,"top",p+"px"),Fc(A.current,"left",d+"px")),zc(A.current,"is-without-arrow",l||"center"===v&&"middle"===b),zc(A.current,"is-alternate",c),Mc(A.current,"data-x-axis",v),Mc(A.current,"data-y-axis",b),Fc(T.current,"maxHeight","number"==typeof w?w+"px":""),Fc(T.current,"maxWidth","number"==typeof E?E+"px":"");D(({left:"right",right:"left"}[v]||"center")+" "+({top:"bottom",bottom:"top"}[b]||"middle"))}}};e();var t,n,r=window.setInterval(e,500),a=function(){window.cancelAnimationFrame(t),t=window.requestAnimationFrame(e)};return window.addEventListener("click",a),window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),_&&(n=new window.MutationObserver(e)).observe(_,{attributes:!0}),function(){window.clearInterval(r),window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0),window.removeEventListener("click",a),window.cancelAnimationFrame(t),n&&n.disconnect()}}),[M,y,g,m,h,f,U,k,_,j]),function(e,t){Object(Ii.useEffect)((function(){var n=setTimeout((function(){if(e&&t.current)if("firstElement"!==e)"container"===e&&t.current.focus();else{var n=ml.tabbable.find(t.current)[0];n?n.focus():t.current.focus()}}),0);return function(){return clearTimeout(n)}}),[])}(d,T);var B=function(e){27===e.keyCode&&n&&(e.stopPropagation(),n()),r&&r(e)};var V=Object(Ii.createElement)(Zl,{onFocusOutside:function(e){if(O)O(e);else if(E){var t;try{t=new window.MouseEvent("click")}catch(e){(t=document.createEvent("MouseEvent")).initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null)}Object.defineProperty(t,"target",{get:function(){return e.relatedTarget}}),Gi("Popover onClickOutside prop",{alternative:"onFocusOutside"}),E(t)}else n&&n()}},Object(Ii.createElement)(Lc,{type:w&&L?"appear":null,options:{origin:L}},(function(e){var r=e.className;return Object(Ii.createElement)(rc,s({className:Di()("components-popover",o,r,{"is-expanded":M,"is-without-arrow":l,"is-alternate":c})},P,{onKeyDown:B,ref:A}),M&&Object(Ii.createElement)(tc,null),M&&Object(Ii.createElement)("div",{className:"components-popover__header"},Object(Ii.createElement)("span",{className:"components-popover__header-title"},t),Object(Ii.createElement)(Jc,{className:"components-popover__close",icon:Rl,onClick:n})),Object(Ii.createElement)("div",{ref:T,className:"components-popover__content",tabIndex:"-1"},Object(Ii.createElement)("div",{style:{position:"relative"}},z,a)))})));return d&&(V=Object(Ii.createElement)(Dc,null,V)),R.ref&&(V=Object(Ii.createElement)(Tc,{name:x},V)),m||y?V:Object(Ii.createElement)("span",{ref:C},V)};Uc.Slot=function(e){var t=e.name,n=void 0===t?"Popover":t;return Object(Ii.createElement)(Cc,{bubblesVirtually:!0,name:n,className:"popover-slot"})};var Bc=Uc;var Vc=function(e){var t,n,r=e.shortcut,a=e.className;return r?(Object(Ri.isString)(r)&&(t=r),Object(Ri.isObject)(r)&&(t=r.display,n=r.ariaLabel),Object(Ii.createElement)("span",{className:a,"aria-label":n},t)):null};function Wc(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Or(e);if(t){var a=Or(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Er(this,n)}}var Hc=function(e){vr(n,e);var t=Wc(n);function n(){var e;return mr(this,n),(e=t.apply(this,arguments)).delayedSetIsOver=Object(Ri.debounce)((function(t){return e.setState({isOver:t})}),700),e.cancelIsMouseDown=e.createSetIsMouseDown(!1),e.isInMouseDown=!1,e.state={isOver:!1},e}return yr(n,[{key:"componentWillUnmount",value:function(){this.delayedSetIsOver.cancel(),document.removeEventListener("mouseup",this.cancelIsMouseDown)}},{key:"emitToChild",value:function(e,t){var n=this.props.children;if(1===Ii.Children.count(n)){var r=Ii.Children.only(n);"function"==typeof r.props[e]&&r.props[e](t)}}},{key:"createToggleIsOver",value:function(e,t){var n=this;return function(r){if(n.emitToChild(e,r),!(r.currentTarget.disabled||"focus"===r.type&&n.isInMouseDown)){n.delayedSetIsOver.cancel();var a=Object(Ri.includes)(["focus","mouseenter"],r.type);a!==n.state.isOver&&(t?n.delayedSetIsOver(a):n.setState({isOver:a}))}}}},{key:"createSetIsMouseDown",value:function(e){var t=this;return function(n){t.emitToChild(e?"onMouseDown":"onMouseUp",n),document[e?"addEventListener":"removeEventListener"]("mouseup",t.cancelIsMouseDown),t.isInMouseDown=e}}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.position,r=e.text,a=e.shortcut;if(1!==Ii.Children.count(t))return t;var o=Ii.Children.only(t),i=this.state.isOver;return Object(Ii.cloneElement)(o,{onMouseEnter:this.createToggleIsOver("onMouseEnter",!0),onMouseLeave:this.createToggleIsOver("onMouseLeave"),onClick:this.createToggleIsOver("onClick"),onFocus:this.createToggleIsOver("onFocus"),onBlur:this.createToggleIsOver("onBlur"),onMouseDown:this.createSetIsMouseDown(!0),children:Yi(o.props.children,i&&Object(Ii.createElement)(Bc,{focusOnMount:!1,position:n,className:"components-tooltip","aria-hidden":"true",animate:!1,noArrow:!0},r,Object(Ii.createElement)(Vc,{className:"components-tooltip__shortcut",shortcut:a})))})}}]),n}(Ii.Component);var $c=function(e){var t=e.icon,n=e.className,r=_r(e,["icon","className"]),a=["dashicon","dashicons","dashicons-"+t,n].filter(Boolean).join(" ");return Object(Ii.createElement)("span",s({className:a},r))};function qc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Kc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?qc(Object(n),!0).forEach((function(t){Object(Tr.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Qc=function(e){var t=e.icon,n=void 0===t?null:t,r=e.size,a=_r(e,["icon","size"]);if("string"==typeof n)return Object(Ii.createElement)($c,s({icon:n},a));if(n&&$c===n.type)return Object(Ii.cloneElement)(n,Kc({},a));var o=r||24;if("function"==typeof n)return n.prototype instanceof Ii.Component?Object(Ii.createElement)(n,Kc({size:o},a)):n(Kc({size:o},a));if(n&&("svg"===n.type||n.type===Dl)){var i=Kc(Kc({width:o,height:o},n.props),a);return Object(Ii.createElement)(Dl,i)}return Object(Ii.isValidElement)(n)?Object(Ii.cloneElement)(n,Kc({size:o},a)):n};function Gc(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Yc(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Yc(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,l=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return i=e.done,e},e:function(e){l=!0,o=e},f:function(){try{i||null==n.return||n.return()}finally{if(l)throw o}}}}function Yc(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Xc=["onMouseDown","onClick"];var Jc=Object(Ii.forwardRef)((function(e,t){var n=e.href,r=e.target,a=e.isPrimary,o=e.isSmall,i=e.isTertiary,l=e.isPressed,c=e.isBusy,u=e.isDefault,f=e.isSecondary,p=e.isLink,d=e.isDestructive,m=e.className,h=e.disabled,y=e.icon,g=e.iconSize,v=e.showTooltip,b=e.tooltipPosition,w=e.shortcut,E=e.label,O=e.children,k=e.__experimentalIsFocusable,S=_r(e,["href","target","isPrimary","isSmall","isTertiary","isPressed","isBusy","isDefault","isSecondary","isLink","isDestructive","className","disabled","icon","iconSize","showTooltip","tooltipPosition","shortcut","label","children","__experimentalIsFocusable"]);u&&Gi("Button isDefault prop",{alternative:"isSecondary"});var x=Di()("components-button",m,{"is-secondary":u||f,"is-primary":a,"is-small":o,"is-tertiary":i,"is-pressed":l,"is-busy":c,"is-link":p,"is-destructive":d,"has-text":!!y&&!!O,"has-icon":!!y}),_=h&&!k,j=void 0===n||_?"button":"a",P="a"===j?{href:n,target:r}:{type:"button",disabled:_,"aria-pressed":l};if(h&&k){P["aria-disabled"]=!0;var C,T=Gc(Xc);try{for(T.s();!(C=T.n()).done;){S[C.value]=function(e){e.stopPropagation(),e.preventDefault()}}}catch(e){T.e(e)}finally{T.f()}}var A=!_&&(v&&E||w||!!E&&(!O||Object(Ri.isArray)(O)&&!O.length)&&!1!==v),N=Object(Ii.createElement)(j,s({},P,S,{className:x,"aria-label":S["aria-label"]||E,ref:t}),y&&Object(Ii.createElement)(Qc,{icon:y,size:g}),O);return A?Object(Ii.createElement)(Hc,{text:E,shortcut:w,position:b},N):N})),Zc=function(e){return i.a.createElement("div",{onScroll:e.onScroll,className:"templately-modal-content-wrapper"},e.children)},eu=tt()((function(e){return i.a.createElement("div",{className:"templately-table ".concat(e.className&&e.className," ")},e.children)})),tu=tt()((function(e){return i.a.createElement("div",{className:"templately-table-row ".concat(void 0!==e.className?e.className:"")},e.children)})),nu=tt()((function(e){return i.a.createElement("div",{className:"templately-table-col ".concat(null!=e.className?e.className:"")},e.children)})),ru=wp.i18n.__,au=function(e){return i.a.createElement(tu,{className:"templately-table-head"},i.a.createElement(nu,null,i.a.createElement("p",null,ru("Name"))),i.a.createElement(nu,null,i.a.createElement(tu,null,i.a.createElement(nu,null,i.a.createElement("p",null,ru("Last Modified"))),i.a.createElement(nu,null,i.a.createElement("p",null,ru("Action"))))))},ou=TemplatelyAdmin.loadingImage,iu=function(e){return i.a.createElement("div",{className:"templately-pre-loader"},i.a.createElement("img",{src:ou}))};function lu(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return cu(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return cu(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function cu(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var uu=wp.i18n.__,su=TemplatelyAdmin,fu=su.nonce,pu=su.platform,du=su.is_block_editor,mu=su.is_editor,hu=tt((function(e){return{cloud_map:e.common.cloud_map,pagination:e.common.pagination,platform:e.common.platform}}))((function(e){var t=lu(Object(o.useState)(!1),2),n=t[0],r=t[1],a=lu(Object(o.useState)(!1),2),l=a[0],c=a[1],u=lu(Object(o.useState)(!1),2),s=u[0],f=u[1],p=lu(Object(o.useState)(!1),2),d=p[0],m=p[1],h=Object(o.useRef)(null),y=Object(o.useRef)(null),g=Object(o.useRef)(null),v=Object(o.useRef)(null),b=function(e){var t=h.current&&h.current.contains(e.target),n=y.current&&y.current.contains(e.target);t||n||r(!1)};return Object(o.useEffect)((function(){if(0!=s){var t=new FormData;t.append("action","get_templately"),t.append("content_type","push_to_cloud"),t.append("nonce",fu),t.append("id",s);var n="templately"===pu?"elementor":pu;t.append("file_type",n),ii("",{showConfirmButton:!1,showCloseButton:!0,html:i.a.createElement(iu,null)}),Do.a.post(ajaxurl,t).then((function(t){t.data.success?("success"==t.data.data.status&&(e.dispatch({type:"ALL_CLOUDS_MAP",payload:{template_id:s,cloud_item_id:t.data.data.data.myCloud_item}}),ii(uu("Successfully Pushed to Cloud.","templately"),{timer:1500,icon:"success"})),"error"==t.data.data.status&&ii(uu("Something went wrong.","templately"),{timer:1500,icon:"error"})):ii(uu(t.data.data,"templately"),{timer:1500,icon:"error"})})).catch((function(e){return console.error("Pushed Related Issue: ",e)})),f(!1)}}),[s]),Object(o.useEffect)((function(){var t,n;0!=d&&(r(!1),(t=d,(n=new FormData).append("action","get_templately"),n.append("content_type","delete_template"),n.append("nonce",ai),n.append("id",t),n.append("type","template"),Do.a.post(ajaxurl,n).then((function(e){return e.data})).catch((function(e){return{success:!1,data:"Something went wrong regarding delete this template."}}))).then((function(t){t.success?(e.dispatch({type:"REMOVE_TEMPLATE",payload:{id:d,page:e.pagination}}),ii(t.data,{timer:2e3,icon:"success"})):ii(t.data,{timer:2e3,icon:"error"})})),m(!1))}),[d]),Object(o.useEffect)((function(){return document.addEventListener("mousedown",b),function(){return document.removeEventListener("mousedown",b)}}),[]),Object(o.useEffect)((function(){0!=l&&(e.isLoading(!0),li(e.template.id,"local",{fileType:e.platform}).then((function(t){!0===t?(window.TemplatelyModal.destroy(),e.dispatch(setLoading(!0))):(e.dispatch(setLoading(!1)),e.isLoading(!1),ii(t,{timer:2e3,icon:"error"}))})))}),[l]),i.a.createElement("div",{ref:v},i.a.createElement(tu,null,i.a.createElement(nu,null,i.a.createElement("div",{className:"ttcol-header"},hi("elementor")&&i.a.createElement("img",{src:hi("elementor"),alt:e.name}),i.a.createElement("p",null,uu(e.name)))),i.a.createElement(nu,null,i.a.createElement(tu,null,i.a.createElement(nu,null,i.a.createElement("p",null,uu(e.date))),i.a.createElement(nu,{className:"templately-col-actions-btn"},(!mu||!du)&&i.a.createElement("button",{className:"templately-cloud-item-action-btn tw-preview",onClick:function(){return ui(e.template.preview_url)}},i.a.createElement("i",null),uu("Preview","templately")),(!mu||!du)&&i.a.createElement("button",{className:"templately-cloud-item-action-btn tw-push-to-cloud",disabled:di(e.template.id,e.cloud_map)||!1!==s,onClick:function(){return f(e.template.id)}},i.a.createElement("i",null),uu("Push to Cloud","templately")),(mu||du)&&i.a.createElement(Jc,{className:"templately-cloud-item-action-btn tw-download",ref:g,onClick:function(){return c(e.template.id)}},i.a.createElement("i",null),uu("Insert","templately")),i.a.createElement(Jc,{className:"templately-cloud-item-action-btn",ref:h,onClick:function(){return r(!n)}},i.a.createElement(hn,null)),n&&i.a.createElement("div",{ref:y,className:"templately-sw-cxt-menu ".concat(!0===n?"topen":"")},i.a.createElement("ul",null,(mu||du)&&i.a.createElement(i.a.Fragment,null,i.a.createElement("li",{className:"tw-preview",onClick:function(){return ui(e.template.preview_url)}},i.a.createElement("i",null)," ",uu("Preview","templately")),i.a.createElement("li",{className:"tw-push-to-cloud",disabled:di(e.template.id,e.cloud_map)||!1!==s,onClick:function(){return f(e.template.id)}},i.a.createElement("i",null)," ",uu("Push to Cloud","templately"))),i.a.createElement("li",{className:"twm-preview",onClick:function(){return ui(e.template.preview_url)}},i.a.createElement("i",null)," ",uu("Preview","templately")),i.a.createElement("li",{className:"twm-push-to-cloud",disabled:di(e.template.id,e.cloud_map)||!1!==s,onClick:function(){return f(e.template.id)}},i.a.createElement("i",null)," ",uu("Push To Cloud","templately")),i.a.createElement("li",{className:"tw-export"},i.a.createElement("a",{href:e.template.export_url},i.a.createElement("i",null)," ",uu("Export","templately"))),i.a.createElement("li",{className:"tw-delete",onClick:function(){return m(e.template.id)}},i.a.createElement("i",null)," ",uu("Delete","templately")))))))))})),yu=function(e){return i.a.createElement("div",e,e.children)};n(109);function gu(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return vu(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return vu(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function vu(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var bu=wp.i18n.__,wu=tt((function(e){return{pagination:e.common.pagination,need_pagination:e.common.need_pagination}}))((function(e){var t=gu(Object(o.useState)(1),2),n=t[0],r=t[1],a=gu(Object(o.useState)(!1),2),l=a[0],c=a[1],u=gu(Object(o.useState)([]),2),s=u[0],f=u[1];Object(o.useEffect)((function(){r(e.count)}),[e.type,e.count]),Object(o.useEffect)((function(){l&&(e.dispatch(Qn(l)),e.dispatch(tr(null)),e.categoryPagination||e.dispatch(Hn({activeSidebarMenu:"all",activeParentSidebarMenu:""})),e.dispatch(Yn(!0)))}),[l]),Object(o.useEffect)((function(){var t=1,r=n;n>10&&(t=Math.max(1,e.pagination-3),r=Math.min(e.pagination+3,n),e.pagination-1<=3&&(r=7),n-e.pagination<=3&&(t=n-6));var a=[];a.push(i.a.createElement("li",{className:1==e.pagination?"epage-link epage-active":"epage-link",key:1,onClick:function(){return c(1)}},bu(1,"templately"))),t>1?a.push(i.a.createElement("li",{className:"epage-link",key:"dotdotdot"},bu("...","templately"))):a.filter((function(e){return"dotdotdot"!=e.key}));for(var o=function(t){a.push(i.a.createElement("li",{className:e.pagination==t?"epage-link epage-active":"epage-link",key:t,onClick:function(){return c(t)}},bu(t,"templately")))},l=t+1;l<r;l+=1)o(l);e.pagination+3<n&&r!==n&&a.push(i.a.createElement("li",{className:"epage-link",key:"dotdotdotdot"},bu("...","templately"))),a.push(i.a.createElement("li",{className:e.pagination==n?"epage-link epage-active":"epage-link",key:n,onClick:function(){return c(n)}},bu(n,"templately"))),n>=2?(e.dispatch(Gn(!0)),f(a)):e.dispatch(Gn(!1))}),[n,e.pagination]);var p,d=function(){var t=e.pagination-1>0?e.pagination-1:0;e.dispatch(Qn(t))},m=function(){var t=e.pagination+1<n?e.pagination+1:n;e.dispatch(Qn(t))};return i.a.createElement(i.a.Fragment,null,!(s.length<2||!e.need_pagination)&&i.a.createElement("div",{className:"templately-pagination"},i.a.createElement("ul",null,(p=!(e.pagination>1),i.a.createElement("li",{className:"epage-link pagination-arrow"},i.a.createElement("button",{onClick:function(){return d()},disabled:p},i.a.createElement(un,null)))),s,function(){var t=!(e.pagination<n);return i.a.createElement("li",{className:"epage-link pagination-arrow"},i.a.createElement("button",{onClick:function(){return m()},disabled:t},i.a.createElement(sn,null)))}())))})),Eu=TemplatelyAdmin.loadingImage,Ou=tt((function(e){return{retry:e.common.retry,retryMessage:e.common.retryMessage}}))((function(e){return i.a.createElement("div",{className:"templately-pre-loader"},e.retryMessage.length>0?i.a.createElement("div",{className:"templately-retry"},i.a.createElement("p",null,e.retryMessage),i.a.createElement("button",{className:"templately-retry-button button-primary",onClick:function(){e.dispatch(Bn(!0)),e.dispatch(Cn(!e.retry)),e.dispatch(In(""))}},"Retry")):i.a.createElement("img",{src:Eu}))}));function ku(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Su(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Su(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Su(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var xu=TemplatelyAdmin.templates,_u=tt((function(e){return{templates:e.common.templates,isTemplate:e.common.isTemplate||!1,userID:e.admin.user.id||null,platform:e.common.platform,need_pagination:e.common.need_pagination,pagination_loading:e.common.pagination_loading,pagination:e.common.pagination}}))((function(e){var t=ku(Object(o.useState)([]),2),n=t[0],r=t[1],a=ku(Object(o.useState)(1),2),l=a[0],c=a[1],u=ku(Object(o.useState)(!1),2),s=u[0],f=u[1];return Object(o.useEffect)((function(){e.pagination>1&&!e.templates.hasOwnProperty(e.pagination)&&(f(!0),function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=new FormData;return t.append("action","get_templately"),t.append("nonce",ai),t.append("content_type","get_templates"),null!=e.page&&t.append("page",e.page),null!=e.platform&&t.append("platform",e.platform),Do.a.post(ajaxurl,t).then((function(e){return e})).catch((function(e){return e}))}({page:e.pagination,platform:e.platform}).then((function(t){t.data.success&&e.dispatch(Mn(t.data.data)),f(!1)})).catch((function(e){console.error(e.response)})))}),[e.pagination]),Object(o.useEffect)((function(){e.isTemplate||(e.dispatch(Mn(xu)),e.dispatch({type:"TEMPLATE_TRIGGER",payload:{isTemplate:!0}}))}),[e.templates,e.isTemplate]),Object(o.useEffect)((function(){if("elementor"===e.platform){var t=[];e.templates.hasOwnProperty(e.pagination)&&(e.templates[e.pagination].map((function(e){t.push(i.a.createElement(hu,{isLoading:function(e){return f(e)},key:e.id,file_type:e.type,id:e.id,name:e.title,date:e.date,template:e}))})),r(t),c(e.templates.total_page))}}),[e.templates,e.pagination]),i.a.createElement(Zc,null,i.a.createElement("div",{className:"templately-modal-content templately-templates"},s&&i.a.createElement(Ou,null),!s&&i.a.createElement(i.a.Fragment,null,i.a.createElement(eu,{className:"templately-clouds-table"},i.a.createElement(au,null),i.a.createElement(yu,{className:"templately-table-body"},n)),i.a.createElement(wu,{type:"templates",count:l}))))})),ju=n(57),Pu=n.n(ju);function Cu(e){return(Cu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Tu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Au(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Nu(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Iu(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Iu(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Iu(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Lu=wp.i18n.__,Du=TemplatelyAdmin,Ru=Du.nonce,Mu=Du.cloud_activity,Fu=wp.apiFetch,zu=tt((function(e){return{user:e.admin.user||!1,isLoggedIn:e.common.isLoggedIn,platform:e.common.platform,workspaceList:e.workspaces.workspacesList,sharedWorkspaceList:e.sharedWorkspaces.sharedWorkspaceList}}))((function(e){var t=Nu(Object(o.useState)(""),2),n=t[0],r=t[1],a=Nu(Object(o.useState)(!0),2),l=a[0],c=a[1],u=Nu(Object(o.useState)(!1),2),s=u[0],f=u[1],p=Nu(Object(o.useState)(!1),2),d=p[0],m=p[1],h=Nu(Object(o.useState)(!1),2),y=h[0],g=h[1],v=Nu(Object(o.useState)([Mu]),2),b=v[0],w=v[1],E=Nu(Object(o.useState)(Mu),2),O=E[0],k=E[1],S=Nu(Object(o.useState)(!1),2),x=S[0],_=S[1],j=Nu(Object(o.useState)("/clouds?refresh"),2),P=j[0],C=j[1],T=Nu(Object(o.useState)([]),2),A=T[0],N=T[1];return Object(o.useEffect)((function(){e.dispatch({type:"SET_NEXT_ROUTE",payload:"/templates/save"}),e.isLoggedIn||e.dispatch(Zn("/sign-in"));!function(t,n){if(A.length<=0)Promise.all([yi(!1,!1),yi(!0,!1)]).then((function(t){if(t.length>0){var n=[];n.push({label:Lu("My Clouds","templately"),value:"clouds"}),null!==t[0]&&(e.dispatch(ar(t[0])),n.push({label:Lu("My WorkSpace","templately"),options:gi(t[0])})),null!==t[1]&&(e.dispatch(or(t[1])),n.push({label:Lu("Shared WorkSpace","templately"),options:gi(t[1],!0)})),w(n),N(n)}})).catch((function(e){Do.a.isCancel(e)||console.error("Something went wrong: regarding fetching WorkSpace list",e)}));else{var r=[];if(r.push({label:Lu("My Clouds","templately"),value:"clouds"}),e.workspaceList.length>0&&r.push({label:Lu("My WorkSpace","templately"),options:gi(e.workspaceList)}),e.sharedWorkspaceList.length>0&&r.push({label:Lu("Shared WorkSpace","templately"),options:gi(e.sharedWorkspaceList)}),r.length>0){var a=[];r.map((function(e){e&&null!=e.options&&(e.options=e.options.filter((function(e){return e.slug&&-1!==e.slug.indexOf(t.toLowerCase())}))),a.push(e)})),w(r)}}}()}),[]),Object(o.useEffect)((function(){c(!(n.length>0))}),[n]),Object(o.useEffect)((function(){f(d)}),[d]),Object(o.useEffect)((function(){if("gutenberg"===e.platform&&s){var t=parseInt(O.value),r=wp.data.select("core/editor").getEditedPostAttribute("title"),a=wp.data.select("core/editor").getEditedPostContent(),o=wp.data.select("core/editor").getCurrentPostId(),i=wp.data.select("core/editor").getCurrentPostType(),l=wp.data.select("core/editor").isEditedPostEmpty(),c={title:r,content:a};0===c.content.length&&ii("You have no content to save in Templately.",{timer:2e3,icon:"warning"}),l||(wp.data.dispatch("core/editor").savePost(),Fu({path:"/wp/v2/".concat(i,"s/").concat(o),method:"POST",data:c}).then((function(r){var a=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Tu(Object(n),!0).forEach((function(t){Au(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Tu(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({__file:"wp_block"},c),o=new FormData;o.append("action","get_templately"),o.append("content_type","push_to_cloud"),o.append("nonce",Ru),isNaN(t)||(o.append("workspace_id",t),o.append("workspaceActivity",JSON.stringify(O)),O.shared?C("/shared/workspace/"+O.slug+"?refresh"):C("/workspace/"+O.slug+"?refresh")),o.append("title",n),o.append("data",JSON.stringify(a)),o.append("file_type","gutenberg"),_(!0),Do.a.post(ajaxurl,o).then((function(t){if(t.data.success){var n=JSON.parse(t.data.data.data);null!=n?(n.hasOwnProperty("myCloud_item")&&e.dispatch(er(n.myCloud_item)),_("redirect")):(ii("Something went wrong.",{timer:2e3,icon:"error"}),C("/templates/save"),_("redirect"))}else ii(t.data.data,{timer:2e3,icon:"error"}),_("redirect"),C("/templates/save")}))}))),f(!1)}if(s&&"elementor"===e.platform){var u=parseInt(O.value),p={};isNaN(u)||((p={workspace_id:u}).workspaceActivity=JSON.stringify(O),O.shared?C("/shared/workspace/"+O.slug+"?refresh"):C("/workspace/"+O.slug+"?refresh")),_(!0);var d=null==e.page||!0===e.page?elementor.previewView.el.firstElementChild.firstElementChild:e.currentElement.el,m=navigator.userAgent.toLowerCase().indexOf("firefox")>-1;if(null==d||m){if(null!=d)ci(n,d,p).then((function(t){if(t.data.success&&null!=t.data.data.data){var n=JSON.parse(t.data.data.data);"object"==Cu(n)&&(n.hasOwnProperty("myCloud_item")&&e.dispatch(er(n.myCloud_item)),_("redirect"),ii(t.data.data.message,{timer:2e3,icon:"success"}))}else ii("Something went wrong.",{timer:2e3,icon:"error"}),_("redirect"),C("/templates/save")})).catch((function(e){return console.error("Pushed Error: ",e)}))}else Pu.a.toJpeg(d,{width:d.clientWidth,bgcolor:"#fff"}).then((function(t){p.thumbnail=t,ci(n,d,p).then((function(t){if(t.data.success&&null!=t.data.data.data){var n=JSON.parse(t.data.data.data);"object"==Cu(n)&&(n.hasOwnProperty("myCloud_item")&&e.dispatch(er(n.myCloud_item)),_("redirect"),ii(t.data.data.message,{timer:2e3,icon:"success"}))}else ii("Something went wrong.",{timer:2e3,icon:"error"}),_("redirect"),C("/templates/save")})).catch((function(e){return console.error("Pushed Error: ",e)}))})).catch((function(e){return console.error("DOMtoIMAGE ERROR: ",e)}));f(!1)}}),[s]),Object(o.useEffect)((function(){y&&k(y)}),[y]),i.a.createElement(Zc,null,i.a.createElement("div",{className:"templately-modal-content templately-templates-save"},x&&i.a.createElement(Ou,null),"redirect"===x&&i.a.createElement(G,{to:P}),!1===x&&i.a.createElement("div",null,i.a.createElement("h3",null,Lu("Save Your Template And Push to Cloud","templately")," "),i.a.createElement("div",{className:"templately-save-form"},i.a.createElement("div",null,i.a.createElement("input",{autoFocus:!0,type:"text",onKeyDown:function(e){return m(13===e.keyCode)},onChange:function(e){return r(e.currentTarget.value)},value:n,placeholder:"Template Name"}),i.a.createElement(Co,{maxMenuHeight:"200px",options:b,value:O,onChange:function(e){return g(e)}})),i.a.createElement("button",{disabled:l,className:"templately-button",onClick:function(){return f(!0)}},Lu("Save & Push","templately"))))))}));n(110);function Uu(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Bu(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Bu(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Bu(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Vu=wp.i18n.__,Wu=function(e){return i.a.createElement("input",{type:e.type||"text",className:"widefat templately-input",placeholder:e.placeholder,name:e.name,value:e.value,onBlur:function(t){return e.onBlur&&e.onBlur(t.target.value)},onChange:function(t){return e.onChange(t.target.value)}})},Hu=tt()((function(e){var t=Uu(Object(o.useState)(""),2),n=t[0],r=t[1],a=Uu(Object(o.useState)(""),2),l=a[0],c=a[1],u=Uu(Object(o.useState)(""),2),s=u[0],f=u[1],p=Uu(Object(o.useState)(""),2),d=p[0],m=p[1],h=Uu(Object(o.useState)(null),2),y=h[0],g=h[1],v=Uu(Object(o.useState)(""),2),b=v[0],w=v[1],E=Uu(Object(o.useState)(!0),2),O=E[0],k=E[1],S=Uu(Object(o.useState)(!1),2),x=S[0],_=S[1],j=Uu(Object(o.useState)(!1),2),P=j[0],C=j[1],T=Uu(Object(o.useState)(!1),2),A=T[0],N=T[1],I=Uu(Object(o.useState)(!1),2),L=I[0],D=I[1];return Object(o.useEffect)((function(){k(!0),""!=n&&""!=l&&""!=d&&""!=b&&""!=s&&x&&P&&mi(s)&&d===b&&Ei(d)&&k(!1)}),[n,l,s,d,b,x,P]),Object(o.useEffect)((function(){null!==y&&("password"!==y&&"confirm_password"!==y||!(d.length>0||b.length>0)||(Ei(d)||ii(Vu("Password must contain at least 8 characters, uppercase, lowercase and numbers."),{icon:"warning",showCloseButton:!0}),"confirm_password"===y&&d!==b&&ii(Vu("Passwords do not match."),{icon:"warning",showCloseButton:!0})),"email"===y&&s.length>0&&!mi(s)&&ii(Vu("Please insert a valid email address."),{icon:"warning",showCloseButton:!0}),g(null))}),[y]),Object(o.useEffect)((function(){A&&(D(!0),function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=new FormData;return null!=e.first_name&&t.append("first_name",e.first_name),null!=e.last_name&&t.append("last_name",e.last_name),null!=e.email&&t.append("email",e.email),null!=e.password&&t.append("password",e.password),t.append("nonce",ai),t.append("action","get_templately"),t.append("content_type","create_user"),Do.a.post(ajaxurl,t).then((function(e){return e})).catch((function(e){return e}))}({first_name:n,last_name:l,email:s,password:d}).then((function(t){if(void 0!==t&&void 0!==t.data&&t.data.success)TemplatelyAdmin.is_logged_in=!0,e.dispatch(Vn(!0)),null!==e.next_route?e.dispatch(Zn(e.next_route)):e.dispatch(Zn("/settings")),e.dispatch(Jn(t.data.data)),e.dispatch(Xn(t.data.data.admin));else if(D(!1),"string"==typeof t.data.data)ii(t.data.data,{timer:2e3,icon:"error"});else{var n=Object.keys(t.data.data).map((function(e){return i.a.createElement("div",null,t.data.data[e])}));ii(i.a.createElement("div",null,n),{timer:2e3,icon:"error"})}})).catch((function(e){return console.error("Error:",e)})),N(!1))}),[A]),i.a.createElement(i.a.Fragment,null,L&&i.a.createElement(Ou,null),i.a.createElement("h3",null,Vu("Create Account!","templately")),i.a.createElement("div",{className:"tadmin-form-row"},i.a.createElement("div",{className:"templately-left"},i.a.createElement(Wu,{placeholder:"First Name",name:"first_name",value:n,onChange:function(e){return r(e)}})),i.a.createElement("div",{className:"templately-right"},i.a.createElement(Wu,{placeholder:"Last Name",name:"last_name",value:l,onChange:function(e){return c(e)}}))),i.a.createElement(Wu,{placeholder:"Email",name:"email",value:s,onBlur:function(){return g("email")},onChange:function(e){return f(e)}}),i.a.createElement("div",{className:"tadmin-form-row"},i.a.createElement("div",{className:"templately-left"},i.a.createElement(Wu,{placeholder:"Password",name:"password",type:"password",value:d,onBlur:function(){return g("password")},onChange:function(e){return m(e)}})),i.a.createElement("div",{className:"templately-right"},i.a.createElement(Wu,{placeholder:"Confirm Password",name:"confirm_password",type:"password",value:b,onBlur:function(){return g("confirm_password")},onChange:function(e){return w(e)}}))),i.a.createElement("div",{className:"widefat templately-input-consent"},i.a.createElement("input",{id:"elem-consent",type:"checkbox",onChange:function(e){return _(e.currentTarget.checked)},name:"consent"}),i.a.createElement("label",{htmlFor:"elem-consent"},"I agree to the Templately"," ",i.a.createElement("a",{href:"https://templately.com/privacy-policy",target:"_blank"},"Privacy Policy"),".")),i.a.createElement("div",{className:"widefat templately-input-consent"},i.a.createElement("input",{id:"elem-consent-terms",type:"checkbox",onChange:function(e){return C(e.currentTarget.checked)},name:"consent"}),i.a.createElement("label",{htmlFor:"elem-consent-terms"},"I agree to the Templately"," ",i.a.createElement("a",{href:"https://templately.com/terms-of-services",target:"_blank"},"Terms of Services"),".")),i.a.createElement("button",{disabled:O,onClick:function(){return N(!0)},className:"button button-primary templately-button",type:"submit"},Vu("Create Account","templately")),i.a.createElement("p",{className:"templately-new-here"},i.a.createElement("span",{onClick:function(){return e.tab(1)}}," ",Vu("Already have an account?","templately"))))}));function $u(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return qu(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return qu(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function qu(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Ku=wp.i18n.__,Qu=tt((function(e){return{isLoggedIn:e.common.isLoggedIn,errorText:e.admin.errorText,next_route:e.common.next_route,is_global_login:e.common.is_global_login,user_can_logout:e.common.user_can_logout,is_linked_login:e.common.is_linked_login}}))((function(e){var t,n=$u(Object(o.useState)(""),2),r=n[0],a=n[1],l=$u(Object(o.useState)(""),2),c=l[0],u=l[1],s=$u(Object(o.useState)(""),2),f=s[0],p=s[1],d=$u(Object(o.useState)("password"),2),m=d[0],h=d[1],y=$u(Object(o.useState)(!0),2),g=y[0],v=y[1],b=$u(Object(o.useState)(!1),2),w=b[0],E=b[1],O=$u(Object(o.useState)(!1),2),k=O[0],S=O[1],x=$u(Object(o.useState)(null),2),_=x[0],j=x[1],P=$u(Object(o.useState)(!1),2),C=P[0],T=P[1];return Object(o.useEffect)((function(){return function(){clearTimeout(t)}}),[]),Object(o.useEffect)((function(){null!==_&&("email"===_&&r.length>0&&!mi(r)&&ii(Ku("Please insert a valid email address."),{icon:"warning",showCloseButton:!0}),j(null))}),[_]),Object(o.useEffect)((function(){if(w){var n={};"api"===m?n.api_key=f:(n.email=r,n.password=c),n.global_signin=C,S(!0),function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=new FormData;return n.append("withApi",t),t?null!=e.api_key&&n.append("api_key",e.api_key):(null!=e.email&&n.append("email",e.email),null!=e.password&&n.append("password",e.password)),null!=e.global_signin&&n.append("global_signin",e.global_signin),n.append("nonce",ai),n.append("action","get_templately"),n.append("content_type","login_user"),Do.a.post(ajaxurl,n).then((function(e){return e})).catch((function(e){return e}))}(n,"api"===m).then((function(t){t.hasOwnProperty("data")?t.data.success?(S(!1),TemplatelyAdmin.is_logged_in=!0,e.is_linked_login||C?C&&e.dispatch(Tn(!0)):(e.dispatch(Tn(!1)),e.dispatch(Nn(!0))),e.dispatch(In("")),e.dispatch(Vn(!0)),null!==e.next_route?e.dispatch(Zn(e.next_route)):e.user_can_logout||e.is_linked_login?e.dispatch(Zn("/settings")):e.dispatch(Zn("/settings?refresh")),e.dispatch(Jn(t.data.data)),e.dispatch(Xn(t.data.data.admin))):(ii(t.data.data,{timer:1500,icon:"error"}),S(!1)):(S(!1),ii(Ku("Something went wrong.","elmentorify"),{timer:1500,icon:"error"}))})).catch((function(e){S(!1),ii(Ku("Something went wrong.","elmentorify"),{timer:1500,icon:"error"})})).finally((function(){t=setTimeout((function(){e.dispatch(Jn(null))}),5e3)})),E(!1)}}),[w]),Object(o.useEffect)((function(){e.errorText&&e.dispatch(tr(null)),v(!0),"api"===m?f.length>=20&&v(!1):mi(r)&&c.length>=8&&v(!1)}),[c,r,f]),i.a.createElement(i.a.Fragment,null,"password"===m&&i.a.createElement(i.a.Fragment,null,i.a.createElement("h3",null,Ku("Great to have you back!","templately")),i.a.createElement("button",{className:"button templately-connect-btn",onClick:function(){return h("api")}},"Connect via API"),i.a.createElement("input",{className:"widefat templately-input",placeholder:"Email",name:"email",onBlur:function(){return j("email")},value:r,onChange:function(e){return a(e.target.value)}}),i.a.createElement("input",{type:"password",className:"widefat templately-input",placeholder:"Password",name:"password",value:c,onChange:function(e){return u(e.target.value)}}),!e.is_global_login&&i.a.createElement(i.a.Fragment,null,i.a.createElement("label",{htmlFor:"global-sign-in",className:"global-sign-in"},i.a.createElement("input",{type:"checkbox",className:"templately-input",id:"global-sign-in",name:"global-sign-in",onChange:function(){return T(!C)}}),i.a.createElement("span",null,Ku("Global Sign In","templately"))),i.a.createElement("p",{className:"templately-helptext"},Ku("All the sitewide users will be logged in with this Templately account","templately"))),i.a.createElement("button",{disabled:g,onClick:function(){return E(!0)},className:"button templately-button",type:"submit"},Ku(k?"Signing In...":"Sign In","templately"))),"api"===m&&i.a.createElement(i.a.Fragment,null,i.a.createElement("button",{className:"button templately-connect-btn",onClick:function(){return h("password")}},"Connect via Login Credentials"),i.a.createElement("div",{className:"templately-api-input-wrapper"},i.a.createElement("input",{className:"widefat templately-input",placeholder:"API Key",name:"api_key",value:f,onChange:function(e){return p(e.target.value)}}),i.a.createElement("a",{href:"https://templately.com/manageapis",target:"_blank"},Ku("Get API Key","templately"))),i.a.createElement("button",{disabled:g,onClick:function(){return E(!0)},className:"button templately-button",type:"submit"},Ku("Connect","templately"))),i.a.createElement("p",{className:"templately-new-here"},Ku("New here?","templately")," ",i.a.createElement("span",{onClick:function(){return e.tab(2)}}," ",Ku("Create an account!","templately")),i.a.createElement("a",{href:"https://templately.com/forgot-password",target:"_blank"},Ku("Forgot Password?","templately"))))}));function Gu(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Yu(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Yu(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Yu(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Xu=wp.i18n.__,Ju=tt((function(e){return{isLoggedIn:e.common.isLoggedIn}}))((function(e){var t=Gu(Object(o.useState)(1),2),n=t[0],r=t[1];return Object(o.useEffect)((function(){e.isLoggedIn&&e.dispatch(Zn("/settings"))}),[]),Object(o.useEffect)((function(){e.isLoggedIn&&e.dispatch(Zn("/settings"))}),[e.isLoggedIn]),i.a.createElement("div",{className:"templately-admin-form-inner"},i.a.createElement("div",{className:"templately-login-form"},i.a.createElement("div",{className:"templately-admin-header"},i.a.createElement("div",{className:"templately-admin-title"},i.a.createElement("h1",null,Xu("Explore 100+ Free Templates","templately")),i.a.createElement("p",null,Xu("From multipurpose themes to niche templates, you’ll always find something that catches your eye.","templately")))),i.a.createElement("div",{className:"templately-admin-content"},i.a.createElement("div",{className:"templately-left"},i.a.createElement("div",{className:"templately-cloud-video-container"},i.a.createElement("iframe",{height:"350",src:"https://www.youtube.com/embed/coLxfjnrm3I",frameBorder:"0",allow:"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0}))),i.a.createElement("div",{className:"templately-right"},i.a.createElement("div",{className:"templately-admin-tab"},i.a.createElement("ul",null,i.a.createElement("li",{onClick:function(){return r(1)},className:"".concat(1===n?"active":""," ")},Xu("Sign In","templately")),i.a.createElement("li",{onClick:function(){return r(2)},className:"".concat(2===n?"active":""," ")},Xu("Sign Up","templately"))),i.a.createElement("div",{className:"templately-admin-tab-content"},i.a.createElement("div",{className:"templately-admin-tcontent ".concat(1===n?"active":"")},i.a.createElement(Qu,{tab:function(e){return r(e)}})),i.a.createElement("div",{className:"templately-admin-tcontent ".concat(2===n?"active":"")},i.a.createElement(Hu,{tab:function(e){return r(e)}}))))))))}));function Zu(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return es(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return es(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function es(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var ts=wp.i18n.__,ns=tt((function(e){return{user:e.admin.user,isLoggedIn:e.common.isLoggedIn,user_can_logout:e.common.user_can_logout,is_linked_login:e.common.is_linked_login}}))((function(e){var t=Zu(Object(o.useState)(!1),2),n=t[0],r=t[1],a=e.user;return Object(o.useEffect)((function(){e.isLoggedIn||e.dispatch(Zn("/sign-in"))}),[]),Object(o.useEffect)((function(){var t;0!=n&&(((t=new FormData).append("action","get_templately"),t.append("content_type","logout"),t.append("nonce",ai),Do.a.post(ajaxurl,t).then((function(e){return e})).catch((function(e){return console.error("Fav Error: ",e.response)}))).then((function(t){t.data.success?(TemplatelyAdmin.is_logged_in=!1,e.dispatch(Vn(!1)),e.dispatch(An(!1)),e.dispatch(Xn([])),ii(ts("Successfully Logged Out.","templately"),{icon:"success",timer:1500}),e.dispatch(Zn("/sign-in"))):ii(ts("Something went wrong.","templately"),{icon:"error",timer:1500})})),r(!1))}),[n]),i.a.createElement("div",{className:"templately-admin-form-inner templately-profile"},i.a.createElement("div",{className:"templately-login-form"},i.a.createElement("div",{className:"templately-manage-accounts"},i.a.createElement("h1",null,ts("Hey","templately")," ",a.display_name||a.name,","," ",ts("Welcome Back!","templately")),i.a.createElement("div",{className:"templately-account-details"},i.a.createElement("strong",null,ts("Account Details","templately"),":"),i.a.createElement("table",{bgcolor:"transparent",border:"0",cellPadding:"0",cellSpacing:"0"},i.a.createElement("tbody",null,a.email&&i.a.createElement("tr",null,i.a.createElement("th",null,i.a.createElement("strong",null,ts("Email","templately"),":")),i.a.createElement("td",null,a.email)),a.plan&&i.a.createElement("tr",null,i.a.createElement("th",null,i.a.createElement("strong",null,ts("Plan","templately"),":")),i.a.createElement("td",{className:"templately-plan"},"free"===a.plan?"Starter":a.plan)),a.joined&&i.a.createElement("tr",null,i.a.createElement("th",null,i.a.createElement("strong",null,ts("Joining Date","templately"),":")),i.a.createElement("td",null,a.joined)),""!=a.plan_expire_at&&i.a.createElement("tr",null,i.a.createElement("th",null,i.a.createElement("strong",null,ts("Expiry Date","templately"),":")),i.a.createElement("td",null,a.plan_expire_at))))),i.a.createElement("div",null,i.a.createElement("a",{className:"button templately-button",target:"_blank",href:"https://templately.com/profile"},ts("Manage Account","templately")),e.user_can_logout&&i.a.createElement(i.a.Fragment,null,i.a.createElement("button",{onClick:function(){return r(!0)},className:"button templately-button"},ts("Logout","templately"))),e.is_linked_login&&!e.user_can_logout&&i.a.createElement("button",{onClick:function(){return r(!0)},className:"button templately-button"},ts("Unlink My Account","templately")),!e.user_can_logout&&!e.is_linked_login&&i.a.createElement(he,{className:"button templately-button",to:"/sign-in"},ts("Link My Account","templately"))))))})),rs=n(58),as=wp.i18n.__,os=function(e){return i.a.createElement("div",{className:"templately-item-badge ".concat(e.pro?"templately-pro":"templately-free")},i.a.createElement("span",null,e.pro?as("Pro","templately"):as("Starter","templately")))};function is(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return ls(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ls(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ls(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var cs=wp.i18n.__,us=TemplatelyAdmin,ss=us.loadingImage,fs=(us.is_editor,function(e){var t=e.content,n=is(Object(o.useState)(!1),2),r=n[0],a=n[1],l=is(Object(o.useState)(!1),2),c=l[0],u=l[1],s=is(Object(o.useState)(""),2),f=s[0],p=s[1],d=is(Object(o.useState)(!1),2),m=d[0],h=d[1],y=is(Object(o.useState)(!1),2),g=y[0],v=y[1],b=is(Object(o.useState)(""),2),w=b[0],E=b[1],O=is(Object(o.useState)(!1),2),k=O[0],S=O[1],x=is(Object(o.useState)(!1),2),_=x[0],j=x[1];return Object(o.useEffect)((function(){var t,n,r,o;0!=g&&(a(!0),(t=g,n=w,r=e.platform,(o=new FormData).append("action","get_templately"),o.append("content_type","create_page"),o.append("title",n),o.append("nonce",ai),o.append("id",t),o.append("platform",r),Do.a.post(ajaxurl,o).then((function(e){return e.data.success?e.data.data:e})).catch((function(e){return e}))).then((function(e){e.hasOwnProperty("data")&&e.data.hasOwnProperty("success")&&!1===e.data.success?(e.data.hasOwnProperty("data")&&e.data.data.hasOwnProperty("errorCode")?(u("required_pro"===e.data.data.errorCode),p(e.data.data.message)):p(e.data.data),a(!1)):(a(!1),S(e))})),v(!1),E(""))}),[g]),Object(o.useEffect)((function(){var e,t;0!=m&&(a(!0),(e=m,(t=new FormData).append("action","get_templately"),t.append("content_type","import_to_library"),t.append("nonce",ai),t.append("id",e),t.append("is_editor",Boolean(oi)),Do.a.post(ajaxurl,t).then((function(e){return e.data.success?e.data.data:e})).catch((function(e){return e}))).then((function(e){u(!1),e.hasOwnProperty("data")&&e.data.hasOwnProperty("success")&&!1===e.data.success?(e.data.hasOwnProperty("data")&&e.data.data.hasOwnProperty("errorCode")?(u("required_pro"===e.data.data.errorCode),p(e.data.data.message)):p(e.data.data),a(!1)):(a(!1),S(e))})).catch((function(e){return console.error("Importing went wrong: ",e)})),h(!1))}),[m]),Object(o.useEffect)((function(){a(!0),function(e){if(e.length<=0)return!1;var t=new FormData;return t.append("action","get_templately"),t.append("nonce",ai),t.append("content_type","platform_exists"),t.append("platform",e),Do.a.post(ajaxurl,t).then((function(e){return e})).catch((function(e){return e}))}(e.platform).then((function(e){a(!1),e.data.data?j(!0):j(!1)}))}),[]),i.a.createElement(i.a.Fragment,null,r&&i.a.createElement("div",{className:"templately-pre-loader templately-platform-check"},i.a.createElement("img",{src:ss}),i.a.createElement("p",null,"Checking platform exists or not...")),!r&&i.a.createElement("div",{className:"templately-import-modal"},i.a.createElement("div",{className:"templately-im-header"},i.a.createElement("h3",null,e.title)),i.a.createElement("div",{className:"templately-im-body"},!1!==k&&i.a.createElement("div",{className:"templately-imb-section"},i.a.createElement("p",null,cs("Template imported successfully! You can now edit or preview the template and push to Templately cloud.","templately")),i.a.createElement("a",{className:"templately-modal-button button",href:k.edit_link},cs("Edit Template","templately")),0!=k.elementor_edit_link&&i.a.createElement("a",{className:"templately-modal-button button",href:k.elementor_edit_link},cs("Edit Template with Elementor","templately")),i.a.createElement("a",{className:"templately-modal-button button",href:k.visit},cs("Preview Template","templately"))),""!==f&&i.a.createElement("div",{className:"templately-imb-section"},i.a.createElement("p",null,f),c&&i.a.createElement("a",{href:"https://templately.com",target:"_blank"},cs("Upgrade to Pro","templately"))),0==k&&_&&""===f&&i.a.createElement(i.a.Fragment,null,"elementor"===e.platform&&i.a.createElement("div",{className:"templately-imb-section"},i.a.createElement("p",null,"Import this template to your library to make it available in your Elementor Saved Templates(opens in a new tab) list for future use."),i.a.createElement("button",{className:"templately-modal-button button",onClick:function(){return h(t.id)}},cs("Import to Library","templately"))),i.a.createElement("div",{className:"templately-imb-section"},i.a.createElement("p",null,"Create a new page from this template to make it available as a draft page in your Pages list."),i.a.createElement("div",{className:"templately-imb-new-form"},i.a.createElement("input",{className:"widefat",type:"text",value:w,onChange:function(e){return E(e.currentTarget.value)}}),i.a.createElement("button",{className:"templately-modal-button button",disabled:""===w,onClick:function(){return v(t.id)}},cs("Create a Page","templately"))))),0==k&&!_&&i.a.createElement(i.a.Fragment,null,i.a.createElement("p",null,"You should have install"," ",cs(e.platform,"templately")," first.")))))});function ps(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ds(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ps(Object(n),!0).forEach((function(t){ms(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ps(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ms(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hs(e){return function(e){if(Array.isArray(e))return vs(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||gs(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ys(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||gs(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function gs(e,t){if(e){if("string"==typeof e)return vs(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?vs(e,t):void 0}}function vs(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var bs=wp.i18n.__,ws=TemplatelyAdmin,Es=ws.loadingImage,Os=ws.is_editor,ks=ws.is_block_editor,Ss=function(e){var t=e.requirement,n=e.completeCallback,r=e.setErrors,a=e.errors,l=ys(Object(o.useState)(!0),2),c=l[0],u=l[1],s=ys(Object(o.useState)(!1),2),f=s[0],p=s[1],d=ys(Object(o.useState)(!1),2),m=d[0],h=d[1],y=ys(Object(o.useState)({}),2),g=y[0],v=y[1];return t?(Object(o.useEffect)((function(){wi(t).then((function(e){u(e.loading),p(e.error),v(e.data)}))}),[]),Object(o.useEffect)((function(){m&&(u(!0),p(!1),wi(t).then((function(e){if(!e.error){var n=a.filter((function(e){return e.id!==t.id}));r(n)}u(e.loading),p(e.error),v(e.data)})),h(!1))}),[m]),Object(o.useEffect)((function(){c||n(f)}),[c]),Object(o.useEffect)((function(){f&&r([].concat(hs(a),[t]))}),[f]),i.a.createElement(i.a.Fragment,null,c?i.a.createElement("span",{className:"templately-installing"},i.a.createElement("span",{className:"dashicons dashicons-update"}),"Installing..."):null,f?g&&g.errorMessage?i.a.createElement("span",{className:"templately-error"},i.a.createElement("span",{className:"dashicons dashicons-no"}),g.errorMessage):i.a.createElement("button",{className:"button button-small templately-retry",onClick:function(){return h(!0)}},i.a.createElement("span",{className:"dashicons dashicons-no"}),"Retry & Proceed to Import"):null,c||f?null:i.a.createElement("span",{className:"templately-success"},i.a.createElement("span",{className:"dashicons dashicons-yes-alt"})," Success"))):(Object(o.useEffect)((function(){n()}),[]),bs("Ignored","templately"))},xs=function(e){var t=ys(Object(o.useState)(!1),2),n=t[0],r=t[1],a=ys(Object(o.useState)(!0),2),l=a[0],c=a[1],u=ys(Object(o.useState)([]),2),s=u[0],f=u[1],p=ys(Object(o.useState)(!1),2),d=p[0],m=p[1],h=ys(Object(o.useState)(null),2),y=h[0],g=h[1],v=ys(Object(o.useState)({}),2),b=v[0],w=v[1],E=ys(Object(o.useState)([]),2),O=E[0],k=E[1];Object(o.useEffect)((function(){var t,n,a;return(n=e.dependencyList,(a=new FormData).append("action","get_templately"),a.append("content_type","check_dependency"),a.append("nonce",ai),a.append("dependency",JSON.stringify(n)),Do.a.post(ajaxurl,a).then((function(e){return e.data.success?e.data.data.dependency:[]}))).then((function(n){var a,o=[];n.length>0&&(n.map((function(e,t){o.push(e)})),a="name",o.sort(Zo(a)),f(o)),o.length>0?c(!1):t=setTimeout((function(){"elementor"===e.platform&&Boolean(Os)||Boolean(ks)&&"gutenberg"===e.platform?$o.a.close({insert:!0}):(c(!1),r(!0))}),1500)})),function(){return clearTimeout(t)}}),[]);var S=function(e){return void 0===b[e]||b[e]},x=function(){g((function(e){return e+1}))},_=function(e){k(e)};return Object(o.useEffect)((function(){null!=y&&y>s.length-1&&0===O.length&&("elementor"===e.platform&&Boolean(Os)||Boolean(ks)&&"gutenberg"===e.platform?$o.a.close({insert:!0}):r(!0))}),[y]),Object(o.useEffect)((function(){d&&$o.a.close({cancel:!0})}),[d]),i.a.createElement("div",{className:"templately-global-modal"},l&&i.a.createElement("div",{className:"templately-pre-loader templately-dependencies"},i.a.createElement("img",{src:Es}),i.a.createElement("p",null,"Checking dependecies...")),n&&!l&&i.a.createElement(fs,{platform:e.platform,title:e.title,content:e.content}),!l&&!n&&i.a.createElement("div",{className:"templately-installer-widget align-left"},i.a.createElement("h4",null,"To import this item you need to install all the Plugin(s) listed below:"),s.length>0&&i.a.createElement("ul",null,s.map((function(e,t){return i.a.createElement("li",{key:t},i.a.createElement("div",{className:"templately-checkbox"},i.a.createElement("input",{value:"1",type:"checkbox",id:"requirement".concat(t),disabled:null!==y&&!e.is_pro,checked:S(t)&&!e.is_pro,onChange:function(n){if(!e.is_pro){var r=!!n.target.checked;w((function(e){return ds(ds({},e),{},ms({},t,r))}))}}}),i.a.createElement("label",{htmlFor:"requirement".concat(t)},i.a.createElement("span",null,e.link&&"#"!=e.link&&""!=e.link?i.a.createElement("a",{target:"_blank",rel:"nofollow",href:e.link},e.name):e.name))),y===t||y>t?i.a.createElement(Ss,{key:"installing".concat(t),requirement:S(t)?e:null,completeCallback:x,errors:O,setErrors:function(e){return _(e)}}):null)}))),i.a.createElement("p",null,i.a.createElement("strong",null,"Note:")," Make sure you have manually installed the ",i.a.createElement("em",null,"Pro Plugin(s)")," necessary and listed above."),i.a.createElement("div",{className:"templately-btn-group"},i.a.createElement("button",{disabled:null!==y,onClick:function(){return m(!0)},className:"button button-large templately-installer-btn"},bs("Cancel","templately")),i.a.createElement("button",{disabled:null!==y,onClick:function(){return g(0)},className:"button button-large templately-installer-btn"},bs("Install & Proceed to Import","templately")))))};function _s(e){return(_s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function js(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ps(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?js(Object(n),!0).forEach((function(t){Cs(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):js(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Cs(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ts(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return As(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return As(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function As(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Ns=wp.i18n.__,Is=TemplatelyAdmin,Ls=Is.default_image,Ds=Is.is_editor,Rs=Is.platform,Ms=tt((function(e){return{preview:e.preview,favourites:e.admin.user.favourites,isLoggedIn:e.common.isLoggedIn,platform:e.common.platform,platform_exists:e.common.platforms}}))((function(e){var t=e.content,n=Ts(Object(o.useState)(!1),2),r=n[0],a=n[1],l=Ts(Object(o.useState)(!1),2),c=l[0],u=l[1],s=Ts(Object(o.useState)(!1),2),f=s[0],p=s[1],d=Ts(Object(o.useState)(!1),2),m=d[0],h=d[1],y=Ts(Object(o.useState)([]),2),g=y[0],v=y[1],b=Ts(Object(o.useState)(t.favourite_count),2),w=b[0],E=b[1];Object(o.useEffect)((function(){if(0!=r){if(!e.isLoggedIn)return e.dispatch(Zn("/sign-in")),void a(!1);ii("",{showCloseButton:!0,allowOutsideClick:!1,target:Ds?"#templately-app-modal":"#templatelyAdmin",html:i.a.createElement(xs,{dependencyList:t.dependencies,platform:e.platform,title:t.name,content:t})}).then((function(t){null!=t.insert&&t.insert&&(e.dispatch(Ln(Ps(Ps({},e.platform_exists),{},Cs({},"elementor",!0)))),e.dispatch(Un(!0)),li(r,"remote",{fileType:e.platform,is_editor:Boolean(Ds)}).then((function(t){if(!0===t)"gutenberg"!==Rs?window.TemplatelyModal.destroy():Ro.close(),e.dispatch(Un(!0));else{e.dispatch(Un(!1));var n="",r=!1;t.data&&t.data.data&&t.data.data.errorCode?("required_pro"===t.data.data.errorCode&&(r=!0),n=t.data.data.message):"string"==typeof t.data.data&&(n=t.data.data),ii("",{icon:"error",html:i.a.createElement(ki,{content:i.a.createElement("div",null,i.a.createElement("p",null,n),r&&i.a.createElement("a",{href:"https://templately.com",target:"_blank"},"Upgrade to Pro"))})})}})))})),a(!1)}}),[r]),Object(o.useEffect)((function(){if(!1!==c){var n={isOpen:!0,type:e.type,itemID:t.id,deep:++e.preview.deep,content:t};e.pack&&(n=Ps(Ps({},n),{type:2===n.deep?t.type:e.type})),"block"!==t.type&&"page"!==t.type&&(n=Ps(Ps({},n),{packSlug:t.slug})),"page"===t.type&&(n=Ps(Ps({},n),{pageSlug:t.slug})),"block"===t.type&&(n=Ps(Ps({},n),{itemSlug:t.slug})),e.dispatch(zn(n)),u(!1)}}),[c]),Object(o.useEffect)((function(){var n;m&&(f?(n=si(t.id,e.type,"set_unfavourite"),p(!1),E(w-1)):(n=si(t.id,e.type),p(!0),E(w+1)),n.then((function(t){t.data.success&&e.dispatch(Xn(t.data.data))})),h(!1))}),[m]);var O="block"===e.type||"page"===e.type?"item":"pack";return Object(o.useEffect)((function(){if(p(void 0!==e.favourites&&e.favourites[O].includes(t.id)),t.dependencies&&t.dependencies.length>0){var n=[];t.dependencies.map((function(e,t){null!=e.icon&&n.push(i.a.createElement("img",{key:t,src:e.icon,alt:e.name}))})),v(n)}}),[]),i.a.createElement(i.a.Fragment,null,"object"==_s(t)&&i.a.createElement("div",{className:"templately-single-item templately-".concat(e.pack?"pack":"block"," ").concat(e.preview.isOpen?"templately-preview-item":"")},i.a.createElement("div",null,i.a.createElement("div",{className:"templately-item-image"},i.a.createElement(os,{pro:0!=t.price}),i.a.createElement(rs.LazyLoadImage,{height:"200px",effect:"blur",width:"100%",delayTime:"500",visibleByDefault:!0,alt:t.name,src:t.thumbnail||Ls}),i.a.createElement("div",{className:"templately-item-image-hover"},i.a.createElement("span",{onClick:function(){return u(!0)}},i.a.createElement(yn,{size:"20",color:"#fff"})),g.length>0&&i.a.createElement("div",{className:"templately-item-dependencies-icon"},g))),i.a.createElement("div",{className:"templately-single-item-details"},i.a.createElement("div",{className:"templately-single-item-details-content"},i.a.createElement("p",{className:"item-title"},i.a.createElement("strong",null,t.name),!e.preview.isOpen&&i.a.createElement("span",{className:"item-author"},Ns("by","templately")," ",t.author.display_name||t.author.name)),!e.preview.isOpen&&i.a.createElement("p",{className:"item-price"},!e.pack&&i.a.createElement("button",{className:"templately-button",onClick:function(){return a(t.id)}},i.a.createElement(mn,{color:"#6072ff"})))),i.a.createElement("div",{className:"templately-single-item-details-hover"},i.a.createElement("div",{className:"templately-fav-rating"},i.a.createElement("button",{className:"templately-button templately-fav",onClick:function(){return h(!0)}},i.a.createElement(vn,{size:"16px",color:f?"#f5365b":"#ddd"}),i.a.createElement("span",null,w)),i.a.createElement("span",{className:"templately-ratings"},i.a.createElement(Sn,{size:"16px",color:"#ffdc63"}),i.a.createElement("span",null,null==t.rating?0:t.rating.toFixed(1)))),("block"==e.type||"page"==e.type||e.preview.isOpen)&&i.a.createElement("button",{className:"templately-button",onClick:function(){return a(t.id)}},i.a.createElement(mn,{color:"#6072ff"})))))))}));function Fs(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return zs(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return zs(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function zs(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Us=function(e){var t=Fs(Object(o.useState)(!1),2),n=t[0],r=t[1],a=Object(o.useRef)(null),l=function(){a.current&&r(a.current.getBoundingClientRect().top<=0)};return Object(o.useEffect)((function(){return window.addEventListener("scroll",l),function(){window.addEventListener("scroll",(function(){return l}))}}),[]),i.a.createElement("div",{className:"templately-modal-sidebar".concat(n?" sticky":""),ref:a},i.a.createElement("div",{className:"templately-modal-sidebar-inner"},e.children))};n(111);function Bs(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Vs(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Vs(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Vs(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Ws=tt((function(e){return{activeSidebar:e.common.activeSidebar}}))((function(e){var t=e.name,n=e.child||[],r=Bs(Object(o.useState)(!1),2),a=r[0],l=r[1],c=[];return n.map((function(t,n){c.push(i.a.createElement("li",{className:"templately-sidebar-menu-item ".concat(e.activeSidebar.activeSidebarMenu===t.id?"templately-smenu-active":""),key:t.id},i.a.createElement("span",{onClick:function(){e.dispatch(Hn({activeSidebarMenu:t.id,activeParentSidebarMenu:e.id})),e.dispatch(Qn(1)),e.dispatch(Bn(!0)),e.dispatch(tr(null))}},t.name)))})),i.a.createElement("li",{className:"templately-sidebar-menu-item ".concat(n.length>0?"templately-has-sub":""," ").concat(e.activeSidebar.activeSidebarMenu===e.id||e.activeSidebar.activeParentSidebarMenu===e.id?"templately-smenu-active":"")},i.a.createElement("span",{onClick:function(){e.dispatch(Hn({activeSidebarMenu:e.id,activeParentSidebarMenu:e.id})),e.dispatch(tr(null)),e.dispatch(Bn(!0)),e.dispatch(Qn(1))}},t),n.length>0&&(a?i.a.createElement(fn,{onClick:function(){return l(!a)}}):i.a.createElement(cn,{onClick:function(){return l(!a)}})),n.length>0&&i.a.createElement("ul",{className:"templately-sidebar-submenu".concat(a?" tcollapse-submenu":"")},c))}));function Hs(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return $s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return $s(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function $s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var qs=function(e){var t=e.item,n=e.isSelected,r=Hs(Object(o.useState)(t.selected),2),a=r[0],l=r[1];return Object(o.useEffect)((function(){l(t.selected)}),[t.selected]),Object(o.useEffect)((function(){null!==a&&n({id:t.id,selected:a,is_pro:t.is_pro})}),[a]),i.a.createElement("li",{key:t.id},i.a.createElement("input",{id:"tsdf-".concat(t.id),type:"checkbox",checked:a,onChange:function(){return l(!t.selected)}}),i.a.createElement("label",{htmlFor:"tsdf-".concat(t.id)},i.a.createElement("span",null,t.name)))};function Ks(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Qs(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ks(Object(n),!0).forEach((function(t){Gs(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ks(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Gs(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ys(e){return function(e){if(Array.isArray(e))return Zs(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||Js(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Xs(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||Js(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Js(e,t){if(e){if("string"==typeof e)return Zs(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Zs(e,t):void 0}}function Zs(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var ef=wp.i18n.__,tf=tt((function(e){return{}}))((function(e){var t=Xs(Object(o.useState)(null),2),n=t[0],r=t[1],a=Xs(Object(o.useState)([]),2),l=a[0],c=a[1],u=Xs(Object(o.useState)([]),2),s=u[0],f=u[1],p=Xs(Object(o.useState)([]),2),d=p[0],m=p[1],h=Xs(Object(o.useState)(!0),2),y=h[0],g=h[1];return Object(o.useEffect)((function(){if(!e.button){c(e.dependencies);var t=e.dependencies.map((function(e){return e.id}));m(t),e.setSelected(t)}}),[e.dependencies]),Object(o.useEffect)((function(){if(!e.button&&l.length>0){var t=[];l.map((function(e){t.push(i.a.createElement(qs,{checked:e.selected,isSelected:function(e){return r(e)},key:e.id,item:e}))})),f(t)}}),[l,y]),Object(o.useEffect)((function(){if(!e.button){var t=d.length>0?Ys(d):[],n=Ys(l);n=n.map((function(e){return-1===t.indexOf(e.id)&&y?t.push(e.id):-1!==t.indexOf(e.id)&&!1===y&&(t=t.filter((function(t){return t!==e.id}))),Qs(Qs({},e),{},{selected:y})})),c(n),m(t),e.setSelected(t)}}),[y]),Object(o.useEffect)((function(){if(!e.button){var t=d.length>0?Ys(d):[],r=Ys(l);null!==n&&(!1===n.selected&&t.length>0?t=t.filter((function(e){return e!==n.id})):-1===t.indexOf(n.id)&&!0===n.selected&&t.push(n.id),r=r.map((function(e){return e.id===n.id?Qs(Qs({},e),{},{selected:n.selected}):e})),0===t.length&&g(!1),e.setSelected(t),c(r),m(t))}}),[n]),e.button?i.a.createElement("div",{className:"templately-sidebar-dependency-filter"},i.a.createElement("button",{className:"templately-filter-button button button-medium button-primary",onClick:function(){return e.setFilter(!0)}},ef("Filter","templately")),e.isReset&&i.a.createElement("button",{className:"templately-filter-button button button-medium button-primary templately-filter-clear",onClick:function(){return e.setReset(!1)}},ef("Reset","templately"))):0===s.length?"":i.a.createElement("div",{className:"templately-sidebar-dependency-filter ".concat("free"===e.active&&e.free||"pro"===e.active&&e.pro?"tsdf-open":"")},i.a.createElement("div",{className:"templately-sidebar-filter-head"},i.a.createElement("div",{className:"templately-pro-batch-select"},i.a.createElement("h4",null,i.a.createElement("input",{id:"tsdf-".concat(e.pro?"pro":"free","-batch-check"),type:"checkbox",checked:y,onChange:function(){r(null),g(!y)}}),i.a.createElement("label",{htmlFor:"tsdf-".concat(e.pro?"pro":"free","-batch-check")},i.a.createElement("span",null,ef("".concat(e.pro?"Pro":"Free"," Plugins Dependencies"),"templately"))),i.a.createElement("span",{className:"tsdf-actions",onClick:function(){return e.setActive(e.pro?"pro"===e.active?"":"pro":e.free?"free"===e.active?"":"free":"")}},"free"===e.active&&e.free||"pro"===e.active&&e.pro?i.a.createElement(fn,null):i.a.createElement(cn,null))))),i.a.createElement("ul",{className:"templately-sidebar-dependency-filter-list"},s))}));function nf(e){return function(e){if(Array.isArray(e))return uf(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||cf(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function rf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function af(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?rf(Object(n),!0).forEach((function(t){of(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rf(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function of(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lf(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||cf(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function cf(e,t){if(e){if("string"==typeof e)return uf(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?uf(e,t):void 0}}function uf(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var sf=wp.i18n.__,ff=tt((function(e){return{dependencyFilterActive:e.common.dependencyFilter.filterActive,platform:e.common.platform,tags:e.common.tags}}),(function(e){return{setSidebar:function(t){return e(Hn(t))},setItemLoading:function(t){return e(Bn(t))},setDependenciesFilterActive:function(t){return e({type:"FILTER_DEPENDENCIES_ACTIVE",payload:t})},setDependenciesIdForFilter:function(t){return e({type:"FILTER_DEPENDENCIES_ID",payload:t})},setFilteredTags:function(t){return e({type:"FILTERED_TAGS",payload:t})}}}))((function(e){var t=[],n=lf(Object(o.useState)("free"),2),r=n[0],a=n[1],l=lf(Object(o.useState)(!1),2),c=l[0],u=l[1],s=lf(Object(o.useState)(!1),2),f=s[0],p=s[1],d=lf(Object(o.useState)([]),2),m=d[0],h=d[1],y=lf(Object(o.useState)([]),2),g=y[0],v=y[1],b=lf(Object(o.useState)([]),2),w=b[0],E=b[1],O=lf(Object(o.useState)([]),2),k=O[0],S=O[1],x=lf(Object(o.useState)([]),2),_=x[0],j=x[1],P=lf(Object(o.useState)([]),2),C=P[0],T=P[1],A=lf(Object(o.useState)([]),2),N=A[0],I=A[1],L=lf(Object(o.useState)([]),2),D=L[0],R=L[1],M=lf(Object(o.useState)([]),2),F=M[0],z=M[1];return Object(o.useEffect)((function(){var t;(function(){var e=new FormData;return e.append("action","get_templately"),e.append("nonce",ai),e.append("content_type","get_dependencies"),e.append("platform",ni),Do.a.post(ajaxurl,e).then((function(e){return e})).catch((function(e){return e}))})().then((function(t){if(t.hasOwnProperty("data")&&t.data.hasOwnProperty("data")){var n=t.data.data.filter((function(t){return t.platform===e.platform})),r=[],a=[],o=[],i=[],l=n.map((function(e){var t=af(af({},e),{},{selected:!0});return e.is_pro?i.push(t):o.push(t),e.is_pro?a.push(t.id):r.push(t.id),t}));h(l),E(o),v(i)}})).catch((function(e){return console.error("On Getting Dependencies: ",e)})),(t=new FormData,t.append("action","get_templately"),t.append("nonce",ai),t.append("content_type","get_tags"),Do.a.post(ajaxurl,t).then((function(e){return e})).catch((function(e){return e}))).then((function(e){e.hasOwnProperty("data")&&e.data.hasOwnProperty("data")&&I(function(e){return e.map((function(e){return{value:e.id,label:sf(e.name,"templately")}}))}(e.data.data))})).catch((function(e){return console.error("On Gettings Tags: ",e)}))}),[]),Object(o.useEffect)((function(){var e=[],t=[];m.map((function(n){var r=af(af({},n),{},{selected:!0});n.is_pro?t.push(r):e.push(r)})),E(e),v(t)}),[m]),Object(o.useEffect)((function(){S([].concat(nf(_),nf(C)))}),[_,C]),Object(o.useEffect)((function(){if(!f){var t=[],n=m.map((function(e){return t.push(e.id),af(af({},e),{},{selected:!0})}));h(n),S(t),e.setDependenciesIdForFilter(t),e.setDependenciesFilterActive(!1),e.setFilteredTags([]),z([]),p(!1)}}),[f]),Object(o.useEffect)((function(){c&&(e.setDependenciesIdForFilter(k),e.setDependenciesFilterActive(!0),e.setFilteredTags(D),p(!0),u(!1))}),[c]),t.push(i.a.createElement("li",{className:"templately-sidebar-menu-item ".concat("all"==e.activeSidebar.activeSidebarMenu?"templately-smenu-active":""),key:"all"},i.a.createElement("span",{onClick:function(){e.setItemLoading(!0),e.setSidebar({activeSidebarMenu:"all",activeParentSidebarMenu:""})}},sf("All Categories","templately")))),e.categories.map((function(e,n){e.hasOwnProperty("child")?t.push(i.a.createElement(Ws,{key:e.id,id:e.id,name:sf(e.name,"templately"),child:e.child})):t.push(i.a.createElement(Ws,{key:e.id,id:e.id,name:sf(e.name,"templately")}))})),i.a.createElement(i.a.Fragment,null,i.a.createElement("ul",{className:"templately-sidebar-menu"},t),i.a.createElement(tf,{pro:!0,dependencies:g,active:r,setSelected:function(e){return T(e)},setActive:function(e){return a(e)}}),i.a.createElement(tf,{free:!0,dependencies:w,active:r,setSelected:function(e){return j(e)},setActive:function(e){return a(e)}}),i.a.createElement("div",{className:"templately-sidebar-dependency-filter templately-tags-filter"},i.a.createElement(Co,{isMulti:!0,name:"templately_tags",options:N,classNamePrefix:"templately-tags",onChange:function(e){return function(e){null!=e?(z(e),e=e.map((function(e){return e.value})),R(e)):(z([]),R([]))}(e)},value:F,maxMenuHeight:200})),i.a.createElement(tf,{button:!0,setFilter:function(e){return u(e)},setReset:function(e){return p(e)},isFilter:c,isReset:f}))})),pf=TemplatelyAdmin.default_image,df=wp.i18n.__,mf=function(e){var t=e.author,n=e.price||"";return i.a.createElement(i.a.Fragment,null,null!=t&&i.a.createElement("div",{className:"templately-author-box"},i.a.createElement("div",{className:"templately-author-image-name"},i.a.createElement("div",{className:"templately-author-image"},i.a.createElement("img",{src:t.profile_photo||pf,alt:t.name})),i.a.createElement("div",{className:"templately-author-name"},i.a.createElement("h3",null,t.display_name||t.name),i.a.createElement("p",null,df("Member since","templately")," ",t.joined))),i.a.createElement("div",{className:"templately-author-item-favs"},i.a.createElement("ul",null,i.a.createElement("li",null,i.a.createElement(vn,{color:"rgb(245, 54, 91)"})," ",null!=e.favourite?e.favourite:0),i.a.createElement("li",null,i.a.createElement(Sn,{color:"rgb(255, 220, 99)"})," ",null!=e.rating?e.rating.toFixed(2):0),i.a.createElement("li",null,i.a.createElement(kn,{color:"rgb(96, 114, 255)"})," ",null!=e.downloads?e.downloads:0," ",df("Purchased","templately")))),i.a.createElement("div",{className:"templately-item-price"},n)))},hf=tt((function(e){return{all_items:e.common.all_items,filtered:e.common.filtered_items}}))((function(e){var t=e.items,n=null!=t.items&&t.items,r=[];return Object(o.useEffect)((function(){if(n){n.filter((function(e){return"block"==e.type}));e.dispatch($n(n)),e.dispatch(qn(n))}}),[e.items]),n.length>0&&n&&e.filtered.map((function(t,n){r.push(i.a.createElement(Ms,{pack:"pack"===e.rootType,block:"block"===e.rootType,page:"page"===e.rootType,type:e.rootType,key:n,content:t}))})),i.a.createElement("div",{className:"templately-item-details-preview"},n.length>0&&null!=n.length&&r,!1===n&&i.a.createElement(Ms,{pack:"pack"===e.rootType,block:"block"===e.rootType,page:"page"===e.rootType,key:t.id,type:e.rootType,content:t}))}));function yf(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return gf(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return gf(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function gf(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var vf=wp.i18n.__,bf=function(e){var t=yf(Object(o.useState)([]),2),n=t[0],r=t[1],a=e.content,l=[];return a&&a.tags.map((function(e,t){l.push(i.a.createElement("span",{key:t},e.name," "))})),Object(o.useEffect)((function(){if(a.dependencies.length>0){var e=[];a.dependencies.map((function(t,n){null!=t.icon&&e.push(i.a.createElement("li",{key:n},i.a.createElement("img",{src:t.icon,alt:t.name}),t.name))})),r(e)}}),[]),i.a.createElement("div",{className:"templately-item-details-box"},l.length>0&&i.a.createElement("div",null,i.a.createElement("h3",null,vf("Tags","templately")),i.a.createElement("p",null,l)),i.a.createElement("div",null,i.a.createElement("h3",null,vf("Details","templately")),i.a.createElement("ul",null,i.a.createElement("li",null,vf("Retina Ready","templately")," ",i.a.createElement("span",null,a.retina_ready)),i.a.createElement("li",null,vf("Documentation Ready","templately")," ",i.a.createElement("span",null,a.documentation_ready)))),n.length>0&&i.a.createElement("div",null,i.a.createElement("h3",null,vf("Dependencies","templately")),i.a.createElement("ul",{className:"templately-preview-dependency-list"},n)))};function wf(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Ef(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ef(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ef(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Of=tt((function(e){return{all_items:e.common.all_items,filtered:e.common.filtered_items}}))((function(e){var t=wf(Object(o.useState)(!1),2),n=t[0],r=t[1];return Object(o.useEffect)((function(){if(!1!==n){var t=e.all_items.filter((function(e){return e.category.id===n}));e.dispatch(qn(t)),e.dispatch(Kn({ulActive:!1})),r(!1)}}),[n]),i.a.createElement("li",null,i.a.createElement("span",{onClick:function(){return r(e.catID)}},e.name,i.a.createElement("span",null,"( ",e.count," )")))}));function kf(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Sf(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Sf(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Sf(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var xf=wp.i18n.__,_f=tt((function(e){return{all_items:e.common.all_items,ulActive:e.common.activeBlockOrPage.ulActive,blockClick:e.common.activeBlockOrPage.blocksBtnClick,pageClick:e.common.activeBlockOrPage.pagesBtnClick}}))((function(e){var t=kf(Object(o.useState)("all"),2),n=t[0],r=t[1],a=kf(Object(o.useState)(!1),2),l=a[0],c=a[1],u=kf(Object(o.useState)(!1),2),s=u[0],f=u[1],p=kf(Object(o.useState)(!1),2),d=(p[0],p[1],e.items.items),m=[],h=[],y=0,g=0;null!=d&&d.map((function(e,t){var n=e.category&&null!=e.category.name?e.category.name:"None",r={};if("block"==e.type&&null!==e.category){var a=fi(e.category.id,m),o=pi(e.category.id,m);m=o,y++,r.name=n,r.id=e.category.id,r.count=++a,m.push(r),r={}}if("page"==e.type&&null!==e.category){var i=fi(e.category.id,h),l=pi(e.category.id,h);h=l,g++,r.name=n,r.id=e.category.id,r.count=++i,h.push(r),r={}}}));var v=[],b=[];return m.map((function(e){v.push(i.a.createElement(Of,{key:e.id,name:e.name,count:e.count,catID:e.id}))})),h.map((function(e){b.push(i.a.createElement(Of,{key:e.id,name:e.name,count:e.count,catID:e.id}))})),Object(o.useEffect)((function(){e.ulActive||(f(!1),c(!1))}),[e.ulActive]),Object(o.useEffect)((function(){"blocks"===n&&l&&e.dispatch(Kn({ulActive:"blocks"})),"blocks"!==n||l||e.dispatch(Kn({ulActive:!1})),"pages"===n&&s&&e.dispatch(Kn({ulActive:"pages"})),"pages"!==n||s||e.dispatch(Kn({ulActive:!1}))}),[s,l,n]),i.a.createElement("div",{className:"templately-pack-preview-header"},i.a.createElement("div",{className:"epp-left epp-button"},i.a.createElement("button",{className:"templately-preview-button templately-preview-blocks ".concat("all"===n?"epp-btn-active":""),onClick:function(){r("all"),f(!1),c(!1),e.dispatch(qn(e.all_items))}},xf("All","templately"))),y>0&&i.a.createElement("div",{className:"epp-left epp-button"},i.a.createElement("button",{className:"templately-preview-button templately-preview-blocks ".concat("blocks"===n?"epp-btn-active":""),onClick:function(){r("blocks"),f(!1),c(!l)}},i.a.createElement("span",{className:"epp-item-count"},"(",y,")"),xf("Blocks","templately")," ",i.a.createElement(cn,null)),v.length>0&&i.a.createElement("ul",{className:"epp-type-child ".concat("blocks"===e.ulActive&&"epp-active")},v)),g>0&&i.a.createElement("div",{className:"epp-right epp-button"},i.a.createElement("button",{className:"templately-preview-button templately-preview-pages ".concat("pages"===n?"epp-btn-active":""),onClick:function(){r("pages"),c(!1),f(!s)}},i.a.createElement("span",{className:"epp-item-count"},"(",g,")"),xf("Pages","templately")," ",i.a.createElement(cn,null)),b.length>0&&i.a.createElement("ul",{className:"epp-type-child ".concat("pages"===e.ulActive&&"epp-active")},b)))}));function jf(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Pf(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Pf(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Pf(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Cf=TemplatelyAdmin.nonce,Tf=tt((function(e){return{common:e.common,preview:e.preview}}))((function(e){var t=jf(Object(o.useState)(!1),2),n=t[0],r=t[1],a=jf(Object(o.useState)(!1),2),l=a[0],c=a[1];return Object(o.useEffect)((function(){var t=e.preview.itemSlug;"block"===e.preview.type&&(t=e.preview.itemSlug),"pack"===e.preview.type&&(t=e.preview.packSlug),"page"===e.preview.type&&(t=e.preview.pageSlug);var n=new FormData;n.append("id",e.preview.itemID),n.append("slug",t),n.append("type",e.preview.type),n.append("action","get_templately"),n.append("nonce",Cf),n.append("content_type","get_item"),Do.a.post(ajaxurl,n).then((function(t){t.data.success&&("block"!=e.preview.type&&"page"!=e.preview.type||(r(t.data.data[0].author),c(t.data.data[0])),"pack"==e.preview.type&&(r(t.data.data[0].author),c(t.data.data[0])))})).catch((function(e){return console.error("Preview Layout Error: ",e)}))}),[e.preview]),i.a.createElement(Zc,null,(!l||!n)&&i.a.createElement(Ou,null),l&&n&&i.a.createElement("div",{className:"templately-preview-wrapper",onClick:function(){return e.dispatch(Kn({ulActive:!1}))}},i.a.createElement("div",{className:"templately-preview-body"},"pack"===e.rootType&&i.a.createElement(i.a.Fragment,null,i.a.createElement(_f,{items:l})),i.a.createElement(hf,{rootType:e.rootType,items:l})),i.a.createElement("div",{className:"templately-preview-sidebar"},i.a.createElement(mf,{author:n,rating:l.rating,favourite:l.favourite_count,downloads:l.downloads}),("block"===e.preview.type||"page"===e.preview.type)&&i.a.createElement(bf,{content:l}))))}));function Af(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Nf(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Af(Object(n),!0).forEach((function(t){If(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Af(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function If(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Lf(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Df(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Df(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Df(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Rf=wp.i18n.__,Mf=TemplatelyAdmin,Ff=Mf.is_editor,zf=Mf.platform,Uf=tt((function(e){return{preview:e.preview,platform:e.common.platform,platform_exists:e.common.platforms}}))((function(e){var t=Lf(Object(o.useState)(!1),2),n=t[0],r=t[1],a=Lf(Object(o.useState)(!1),2),l=a[0],c=a[1];return Object(o.useEffect)((function(){if(n){var t=--e.preview.deep,a={deep:t};t<=0&&(a=Nf(Nf({},a),{isOpen:!1,deep:0})),1===t&&(a=Nf(Nf({},a),{type:e.preview.previousType})),e.dispatch(zn(a)),r(!1)}}),[n]),Object(o.useEffect)((function(){0!=l&&(ii("",{showCloseButton:!0,allowOutsideClick:!1,target:Ff?"#templately-app-modal":"#templatelyAdmin",html:i.a.createElement(xs,{dependencyList:e.content.dependencies,platform:e.platform,title:e.content.name,content:e.content})}).then((function(t){null!=t.insert&&t.insert&&(e.dispatch(Ln(Nf(Nf({},e.platform_exists),{},If({},"elementor",!0)))),e.dispatch(Un(!0)),li(startInsert,"remote",{fileType:e.platform,is_editor:Boolean(Ff)}).then((function(t){if(!0===t)"gutenberg"!==zf?window.TemplatelyModal.destroy():Ro.close(),e.dispatch(Un(!0));else{e.dispatch(Un(!1));var n="",r=!1;t.data&&t.data.data&&t.data.data.errorCode?("required_pro"===t.data.data.errorCode&&(r=!0),n=t.data.data.message):"string"==typeof t.data.data&&(n=t.data.data),ii("",{icon:"error",html:i.a.createElement(ki,{content:i.a.createElement("div",null,i.a.createElement("p",null,n),r&&i.a.createElement("a",{href:"https://templately.com",target:"_blank"},"Upgrade to Pro"))})})}})))})),c(!1))}),[l]),i.a.createElement("div",{className:"templately-block-preview-header"},i.a.createElement("div",{className:"ep-left"},i.a.createElement("button",{className:"templately-preview-back",onClick:function(){return r(!0)}},i.a.createElement(ln,null)," ",Rf("Back","templately"))),i.a.createElement("div",{className:"ep-right"},i.a.createElement("button",{onClick:function(){return c(e.itemID)},className:"ep-preview-insert"},Rf("Insert","templately")," ",i.a.createElement(mn,null))))}));n(112);function Bf(e){return(Bf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Vf(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Wf(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Wf(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Wf(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Hf=TemplatelyAdmin.nonce,$f=tt()((function(e){var t=Vf(Object(o.useState)(!1),2),n=t[0],r=t[1],a=Vf(Object(o.useState)("desktop"),2),l=a[0],c=a[1],u=Vf(Object(o.useState)("100%"),2),s=u[0],f=u[1];return Object(o.useEffect)((function(){"mobile"==l&&f("480px"),"tablet"==l&&f("786px"),"desktop"==l&&f("100%")}),[l,n]),Object(o.useEffect)((function(){var t=new FormData;"page"===e.preview.type&&t.append("slug",e.preview.pageSlug),"block"===e.preview.type&&t.append("slug",e.preview.itemSlug),"pack"===e.preview.type&&t.append("slug",e.preview.packSlug),t.append("type",e.preview.type),t.append("action","get_templately"),t.append("nonce",Hf),t.append("content_type","get_item"),Do.a.post(ajaxurl,t).then((function(e){e.data.success&&r(e.data.data[0])})).catch((function(e){return console.error("Error",e)}))}),[e]),i.a.createElement("div",{className:"templately-preview-html-or-image"},!n&&i.a.createElement(Ou,null),"object"==Bf(n)&&i.a.createElement(i.a.Fragment,null,i.a.createElement(Uf,{itemID:n.id,content:n}),i.a.createElement("div",{className:"templately-preview-image-wrapper"},i.a.createElement("div",{className:"templately-preview-hover"},i.a.createElement("button",{onClick:function(){return c("mobile")},className:"mobile"==l?"preview-active":""},i.a.createElement(bn,null)),i.a.createElement("button",{onClick:function(){return c("tablet")},className:"tablet"==l?"preview-active":""},i.a.createElement(xn,null)),i.a.createElement("button",{onClick:function(){return c("desktop")},className:"desktop"==l?"preview-active":""},i.a.createElement(dn,null))),i.a.createElement("iframe",{id:"templately-preview-iframe",width:s,height:"100%",src:n.live_url}))))}));n(113);function qf(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Kf(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Kf(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Kf(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Qf=tt((function(e){return{plan:e.common.plan}}))((function(e){var t=qf(Object(o.useState)(e.plan),2),n=t[0],r=t[1];return Object(o.useEffect)((function(){n!=e.plan&&(e.dispatch({type:"SET_PLAN",payload:n}),e.dispatch(Qn(1)))}),[n]),i.a.createElement("div",{className:"templately-items-header-wrapper".concat(" ".concat(e.sticky))},i.a.createElement("div",{className:"templately-items-header-wrapper-inner"},i.a.createElement("div",{className:"templately-items-header"},i.a.createElement("h3",null,"All ",e.title)),i.a.createElement("div",{className:"templately-plan-switcher"},i.a.createElement("button",{onClick:function(){return r("all")},className:"components-button templately-plan-all ".concat("all"===e.plan?"tactive":"")},"All"),i.a.createElement("button",{onClick:function(){return r("starter")},className:"components-button templately-plan-starter ".concat("starter"===e.plan?"tactive":"")},"Starter"),i.a.createElement("button",{onClick:function(){return r("pro")},className:"components-button templately-plan-pro ".concat("pro"===e.plan?"tactive":"")},"Pro"))))}));function Gf(){return(Gf=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Yf(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Xf(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Xf(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Xf(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Jf=TemplatelyAdmin,Zf=Jf.categories,ep=Jf.not_found,tp=Jf.platform,np=tt((function(e){return{blocks:e.blocks,pages:e.pages,packs:e.packs,preview:e.preview,sidebar:e.common.activeSidebar,need_pagination:e.common.need_pagination,pagination_loading:e.common.pagination_loading,pagination:e.common.pagination,activeSidebar:e.common.activeSidebar,loading:e.common.loading,platform:e.common.platform,plan:e.common.plan,itemLoading:e.common.itemLoading,retry:e.common.retry,dependencyFiltersID:e.common.dependencyFilter.filtersID,dependencyFilterActive:e.common.dependencyFilter.filterActive,dependencyFilterResults:e.common.dependencyFilter.filtersResults,selectedTags:e.common.tags}}))((function(e){var t=e.location.pathname.replace(/^\/+/,"")||("gutenberg"===e.platform?"blocks":"packs"),n=t.substring(0,t.length-1),r=Yf(Object(o.useState)([]),2),a=r[0],l=r[1],c=Yf(Object(o.useState)(1),2),u=c[0],s=c[1],f=Yf(Object(o.useState)(""),2),p=f[0],d=f[1];return Object(o.useEffect)((function(){if(null!==e.pagination){if(!1===e.dependencyFilterActive)if("all"===e.sidebar.activeSidebarMenu){if(e[t].hasOwnProperty(e.plan)&&e[t][e.plan].hasOwnProperty(e.platform)&&e[t][e.plan][e.platform].hasOwnProperty(e.pagination))return s(e[t][e.plan][e.platform].total_page),e.dispatch(Un(!1)),e.dispatch(Bn(!1)),void e.dispatch(Yn(!1))}else if(e[t].hasOwnProperty(e.plan)&&e[t][e.plan].hasOwnProperty(e.platform)&&e[t][e.plan][e.platform].hasOwnProperty("categoryData")&&e[t][e.plan][e.platform].categoryData.hasOwnProperty(e.sidebar.activeSidebarMenu)&&e[t][e.plan][e.platform].categoryData[e.sidebar.activeSidebarMenu].hasOwnProperty(e.pagination)&&e[t][e.plan][e.platform].categoryData[e.sidebar.activeSidebarMenu][e.pagination].length>0)return s(e[t][e.plan][e.platform].categoryData[e.sidebar.activeSidebarMenu].total_page),e.dispatch(Un(!1)),e.dispatch(Bn(!1)),void e.dispatch(Yn(!1));e.dispatch(Bn(!0));try{(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={content_type:"blocks",per_page:48,page:1};e=Xo(Xo({},t),e);var n=new FormData;return n.append("action","get_templately"),n.append("nonce",ai),n.append("content_type",e.content_type),n.append("pagenum",e.page),n.append("per_page",e.per_page),null!=e.platform&&n.append("platform",e.platform),null!=e.category_id&&n.append("category_id",e.category_id),null!=e.dependencies&&e.dependencies.length>0&&n.append("dependencies",JSON.stringify(e.dependencies)),null!=e.tag_id&&e.tag_id.length>0&&n.append("tag_id",JSON.stringify(e.tag_id)),null!=e.plan_type&&"all"!==e.plan_type&&n.append("plan_type",e.plan_type),Do.a.post(ajaxurl,n).then((function(e){return e})).catch((function(e){return e}))})({content_type:t,page:e.pagination,platform:e.platform,plan_type:e.plan,per_page:"templately"===tp?52:51,category_id:"all"!==e.sidebar.activeSidebarMenu?e.sidebar.activeSidebarMenu:void 0,dependencies:e.dependencyFiltersID,tag_id:e.selectedTags}).then((function(n){if(n.data.success){if(n.data.data.hasOwnProperty("data"))return e.dependencyFilterActive?(s(n.data.data.total_page),e.dispatch({type:"FILTER_DEPENDENCIES_RESULTS",payload:{current_page:e.pagination,data:n.data.data.data,platform:e.platform,plan:e.plan,total_page:n.data.data.total_page}}),e.dispatch(Bn(!1)),e.dispatch(Un(!1)),void e.dispatch(Yn(!1))):("blocks"===t&&(s(n.data.data.total_page),"all"===e.sidebar.activeSidebarMenu?e.dispatch(Dn({current_page:e.pagination,data:n.data.data.data,platform:e.platform,plan:e.plan,total_page:n.data.data.total_page})):e.dispatch(function(e){return{type:"ALL_CATEGORY_ITEMS",payload:e}}({categoryID:e.sidebar.activeSidebarMenu,current_page:e.pagination,data:n.data.data.data,platform:e.platform,plan:e.plan,total_page:n.data.data.total_page}))),"packs"===t&&(s(n.data.data.total_page),"all"===e.sidebar.activeSidebarMenu?e.dispatch(Rn({current_page:e.pagination,data:n.data.data.data,platform:e.platform,plan:e.plan,total_page:n.data.data.total_page})):e.dispatch(function(e){return{type:"ALL_CATEGORY_PACKS",payload:e}}({categoryID:e.sidebar.activeSidebarMenu,current_page:e.pagination,data:n.data.data.data,platform:e.platform,plan:e.plan,total_page:n.data.data.total_page}))),"pages"===t&&(s(n.data.data.total_page),"all"===e.sidebar.activeSidebarMenu?e.dispatch(function(e){return{type:"ALL_PAGES",payload:e}}({current_page:e.pagination,data:n.data.data.data,platform:e.platform,plan:e.plan,total_page:n.data.data.total_page})):e.dispatch(function(e){return{type:"ALL_CATEGORY_PAGES",payload:e}}({categoryID:e.sidebar.activeSidebarMenu,current_page:e.pagination,data:n.data.data.data,platform:e.platform,plan:e.plan,total_page:n.data.data.total_page}))),e.dispatch(Bn(!1)),e.dispatch(Un(!1)),void e.dispatch(Yn(!1)));e.dispatch(In(n.data.data))}else e.dispatch(In(n.data.data))}))}catch(t){return e.dispatch(In(res.data.data)),void console.error("Catched Error: ",t)}}}),[e.pagination,e.sidebar,e.platform,e.plan,e.retry,e.dependencyFilterActive,e.dependencyFiltersID,e.selectedTags]),Object(o.useEffect)((function(){var r=[];!0!==e.dependencyFilterActive?"all"!=e.sidebar.activeSidebarMenu?e[t].hasOwnProperty(e.plan)&&e[t][e.plan].hasOwnProperty(e.platform)&&e[t][e.plan][e.platform].hasOwnProperty("categoryData")&&e[t][e.plan][e.platform].categoryData.hasOwnProperty(e.sidebar.activeSidebarMenu)&&e[t][e.plan][e.platform].categoryData[e.sidebar.activeSidebarMenu].hasOwnProperty(e.pagination)&&(e[t][e.plan][e.platform].categoryData[e.sidebar.activeSidebarMenu][e.pagination].map((function(e,t){r.push(i.a.createElement(Ms,{type:n,pack:"pack"===n,page:"page"===n,block:"block"===n,key:t,content:e}))})),l(r)):(e[t].hasOwnProperty(e.plan)&&e[t][e.plan].hasOwnProperty(e.platform)&&e[t][e.plan][e.platform].hasOwnProperty(e.pagination)&&void 0!==e[t][e.plan][e.platform][e.pagination]&&e[t][e.plan][e.platform][e.pagination].map((function(e,t){r.push(i.a.createElement(Ms,{type:n,pack:"pack"===n,page:"page"===n,block:"block"===n,key:t,content:e}))})),l(r)):e.dependencyFilterResults.hasOwnProperty(e.plan)&&e.dependencyFilterResults[e.plan].hasOwnProperty(e.platform)&&e.dependencyFilterResults[e.plan][e.platform].hasOwnProperty(e.pagination)&&(e.dependencyFilterResults[e.plan][e.platform][e.pagination].map((function(e,t){r.push(i.a.createElement(Ms,{type:n,pack:"pack"===n,page:"page"===n,block:"block"===n,key:t,content:e}))})),l(r))}),[e.blocks,e.pages,e.packs,e.pagination,e.sidebar,e.platform,e.plan,e.dependencyFilterActive,e.dependencyFilterResults]),i.a.createElement(i.a.Fragment,null,e.loading&&i.a.createElement(Zc,null,i.a.createElement(Ou,null)),!e.loading&&!e.preview.isOpen&&Zf[t].length>0&&i.a.createElement(Us,null,i.a.createElement(ff,{categories:Zf[t],activeSidebar:e.activeSidebar})),!e.loading&&!e.preview.isOpen&&i.a.createElement(i.a.Fragment,null,e.itemLoading&&i.a.createElement(Ou,null),!e.itemLoading&&i.a.createElement(Zc,{onScroll:function(e){e.target.scrollTop>200?d("templately-header-sticky"):d("")}},i.a.createElement(Qf,{sticky:p,title:t}),0===a.length&&!e.itemLoading&&!e.pagination_loading&&i.a.createElement("div",{className:"templately-empty-clouds"},i.a.createElement("img",{src:ep,alt:"Items Not Found"})),i.a.createElement("div",{className:"templately-modal-content templately-blocks ".concat(e.need_pagination?"templately-has-pagination":""," templately-tab-").concat(t)},!e.pagination_loading&&a,e.pagination_loading&&i.a.createElement(Ou,null)),"all"===e.sidebar.activeSidebarMenu&&i.a.createElement(wu,{type:n,count:u}),"all"!==e.sidebar.activeSidebarMenu&&i.a.createElement(wu,{categoryPagination:!0,type:n,count:u}))),!e.loading&&e.preview.isOpen&&1===e.preview.deep&&i.a.createElement(Tf,Gf({rootType:n},e)),!e.loading&&e.preview.isOpen&&2===e.preview.deep&&i.a.createElement($f,Gf({rootType:n},e)))}));function rp(){return(rp=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function ap(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return op(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return op(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function op(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var ip=wp.i18n.__,lp=TemplatelyAdmin,cp=(lp.platform,lp.nonce),up=lp.not_found,sp=tt((function(e){return{searchQuery:e.common.searchQuery.query,isSearching:e.common.searchQuery.isSearching||!1,searchResults:e.common.searchQuery.results,preview:e.preview,loading:e.common.loading,platform:e.common.platform}}))((function(e){var t=ce().query,n=ap(Object(o.useState)([]),2),r=n[0],a=n[1],l=ap(Object(o.useState)(!0),2),c=l[0],u=l[1];return Object(o.useEffect)((function(){null!=t&&t.length>0&&e.dispatch(nr({query:t,isSearching:!0}))}),[]),Object(o.useEffect)((function(){if(e.searchQuery.length>0){var t=new FormData;t.append("action","get_templately"),t.append("nonce",cp),t.append("content_type","search"),t.append("search",e.searchQuery),t.append("platform",e.platform),u(!0),Do.a.post(ajaxurl,t).then((function(t){200==t.status&&t.data.success&&e.dispatch(nr({query:e.searchQuery,results:t.data.data,isSearching:!1})),u(!1)})).catch((function(e){console.error(e.response),u(!1)}))}}),[e.searchQuery,e.isSearching,e.platform]),Object(o.useEffect)((function(){var t=[];e.searchResults&&e.searchResults.length>0&&e.searchResults.map((function(e,n){t.push(i.a.createElement(Ms,{type:e.type,pack:"pack"===e.type,page:"page"===e.type,block:"block"===e.type,key:n,content:e}))})),a(t)}),[e.searchResults]),i.a.createElement(i.a.Fragment,null,!e.preview.isOpen&&i.a.createElement("div",{className:"templately-modal-search"},i.a.createElement("div",{className:"templately-searched"},i.a.createElement("p",null,i.a.createElement("strong",null,ip("You are looking for: ","templately")),t)),i.a.createElement("div",{className:"templately-searched-items templately-modal-content templately-blocks"},r.length>0&&r,r.length<=0&&!c&&i.a.createElement("div",{className:"templately-search-not-found"},i.a.createElement("div",null,i.a.createElement("img",{src:up,alt:"Searched Item Not Found"}))),c&&i.a.createElement(Ou,null))),!e.loading&&e.preview.isOpen&&1===e.preview.deep&&i.a.createElement(Tf,rp({rootType:e.preview.type&&e.preview.type},e)),!e.loading&&e.preview.isOpen&&2===e.preview.deep&&i.a.createElement($f,rp({rootType:e.preview.type&&e.preview.type},e)))}));n(114),n(47),n(115);function fp(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return pp(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return pp(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function pp(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var dp=wp.i18n.__,mp=TemplatelyAdmin,hp=mp.nonce,yp=(mp.platform,function(e,t){return t.path===e}),gp=tt((function(e){return{cloudUsageLimit:e.common.cloud_usage_limit}}))((function(e){var t=function(e){var t=le(),n=ie(W).match;return e?J(t.pathname,e):n}(),n=fp(Object(o.useState)(0),2),r=n[0],a=n[1];return Object(o.useEffect)((function(){if(void 0===e.cloudUsageLimit.plan){var t=new FormData;t.append("action","get_templately"),t.append("content_type","cloud_usage_limit"),t.append("nonce",hp);Do.a.post(ajaxurl,t).then((function(t){200===t.status&&t.data.success&&"success"===t.data.data.status&&e.dispatch({type:"CLOUD_USAGE_LIMIT",payload:JSON.parse(t.data.data.data)})})).catch((function(e){console.error("Usages Limit: ",e)}))}}),[]),Object(o.useEffect)((function(){a(100*e.cloudUsageLimit.files/e.cloudUsageLimit.limit)}),[e.cloudUsageLimit]),i.a.createElement("div",{className:"templately-workspace-sidebar"},i.a.createElement("div",{className:"tws-menu-list"},i.a.createElement("ul",null,i.a.createElement(dr,{to:"/clouds"},i.a.createElement(pn,{size:"16"}),i.a.createElement("span",null,dp("My Cloud","templately"))),i.a.createElement(dr,{to:"/workspace",active:yp("/workspace/:slug",t)},i.a.createElement(gn,{size:"16"}),i.a.createElement("span",null,dp("My WorkSpace","templately"))),i.a.createElement(dr,{to:"/shared/workspace",active:yp("/shared/workspace/:slug",t)},i.a.createElement(On,{size:"16"}),i.a.createElement("span",null,dp("Shared with Me","templately"))),i.a.createElement(dr,{to:"/settings"},i.a.createElement(jn,{size:"16"}),i.a.createElement("span",null,dp("Profile","templately"))))),i.a.createElement("div",{className:"tws-size"},i.a.createElement(pn,{size:"20"}),i.a.createElement("div",null,i.a.createElement("p",null,"File Details Count"),i.a.createElement("div",null,i.a.createElement("span",{style:{width:"".concat(r,"%")}})),i.a.createElement("p",null,"".concat(e.cloudUsageLimit&&e.cloudUsageLimit.files," of ").concat(e.cloudUsageLimit&&(-1===e.cloudUsageLimit.limit?"Unlimited":e.cloudUsageLimit.limit)," Files")))))})),vp=tt()((function(e){return i.a.createElement("div",{className:"templately-workspace"},i.a.createElement(gp,null),i.a.createElement("div",{className:"templately-workspace-content"},e.children))}));function bp(){return(bp=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var Ep=function(e){return i.a.createElement("div",{className:e.className},i.a.createElement("div",null,i.a.createElement("input",bp({type:"text"},e))))};function Op(e){return function(e){if(Array.isArray(e))return xp(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||Sp(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function kp(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||Sp(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Sp(e,t){if(e){if("string"==typeof e)return xp(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?xp(e,t):void 0}}function xp(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var _p=wp.i18n.__,jp=TemplatelyAdmin,Pp=jp.loadingImage,Cp=jp.nonce,Tp=function(e){var t=kp(Object(o.useState)(e.isLoading||!1),2),n=t[0],r=t[1],a=kp(Object(o.useState)(!0),2),l=a[0],c=a[1],u=kp(Object(o.useState)(!1),2),s=u[0],f=u[1],p=kp(Object(o.useState)(e.content.name),2),d=p[0],m=p[1],h=kp(Object(o.useState)([]),2),y=h[0],g=h[1],v=kp(Object(o.useState)([]),2),b=v[0],w=v[1],E=kp(Object(o.useState)(!1),2),O=E[0],k=E[1],S=kp(Object(o.useState)(!1),2),x=S[0],_=S[1],j=kp(Object(o.useState)(!1),2),P=j[0],C=j[1],T=kp(Object(o.useState)(""),2),A=T[0],N=T[1],I=kp(Object(o.useState)(!1),2),L=I[0],D=I[1],R=kp(Object(o.useState)([]),2),M=R[0],F=R[1],z=kp(Object(o.useState)([]),2),U=z[0],B=z[1],V=kp(Object(o.useState)([]),2),W=(V[0],V[1]),H=kp(Object(o.useState)([]),2),$=H[0],q=H[1];return Object(o.useEffect)((function(){var t=[],n=[];if(e.content.sharedWith&&e.content.sharedWith.length>0&&(e.content.sharedWith.map((function(e,r){n.push(e.email),t.push(i.a.createElement("li",{key:r},e.profile_photo&&i.a.createElement("img",{src:e.profile_photo}),i.a.createElement("span",{className:"tae-name "},e.name),i.a.createElement("span",{className:"tae-remove",onClick:function(t){_({email:e.email,currentTarget:t.currentTarget.parentElement})}}),i.a.createElement("span",{className:"tae-undo",onClick:function(t){C({email:e.email,currentTarget:t.currentTarget.parentElement})}})))})),F(n),g(t)),e.content.pending_invitations&&e.content.pending_invitations.length>0){var r=JSON.parse(e.content.pending_invitations),a=[],o=[];r.map((function(e){mi(e)&&(o.push(e),a.push(i.a.createElement("li",{key:e},i.a.createElement("span",{className:"tae-name "},e,i.a.createElement("em",null,_p("invited","templately"))),i.a.createElement("span",{className:"tae-remove",onClick:function(t){_({email:e,currentTarget:t.currentTarget.parentElement})}}),i.a.createElement("span",{className:"tae-undo",onClick:function(t){C({email:e,currentTarget:t.currentTarget.parentElement})}}))))})),W(o),F([].concat(n,o)),g([].concat(t,a))}}),[]),Object(o.useEffect)((function(){if(O){var e=Op(U),t=A.toLowerCase();mi(t)&&(e.includes(t)||(e.push(t),B(e)),N("")),k(!1)}}),[O]),Object(o.useEffect)((function(){if(!1!==L){var e=Op(U).filter((function(e){return L!=e}));B(e),D(!1)}}),[L]),Object(o.useEffect)((function(){if(!1!==x||!1!==P){var e=Op(M),t=Op($);if(0!=x&&(x.currentTarget.classList.add("removed"),t.push(x.email),e=e.filter((function(e){return x.email!=e})),F(e),q(t),_(!1)),0!=P){P.currentTarget.classList.remove("removed"),e.push(P.email);var n=t.filter((function(e){return P.email!=e}));F(e),q(n),C(!1)}}}),[x,P]),Object(o.useEffect)((function(){var e=[];U.length>0&&U.map((function(t,n){return e.push(i.a.createElement("li",{key:n},t,i.a.createElement("span",{onClick:function(){return D(t)}})))})),w(e)}),[U]),Object(o.useEffect)((function(){c(!(M.length!==(e.content.sharedWith?e.content.sharedWith.length:0)||U.length>0))}),[M,U]),Object(o.useEffect)((function(){if(!0===s){r(!0);var t=U,n=Op($),a=new FormData;a.append("action","get_templately"),a.append("content_type","edit_workspace"),a.append("id",e.content.id),a.append("title",d),a.append("share_with",t.join()),a.append("remove",n.join()),a.append("nonce",Cp),a.append("platform",e.platform),Do.a.post(ajaxurl,a).then((function(t){t.data.success&&("success"===t.data.data.status?(e.singleDispatch(t.data.data.workspace),$o.a.close({saved:!0})):$o.a.close({saved:!1}))})),f(!1)}}),[s]),i.a.createElement(i.a.Fragment,null,n&&i.a.createElement("div",{className:"templately-pre-loader"},i.a.createElement("img",{src:Pp})),!n&&i.a.createElement("div",{className:"templately-workspace-edit-modal"},i.a.createElement("div",{className:"templately-wem-row"},i.a.createElement("div",{className:"templately-wem-title"},i.a.createElement("span",{className:"wem-title-icon"})),i.a.createElement("div",{className:"templately-wem-input templately-workspace-name"},i.a.createElement(Ep,{value:d,onChange:function(e){c(!1),m(e.target.value)}}))),y.length>0&&i.a.createElement("div",{className:"templately-wem-row"},i.a.createElement("div",{className:"templately-wem-title"},i.a.createElement("p",null,_p("Shared with","templately"),": ")),i.a.createElement("div",{className:"templately-wem-input templately-shared-with"},i.a.createElement("ul",{className:"templately-added-email-list"},y))),i.a.createElement("div",{className:"templately-wem-row"},i.a.createElement("div",{className:"templately-wem-title"},i.a.createElement("p",null,_p("Add People","templately"),": ")),i.a.createElement("div",{className:"templately-wem-input templately-new-shared"},i.a.createElement("ul",{className:"templately-wem-new-email-list"},b),i.a.createElement("div",null,i.a.createElement(Ep,{onKeyUp:function(e){return k(13===e.keyCode)},onChange:function(e){return N(e.target.value)},value:A,placeholder:_p("Type email to add","templately")}),i.a.createElement(Jc,{disabled:0===A.length,onClick:function(){return k(!0)}},_p("Add","templately"))))),i.a.createElement("div",{className:"templately-wem-row templately-wem-save-btn"},i.a.createElement(Jc,{disabled:l,onClick:function(){return f(!0)}},_p("Save","templately")))))},Ap=function(e){return i.a.createElement("div",{className:"templately-delete-confirm-text"},i.a.createElement("h3",null,"Are You Sure?"),i.a.createElement("p",null,"The WorkSpace will be permanently deleted including the files."))};function Np(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Ip(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ip(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ip(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Lp=wp.i18n.__,Dp=tt((function(e){return{pagination:e.common.pagination,userID:e.admin.user.id||null}}))((function(e){var t=Np(Object(o.useState)(!1),2),n=t[0],r=t[1],a=Np(Object(o.useState)(!1),2),l=a[0],c=a[1],u=Np(Object(o.useState)(!1),2),s=u[0],f=u[1],p=Np(Object(o.useState)([]),2),d=p[0],m=p[1],h=Np(Object(o.useState)(!1),2),y=h[0],g=h[1],v=le(),b=Object(o.useRef)(null),w=Object(o.useRef)(null),E=function(t){if(e.userID===e.content.owner.id){var n=b.current.contains(t.target),a=w.current&&w.current.contains(t.target);n||a||r(!1)}};return Object(o.useEffect)((function(){l&&(ii("",{showConfirmButton:!1,showCloseButton:!0,allowOutsideClick:!1,html:i.a.createElement(Tp,{singleDispatch:function(t){e.dispatch({type:"EDIT_WORKSPACE",payload:{page:e.pagination,slug:t.slug,data:t,platform:e.platform}}),e.dispatch(function(e){return{type:"EDIT_WORKSPACE_DETAILS",payload:e}}({page:e.pagination,slug:t.slug,data:t,platform:e.platform}))},pagination:e.pagination,content:e.content,platform:e.platform})}).then((function(e){return e.saved?ii("",{icon:"success",timer:1500,html:i.a.createElement(ki,{title:"Successfully Saved",content:"You have succesfully saved your WorkSpace changes."})}):e.dismiss?void 0:ii("",{icon:"error",timer:1500,html:i.a.createElement(ki,{title:"Something went wrong.",content:"Something went wrong regarding changes in your WorkSpace. Try Later or Contact support."})})})),c(!1))}),[l]),Object(o.useEffect)((function(){s&&(ii("",{showConfirmButton:!0,allowOutsideClick:!1,confirmButtonText:"Delete",cancelButtonText:"Cancel",showCancelButton:!0,showCloseButton:!0,showLoaderOnConfirm:!0,reverseButtons:!0,customClass:{container:"templately-delete-modal",confirmButton:"templately-delete-confirm",cancelButton:"templately-delete-cancel"},html:i.a.createElement(Ap,null),input:"checkbox",inputValue:0,inputPlaceholder:"Delete WorkSpace Files?",preConfirm:function(t){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(null!==e){var n=new FormData;return n.append("action","get_templately"),n.append("content_type","delete_workspace"),n.append("id",e),n.append("withFiles",t),n.append("nonce",ai),Do.a.post(ajaxurl,n).then((function(e){return e}))}}(s,t).then((function(t){return t.data.success&&"success"==t.data.data?(e.dispatch({type:"DELETE_WORKSPACE",payload:{page:e.pagination,data:s}}),{delete:!0}):{delete:!1}}))}}).then((function(t){if(t.hasOwnProperty("value")&&t.value.hasOwnProperty("delete")){if(t.value.delete){var n=v.pathname.replace(e.content.slug,"");return e.dispatch(Zn(n)),ii("",{icon:"success",timer:1500,html:i.a.createElement(ki,{title:"Successfully Deleted",content:"You have deleted a WorkSpace from your account."})})}return ii("",{icon:"error",timer:1500,html:i.a.createElement(ki,{title:"Something went wrong.",content:"Something went wrong regarding deleting your WorkSpace. Try Later."})})}})),f(!1))}),[s]),Object(o.useEffect)((function(){var t=[];e.content.sharedWith&&e.content.sharedWith.length>0&&(e.content.sharedWith.slice(0,e.shared||e.userID!==e.content.owner.id?5:4).map((function(e,n){null!=e.profile_photo?t.push(i.a.createElement("img",{key:n,src:e.profile_photo,alt:e.name})):t.push(i.a.createElement("span",{key:n},e.name.slice(0,1)))})),m(t));return document.addEventListener("mousedown",E),function(){return document.removeEventListener("mousedown",E)}}),[]),Object(o.useEffect)((function(){e.details||(!1!==y&&!1===n&&!1===l&&e.dispatch(Zn(e.shared?"/shared/workspace/".concat(y):"/workspace/".concat(y))),g(!1))}),[y]),i.a.createElement("div",{onClick:function(){return g(e.content.slug)},className:"".concat(e.details?"tsw-active ":"","templately-single-workspace").concat(!0===n?" templately-ctxmenu-open":"")},i.a.createElement("div",{className:"templately-single-workspace-inner"},e.userID===e.content.owner.id&&i.a.createElement("div",{className:"templately-sw-cxt-menu-wrapper"},i.a.createElement(Jc,{ref:b,className:"templately-sw-action-btn",onClick:function(){return r(!n)}},i.a.createElement(hn,null)),n&&i.a.createElement("div",{ref:w,className:"templately-sw-cxt-menu".concat(!0===n?" topen":"")},i.a.createElement("ul",null,i.a.createElement("li",{className:"tw-edit",onClick:function(){return c(e.content.id)}},i.a.createElement("i",null),Lp("Edit","templately")),i.a.createElement("li",{className:"tw-delete",onClick:function(){return f(e.content.id)}},i.a.createElement("i",null),Lp("Delete","templately"))))),i.a.createElement("header",null,i.a.createElement("span",{className:"tw-icon"}),i.a.createElement("div",null,i.a.createElement("span",{className:"tw-title"},Lp(e.content.name,"templately")),(e.shared||e.details)&&i.a.createElement("span",{className:"tw-author"},Lp("by "+e.content.owner.name,"templately")))),i.a.createElement("div",{className:"templately-workspace-sharewith"},i.a.createElement("p",null,Lp("Shared with","templately")," "),i.a.createElement("div",{className:"templately-workspace-sharewith-image"},d,e.userID===e.content.owner.id&&i.a.createElement(Jc,{onClick:function(){return c(!0)}},i.a.createElement(wn,null))))))}));function Rp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Mp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Rp(Object(n),!0).forEach((function(t){Fp(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Rp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Fp(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zp(e){return function(e){if(Array.isArray(e))return Vp(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||Bp(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Up(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||Bp(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Bp(e,t){if(e){if("string"==typeof e)return Vp(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Vp(e,t):void 0}}function Vp(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Wp=wp.i18n.__,Hp=TemplatelyAdmin.loadingImage,$p=function(e){var t=Up(Object(o.useState)(!1),2),n=t[0],r=t[1],a=Up(Object(o.useState)(!0),2),l=a[0],c=a[1],u=Up(Object(o.useState)(!1),2),s=u[0],f=u[1],p=Up(Object(o.useState)(""),2),d=p[0],m=p[1],h=Up(Object(o.useState)([]),2),y=h[0],g=h[1],v=Up(Object(o.useState)(!1),2),b=v[0],w=v[1],E=Up(Object(o.useState)(""),2),O=E[0],k=E[1],S=Up(Object(o.useState)(!1),2),x=S[0],_=S[1],j=Up(Object(o.useState)([]),2),P=j[0],C=j[1];return Object(o.useEffect)((function(){if(b){var e=zp(P),t=O.toLowerCase();mi(t)&&(e.includes(t)||(e.push(t),C(e)),k("")),w(!1)}}),[b]),Object(o.useEffect)((function(){if(!1!==x){var e=zp(P).filter((function(e){return x!=e}));C(e),_(!1)}}),[x]),Object(o.useEffect)((function(){var e=[];P.length>0&&P.map((function(t,n){return e.push(i.a.createElement("li",{key:n},t,i.a.createElement("span",{onClick:function(){return _(t)}})))})),g(e)}),[P]),Object(o.useEffect)((function(){c(!(P.length>0||d.length>0))}),[P,d]),Object(o.useEffect)((function(){s&&(r(!0),function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(null!==e){var n=new FormData;return n.append("action","get_templately"),n.append("content_type","create_workspace"),n.append("title",e),n.append("share_with",t.join()),n.append("nonce",ai),Do.a.post(ajaxurl,n).then((function(e){return e})).catch((function(e){return e}))}}(d,P).then((function(t){t.data.success?"success"===t.data.data.status?(e.singleDispatch(t.data.data.workspace),$o.a.close(Mp({created:!0},t.data.data))):$o.a.close(Mp({created:!1},t.data.data)):r(!1)})),f(!1))}),[s]),i.a.createElement(i.a.Fragment,null,i.a.createElement("div",{className:"templately-workspace-edit-modal templately-workspace-create-modal"},n&&i.a.createElement("div",{className:"templately-pre-loader"},i.a.createElement("img",{src:Hp})),i.a.createElement("div",{className:"templately-wem-row"},i.a.createElement("div",{className:"templately-wem-title"},i.a.createElement("span",{className:"wem-title-icon"})),i.a.createElement("div",{className:"templately-wem-input templately-workspace-name"},i.a.createElement("input",{autoFocus:!0,type:"text",value:d,onChange:function(e){return m(e.target.value)},placeholder:Wp("WorkSpace Name","templately")}))),i.a.createElement("div",{className:"templately-wem-row"},i.a.createElement("div",{className:"templately-wem-title"},i.a.createElement("p",null,Wp("Add People","templately"),": ")),i.a.createElement("div",{className:"templately-wem-input templately-new-shared"},i.a.createElement("ul",{className:"templately-wem-new-email-list"},y),i.a.createElement("div",null,i.a.createElement(Ep,{onChange:function(e){return k(e.currentTarget.value)},onKeyUp:function(e){return w(13===e.keyCode)},value:O,placeholder:Wp("Type email to add","templately")}),i.a.createElement(Jc,{disabled:0===O.length,onClick:function(){return w(!0)}},Wp("Add","templately"))))),i.a.createElement("div",{className:"templately-wem-row templately-wem-save-btn"},i.a.createElement(Jc,{disabled:l,onClick:function(){return f(!0)}},Wp("Create WorkSpace","templately")))))};function qp(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Kp(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Kp(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Kp(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Qp=function(e){var t=qp(Object(o.useState)(!0),2),n=t[0],r=t[1];return Object(o.useEffect)((function(){var t=setTimeout((function(){r(!1)}),[e.delay]);return function(){return clearTimeout(t)}}),[]),n?i.a.createElement("div",{className:"templately-single-workspace templately-single-workspace-placeholder"},i.a.createElement("svg",{"aria-labelledby":"loading-aria",preserveAspectRatio:"none",viewBox:"0 0 305 159"},i.a.createElement("rect",{width:"100%",height:"100%",fill:'url("#fill")',clipPath:"url(#clip-path)"}),i.a.createElement("defs",null,i.a.createElement("clipPath",{id:"clip-path"},i.a.createElement("circle",{cx:"300",cy:"22",r:"3"}),i.a.createElement("circle",{cx:"300",cy:"29",r:"3"}),i.a.createElement("circle",{cx:"300",cy:"36",r:"3"}),i.a.createElement("path",{d:"M207.4 72.6H5.1c-2.8 0-5.1-2.3-5.1-5.1s2.3-5.1 5.1-5.1h202.2c2.8 0 5.1 2.3 5.1 5.1.1 2.7-2.1 5-4.8 5.1h-.2zM82.3 97.4H5.1c-2.8 0-5.1-2.3-5.1-5.1s2.3-5.1 5.1-5.1h77.3c2.8 0 5.1 2.3 5.1 5.1-.1 2.8-2.3 5.1-5.2 5.1.1 0 .1 0 0 0z"}),i.a.createElement("circle",{cx:"21",cy:"22",r:"21"}),i.a.createElement("path",{d:"M34.8 125C27 118 15 118.6 8 126.4c-7 7.8-6.4 19.8 1.4 26.8 3.5 3.1 8 4.9 12.7 4.9 4.7 0 9.2-1.7 12.7-4.8-6.6-8.4-6.6-20.1 0-28.3z"}),i.a.createElement("path",{d:"M59.8 138.9c0-5.1 1.7-10 5-14-7.8-7-19.8-6.4-26.8 1.4-7 7.8-6.4 19.8 1.4 26.8 3.5 3.1 8 4.9 12.7 4.9 4.7 0 9.2-1.7 12.7-4.8-3.2-4.1-4.9-9.1-5-14.3z"}),i.a.createElement("path",{d:"M90 138.9c0-5.1 1.7-10 5-14-7.8-7-19.8-6.4-26.8 1.4-7 7.8-6.4 19.8 1.4 26.8 3.5 3.1 8 4.9 12.7 4.9 4.7 0 9.2-1.7 12.7-4.8-3.2-4.1-5-9.1-5-14.3z"}),i.a.createElement("path",{d:"M120 138.9c0-5.1 1.7-10 5-14-7.8-7-19.8-6.4-26.8 1.4-7 7.8-6.4 19.8 1.4 26.8 3.5 3.1 8 4.9 12.7 4.9 4.7 0 9.2-1.7 12.7-4.8-3.2-4.1-5-9.1-5-14.3z"}),i.a.createElement("circle",{cx:"142",cy:"139",r:"19"})),i.a.createElement("linearGradient",{id:"fill"},i.a.createElement("stop",{offset:"0.6",stopColor:"#f3f3f3"},i.a.createElement("animate",{attributeName:"offset",dur:"2s",keyTimes:"0; 0.25; 1",repeatCount:"indefinite",values:"-2; -2; 1"})),i.a.createElement("stop",{offset:"1.6",stopColor:"#6c7dff"},i.a.createElement("animate",{attributeName:"offset",dur:"2s",keyTimes:"0; 0.25; 1",repeatCount:"indefinite",values:"-1; -1; 2"})),i.a.createElement("stop",{offset:"2.6",stopColor:"#f3f3f3"},i.a.createElement("animate",{attributeName:"offset",dur:"2s",keyTimes:"0; 0.25; 1",repeatCount:"indefinite",values:"0; 0; 3"})))))):i.a.createElement("div",null)};function Gp(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Yp(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Yp(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Yp(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Xp=wp.i18n.__,Jp=function(e){var t=Gp(Object(o.useState)(!1),2),n=t[0],r=t[1];return Object(o.useEffect)((function(){var t=setTimeout((function(){r(!0)}),[e.delay]);return function(){return clearTimeout(t)}}),[]),n?i.a.createElement("div",{className:"templately-single-workspace templately-add-workspace no-workspace-found-wrapper"},i.a.createElement("div",{className:"templately-add-workspace-inner"},i.a.createElement("span",{className:"tw-icon"}),i.a.createElement("span",{className:"tw-title"},Xp("No Workspaces Found.","templately")))):i.a.createElement("div",null)},Zp=function(e){return void 0===e.visibility||e.visibility||e.title&&e.title.length<=0?"":i.a.createElement("div",{className:"templately-workspace-header"},i.a.createElement("h1",null,e.title),e.children)};function ed(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return td(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return td(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function td(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var nd=wp.i18n.__,rd=tt((function(e){return{workspaces:e.workspaces||null,need_pagination:e.common.need_pagination,pagination_loading:e.common.pagination_loading,pagination:e.common.pagination,workspaceList:e.workspaces.workspacesList}}))((function(e){var t=ed(Object(o.useState)(!1),2),n=t[0],r=t[1],a=ed(Object(o.useState)([]),2),l=a[0],c=a[1],u=ed(Object(o.useState)(1),2),s=u[0],f=u[1];return Object(o.useEffect)((function(){e.workspaces.hasOwnProperty(e.pagination)&&e.workspaces[e.pagination].length>0||yi(!1,!0,{page:e.pagination}).then((function(t){t.data.success&&(t.data.hasOwnProperty("data")&&t.data.data.hasOwnProperty("total_page")&&f(t.data.data.total_page),e.dispatch({type:"ALL_WORKSPACE_QUERY",payload:{current_page:t.data.data.current_page,data:t.data.data.data,total_page:t.data.data.total_page}}))})).catch((function(e){return console.error("Something went wrong: regarding fetching WorkSpace list",e)}))}),[e.pagination]),Object(o.useEffect)((function(){if(null!=e.workspaces){var t=[];e.workspaces.hasOwnProperty(e.pagination)&&e.workspaces[e.pagination].length>0&&e.workspaces[e.pagination].map((function(e,n){t.push(i.a.createElement(Dp,{key:e.id,content:e}))})),c(t)}}),[e.workspaces,e.pagination]),Object(o.useEffect)((function(){n&&(ii("",{showConfirmButton:!1,showCloseButton:!0,allowOutsideClick:!1,html:i.a.createElement($p,{singleDispatch:function(t,n){e.workspaceList.length>0&&e.dispatch({type:"ADD_WORKSPACE_IN_LIST",payload:[{id:t.id,name:t.name,slug:t.slug}]}),e.dispatch(function(e){return{type:"CREATE_WORKSPACE",payload:e}}({page:e.pagination,data:t}))}})}).then((function(e){if(e.hasOwnProperty("created"))return e.created?ii("",{icon:"success",timer:2e3,html:i.a.createElement(ki,{title:"Successfully Created",content:i.a.createElement("p",null,"You have created a WorkSpace called"," ",i.a.createElement("strong",null,e.workspace.name))})}):ii("",{icon:"error",showCloseButton:!0,html:i.a.createElement(ki,{title:"Something went wrong.",content:i.a.createElement("div",null,i.a.createElement("p",null,e.message),i.a.createElement("a",{href:"https://templately.com/subscription",target:"_blank"},nd("Upgrade to Pro","templately")))})})})),r(!1))}),[n]),i.a.createElement(vp,null,i.a.createElement(Zp,{title:"My WorkSpace"}),i.a.createElement("div",{className:"templately-my-workspace templately-workspace-list"},i.a.createElement("div",{className:"templately-single-workspace templately-add-workspace",onClick:function(){return r(!0)}},i.a.createElement("div",{className:"templately-add-workspace-inner"},i.a.createElement("span",{className:"tw-icon"}),i.a.createElement("span",{className:"tw-title"},nd("Add New WorkSpace","templately"))))," ",l.length>0?l:i.a.createElement(i.a.Fragment,null,i.a.createElement(Qp,{delay:3e3}),i.a.createElement(Qp,{delay:3e3}),i.a.createElement(Qp,{delay:3e3}),i.a.createElement(Jp,{delay:3e3}))),i.a.createElement(wu,{type:"workspace",count:s}))}));n(48),n(49);function ad(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return od(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return od(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function od(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var id=wp.i18n.__,ld=TemplatelyAdmin,cd=ld.loadingImage,ud=(ld.platform,ld.nonce,function(e){var t=ad(Object(o.useState)(!1),2),n=t[0],r=t[1],a=ad(Object(o.useState)(!1),2),l=a[0],c=a[1],u=ad(Object(o.useState)(""),2),s=u[0],f=u[1],p=ad(Object(o.useState)(!0),2),d=p[0],m=p[1],h=ad(Object(o.useState)(!1),2),y=h[0],g=h[1],v=ad(Object(o.useState)(!1),2),b=v[0],w=v[1],E=ad(Object(o.useState)([]),2),O=E[0],k=E[1];return Object(o.useEffect)((function(){if(e.workspaceList.length<=0||e.sharedWorkspaceList.length<=0)r(!0),Promise.all([yi(),yi(!0)]).then((function(t){if(t.length>0){var n=[];null!==t[0]&&"string"!=typeof t[0]&&(e.singleDispatch(t[0],"workspace"),n.push({label:id("My WorkSpace","templately"),options:gi(t[0])})),null!==t[1]&&"string"!=typeof t[1]&&(e.singleDispatch(t[1]),n.push({label:id("Shared WorkSpace","templately"),options:gi(t[1],!0)})),n.length>0?(r(!1),k(n)):f("string"==typeof t[0]?t[0]:"string"==typeof t[1]?t[1]:"")}})).catch((function(e){return console.error("Something went wrong: regarding fetching WorkSpace list",e)}));else{var t=[];e.workspaceList.length>0&&t.push({label:id("My WorkSpace","templately"),options:gi(e.workspaceList)}),e.sharedWorkspaceList.length>0&&t.push({label:id("Shared WorkSpace","templately"),options:gi(e.sharedWorkspaceList,!0)}),t.length>0&&k(t)}}),[l]),Object(o.useEffect)((function(){m(!1===b)}),[b]),Object(o.useEffect)((function(){y&&(r(!0),function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"copy";if(null===e||null===t)return!1;var r=new FormData;return r.append("action","get_templately"),r.append("content_type","copy_or_move"),r.append("cloud_file_id",e),r.append("workspace_id",t),r.append("trigger_action",n),r.append("nonce",ai),Do.a.post(ajaxurl,r).then((function(e){return e}))}(e.itemID,b.value,e.action).then((function(t){t.data.success&&"success"==t.data.data?$o.a.close({triggered:!0,action:e.action,name:b.label,fileTo:b.slug}):r(!1)})),g(!1))}),[y]),i.a.createElement(i.a.Fragment,null,i.a.createElement("div",{className:"templately-workspace-edit-modal templately-workspace-copy-modal"},n&&i.a.createElement("div",{className:"templately-pre-loader"},s.length>0?i.a.createElement("div",{className:"templately-retry"},i.a.createElement("p",null,s),i.a.createElement("button",{className:"templately-retry-button button-primary",onClick:function(){r(!0),c(!l),f("")}},"Retry")):i.a.createElement("img",{src:cd})),i.a.createElement("div",{className:"templately-wem-row"},i.a.createElement("div",{className:"templately-wem-title"},i.a.createElement("p",null,id("Item Name","templately"),": ")),i.a.createElement("div",{className:"templately-wem-input"},i.a.createElement("h3",null,e.title))),i.a.createElement("div",{className:"templately-wem-row"},i.a.createElement("div",{className:"templately-wem-title"},i.a.createElement("p",null,"copy"===e.action?id("Copy to","templately"):id("Move to","templately"),": ")),i.a.createElement("div",{className:"templately-wem-input"},i.a.createElement(Co,{options:O,onChange:function(e){return w(e)}}))),i.a.createElement("div",{className:"templately-wem-row templately-wem-save-btn"},i.a.createElement(Jc,{disabled:d,onClick:function(){return g(!0)}},id("Done","templately")))))});function sd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function fd(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?sd(Object(n),!0).forEach((function(t){pd(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sd(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function pd(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dd(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return md(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return md(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function md(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var hd=wp.i18n.__,yd=TemplatelyAdmin,gd=yd.platform,vd=yd.is_block_editor,bd=yd.is_editor,wd=tt((function(e){return{clouds:e.common.cloud_files,workspaceList:e.workspaces.workspacesList,sharedWorkspaceList:e.sharedWorkspaces.sharedWorkspaceList,userID:e.admin.user.id||null,pagination:e.common.pagination,platform:e.common.platform}}))((function(e){var t=dd(Object(o.useState)(!1),2),n=t[0],r=t[1],a=dd(Object(o.useState)(!1),2),l=a[0],c=a[1],u=dd(Object(o.useState)(!1),2),s=u[0],f=u[1],p=dd(Object(o.useState)(!1),2),d=p[0],m=p[1],h=dd(Object(o.useState)(!1),2),y=h[0],g=h[1],v=Object(o.useRef)(null),b=Object(o.useRef)(null),w=Object(o.useRef)(null),E=Object(o.useRef)(null),O=function(e){var t=v.current&&v.current.contains(e.target),n=b.current&&b.current.contains(e.target);t||n||r(!1)};return Object(o.useEffect)((function(){return document.addEventListener("mousedown",O),function(){return document.removeEventListener("mousedown",O)}}),[]),Object(o.useEffect)((function(){!1!==l&&(e.isLoading(!0),li(l,"cloud",{fileType:e.platform}).then((function(t){!0===t?(e.isLoading(!1),"gutenberg"!==gd?window.TemplatelyModal.destroy():Ro.close()):(e.isLoading(!1),ii(t,{icon:"error",timer:2e3}))})))}),[l]),Object(o.useEffect)((function(){if(!1!==s||!1!==d){var t=!1!==d?"move":"copy",n="copy"===t?"Copied":"Moved",r=!1!==d?d:s;ii("",{html:i.a.createElement(ud,{title:e.name,singleDispatch:function(t,n){"workspace"===n?e.dispatch(ar(t)):e.dispatch(or(t))},itemID:r,currentWorkspace:e.currentWorkspace,action:t,workspaceList:e.workspaceList,sharedWorkspaceList:e.sharedWorkspaceList})}).then((function(t){if(t.triggered){if("move"!==t.action||e.details)"move"===t.action&&e.details&&(e.itemDelete(!0),e.isLoading(!0));else{var a=e.clouds[e.platform][e.pagination].filter((function(e){return e.id!==r})),o=e.clouds.hasOwnProperty(e.platform)?e.clouds[e.platform].total_page:1;e.dispatch(Fn({current_page:e.pagination,data:a,total_page:o,platform:e.platform})),e.isDelete(!0)}return ii("",{icon:"success",timer:1500,html:i.a.createElement(ki,{title:"Successfully ".concat(n),content:i.a.createElement("p",null,"Your file has been ".concat(n.toLowerCase()," to a WorkSpace called")," ",i.a.createElement("strong",null,t.name))})})}})),"copy"===t?f(!1):m(!1)}}),[s,d]),Object(o.useEffect)((function(){if(!1!==y){ii("",fd(fd({showConfirmButton:!0,confirmButtonText:"Delete",cancelButtonText:"Cancel",showCancelButton:!0,showCloseButton:!0,showLoaderOnConfirm:!0,reverseButtons:!0,html:i.a.createElement(ki,{title:"Are You Sure?",content:"You want to delete the file from your cloud."})},{}),{},{preConfirm:function(t){return t?function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"cloud",n=new FormData;n.append("action","get_templately"),n.append("content_type","remove_from_cloud"),n.append("remove_from",t);var r="templately"===ni?"elementor":ni;return n.append("file_type",r),n.append("id",e),n.append("nonce",ai),Do.a.post(ajaxurl,n).then((function(e){return e})).catch((function(e){return e}))}(y,e.details?"workspace":"cloud").then((function(t){return t.data.success?(e.details?(e.itemDelete(!0),e.dispatch(function(e){return{type:"DELETE_FILE_FROM_WORKSPACE",payload:e}}({fileFrom:e.currentWorkspace,id:y,page:e.pagination}))):(e.isDelete(!0),e.dispatch({type:"REMOVE_CLOUD_FILE",payload:{page:e.pagination,id:t.data.data,platform:e.platform}})),{delete:!0,fileFrom:e.currentWorkspace}):{delete:!1}})):{delete:!1}}})).then((function(e){if(!e.dismiss){if(e.value&&e.value.delete){var t=e.value.fileFrom?"You have deleted a file from your WorkSpace called ".concat(e.value.fileFrom):"You have deleted a file from your cloud.";return ii("",{icon:"success",timer:1500,html:i.a.createElement(ki,{title:"Successfully Deleted",content:t})})}return ii("",{icon:"error",timer:1500,html:i.a.createElement(ki,{title:"Something went wrong.",content:"Something went wrong regarding deleting your file. Try Later or Contact for Support."})})}})),g(!1)}}),[y]),i.a.createElement("div",{ref:E},i.a.createElement(tu,null,i.a.createElement(nu,null,i.a.createElement("div",{className:"ttcol-header"},hi(e.file_type)&&i.a.createElement("img",{src:hi(e.file_type),alt:e.name}),i.a.createElement("p",null,hd(e.name)))),i.a.createElement(nu,null,i.a.createElement(tu,null,i.a.createElement(nu,null,i.a.createElement("p",null,hd(e.date))),i.a.createElement(nu,{className:"templately-col-actions-btn"},(bd||vd)&&i.a.createElement(Jc,{className:"templately-cloud-item-action-btn tw-download",ref:w,onClick:function(){return c(e.details?e.cloud_id:e.id)}},i.a.createElement("i",null),"Insert"),i.a.createElement(Jc,{className:"templately-cloud-item-action-btn",ref:v,onClick:function(){return r(!n)}},i.a.createElement(hn,null)),n&&i.a.createElement("div",{ref:b,className:"templately-sw-cxt-menu ".concat(!0===n?"topen":"")},i.a.createElement("ul",null,i.a.createElement("li",{className:"tw-copy".concat(e.owner.id!==e.userID?" tw-disable":""),onClick:function(){return f(e.owner.id===e.userID&&(e.details?e.cloud_id:e.id))}},i.a.createElement("i",null),"Copy to WorkSpace"),i.a.createElement("li",{className:"tw-move".concat(e.owner.id!==e.userID?" tw-disable":""),onClick:function(){return m(e.owner.id===e.userID&&(e.details?e.cloud_id:e.id))}},i.a.createElement("i",null),"Move to WorkSpace"),i.a.createElement("li",{className:"tw-delete".concat(e.owner.id!==e.userID?" tw-disable":""),onClick:function(){return g(e.owner.id===e.userID&&e.id)}},i.a.createElement("i",null),"Delete"))))))))})),Ed=TemplatelyAdmin.not_found,Od=tt((function(e){return{retry:e.common.retry,retryMessage:e.common.retryMessage}}))((function(e){return i.a.createElement("div",{className:"templately-nothing-is-there"},""!=e.retryMessage?i.a.createElement("div",{className:"templately-retry"},i.a.createElement("p",null,e.retryMessage),i.a.createElement("button",{className:"templately-retry-button button-primary",onClick:function(){e.dispatch(Cn(!e.retry)),e.dispatch(In(""))}},"Retry")):i.a.createElement("img",{src:Ed}))}));function kd(e){return function(e){if(Array.isArray(e))return Cd(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||Pd(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Sd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function xd(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Sd(Object(n),!0).forEach((function(t){_d(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Sd(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function _d(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jd(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||Pd(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Pd(e,t){if(e){if("string"==typeof e)return Cd(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Cd(e,t):void 0}}function Cd(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Td=wp.i18n.__,Ad=TemplatelyAdmin.loadingImage,Nd=function(e){var t=jd(Object(o.useState)(!1),2),n=t[0],r=t[1],a=jd(Object(o.useState)(!1),2),l=a[0],c=a[1],u=jd(Object(o.useState)(""),2),s=u[0],f=u[1],p=jd(Object(o.useState)(!0),2),d=p[0],m=p[1],h=jd(Object(o.useState)(!1),2),y=h[0],g=h[1],v=jd(Object(o.useState)(!1),2),b=v[0],w=v[1],E=jd(Object(o.useState)(!1),2),O=E[0],k=E[1],S=jd(Object(o.useState)({value:"clouds",label:Td("My Clouds","templately")}),2),x=S[0],_=S[1],j=jd(Object(o.useState)([]),2),P=j[0],C=j[1],T=jd(Object(o.useState)([]),2),A=T[0],N=T[1],I=jd(Object(o.useState)([]),2),L=I[0],D=I[1],R=jd(Object(o.useState)([]),2),M=R[0],F=R[1],z=jd(Object(o.useState)(e.cloudFiles),2),U=z[0],B=z[1];Object(o.useEffect)((function(){if(F([]),"clouds"==x.value)if(U.hasOwnProperty("clouds")){var t=[];U.clouds.map((function(e){t.push({label:e.name,value:e.id,file_type:e.file_type})})),D(t)}else D([]);if("workspaces"==x.value&&!1!==O)if(U.hasOwnProperty(O.slug)){var n=[];U[O.slug].map((function(e){n.push({label:e.name,value:e.my_cloud_id,file_type:e.file_type})})),D(n)}else{r(!0),bi(O.slug,{per_page:-1,platform:e.platform}).then((function(t){if(t.data.success)if(r(!1),null!==t.data.data.files){var n=xd({},U);n[O.slug]=t.data.data.files.data,B(n),e.singleDispatch({data:t.data.data.files.data,slug:O.slug});var a=[];t.data.data.files.data.map((function(e){a.push({label:e.name,value:e.my_cloud_id,file_type:e.file_type})})),D(a)}else D([]);else f("string"==typeof t.data.data?t.data.data:"")}))}if("shared_workspaces"==x.value&&!1!==b)if(U.hasOwnProperty(b.slug)){var a=[];U[b.slug].map((function(e){a.push({label:e.name,value:e.my_cloud_id,file_type:e.file_type})})),D(a)}else{r(!0),bi(b.slug,{per_page:-1,platform:e.platform}).then((function(t){if(t.data.success)if(r(!1),null!==t.data.data.files){var n=xd({},U);n[b.slug]=t.data.data.files.data,B(n),e.singleDispatch({data:t.data.data.files.data,slug:b.slug});var a=[];t.data.data.files.data.map((function(e){a.push({label:e.name,value:e.my_cloud_id,file_type:e.file_type})})),D(a)}else D([]);else f("string"==typeof t.data.data?t.data.data:"")}))}}),[x,O,b,U,l]),Object(o.useEffect)((function(){if(r(!0),U.hasOwnProperty("clouds")){if(U.hasOwnProperty("clouds")){var t=[];U.clouds.map((function(e){t.push({label:e.name,value:e.id,file_type:e.file_type})})),D(t)}}else vi({per_page:-1,platform:e.platform}).then((function(t){if(t.data.success){if(t.data.data.data.length>0){var n=[];t.data.data.data.map((function(e){n.push({label:e.name,value:e.id,file_type:e.file_type})})),D(n);var a=xd({},U);a.clouds=t.data.data.data,B(a),e.singleDispatch({slug:"clouds",data:t.data.data.data}),r(!1)}}else r(!0),f("string"==typeof t.data.data?t.data.data:"")}));e.workspaceList.length<=0||e.sharedWorkspaceList.length<=0?Promise.all([yi(),yi(!0)]).then((function(t){if(t.length>0){var n=[],a=[];null!==t[0]&&"string"!=typeof t[0]?(e.singleDispatch(t[0],"workspace"),n=gi(t[0])):f("string"==typeof t[0]?t[0]:""),null!==t[1]&&"string"!=typeof t[1]?(e.singleDispatch(t[1]),a=gi(t[1],!0)):f("string"==typeof t[1]?t[1]:""),n.length>0&&C(n),a.length>0&&N(a),(a.length>0||n.length>0)&&r(!1)}})).catch((function(e){return console.error("Error Regarding Fetching WorkSpace List:",e)})):(e.workspaceList.length>0&&C(gi(e.workspaceList)),e.sharedWorkspaceList.length>0&&N(gi(e.sharedWorkspaceList)),r(!1))}),[l]),Object(o.useEffect)((function(){null!==M?("workspaces"===x.value&&!1!==O&&M.length>0&&m(!1),"shared_workspaces"===x.value&&!1!==b&&M.length>0&&m(!1),"clouds"===x.value&&!b&&!O&&M.length>0&&m(!1)):m(!0)}),[b,O,M]),Object(o.useEffect)((function(){if(y){var t=M.reduce((function(e,t){var n=kd(e);return n.push(t.value),n}),[]);r(!0),function(e,t){var n=new FormData;return n.append("action","get_templately"),n.append("content_type","add_files_to_workspace"),n.append("workspace_id",e),n.append("files",t),n.append("nonce",ai),Do.a.post(ajaxurl,n).then((function(e){return e})).catch((function(e){return e}))}(e.workspaceID,JSON.stringify(t)).then((function(t){if(t.data.success){if("success"===t.data.data.status){var n=JSON.parse(t.data.data.data);if(n.files.length>0){var a=[];n.files.map((function(e){a.push({id:e.id,my_cloud_id:e.my_cloud_item_id,name:e.name,file_type:e.file_type,created_at:e.created_at,last_modified:e.last_modified,owner:e.owner})})),e.singleDispatch({slug:e.workspaceSlug,data:a},"workspace_details"),$o.a.close({added:!0})}}}else r(!1)})),g(!1)}}),[y]);return i.a.createElement(i.a.Fragment,null,i.a.createElement("div",{className:"templately-workspace-edit-modal templately-workspace-copy-modal"},n&&i.a.createElement("div",{className:"templately-pre-loader"},s.length>0?i.a.createElement("div",{className:"templately-retry"},i.a.createElement("p",null,s),i.a.createElement("button",{className:"templately-retry-button button-primary",onClick:function(){r(!0),c(!l),f("")}},"Retry")):i.a.createElement("img",{src:Ad})),i.a.createElement("div",{className:"templately-wem-row"},i.a.createElement("div",{className:"templately-wem-title"},i.a.createElement("p",null,Td("Add Template to WorkSpace","templately"),": "))),i.a.createElement("div",{className:"templately-wem-row"},i.a.createElement("div",{className:"templately-wem-title"},i.a.createElement("p",null,Td("Select Source","templately"),": ")),i.a.createElement("div",{className:"templately-wem-input"},i.a.createElement(Co,{isSearchable:!1,defaultValue:{value:"clouds",label:Td("My Clouds","templately")},options:[{value:"clouds",label:Td("My Clouds","templately")},{value:"workspaces",label:Td("My Workspaces","templately")},{value:"shared_workspaces",label:Td("Shared Workspaces","templately")}],onChange:function(e){return _(e)}}))),"workspaces"===x.value&&i.a.createElement("div",{className:"templately-wem-row"},i.a.createElement("div",{className:"templately-wem-title"},i.a.createElement("p",null,Td("Select WorkSpace","templately"),": ")),i.a.createElement("div",{className:"templately-wem-input"},i.a.createElement(Co,{options:P,noOptionsMessage:function(){return Td("No WorkSpace Found","templately")},onChange:function(e){return k(e)}}))),"shared_workspaces"===x.value&&i.a.createElement("div",{className:"templately-wem-row"},i.a.createElement("div",{className:"templately-wem-title"},i.a.createElement("p",null,Td("Select WorkSpace","templately"),": ")),i.a.createElement("div",{className:"templately-wem-input"},i.a.createElement(Co,{options:A,noOptionsMessage:function(){return Td("No Shared WorkSpace Found","templately")},onChange:function(e){return w(e)}}))),("shared_workspaces"===x.value&&!1!==b||"workspaces"===x.value&&!1!==O||"clouds"===x.value)&&i.a.createElement("div",{className:"templately-wem-row"},i.a.createElement("div",{className:"templately-wem-title"},i.a.createElement("p",null,Td("Select Templates","templately"),": ")),i.a.createElement("div",{className:"templately-wem-input"},i.a.createElement(Co,{value:M,noOptionsMessage:function(){return Td("No Saved Templates Found","templately")},classNamePrefix:"templately",isMulti:!0,options:L,onChange:function(e){return F(e)}}))),i.a.createElement("div",{className:"templately-wem-row templately-wem-save-btn"},i.a.createElement(Jc,{disabled:d,onClick:function(){return g(!0)}},Td("Add To WorkSpace","templately")))))};function Id(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Ld(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ld(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ld(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Dd=wp.i18n.__,Rd=tt((function(e){return{workspaceList:e.workspaces.workspacesList,sharedWorkspaceList:e.sharedWorkspaces.sharedWorkspaceList,clouds_file_list:e.workspacesDetails.filesList,platform:e.common.platform}}))((function(e){var t=Id(Object(o.useState)(!1),2),n=t[0],r=t[1],a=Id(Object(o.useState)(!1),2),l=a[0],c=a[1],u=Id(Object(o.useState)(""),2),s=u[0],f=u[1],p=Id(Object(o.useState)(!1),2),d=p[0],m=p[1],h=Id(Object(o.useState)([]),2),y=h[0],g=h[1];return Object(o.useEffect)((function(){!1!==n&&e.workspaceSlug!==n.slug&&(e.setSearch(!1),e.setLoading(!0),e.dispatch(Qn(1)),e.dispatch(Zn(n.shared?"/shared/workspace/".concat(n.slug):"/workspace/".concat(n.slug))),e.dispatch({type:"WORKSPACE_SLUG",payload:n.slug}),r(!1))}),[n]),Object(o.useEffect)((function(){d&&s.length>0&&(e.setItemLoading(!0),e.setSearch(!0),bi(e.workspaceSlug,{search:s,per_page:-1}).then((function(t){t.data.success&&(t.data.data.files.data&&e.setSearchedItem(t.data.data.files.data),e.setItemLoading(!1))})),m(!1)),d&&0===s.length&&e.setSearch(!1)}),[d]),Object(o.useEffect)((function(){if(e.workspaceList.length<=0||e.sharedWorkspaceList.length<=0)Promise.all([yi(),yi(!0)]).then((function(t){if(t.length>0){var n=[];null!==t[0]&&"string"!=typeof t[0]&&(e.dispatch(ar(t[0])),n.push({label:Dd("My WorkSpace","templately"),options:gi(t[0])})),null!==t[1]&&"string"!=typeof t[1]&&(e.dispatch(or(t[1])),n.push({label:Dd("Shared WorkSpace","templately"),options:gi(t[1],!0)})),n.length>0&&g(n)}})).catch((function(e){return console.error("Something went wrong: regarding fetching WorkSpace list",e)}));else{var t=[];e.workspaceList.length>0&&t.push({label:Dd("My WorkSpace","templately"),options:gi(e.workspaceList)}),e.sharedWorkspaceList.length>0&&t.push({label:Dd("Shared WorkSpace","templately"),options:gi(e.sharedWorkspaceList,!0)}),t.length>0&&g(t)}}),[e.retry]),Object(o.useEffect)((function(){l&&(ii("",{html:i.a.createElement(Nd,{title:e.name,singleDispatch:function(t,n){"workspace_details"===n||e.dispatch({type:"ALL_CLOUDS_FILE_LIST",payload:{slug:t.slug,data:t.data,platform:e.platform}})},platform:e.platform,workspaceSlug:e.workspaceSlug,workspaceID:e.workspaceID,cloudFiles:e.clouds_file_list[e.platform]||[],currentWorkspace:e.currentWorkspace,workspaceList:e.workspaceList,sharedWorkspaceList:e.sharedWorkspaceList})}).then((function(t){if(t.added)return e.setFileAdded(!0),ii("",{icon:"success",timer:1500,html:i.a.createElement(ki,{title:"Successfully Added.",content:i.a.createElement("p",null,"Your file has been added to this workspace."," ",i.a.createElement("strong",null,t.name))})})})),c(!1))}),[l]),i.a.createElement("div",{className:"templately-workspace-file-add"},i.a.createElement("div",{className:"twfa-header twfa-action"},i.a.createElement("h3",null,Dd("My Files","templately"))),i.a.createElement("div",{className:"twfa-search twfa-action"},i.a.createElement("div",null,i.a.createElement(Co,{className:"templately-select-workspace",classNamePrefix:"templately",options:y,defaultValue:e.currentDetails,onChange:function(e){return r(e)}}),i.a.createElement(Ep,{onChange:function(e){return f(e)},onKeyDown:function(e){var t=e.keyCode;return m(13===t)},placeholder:Dd("Search...","templately")}))),i.a.createElement("div",{className:"twfa-add twfa-action"},i.a.createElement(Jc,{onClick:function(){return c(!0)}},i.a.createElement(wn,null))))}));function Md(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Fd(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Fd(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Fd(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var zd=tt((function(e){return{isLoggedIn:e.common.isLoggedIn,clouds:e.common.cloud_files,workspace_slug:e.common.workspace_slug,workspacesDetails:e.workspacesDetails||!1,pagination_loading:e.common.pagination_loading,pagination:e.common.pagination,platform:e.common.platform,retry:e.common.retry}}))((function(e){var t=Md(Object(o.useState)({}),2),n=t[0],r=t[1],a=Md(Object(o.useState)([]),2),l=a[0],c=a[1],u=Md(Object(o.useState)([]),2),s=u[0],f=u[1],p=Md(Object(o.useState)([]),2),d=p[0],m=p[1],h=Md(Object(o.useState)(!0),2),y=h[0],g=h[1],v=Md(Object(o.useState)(!1),2),b=v[0],w=v[1],E=Md(Object(o.useState)(!1),2),O=E[0],k=E[1],S=Md(Object(o.useState)(!1),2),x=S[0],_=S[1],j=Md(Object(o.useState)(!1),2),P=j[0],C=j[1],T=Md(Object(o.useState)(!1),2),A=T[0],N=T[1],I=Md(Object(o.useState)(1),2),L=I[0],D=I[1],R=ce(),M=le(),F=Md(Object(o.useState)(!1!==e.workspace_slug?e.workspace_slug:R.slug),2),z=F[0],U=F[1];return Object(o.useEffect)((function(){!1!==e.workspace_slug&&U(e.workspace_slug)}),[e.workspace_slug]),Object(o.useEffect)((function(){if(!1!==z&&!(e.workspacesDetails.hasOwnProperty(z)&&null!==e.workspacesDetails[z].files&&e.workspacesDetails[z].files.hasOwnProperty(e.platform)&&e.workspacesDetails[z].files[e.platform].hasOwnProperty(e.pagination)&&0===M.search.length||e.workspacesDetails.hasOwnProperty(z)&&e.workspacesDetails[z].files.hasOwnProperty(e.platform)&&e.workspacesDetails[z].files[e.platform].hasOwnProperty(e.pagination)&&0===M.search.length)){var t=!1;y||(t=!0,_(!0)),bi(z,{page:e.pagination,platform:e.platform}).then((function(n){if(200===n.status){if(n.data.success)if(n.data.hasOwnProperty("data")&&null!==n.data.data){if(n.data.data.hasOwnProperty("files")&&null!==n.data.data.files){if("refresh"===b&&e.pagination===L)return e.dispatch(Qn(n.data.data.files.total_page)),void _(!1);D(n.data.data.files.total_page)}r({label:n.data.data.name,slug:n.data.data.slug,value:n.data.data.id}),e.dispatch({type:"ADD_WORKSPACE_WITH_DETAILS",payload:{slug:z,data:n.data.data,platform:e.platform,page:e.pagination,iLoading:t}})}else{var a=M.pathname.replace(R.slug,"");e.dispatch(Zn(a))}else e.dispatch(In("string"==typeof n.data.data?n.data.data:""));g(!1),_(!1)}else g(!1),_(!1)})).catch((function(e){g(!1),console.error("WorkSpace Details Error: ",e)}))}}),[z,e.pagination,b,O,e.platform,e.retry]),Object(o.useEffect)((function(){!0===O&&(e.dispatch(rr({page:e.pagination,slug:z,platform:e.platform,fileAdded:!0})),k("refresh")),!0===b&&(e.dispatch(rr({page:e.pagination,slug:z,platform:e.platform})),w("refresh"))}),[b,O]),Object(o.useEffect)((function(){if(!1!==z&&e.workspacesDetails.hasOwnProperty(z)){if(N(e.workspacesDetails[z].id),e.workspacesDetails[z].hasOwnProperty("files")&&null!=e.workspacesDetails[z].files){var t=[];if(!e.workspacesDetails[z].files.hasOwnProperty(e.platform))return void c([]);e.workspacesDetails[z].files[e.platform].hasOwnProperty(e.pagination)&&e.workspacesDetails[z].files[e.platform][e.pagination].length>0?(e.workspacesDetails[z].files[e.platform][e.pagination].map((function(e){t.push(i.a.createElement(wd,{details:!0,itemDelete:function(e){return w(e)},isLoading:function(e){return g(e)},key:e.id,currentWorkspace:z,owner:e.owner,file_type:e.file_type,cloud_id:e.my_cloud_id,id:e.id,name:e.name,date:e.last_modified}))})),c(t)):c([])}else c([]);g(!1),"refresh"===b&&w(!1)}}),[e.workspacesDetails,z,e.pagination,e.platform]),Object(o.useEffect)((function(){if(s.length>0){if(!1===z)return;var e=[];s.map((function(t){e.push(i.a.createElement(wd,{details:!0,isLoading:function(e){return g(e)},key:t.id,currentWorkspace:z,owner:t.owner,file_type:t.file_type,cloud_id:t.my_cloud_id,id:t.id,name:t.name,date:t.last_modified}))})),m(e)}else m([])}),[s]),Object(o.useEffect)((function(){e.workspacesDetails.hasOwnProperty(z)&&e.workspacesDetails[z].hasOwnProperty("files")&&e.workspacesDetails[z].files.hasOwnProperty(e.platform)&&D(e.workspacesDetails[z].files[e.platform].total_page)}),[e.platform,e.workspacesDetails,z,b,O]),i.a.createElement(vp,null,i.a.createElement("div",{className:"".concat(L>1?"thas-pagination ":"","templately-my-workspace templately-workspace-details templately-list-view").concat(y?" templately-loading":"")},y&&i.a.createElement(Ou,null),e.workspacesDetails[R.slug]&&!y&&i.a.createElement(Dp,{details:!0,content:e.workspacesDetails[R.slug],platform:e.platform}),!y&&i.a.createElement(i.a.Fragment,null,i.a.createElement(Rd,{retry:e.retry,setFileAdded:function(e){return k(e)},setLoading:function(e){return g(e)},setItemLoading:function(e){return _(e)},setSearch:function(e){return C(e)},setSearchedItem:function(e){return f(e)},workspaceSlug:z,workspaceID:A,currentDetails:n}),i.a.createElement(eu,{className:"templately-clouds-table"},(l.length>0&&!P||d.length>0&&P)&&i.a.createElement(i.a.Fragment,null,i.a.createElement(au,null),x&&i.a.createElement(Ou,{small:!0}),P&&!x&&i.a.createElement(yu,{className:"templately-table-body"},d),!x&&!P&&i.a.createElement(yu,{className:"templately-table-body"},l)),(0===l.length&&x||0===d.length&&x)&&i.a.createElement(i.a.Fragment,null,x&&i.a.createElement(Ou,{small:!0})),!P&&0===l.length&&!x&&i.a.createElement(Od,null),P&&0===d.length&&!x&&i.a.createElement(Od,null)),L>1&&i.a.createElement(wu,{type:"workspace",count:L}))))})),Ud=wp.i18n.__,Bd=function(e){return i.a.createElement("div",{className:"ttemplately-loggein-message"},i.a.createElement("div",null,i.a.createElement("p",null,Ud("You have to logged in, in order to visit this page or view your items from cloud.","templately")),i.a.createElement(he,{className:"templately-button",to:"/sign-in"},Ud("Login","templately"))))};function Vd(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Wd(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Wd(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Wd(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Hd=wp.i18n.__,$d=tt((function(e){return{isLoggedIn:e.common.isLoggedIn,clouds:e.common.cloud_files,platform:e.common.platform,loading:e.common.loading,pushed_time:e.common.pushed_time,userID:e.admin.user.id||null,pagination:e.common.pagination,retry:e.common.retry}}))((function(e){var t=Vd(Object(o.useState)(!0),2),n=t[0],r=t[1],a=Vd(Object(o.useState)(!1),2),l=a[0],c=a[1],u=Vd(Object(o.useState)(!1),2),s=u[0],f=u[1],p=Vd(Object(o.useState)([]),2),d=p[0],m=p[1],h=Vd(Object(o.useState)(1),2),y=h[0],g=h[1],v=Vd(Object(o.useState)(""),2),b=v[0],w=v[1],E=Vd(Object(o.useState)(""),2),O=E[0],k=E[1],S=Vd(Object(o.useState)(!1),2),x=S[0],_=S[1],j=Vd(Object(o.useState)(!1),2),P=j[0],C=j[1],T=Vd(Object(o.useState)(!1),2),A=T[0],N=T[1],I=Vd(Object(o.useState)({}),2),L=I[0],D=I[1],R=Vd(Object(o.useState)(1),2),M=R[0],F=R[1],z=le();return Object(o.useEffect)((function(){A&&(e.dispatch(Qn(1)),C(!1),w(""),k(""),D({}),N(!1))}),[A]),Object(o.useEffect)((function(){if(M!==e.pagination||x){if(b.length>0){if(L.hasOwnProperty(e.pagination)&&O===b)return void f(!1);k(b),F(e.pagination),f(!0),vi({per_page:10,page:e.pagination,platform:e.platform,search:b}).then((function(t){if(200===t.status)if(t.data.success){C(!0),g(t.data.data.total_page);var n={};n[e.pagination]=t.data.data.data,D(n),f(!1)}else f(!1)})).catch((function(e){return console.error("Search MyClouds Error: ",e)}))}_(!1)}}),[x,e.pagination]),Object(o.useEffect)((function(){if(!P){if(e.clouds.hasOwnProperty(e.platform)&&e.clouds[e.platform].hasOwnProperty(e.pagination)&&!l&&"?refresh"!==z.search)return f(!1),void r(!1);r(!0),f(!0),vi({page:e.pagination,platform:e.platform,per_page:10}).then((function(t){200===t.status&&t.data.success&&(g(t.data.data.total_page),e.dispatch(Fn({current_page:t.data.data.current_page,data:t.data.data.data,total_page:t.data.data.total_page,platform:e.platform})),f(!1),r(!1),e.dispatch({type:"SET_SUCCESS_TEXT",payload:Hd("Successfully Synced","templately")}))})).catch((function(e){return console.error("Sync Error From MyClouds: ",e)}))}}),[e.pagination,l,e.platform,e.retry]),Object(o.useEffect)((function(){if(P){if(!L.hasOwnProperty(e.pagination))return;if(L.hasOwnProperty(e.pagination)){var t=[];L[e.pagination]&&L[e.pagination].length>0&&L[e.pagination].map((function(n){t.push(i.a.createElement(wd,{isDelete:function(e){return c(e)},isLoading:function(e){return r(e)},key:n.id,file_type:n.file_type,owner:{id:e.userID},id:n.id,name:n.name,date:n.created_at}))})),m(t)}}else if(e.clouds.hasOwnProperty(e.platform)&&e.clouds[e.platform].hasOwnProperty(e.pagination)&&(l||s||!1===n)){g(e.clouds[e.platform].total_page);var a=[];e.clouds[e.platform][e.pagination].length>0&&e.clouds[e.platform][e.pagination].map((function(t){a.push(i.a.createElement(wd,{isDelete:function(e){return c(e)},isLoading:function(e){return r(e)},key:t.id,file_type:t.file_type,owner:{id:e.userID},id:t.id,name:t.name,date:t.created_at}))})),m(a),c(!1)}}),[e.clouds,s,n,e.pagination,l,e.platform,A,x]),Object(o.useEffect)((function(){e.clouds.hasOwnProperty(e.platform)&&g(e.clouds[e.platform].total_page||0)}),[e.platform]),i.a.createElement(i.a.Fragment,null,!e.isLoggedIn&&i.a.createElement(Bd,null),e.isLoggedIn&&i.a.createElement(vp,null,n&&i.a.createElement(Ou,null),!n&&i.a.createElement(i.a.Fragment,null,i.a.createElement(Zp,{visibility:!1,title:"My Cloud"},i.a.createElement("div",{className:"templately-cloud-searchbox"},i.a.createElement(Ep,{className:"templately-cloud-search",value:b,onChange:function(e){return w(e.target.value)},onKeyDown:function(e){return _(13===e.keyCode)},placeholder:Hd("Type and press enter...","templately")}),!P&&i.a.createElement(Jc,{onClick:function(){return _(!0)},className:"templately-cloud-search-clear tsearch"},i.a.createElement(En,null)),P&&i.a.createElement(Jc,{onClick:function(){return N(!0)},className:"templately-cloud-search-clear"},i.a.createElement(_n,null)))),i.a.createElement("div",{className:"templately-my-clouds"},i.a.createElement(eu,{className:"templately-clouds-table"},d.length>0&&i.a.createElement(i.a.Fragment,null,i.a.createElement(au,null),!s&&i.a.createElement(yu,{className:"templately-table-body"},d),s&&i.a.createElement(Ou,null)),0===d.length&&!s&&i.a.createElement(Od,null)),i.a.createElement(wu,{type:"clouds",count:y})))))}));function qd(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Kd(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Kd(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Kd(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Qd=tt((function(e){return{workspaces:e.sharedWorkspaces||null,need_pagination:e.common.need_pagination,pagination_loading:e.common.pagination_loading,pagination:e.common.pagination,retry:e.common.retry}}))((function(e){var t=qd(Object(o.useState)([]),2),n=t[0],r=t[1],a=qd(Object(o.useState)(!0),2),l=a[0],c=a[1],u=qd(Object(o.useState)(1),2),s=u[0],f=u[1];return Object(o.useEffect)((function(){e.workspaces.hasOwnProperty(e.pagination)&&e.workspaces[e.pagination].length>0?c(!1):(c(!0),yi(!0,!0,{page:1}).then((function(t){t.data.success?(t.data.hasOwnProperty("data")&&t.data.data.hasOwnProperty("total_page")&&f(t.data.data.total_page),e.dispatch({type:"SHARED_WORKSPACE_QUERY",payload:{current_page:t.data.data.current_page,data:t.data.data.data,total_page:t.data.data.total_page}}),c(!1)):(c(!1),e.dispatch(In("string"==typeof t.data.data?t.data.data:"")))})).catch((function(e){return console.error("Something went wrong: regarding fetching Shared WorkSpace list",e)})))}),[e.retry]),Object(o.useEffect)((function(){if(null!=e.workspaces){var t=[];e.workspaces.hasOwnProperty(e.pagination)&&e.workspaces[e.pagination].length>0&&e.workspaces[e.pagination].map((function(e,n){t.push(i.a.createElement(Dp,{key:n,shared:!0,content:e}))})),r(t)}}),[e.workspaces]),i.a.createElement(vp,null,i.a.createElement("div",{className:"templately-my-workspace templately-shared-workspace-wrapper templately-list-view"},!l&&n,!l&&0===n.length&&i.a.createElement(Od,null),l&&i.a.createElement(Ou,null)),i.a.createElement(wu,{type:"shared_workspace",count:s}))}));function Gd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Yd(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Xd(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Jd(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Jd(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Jd(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Zd=TemplatelyAdmin.is_editor,em=wp.i18n.__,tm=tt((function(e){return{user:e.admin.user||!1,isLoggedIn:e.common.isLoggedIn,currentRoutes:e.common.current_route,platform:e.common.platform}}))((function(e){var t=le(),n=Xd(Object(o.useState)(!1),2),r=n[0],a=n[1];return Object(o.useEffect)((function(){var t;r&&(t=new FormData,t.append("action","get_templately"),t.append("nonce",ai),t.append("content_type","verification_done"),Do.a.post(ajaxurl,t).then((function(e){return e})).catch((function(e){return e}))).then((function(t){if(t.data.data){a(!1);var n=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Gd(Object(n),!0).forEach((function(t){Yd(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Gd(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},e.user);delete n.is_verified,e.dispatch(Xn(n))}}))}),[r]),Object(o.useEffect)((function(){e.isLoggedIn||"/"!==t.pathname||window.elementorFrontend||e.dispatch(Zn("/sign-in"))}),[]),Object(o.useEffect)((function(){"/templates"!==t.pathname&&"/blocks"!==t.pathname&&"/packs"!==t.pathname||"gutenberg"===e.platform&&e.dispatch(Zn("/"))}),[e.platform]),i.a.createElement("div",{className:"templately-modal-body templately-".concat(e.platform,"-platform ").concat(!Zd&&!e.user.hasOwnProperty("status")&&e.isLoggedIn||"/settings"===t.pathname||"/sign-in"===t.pathname?"templately-admin-form":"")},null!=e.currentRoutes&&i.a.createElement(G,{to:"".concat(e.currentRoutes)}),i.a.createElement(oe,null,i.a.createElement(Z,{exact:!0,path:"/sign-in",component:Ju}),i.a.createElement(Z,{exact:!0,path:"/pages",component:np}),i.a.createElement(Z,{exact:!0,path:"/search/:query",component:sp}),i.a.createElement(Z,{exact:!0,path:"/blocks",component:np}),i.a.createElement(Z,{exact:!0,path:"/",component:np}),i.a.createElement(Z,{exact:!0,path:"/templates",component:_u}),i.a.createElement(Z,{exact:!0,path:"/templates/save",component:function(){return i.a.createElement(zu,e)}}),i.a.createElement(Z,{exact:!0,path:"/clouds",component:$d}),i.a.createElement(Z,{exact:!0,path:"/workspace",component:rd}),i.a.createElement(Z,{exact:!0,path:"/workspace/:slug",component:zd}),i.a.createElement(Z,{exact:!0,path:"/shared/workspace",component:Qd}),i.a.createElement(Z,{exact:!0,path:"/shared/workspace/:slug",component:zd}),i.a.createElement(Z,{exact:!0,path:"/settings",component:ns})),!1===e.user.is_verified&&i.a.createElement("div",{className:"templately-verification"},i.a.createElement("p",null,em("Please check your email & verify your account. Otherwise, account will be deleted.","templately")),i.a.createElement(Jc,{onClick:function(){return a(!0)}},em("Close","template"))))}));function nm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function rm(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var am=TemplatelyAdmin,om=am.is_logged_in,im=am.platform_exists,lm=am.user_can_logout,cm=am.is_linked_login,um=am.is_global_login,sm=function(e){var t=e.toggle,n=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?nm(Object(n),!0).forEach((function(t){rm(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nm(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},e);return delete n.toggle,Zt.dispatch(Ln(im)),Zt.dispatch(Zn(e.route)),Zt.dispatch(Vn(Boolean(om))),Zt.dispatch(Tn(Boolean(lm))),Zt.dispatch(Nn(Boolean(cm))),Zt.dispatch(An(Boolean(um))),t&&i.a.createElement(ke,{store:Zt},i.a.createElement(ue,null,i.a.createElement("div",{className:"templately-modal-templately"},i.a.createElement(Ni,null),i.a.createElement(tm,n))))};function fm(){return(fm=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var pm=function(e){var t=e.toggle;return i.a.createElement("div",{id:"templatelyGutenberg"},i.a.createElement("div",{className:"templately-modal-templately-overlay",onClick:function(){return Ro.close()}}),i.a.createElement(sm,fm({toggle:t},e)))};function dm(){return(dm=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var mm=TemplatelyAdmin.platform;if(window.Templately={modalOpen:function(e,t,n){c.a.render(i.a.createElement(sm,dm({toggle:e},t)),n)}},null!=document.getElementById("templatelyAdmin")&&c.a.render(i.a.createElement(sm,{toggle:!0}),document.getElementById("templatelyAdmin")),"gutenberg"===mm){var hm=function(){Ro.open(i.a.createElement(pm,{toggle:!0}))},ym=function(){Ro.open(i.a.createElement(pm,{toggle:!0,route:"/templates/save",editor:"gutenberg"}))};window.addEventListener("load",(function(){var e=wp.data.select("core/editor").getCurrentPostType().toLowerCase().replace("/(?<= )[^s]|^./g",(function(e){return e.toUpperCase()})),t=document.querySelector(".edit-post-header-toolbar"),n=document.createElement("div");n.id="templately-guten-icon",n.innerHTML="<button class='gutenberg-add-templately-button' id='templatelyGutenbergButton'><span class='gutenberg-templately-icon'></span>Templately</button><button id='templatelyGutenbergPushButton' class='gutenberg-add-templately-button'>Save "+e+" in Templately</button>",t.appendChild(n),document.getElementById("templatelyGutenbergButton").addEventListener("click",hm),document.getElementById("templatelyGutenbergPushButton").addEventListener("click",ym)}))}},,function(e,t,n){"use strict";!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE){0;try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}}(),e.exports=n(106)}]);
|
71 |
*
|
72 |
* This source code is licensed under the MIT license found in the
|
73 |
* LICENSE file in the root directory of this source tree.
|
74 |
+
*/var r,a,o,i,l;if("undefined"==typeof window||"function"!=typeof MessageChannel){var c=null,u=null,s=function(){if(null!==c)try{var e=t.unstable_now();c(!0,e),c=null}catch(e){throw setTimeout(s,0),e}},f=Date.now();t.unstable_now=function(){return Date.now()-f},r=function(e){null!==c?setTimeout(r,0,e):(c=e,setTimeout(s,0))},a=function(e,t){u=setTimeout(e,t)},o=function(){clearTimeout(u)},i=function(){return!1},l=t.unstable_forceFrameRate=function(){}}else{var p=window.performance,d=window.Date,m=window.setTimeout,h=window.clearTimeout;if("undefined"!=typeof console){var y=window.cancelAnimationFrame;"function"!=typeof window.requestAnimationFrame&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills"),"function"!=typeof y&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills")}if("object"==typeof p&&"function"==typeof p.now)t.unstable_now=function(){return p.now()};else{var g=d.now();t.unstable_now=function(){return d.now()-g}}var v=!1,b=null,w=-1,E=5,O=0;i=function(){return t.unstable_now()>=O},l=function(){},t.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing framerates higher than 125 fps is not unsupported"):E=0<e?Math.floor(1e3/e):5};var k=new MessageChannel,S=k.port2;k.port1.onmessage=function(){if(null!==b){var e=t.unstable_now();O=e+E;try{b(!0,e)?S.postMessage(null):(v=!1,b=null)}catch(e){throw S.postMessage(null),e}}else v=!1},r=function(e){b=e,v||(v=!0,S.postMessage(null))},a=function(e,n){w=m((function(){e(t.unstable_now())}),n)},o=function(){h(w),w=-1}}function x(e,t){var n=e.length;e.push(t);e:for(;;){var r=n-1>>>1,a=e[r];if(!(void 0!==a&&0<P(a,t)))break e;e[r]=t,e[n]=a,n=r}}function _(e){return void 0===(e=e[0])?null:e}function j(e){var t=e[0];if(void 0!==t){var n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,a=e.length;r<a;){var o=2*(r+1)-1,i=e[o],l=o+1,c=e[l];if(void 0!==i&&0>P(i,n))void 0!==c&&0>P(c,i)?(e[r]=c,e[l]=n,r=l):(e[r]=i,e[o]=n,r=o);else{if(!(void 0!==c&&0>P(c,n)))break e;e[r]=c,e[l]=n,r=l}}}return t}return null}function P(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}var C=[],T=[],A=1,N=null,I=3,L=!1,D=!1,R=!1;function M(e){for(var t=_(T);null!==t;){if(null===t.callback)j(T);else{if(!(t.startTime<=e))break;j(T),t.sortIndex=t.expirationTime,x(C,t)}t=_(T)}}function F(e){if(R=!1,M(e),!D)if(null!==_(C))D=!0,r(z);else{var t=_(T);null!==t&&a(F,t.startTime-e)}}function z(e,n){D=!1,R&&(R=!1,o()),L=!0;var r=I;try{for(M(n),N=_(C);null!==N&&(!(N.expirationTime>n)||e&&!i());){var l=N.callback;if(null!==l){N.callback=null,I=N.priorityLevel;var c=l(N.expirationTime<=n);n=t.unstable_now(),"function"==typeof c?N.callback=c:N===_(C)&&j(C),M(n)}else j(C);N=_(C)}if(null!==N)var u=!0;else{var s=_(T);null!==s&&a(F,s.startTime-n),u=!1}return u}finally{N=null,I=r,L=!1}}function U(e){switch(e){case 1:return-1;case 2:return 250;case 5:return 1073741823;case 4:return 1e4;default:return 5e3}}var B=l;t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){D||L||(D=!0,r(z))},t.unstable_getCurrentPriorityLevel=function(){return I},t.unstable_getFirstCallbackNode=function(){return _(C)},t.unstable_next=function(e){switch(I){case 1:case 2:case 3:var t=3;break;default:t=I}var n=I;I=t;try{return e()}finally{I=n}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=B,t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=I;I=e;try{return t()}finally{I=n}},t.unstable_scheduleCallback=function(e,n,i){var l=t.unstable_now();if("object"==typeof i&&null!==i){var c=i.delay;c="number"==typeof c&&0<c?l+c:l,i="number"==typeof i.timeout?i.timeout:U(e)}else i=U(e),c=l;return e={id:A++,callback:n,priorityLevel:e,startTime:c,expirationTime:i=c+i,sortIndex:-1},c>l?(e.sortIndex=c,x(T,e),null===_(C)&&e===_(T)&&(R?o():R=!0,a(F,c-l))):(e.sortIndex=i,x(C,e),D||L||(D=!0,r(z))),e},t.unstable_shouldYield=function(){var e=t.unstable_now();M(e);var n=_(C);return n!==N&&null!==N&&null!==n&&null!==n.callback&&n.startTime<=e&&n.expirationTime<N.expirationTime||i()},t.unstable_wrapCallback=function(e){var t=I;return function(){var n=I;I=t;try{return e.apply(this,arguments)}finally{I=n}}}},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},,function(e,t,n){"use strict";n.r(t);var r={};n.r(r),n.d(r,"find",(function(){return al}));var a={};n.r(a),n.d(a,"isTabbableIndex",(function(){return il})),n.d(a,"find",(function(){return fl})),n.d(a,"findPrevious",(function(){return pl})),n.d(a,"findNext",(function(){return dl}));var o=n(0),i=n.n(o),l=n(9),c=n.n(l),u=n(10);n(17);function s(){return(s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function f(e){return"/"===e.charAt(0)}function p(e,t){for(var n=t,r=n+1,a=e.length;r<a;n+=1,r+=1)e[n]=e[r];e.pop()}var d=function(e,t){void 0===t&&(t="");var n,r=e&&e.split("/")||[],a=t&&t.split("/")||[],o=e&&f(e),i=t&&f(t),l=o||i;if(e&&f(e)?a=r:r.length&&(a.pop(),a=a.concat(r)),!a.length)return"/";if(a.length){var c=a[a.length-1];n="."===c||".."===c||""===c}else n=!1;for(var u=0,s=a.length;s>=0;s--){var d=a[s];"."===d?p(a,s):".."===d?(p(a,s),u++):u&&(p(a,s),u--)}if(!l)for(;u--;u)a.unshift("..");!l||""===a[0]||a[0]&&f(a[0])||a.unshift("");var m=a.join("/");return n&&"/"!==m.substr(-1)&&(m+="/"),m};function m(e){return e.valueOf?e.valueOf():Object.prototype.valueOf.call(e)}var h=function e(t,n){if(t===n)return!0;if(null==t||null==n)return!1;if(Array.isArray(t))return Array.isArray(n)&&t.length===n.length&&t.every((function(t,r){return e(t,n[r])}));if("object"==typeof t||"object"==typeof n){var r=m(t),a=m(n);return r!==t||a!==n?e(r,a):Object.keys(Object.assign({},t,n)).every((function(r){return e(t[r],n[r])}))}return!1};var y=function(e,t){if(!e)throw new Error("Invariant failed")};function g(e){return"/"===e.charAt(0)?e:"/"+e}function v(e){return"/"===e.charAt(0)?e.substr(1):e}function b(e,t){return function(e,t){return 0===e.toLowerCase().indexOf(t.toLowerCase())&&-1!=="/?#".indexOf(e.charAt(t.length))}(e,t)?e.substr(t.length):e}function w(e){return"/"===e.charAt(e.length-1)?e.slice(0,-1):e}function E(e){var t=e.pathname,n=e.search,r=e.hash,a=t||"/";return n&&"?"!==n&&(a+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(a+="#"===r.charAt(0)?r:"#"+r),a}function O(e,t,n,r){var a;"string"==typeof e?(a=function(e){var t=e||"/",n="",r="",a=t.indexOf("#");-1!==a&&(r=t.substr(a),t=t.substr(0,a));var o=t.indexOf("?");return-1!==o&&(n=t.substr(o),t=t.substr(0,o)),{pathname:t,search:"?"===n?"":n,hash:"#"===r?"":r}}(e)).state=t:(void 0===(a=s({},e)).pathname&&(a.pathname=""),a.search?"?"!==a.search.charAt(0)&&(a.search="?"+a.search):a.search="",a.hash?"#"!==a.hash.charAt(0)&&(a.hash="#"+a.hash):a.hash="",void 0!==t&&void 0===a.state&&(a.state=t));try{a.pathname=decodeURI(a.pathname)}catch(e){throw e instanceof URIError?new URIError('Pathname "'+a.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):e}return n&&(a.key=n),r?a.pathname?"/"!==a.pathname.charAt(0)&&(a.pathname=d(a.pathname,r.pathname)):a.pathname=r.pathname:a.pathname||(a.pathname="/"),a}function k(){var e=null;var t=[];return{setPrompt:function(t){return e=t,function(){e===t&&(e=null)}},confirmTransitionTo:function(t,n,r,a){if(null!=e){var o="function"==typeof e?e(t,n):e;"string"==typeof o?"function"==typeof r?r(o,a):a(!0):a(!1!==o)}else a(!0)},appendListener:function(e){var n=!0;function r(){n&&e.apply(void 0,arguments)}return t.push(r),function(){n=!1,t=t.filter((function(e){return e!==r}))}},notifyListeners:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];t.forEach((function(e){return e.apply(void 0,n)}))}}}var S=!("undefined"==typeof window||!window.document||!window.document.createElement);function x(e,t){t(window.confirm(e))}function _(){try{return window.history.state||{}}catch(e){return{}}}function j(e){void 0===e&&(e={}),S||y(!1);var t,n=window.history,r=(-1===(t=window.navigator.userAgent).indexOf("Android 2.")&&-1===t.indexOf("Android 4.0")||-1===t.indexOf("Mobile Safari")||-1!==t.indexOf("Chrome")||-1!==t.indexOf("Windows Phone"))&&window.history&&"pushState"in window.history,a=!(-1===window.navigator.userAgent.indexOf("Trident")),o=e,i=o.forceRefresh,l=void 0!==i&&i,c=o.getUserConfirmation,u=void 0===c?x:c,f=o.keyLength,p=void 0===f?6:f,d=e.basename?w(g(e.basename)):"";function m(e){var t=e||{},n=t.key,r=t.state,a=window.location,o=a.pathname+a.search+a.hash;return d&&(o=b(o,d)),O(o,r,n)}function h(){return Math.random().toString(36).substr(2,p)}var v=k();function j(e){s(z,e),z.length=n.length,v.notifyListeners(z.location,z.action)}function P(e){(function(e){return void 0===e.state&&-1===navigator.userAgent.indexOf("CriOS")})(e)||A(m(e.state))}function C(){A(m(_()))}var T=!1;function A(e){if(T)T=!1,j();else{v.confirmTransitionTo(e,"POP",u,(function(t){t?j({action:"POP",location:e}):function(e){var t=z.location,n=I.indexOf(t.key);-1===n&&(n=0);var r=I.indexOf(e.key);-1===r&&(r=0);var a=n-r;a&&(T=!0,D(a))}(e)}))}}var N=m(_()),I=[N.key];function L(e){return d+E(e)}function D(e){n.go(e)}var R=0;function M(e){1===(R+=e)&&1===e?(window.addEventListener("popstate",P),a&&window.addEventListener("hashchange",C)):0===R&&(window.removeEventListener("popstate",P),a&&window.removeEventListener("hashchange",C))}var F=!1;var z={length:n.length,action:"POP",location:N,createHref:L,push:function(e,t){var a=O(e,t,h(),z.location);v.confirmTransitionTo(a,"PUSH",u,(function(e){if(e){var t=L(a),o=a.key,i=a.state;if(r)if(n.pushState({key:o,state:i},null,t),l)window.location.href=t;else{var c=I.indexOf(z.location.key),u=I.slice(0,c+1);u.push(a.key),I=u,j({action:"PUSH",location:a})}else window.location.href=t}}))},replace:function(e,t){var a=O(e,t,h(),z.location);v.confirmTransitionTo(a,"REPLACE",u,(function(e){if(e){var t=L(a),o=a.key,i=a.state;if(r)if(n.replaceState({key:o,state:i},null,t),l)window.location.replace(t);else{var c=I.indexOf(z.location.key);-1!==c&&(I[c]=a.key),j({action:"REPLACE",location:a})}else window.location.replace(t)}}))},go:D,goBack:function(){D(-1)},goForward:function(){D(1)},block:function(e){void 0===e&&(e=!1);var t=v.setPrompt(e);return F||(M(1),F=!0),function(){return F&&(F=!1,M(-1)),t()}},listen:function(e){var t=v.appendListener(e);return M(1),function(){M(-1),t()}}};return z}var P={hashbang:{encodePath:function(e){return"!"===e.charAt(0)?e:"!/"+v(e)},decodePath:function(e){return"!"===e.charAt(0)?e.substr(1):e}},noslash:{encodePath:v,decodePath:g},slash:{encodePath:g,decodePath:g}};function C(e){var t=e.indexOf("#");return-1===t?e:e.slice(0,t)}function T(){var e=window.location.href,t=e.indexOf("#");return-1===t?"":e.substring(t+1)}function A(e){window.location.replace(C(window.location.href)+"#"+e)}function N(e){void 0===e&&(e={}),S||y(!1);var t=window.history,n=(window.navigator.userAgent.indexOf("Firefox"),e),r=n.getUserConfirmation,a=void 0===r?x:r,o=n.hashType,i=void 0===o?"slash":o,l=e.basename?w(g(e.basename)):"",c=P[i],u=c.encodePath,f=c.decodePath;function p(){var e=f(T());return l&&(e=b(e,l)),O(e)}var d=k();function m(e){s(z,e),z.length=t.length,d.notifyListeners(z.location,z.action)}var h=!1,v=null;function _(){var e,t,n=T(),r=u(n);if(n!==r)A(r);else{var o=p(),i=z.location;if(!h&&(t=o,(e=i).pathname===t.pathname&&e.search===t.search&&e.hash===t.hash))return;if(v===E(o))return;v=null,function(e){if(h)h=!1,m();else{d.confirmTransitionTo(e,"POP",a,(function(t){t?m({action:"POP",location:e}):function(e){var t=z.location,n=L.lastIndexOf(E(t));-1===n&&(n=0);var r=L.lastIndexOf(E(e));-1===r&&(r=0);var a=n-r;a&&(h=!0,D(a))}(e)}))}}(o)}}var j=T(),N=u(j);j!==N&&A(N);var I=p(),L=[E(I)];function D(e){t.go(e)}var R=0;function M(e){1===(R+=e)&&1===e?window.addEventListener("hashchange",_):0===R&&window.removeEventListener("hashchange",_)}var F=!1;var z={length:t.length,action:"POP",location:I,createHref:function(e){var t=document.querySelector("base"),n="";return t&&t.getAttribute("href")&&(n=C(window.location.href)),n+"#"+u(l+E(e))},push:function(e,t){var n=O(e,void 0,void 0,z.location);d.confirmTransitionTo(n,"PUSH",a,(function(e){if(e){var t=E(n),r=u(l+t);if(T()!==r){v=t,function(e){window.location.hash=e}(r);var a=L.lastIndexOf(E(z.location)),o=L.slice(0,a+1);o.push(t),L=o,m({action:"PUSH",location:n})}else m()}}))},replace:function(e,t){var n=O(e,void 0,void 0,z.location);d.confirmTransitionTo(n,"REPLACE",a,(function(e){if(e){var t=E(n),r=u(l+t);T()!==r&&(v=t,A(r));var a=L.indexOf(E(z.location));-1!==a&&(L[a]=t),m({action:"REPLACE",location:n})}}))},go:D,goBack:function(){D(-1)},goForward:function(){D(1)},block:function(e){void 0===e&&(e=!1);var t=d.setPrompt(e);return F||(M(1),F=!0),function(){return F&&(F=!1,M(-1)),t()}},listen:function(e){var t=d.appendListener(e);return M(1),function(){M(-1),t()}}};return z}function I(e,t,n){return Math.min(Math.max(e,t),n)}function L(e){void 0===e&&(e={});var t=e,n=t.getUserConfirmation,r=t.initialEntries,a=void 0===r?["/"]:r,o=t.initialIndex,i=void 0===o?0:o,l=t.keyLength,c=void 0===l?6:l,u=k();function f(e){s(g,e),g.length=g.entries.length,u.notifyListeners(g.location,g.action)}function p(){return Math.random().toString(36).substr(2,c)}var d=I(i,0,a.length-1),m=a.map((function(e){return O(e,void 0,"string"==typeof e?p():e.key||p())})),h=E;function y(e){var t=I(g.index+e,0,g.entries.length-1),r=g.entries[t];u.confirmTransitionTo(r,"POP",n,(function(e){e?f({action:"POP",location:r,index:t}):f()}))}var g={length:m.length,action:"POP",location:m[d],index:d,entries:m,createHref:h,push:function(e,t){var r=O(e,t,p(),g.location);u.confirmTransitionTo(r,"PUSH",n,(function(e){if(e){var t=g.index+1,n=g.entries.slice(0);n.length>t?n.splice(t,n.length-t,r):n.push(r),f({action:"PUSH",location:r,index:t,entries:n})}}))},replace:function(e,t){var r=O(e,t,p(),g.location);u.confirmTransitionTo(r,"REPLACE",n,(function(e){e&&(g.entries[g.index]=r,f({action:"REPLACE",location:r}))}))},go:y,goBack:function(){y(-1)},goForward:function(){y(1)},canGo:function(e){var t=g.index+e;return t>=0&&t<g.entries.length},block:function(e){return void 0===e&&(e=!1),u.setPrompt(e)},listen:function(e){return u.appendListener(e)}};return g}var D=n(33),R=n(34),M=n.n(R),F=n(24);function z(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}var U=n(21),B=n.n(U),V=function(e){var t=Object(D.a)();return t.displayName=e,t}("Router-History"),W=function(e){var t=Object(D.a)();return t.displayName=e,t}("Router"),H=function(e){function t(t){var n;return(n=e.call(this,t)||this).state={location:t.history.location},n._isMounted=!1,n._pendingLocation=null,t.staticContext||(n.unlisten=t.history.listen((function(e){n._isMounted?n.setState({location:e}):n._pendingLocation=e}))),n}Object(u.a)(t,e),t.computeRootMatch=function(e){return{path:"/",url:"/",params:{},isExact:"/"===e}};var n=t.prototype;return n.componentDidMount=function(){this._isMounted=!0,this._pendingLocation&&this.setState({location:this._pendingLocation})},n.componentWillUnmount=function(){this.unlisten&&this.unlisten()},n.render=function(){return i.a.createElement(W.Provider,{value:{history:this.props.history,location:this.state.location,match:t.computeRootMatch(this.state.location.pathname),staticContext:this.props.staticContext}},i.a.createElement(V.Provider,{children:this.props.children||null,value:this.props.history}))},t}(i.a.Component);i.a.Component;var $=function(e){function t(){return e.apply(this,arguments)||this}Object(u.a)(t,e);var n=t.prototype;return n.componentDidMount=function(){this.props.onMount&&this.props.onMount.call(this,this)},n.componentDidUpdate=function(e){this.props.onUpdate&&this.props.onUpdate.call(this,this,e)},n.componentWillUnmount=function(){this.props.onUnmount&&this.props.onUnmount.call(this,this)},n.render=function(){return null},t}(i.a.Component);var q={},K=0;function Q(e,t){return void 0===e&&(e="/"),void 0===t&&(t={}),"/"===e?e:function(e){if(q[e])return q[e];var t=M.a.compile(e);return K<1e4&&(q[e]=t,K++),t}(e)(t,{pretty:!0})}function G(e){var t=e.computedMatch,n=e.to,r=e.push,a=void 0!==r&&r;return i.a.createElement(W.Consumer,null,(function(e){e||y(!1);var r=e.history,o=e.staticContext,l=a?r.push:r.replace,c=O(t?"string"==typeof n?Q(n,t.params):s({},n,{pathname:Q(n.pathname,t.params)}):n);return o?(l(c),null):i.a.createElement($,{onMount:function(){l(c)},onUpdate:function(e,t){var n,r,a=O(t.to);n=a,r=s({},c,{key:a.key}),n.pathname===r.pathname&&n.search===r.search&&n.hash===r.hash&&n.key===r.key&&h(n.state,r.state)||l(c)},to:n})}))}var Y={},X=0;function J(e,t){void 0===t&&(t={}),("string"==typeof t||Array.isArray(t))&&(t={path:t});var n=t,r=n.path,a=n.exact,o=void 0!==a&&a,i=n.strict,l=void 0!==i&&i,c=n.sensitive,u=void 0!==c&&c;return[].concat(r).reduce((function(t,n){if(!n&&""!==n)return null;if(t)return t;var r=function(e,t){var n=""+t.end+t.strict+t.sensitive,r=Y[n]||(Y[n]={});if(r[e])return r[e];var a=[],o={regexp:M()(e,a,t),keys:a};return X<1e4&&(r[e]=o,X++),o}(n,{end:o,strict:l,sensitive:u}),a=r.regexp,i=r.keys,c=a.exec(e);if(!c)return null;var s=c[0],f=c.slice(1),p=e===s;return o&&!p?null:{path:n,url:"/"===n&&""===s?"/":s,isExact:p,params:i.reduce((function(e,t,n){return e[t.name]=f[n],e}),{})}}),null)}var Z=function(e){function t(){return e.apply(this,arguments)||this}return Object(u.a)(t,e),t.prototype.render=function(){var e=this;return i.a.createElement(W.Consumer,null,(function(t){t||y(!1);var n=e.props.location||t.location,r=s({},t,{location:n,match:e.props.computedMatch?e.props.computedMatch:e.props.path?J(n.pathname,e.props):t.match}),a=e.props,o=a.children,l=a.component,c=a.render;return Array.isArray(o)&&0===o.length&&(o=null),i.a.createElement(W.Provider,{value:r},r.match?o?"function"==typeof o?o(r):o:l?i.a.createElement(l,r):c?c(r):null:"function"==typeof o?o(r):null)}))},t}(i.a.Component);function ee(e){return"/"===e.charAt(0)?e:"/"+e}function te(e,t){if(!e)return t;var n=ee(e);return 0!==t.pathname.indexOf(n)?t:s({},t,{pathname:t.pathname.substr(n.length)})}function ne(e){return"string"==typeof e?e:E(e)}function re(e){return function(){y(!1)}}function ae(){}i.a.Component;var oe=function(e){function t(){return e.apply(this,arguments)||this}return Object(u.a)(t,e),t.prototype.render=function(){var e=this;return i.a.createElement(W.Consumer,null,(function(t){t||y(!1);var n,r,a=e.props.location||t.location;return i.a.Children.forEach(e.props.children,(function(e){if(null==r&&i.a.isValidElement(e)){n=e;var o=e.props.path||e.props.from;r=o?J(a.pathname,s({},e.props,{path:o})):t.match}})),r?i.a.cloneElement(n,{location:a,computedMatch:r}):null}))},t}(i.a.Component);var ie=i.a.useContext;function le(){return ie(W).location}function ce(){var e=ie(W).match;return e?e.params:{}}i.a.Component;var ue=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return(t=e.call.apply(e,[this].concat(r))||this).history=N(t.props),t}return Object(u.a)(t,e),t.prototype.render=function(){return i.a.createElement(H,{history:this.history,children:this.props.children})},t}(i.a.Component);var se=function(e,t){return"function"==typeof e?e(t):e},fe=function(e,t){return"string"==typeof e?O(e,null,null,t):e},pe=function(e){return e},de=i.a.forwardRef;void 0===de&&(de=pe);var me=de((function(e,t){var n=e.innerRef,r=e.navigate,a=e.onClick,o=z(e,["innerRef","navigate","onClick"]),l=o.target,c=s({},o,{onClick:function(e){try{a&&a(e)}catch(t){throw e.preventDefault(),t}e.defaultPrevented||0!==e.button||l&&"_self"!==l||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e)||(e.preventDefault(),r())}});return c.ref=pe!==de&&t||n,i.a.createElement("a",c)}));var he=de((function(e,t){var n=e.component,r=void 0===n?me:n,a=e.replace,o=e.to,l=e.innerRef,c=z(e,["component","replace","to","innerRef"]);return i.a.createElement(W.Consumer,null,(function(e){e||y(!1);var n=e.history,u=fe(se(o,e.location),e.location),f=u?n.createHref(u):"",p=s({},c,{href:f,navigate:function(){var t=se(o,e.location);(a?n.replace:n.push)(t)}});return pe!==de?p.ref=t||l:p.innerRef=l,i.a.createElement(r,p)}))})),ye=function(e){return e},ge=i.a.forwardRef;void 0===ge&&(ge=ye);ge((function(e,t){var n=e["aria-current"],r=void 0===n?"page":n,a=e.activeClassName,o=void 0===a?"active":a,l=e.activeStyle,c=e.className,u=e.exact,f=e.isActive,p=e.location,d=e.sensitive,m=e.strict,h=e.style,g=e.to,v=e.innerRef,b=z(e,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return i.a.createElement(W.Consumer,null,(function(e){e||y(!1);var n=p||e.location,a=fe(se(g,n),n),w=a.pathname,E=w&&w.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),O=E?J(n.pathname,{path:E,exact:u,sensitive:d,strict:m}):null,k=!!(f?f(O,n):O),S=k?function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.filter((function(e){return e})).join(" ")}(c,o):c,x=k?s({},h,{},l):h,_=s({"aria-current":k&&r||null,className:S,style:x,to:a},b);return ye!==ge?_.ref=t||v:_.innerRef=v,i.a.createElement(he,_)}))}));var ve=i.a.createContext(null);var be=function(e){e()},we={notify:function(){}};function Ee(){var e=be,t=null,n=null;return{clear:function(){t=null,n=null},notify:function(){e((function(){for(var e=t;e;)e.callback(),e=e.next}))},get:function(){for(var e=[],n=t;n;)e.push(n),n=n.next;return e},subscribe:function(e){var r=!0,a=n={callback:e,next:null,prev:n};return a.prev?a.prev.next=a:t=a,function(){r&&null!==t&&(r=!1,a.next?a.next.prev=a.prev:n=a.prev,a.prev?a.prev.next=a.next:t=a.next)}}}}var Oe=function(){function e(e,t){this.store=e,this.parentSub=t,this.unsubscribe=null,this.listeners=we,this.handleChangeWrapper=this.handleChangeWrapper.bind(this)}var t=e.prototype;return t.addNestedSub=function(e){return this.trySubscribe(),this.listeners.subscribe(e)},t.notifyNestedSubs=function(){this.listeners.notify()},t.handleChangeWrapper=function(){this.onStateChange&&this.onStateChange()},t.isSubscribed=function(){return Boolean(this.unsubscribe)},t.trySubscribe=function(){this.unsubscribe||(this.unsubscribe=this.parentSub?this.parentSub.addNestedSub(this.handleChangeWrapper):this.store.subscribe(this.handleChangeWrapper),this.listeners=Ee())},t.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null,this.listeners.clear(),this.listeners=we)},e}();var ke=function(e){var t=e.store,n=e.context,r=e.children,a=Object(o.useMemo)((function(){var e=new Oe(t);return e.onStateChange=e.notifyNestedSubs,{store:t,subscription:e}}),[t]),l=Object(o.useMemo)((function(){return t.getState()}),[t]);Object(o.useEffect)((function(){var e=a.subscription;return e.trySubscribe(),l!==t.getState()&&e.notifyNestedSubs(),function(){e.tryUnsubscribe(),e.onStateChange=null}}),[a,l]);var c=n||ve;return i.a.createElement(c.Provider,{value:a},r)},Se="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?o.useLayoutEffect:o.useEffect,xe=[],_e=[null,null];function je(e,t){var n=e[1];return[t.payload,n+1]}function Pe(e,t,n){Se((function(){return e.apply(void 0,t)}),n)}function Ce(e,t,n,r,a,o,i){e.current=r,t.current=a,n.current=!1,o.current&&(o.current=null,i())}function Te(e,t,n,r,a,o,i,l,c,u){if(e){var s=!1,f=null,p=function(){if(!s){var e,n,p=t.getState();try{e=r(p,a.current)}catch(e){n=e,f=e}n||(f=null),e===o.current?i.current||c():(o.current=e,l.current=e,i.current=!0,u({type:"STORE_UPDATED",payload:{error:n}}))}};n.onStateChange=p,n.trySubscribe(),p();return function(){if(s=!0,n.tryUnsubscribe(),n.onStateChange=null,f)throw f}}}var Ae=function(){return[null,0]};function Ne(e,t){void 0===t&&(t={});var n=t,r=n.getDisplayName,a=void 0===r?function(e){return"ConnectAdvanced("+e+")"}:r,l=n.methodName,c=void 0===l?"connectAdvanced":l,u=n.renderCountProp,f=void 0===u?void 0:u,p=n.shouldHandleStateChanges,d=void 0===p||p,m=n.storeKey,h=void 0===m?"store":m,y=(n.withRef,n.forwardRef),g=void 0!==y&&y,v=n.context,b=void 0===v?ve:v,w=z(n,["getDisplayName","methodName","renderCountProp","shouldHandleStateChanges","storeKey","withRef","forwardRef","context"]),E=b;return function(t){var n=t.displayName||t.name||"Component",r=a(n),l=s({},w,{getDisplayName:a,methodName:c,renderCountProp:f,shouldHandleStateChanges:d,storeKey:h,displayName:r,wrappedComponentName:n,WrappedComponent:t}),u=w.pure;var p=u?o.useMemo:function(e){return e()};function m(n){var r=Object(o.useMemo)((function(){var e=n.reactReduxForwardedRef,t=z(n,["reactReduxForwardedRef"]);return[n.context,e,t]}),[n]),a=r[0],c=r[1],u=r[2],f=Object(o.useMemo)((function(){return a&&a.Consumer&&Object(F.isContextConsumer)(i.a.createElement(a.Consumer,null))?a:E}),[a,E]),m=Object(o.useContext)(f),h=Boolean(n.store)&&Boolean(n.store.getState)&&Boolean(n.store.dispatch);Boolean(m)&&Boolean(m.store);var y=h?n.store:m.store,g=Object(o.useMemo)((function(){return function(t){return e(t.dispatch,l)}(y)}),[y]),v=Object(o.useMemo)((function(){if(!d)return _e;var e=new Oe(y,h?null:m.subscription),t=e.notifyNestedSubs.bind(e);return[e,t]}),[y,h,m]),b=v[0],w=v[1],O=Object(o.useMemo)((function(){return h?m:s({},m,{subscription:b})}),[h,m,b]),k=Object(o.useReducer)(je,xe,Ae),S=k[0][0],x=k[1];if(S&&S.error)throw S.error;var _=Object(o.useRef)(),j=Object(o.useRef)(u),P=Object(o.useRef)(),C=Object(o.useRef)(!1),T=p((function(){return P.current&&u===j.current?P.current:g(y.getState(),u)}),[y,S,u]);Pe(Ce,[j,_,C,u,T,P,w]),Pe(Te,[d,y,b,g,j,_,C,P,w,x],[y,b,g]);var A=Object(o.useMemo)((function(){return i.a.createElement(t,s({},T,{ref:c}))}),[c,t,T]);return Object(o.useMemo)((function(){return d?i.a.createElement(f.Provider,{value:O},A):A}),[f,A,O])}var y=u?i.a.memo(m):m;if(y.WrappedComponent=t,y.displayName=r,g){var v=i.a.forwardRef((function(e,t){return i.a.createElement(y,s({},e,{reactReduxForwardedRef:t}))}));return v.displayName=r,v.WrappedComponent=t,B()(v,t)}return B()(y,t)}}function Ie(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function Le(e,t){if(Ie(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var a=0;a<n.length;a++)if(!Object.prototype.hasOwnProperty.call(t,n[a])||!Ie(e[n[a]],t[n[a]]))return!1;return!0}var De=n(32),Re=function(){return Math.random().toString(36).substring(7).split("").join(".")},Me={INIT:"@@redux/INIT"+Re(),REPLACE:"@@redux/REPLACE"+Re(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+Re()}};function Fe(e){if("object"!=typeof e||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function ze(e,t){var n=t&&t.type;return"Given "+(n&&'action "'+String(n)+'"'||"an action")+', reducer "'+e+'" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.'}function Ue(e,t){return function(){return t(e.apply(this,arguments))}}function Be(e){return function(t,n){var r=e(t,n);function a(){return r}return a.dependsOnOwnProps=!1,a}}function Ve(e){return null!==e.dependsOnOwnProps&&void 0!==e.dependsOnOwnProps?Boolean(e.dependsOnOwnProps):1!==e.length}function We(e,t){return function(t,n){n.displayName;var r=function(e,t){return r.dependsOnOwnProps?r.mapToProps(e,t):r.mapToProps(e)};return r.dependsOnOwnProps=!0,r.mapToProps=function(t,n){r.mapToProps=e,r.dependsOnOwnProps=Ve(e);var a=r(t,n);return"function"==typeof a&&(r.mapToProps=a,r.dependsOnOwnProps=Ve(a),a=r(t,n)),a},r}}var He=[function(e){return"function"==typeof e?We(e):void 0},function(e){return e?void 0:Be((function(e){return{dispatch:e}}))},function(e){return e&&"object"==typeof e?Be((function(t){return function(e,t){if("function"==typeof e)return Ue(e,t);if("object"!=typeof e||null===e)throw new Error("bindActionCreators expected an object or a function, instead received "+(null===e?"null":typeof e)+'. Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?');var n={};for(var r in e){var a=e[r];"function"==typeof a&&(n[r]=Ue(a,t))}return n}(e,t)})):void 0}];var qe=[function(e){return"function"==typeof e?We(e):void 0},function(e){return e?void 0:Be((function(){return{}}))}];function Ke(e,t,n){return s({},n,e,t)}var Qe=[function(e){return"function"==typeof e?function(e){return function(t,n){n.displayName;var r,a=n.pure,o=n.areMergedPropsEqual,i=!1;return function(t,n,l){var c=e(t,n,l);return i?a&&o(c,r)||(r=c):(i=!0,r=c),r}}}(e):void 0},function(e){return e?void 0:function(){return Ke}}];function Ge(e,t,n,r){return function(a,o){return n(e(a,o),t(r,o),o)}}function Ye(e,t,n,r,a){var o,i,l,c,u,s=a.areStatesEqual,f=a.areOwnPropsEqual,p=a.areStatePropsEqual,d=!1;function m(a,d){var m,h,y=!f(d,i),g=!s(a,o);return o=a,i=d,y&&g?(l=e(o,i),t.dependsOnOwnProps&&(c=t(r,i)),u=n(l,c,i)):y?(e.dependsOnOwnProps&&(l=e(o,i)),t.dependsOnOwnProps&&(c=t(r,i)),u=n(l,c,i)):g?(m=e(o,i),h=!p(m,l),l=m,h&&(u=n(l,c,i)),u):u}return function(a,s){return d?m(a,s):(l=e(o=a,i=s),c=t(r,i),u=n(l,c,i),d=!0,u)}}function Xe(e,t){var n=t.initMapStateToProps,r=t.initMapDispatchToProps,a=t.initMergeProps,o=z(t,["initMapStateToProps","initMapDispatchToProps","initMergeProps"]),i=n(e,o),l=r(e,o),c=a(e,o);return(o.pure?Ye:Ge)(i,l,c,e,o)}function Je(e,t,n){for(var r=t.length-1;r>=0;r--){var a=t[r](e);if(a)return a}return function(t,r){throw new Error("Invalid value of type "+typeof e+" for "+n+" argument when connecting component "+r.wrappedComponentName+".")}}function Ze(e,t){return e===t}function et(e){var t=void 0===e?{}:e,n=t.connectHOC,r=void 0===n?Ne:n,a=t.mapStateToPropsFactories,o=void 0===a?qe:a,i=t.mapDispatchToPropsFactories,l=void 0===i?He:i,c=t.mergePropsFactories,u=void 0===c?Qe:c,f=t.selectorFactory,p=void 0===f?Xe:f;return function(e,t,n,a){void 0===a&&(a={});var i=a,c=i.pure,f=void 0===c||c,d=i.areStatesEqual,m=void 0===d?Ze:d,h=i.areOwnPropsEqual,y=void 0===h?Le:h,g=i.areStatePropsEqual,v=void 0===g?Le:g,b=i.areMergedPropsEqual,w=void 0===b?Le:b,E=z(i,["pure","areStatesEqual","areOwnPropsEqual","areStatePropsEqual","areMergedPropsEqual"]),O=Je(e,o,"mapStateToProps"),k=Je(t,l,"mapDispatchToProps"),S=Je(n,u,"mergeProps");return r(p,s({methodName:"connect",getDisplayName:function(e){return"Connect("+e+")"},shouldHandleStateChanges:Boolean(e),initMapStateToProps:O,initMapDispatchToProps:k,initMergeProps:S,pure:f,areStatesEqual:m,areOwnPropsEqual:y,areStatePropsEqual:v,areMergedPropsEqual:w},E))}}var tt=et();var nt;nt=l.unstable_batchedUpdates,be=nt;function rt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function at(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?rt(Object(n),!0).forEach((function(t){ot(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ot(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var it={},lt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:it,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ALL_ITEMS":var n=t.payload,r=n.current_page,a=n.data,o=n.platform,i=n.total_page,l=n.plan,c=at({},e);return c.hasOwnProperty(l)?(c[l]={},c[l][o]={}):(c[l]={},c[l][o]={},c[l][o].total_page=i,c[l][o].current_page=r),c[l][o][r]=a,c;case"ALL_CATEGORY_ITEMS":var u=t.payload,s=u.categoryID,f=u.current_page,p=u.data,d=u.platform,m=u.total_page,h=u.plan,y=at({},e),g={};return g.current_page=f,g.total_page=m,g[f]=p,y.hasOwnProperty(h)?y[h].hasOwnProperty(d)?y[h][d].hasOwnProperty("categoryData")?y[h][d].categoryData.hasOwnProperty(s)?y[h][d].categoryData[s][f]=p:y[h][d].categoryData[s]=g:(y[h][d].categoryData={},y[h][d].categoryData[s]=g):(y[h][d]={},y[h][d].categoryData={},y[h][d].categoryData[s]=g):(y[h]={},y[h][d]={},y[h][d].categoryData={},y[h][d].categoryData[s]=g),y;case"BLOCKS_TOTAL_PAGES":var v=t.payload,b=v.current_page,w=v.total_page,E=v.platform,O=b,k=w,S=at({},e);return S.hasOwnProperty(E)?S=at(at({},S[E]),{},{currentPage:O,totalPages:k}):S[E]={currentPage:O,totalPages:k},S;case"BLOCKS_CURRENT_PAGE":var x=t.payload,_=at(at({},e),{},{currentPage:x});return _;default:return e}};function ct(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ut(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ct(Object(n),!0).forEach((function(t){st(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ct(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function st(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ft={},pt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ft,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ALL_PAGES":var n=t.payload,r=n.current_page,a=n.data,o=n.platform,i=n.total_page,l=n.plan,c=ut({},e);return c.hasOwnProperty(l)||(c[l]={},c[l][o]={},c[l][o].total_page=i,c[l][o].current_page=r),c[l][o][r]=a,c;case"ALL_CATEGORY_PAGES":var u=t.payload,s=u.categoryID,f=u.current_page,p=u.data,d=u.platform,m=u.total_page,h=u.plan,y=ut({},e),g={};return g.current_page=f,g.total_page=m,g[f]=p,y.hasOwnProperty(h)?y[h].hasOwnProperty(d)?y[h][d].hasOwnProperty("categoryData")?y[h][d].categoryData.hasOwnProperty(s)?y[h][d].categoryData[s][f]=p:y[h][d].categoryData[s]=g:(y[h][d].categoryData={},y[h][d].categoryData[s]=g):(y[h][d]={},y[h][d].categoryData={},y[h][d].categoryData[s]=g):(y[h]={},y[h][d]={},y[h][d].categoryData={},y[h][d].categoryData[s]=g),y;case"PAGES_TOTAL_PAGES":var v=t.payload,b=v.current_page,w=v.total_page,E=ut(ut({},e),{},{totalPages:w,currentPage:b});return E;case"PAGES_CURRENT_PAGE":var O=t.payload,k=ut(ut({},e),{},{currentPage:O});return k;default:return e}};function dt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function mt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?dt(Object(n),!0).forEach((function(t){ht(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ht(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var yt={},gt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:yt,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ALL_PACKS":var n=t.payload,r=n.current_page,a=n.data,o=n.platform,i=n.total_page,l=n.plan,c=mt({},e);return c.hasOwnProperty(l)||(c[l]={},c[l][o]={},c[l][o].total_page=i,c[l][o].current_page=r),c[l][o][r]=a,c;case"ALL_CATEGORY_PACKS":var u=t.payload,s=u.categoryID,f=u.current_page,p=u.data,d=u.platform,m=u.total_page,h=u.plan,y=mt({},e),g={};return g.current_page=f,g.total_page=m,g[f]=p,y.hasOwnProperty(h)?y[h].hasOwnProperty(d)?y[h][d].hasOwnProperty("categoryData")?y[h][d].categoryData.hasOwnProperty(s)?y[h][d].categoryData[s][f]=p:y[h][d].categoryData[s]=g:(y[h][d].categoryData={},y[h][d].categoryData[s]=g):(y[h][d]={},y[h][d].categoryData={},y[h][d].categoryData[s]=g):(y[h]={},y[h][d]={},y[h][d].categoryData={},y[h][d].categoryData[s]=g),y;case"PACKS_TOTAL_PAGES":var v=t.payload,b=v.current_page,w=v.total_page,E=mt(mt({},e),{},{totalPages:w,currentPage:b});return E;case"PACKS_CURRENT_PAGE":var O=t.payload,k=mt(mt({},e),{},{currentPage:O});return k;default:return e}};function vt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function bt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?vt(Object(n),!0).forEach((function(t){wt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function wt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Et={isOpen:!1,type:!1,deep:0},Ot=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Et,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"PREVIEW":var n=e;n.previousType=n.type;var r=bt(bt({},n),t.payload);return r;default:return e}};function kt(e){return function(e){if(Array.isArray(e))return St(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return St(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return St(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function St(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function xt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _t(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?xt(Object(n),!0).forEach((function(t){jt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function jt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Pt=TemplatelyAdmin,Ct=Pt.cloud_map,Tt=Pt.platform,At={platforms:Pt.platform_exists,platform:"templately"===Tt?"elementor":Tt,plan:"all",current_route:null,previous_route:null,next_route:null,isLoggedIn:!1,isTemplate:!1,successText:null,loading:!1,itemLoading:!1,templates:{current_page:1,total_page:null},cloud_files:{search:{}},cloud_map:Ct||[],activeSidebar:{activeSidebarMenu:"all",activeParentSidebarMenu:""},dependencyFilter:{filterActive:!1,filtersID:[],filtersResults:{}},all_items:[],filtered_items:[],activeBlockOrPage:{type:"all",ulActive:!1,id:null},pagination:1,need_pagination:!1,pagination_loading:!1,pushed_time:null,searchQuery:{query:"",results:[]},cloud_usage_limit:{limit:10,files:0},workspace_slug:!1,retry:!1,retryMessage:"",tags:[],is_global_login:!1,user_can_logout:!1,is_linked_login:!1},Nt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:At,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_RETRY":var n=t.payload,r=_t(_t({},e),{},{retry:n});return r;case"SET_RETRY_MSG":var a=t.payload,o=_t(_t({},e),{},{retryMessage:a});return o;case"ADD_PLATFORMS":var i=t.payload,l=_t(_t({},e),{},{platforms:i});return l;case"SET_PLATFORM":var c=t.payload,u=_t(_t({},e),{},{platform:c});return u;case"SET_PLAN":var s=t.payload,f=_t(_t({},e),{},{plan:s});return f;case"ALL_TEMPLATES":var p=t.payload,d=p.current_page,m=p.total_page,h=p.items,y=_t({},e.templates);y.hasOwnProperty(d)||(y[d]=h,y.current_page=d,y.total_page=m);var g=_t(_t({},e),{},{templates:y});return g;case"REMOVE_TEMPLATE":var v=t.payload,b=v.id,w=v.page,E=e.templates[w].filter((function(e){return e.id!=b})),O=_t({},e.templates);O[w]=E;var k=_t(_t({},e),{},{templates:O});return k;case"TEMPLATE_TRIGGER":var S=_t(_t({},e),t.payload);return S;case"ALL_CLOUDS":var x=t.payload,_=x.current_page,j=x.data,P=x.total_page,C=x.platform,T=_t({},e);return T.cloud_files.hasOwnProperty(C)||(T.cloud_files[C]={}),T.cloud_files[C][_]=j,T.cloud_files[C].total_page=P,T.cloud_files[C].current_page=_,T;case"REMOVE_CLOUD_FILE":var A=t.payload,N=A.id,I=A.page,L=A.platform,D=_t({},e),R={};R[L]={},R[L].current_page=D.cloud_files[L].current_page,R[L].total_page=D.cloud_files[L].total_page;var M=D.cloud_files[L][I].filter((function(e){return e.id!=N}));return R[L][I]=M,D.cloud_files=R,D;case"ALL_CLOUDS_MAP":var F=_t({},t.payload),z=_t(_t({},e),{},{cloud_map:F});return z;case"ACTIVE_SIDEBAR":var U=_t(_t({},e.activeSidebar),t.payload),B=_t(_t({},e),{},{activeSidebar:U});return B;case"FILTER_DEPENDENCIES_RESULTS":var V=t.payload,W=V.current_page,H=V.data,$=V.platform,q=V.total_page,K=V.plan,Q=_t({},e.dependencyFilter),G=_t({},Q.filtersResults);G.hasOwnProperty(K)||(G[K]={},G[K][$]={},G[K][$].total_page=q,G[K][$].current_page=W),G[K][$][W]=H,Q=_t(_t({},Q),{},{filtersResults:G});var Y=_t(_t({},e),{},{dependencyFilter:Q});return Y;case"FILTER_DEPENDENCIES_ACTIVE":var X=_t({},e.dependencyFilter),J=t.payload;X=_t(_t({},X),{},{filterActive:J});var Z=_t(_t({},e),{},{dependencyFilter:X});return Z;case"FILTER_DEPENDENCIES_ID":var ee=_t({},e.dependencyFilter),te=kt(t.payload);ee=_t(_t({},ee),{},{filtersID:te});var ne=_t(_t({},e),{},{dependencyFilter:ee});return ne;case"USER_CAN_LOGOUT":return _t(_t({},e),{},{user_can_logout:t.payload});case"IS_LINKED_LOGIN":return _t(_t({},e),{},{is_linked_login:t.payload});case"SET_GLOBAL_SIGN_IN":return _t(_t({},e),{},{is_global_login:t.payload});case"FILTERED_TAGS":return _t(_t({},e),{},{tags:kt(t.payload)});case"COMMON_ALL_ITEMS":var re=e;if(!1!==t.payload){var ae=kt(t.payload);re=_t(_t({},e),{},{all_items:ae})}return re;case"COMMON_FILTERED_ITEMS":var oe=e;if(!1!==t.payload){var ie=kt(t.payload);oe=_t(_t({},e),{},{filtered_items:ie})}return oe;case"PACK_BLOCK_OR_PAGE":var le=_t(_t({},e.activeBlockOrPage),t.payload),ce=_t(_t({},e),{},{activeBlockOrPage:le});return ce;case"SET_SUCCESS_TEXT":var ue=t.payload,se=_t(_t({},e),{},{successText:ue});return se;case"SET_PAGINATION":var fe=t.payload,pe=_t(_t({},e),{},{pagination:fe});return pe;case"NEED_PAGINATION":var de=t.payload,me=_t(_t({},e),{},{need_pagination:de});return me;case"PAGINATION_LOADING":var he=t.payload,ye=_t(_t({},e),{},{pagination_loading:he});return ye;case"SET_LOADING":var ge=t.payload,ve=_t(_t({},e),{},{loading:ge});return ve;case"SET_ITEM_LOADING":var be=t.payload,we=_t(_t({},e),{},{itemLoading:be});return we;case"SET_LOGGED_IN":var Ee=t.payload,Oe=_t(_t({},e),{},{isLoggedIn:Ee});return Oe;case"SET_CURRENT_ROUTE":var ke=t.payload,Se=_t(_t({},e),{},{current_route:ke});return Se;case"SET_PREV_ROUTE":var xe=t.payload,_e=_t(_t({},e),{},{previous_route:xe});return _e;case"SET_NEXT_ROUTE":var je=t.payload,Pe=_t(_t({},e),{},{next_route:je});return Pe;case"SET_PUSHED_TIME":var Ce=t.payload,Te=_t(_t({},e),{},{pushed_time:Ce});return Te;case"SEARCH_QUERY":var Ae=t.payload,Ne=_t(_t({},e),{},{searchQuery:Ae});return Ne;case"CLOUD_USAGE_LIMIT":var Ie=t.payload,Le=_t(_t({},e),{},{cloud_usage_limit:Ie});return Le;case"WORKSPACE_SLUG":var De=t.payload,Re=_t(_t({},e),{},{workspace_slug:De});return Re;default:return e}};function It(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Lt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?It(Object(n),!0).forEach((function(t){Dt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):It(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Dt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Rt={user:TemplatelyAdmin.admin||{},errorText:null,successText:null};function Mt(e){return function(e){if(Array.isArray(e))return Ft(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Ft(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ft(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ft(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function zt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ut(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?zt(Object(n),!0).forEach((function(t){Bt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Bt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Vt={current_page:1,total_page:1,workspacesList:[]};function Wt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ht(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Wt(Object(n),!0).forEach((function(t){$t(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Wt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function $t(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var qt={current_page:1,total_page:1,sharedWorkspaceList:[]};function Kt(e){return function(e){if(Array.isArray(e))return Qt(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Qt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Qt(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Qt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Gt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Yt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Gt(Object(n),!0).forEach((function(t){Xt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Gt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Xt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Jt={filesList:{},searchFiles:{current_page:1,total_page:1,files:[]}},Zt=function e(t,n,r){var a;if("function"==typeof n&&"function"==typeof r||"function"==typeof r&&"function"==typeof arguments[3])throw new Error("It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function.");if("function"==typeof n&&void 0===r&&(r=n,n=void 0),void 0!==r){if("function"!=typeof r)throw new Error("Expected the enhancer to be a function.");return r(e)(t,n)}if("function"!=typeof t)throw new Error("Expected the reducer to be a function.");var o=t,i=n,l=[],c=l,u=!1;function s(){c===l&&(c=l.slice())}function f(){if(u)throw new Error("You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return i}function p(e){if("function"!=typeof e)throw new Error("Expected the listener to be a function.");if(u)throw new Error("You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api-reference/store#subscribelistener for more details.");var t=!0;return s(),c.push(e),function(){if(t){if(u)throw new Error("You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api-reference/store#subscribelistener for more details.");t=!1,s();var n=c.indexOf(e);c.splice(n,1),l=null}}}function d(e){if(!Fe(e))throw new Error("Actions must be plain objects. Use custom middleware for async actions.");if(void 0===e.type)throw new Error('Actions may not have an undefined "type" property. Have you misspelled a constant?');if(u)throw new Error("Reducers may not dispatch actions.");try{u=!0,i=o(i,e)}finally{u=!1}for(var t=l=c,n=0;n<t.length;n++){(0,t[n])()}return e}function m(e){if("function"!=typeof e)throw new Error("Expected the nextReducer to be a function.");o=e,d({type:Me.REPLACE})}function h(){var e,t=p;return(e={subscribe:function(e){if("object"!=typeof e||null===e)throw new TypeError("Expected the observer to be an object.");function n(){e.next&&e.next(f())}return n(),{unsubscribe:t(n)}}})[De.a]=function(){return this},e}return d({type:Me.INIT}),(a={dispatch:d,subscribe:p,getState:f,replaceReducer:m})[De.a]=h,a}(function(e){for(var t=Object.keys(e),n={},r=0;r<t.length;r++){var a=t[r];0,"function"==typeof e[a]&&(n[a]=e[a])}var o,i=Object.keys(n);try{!function(e){Object.keys(e).forEach((function(t){var n=e[t];if(void 0===n(void 0,{type:Me.INIT}))throw new Error('Reducer "'+t+"\" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.");if(void 0===n(void 0,{type:Me.PROBE_UNKNOWN_ACTION()}))throw new Error('Reducer "'+t+"\" returned undefined when probed with a random type. Don't try to handle "+Me.INIT+' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.')}))}(n)}catch(e){o=e}return function(e,t){if(void 0===e&&(e={}),o)throw o;for(var r=!1,a={},l=0;l<i.length;l++){var c=i[l],u=n[c],s=e[c],f=u(s,t);if(void 0===f){var p=ze(c,t);throw new Error(p)}a[c]=f,r=r||f!==s}return(r=r||i.length!==Object.keys(e).length)?a:e}}({admin:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Rt,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_USER":var n=t.payload,r=Lt(Lt({},e),{},{user:n});return r;case"ERROR_TEXT":var a=t.payload,o=Lt(Lt({},e),{},{errorText:a});return o;case"SUCCESS_TEXT":var i=t.payload,l=Lt(Lt({},e),{},{successText:i});return l;default:return e}},blocks:lt,pages:pt,packs:gt,preview:Ot,common:Nt,workspaces:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Vt,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ALL_WORKSPACE_QUERY":var n=t.payload,r=n.current_page,a=n.data,o=n.total_page,i=Ut(Ut({},e),{},{current_page:r,total_page:o});return null!==r&&(i[r]=a),i;case"ALL_WORKSPACE_LIST":var l=t.payload;return null!==l?Ut(Ut({},e),{},{workspacesList:l}):Ut({},e);case"ADD_WORKSPACE_IN_LIST":var c=t.payload,u=[].concat(Mt(c),Mt(e.workspacesList)),s=Ut(Ut({},e),{},{workspacesList:u});return s;case"EDIT_WORKSPACE":var f=t.payload.page,p=t.payload.data,d=Ut({},e);if(d.hasOwnProperty(f)){var m=Mt(d[f]).filter((function(e){return e.id!=p.id}));m=[p].concat(Mt(m)),d[f]=m}return d;case"DELETE_WORKSPACE":var h=t.payload.page,y=t.payload.data,g=Ut({},e);if(g.hasOwnProperty(h)){var v=Mt(g[h]).filter((function(e){return e.id!=y}));g[h]=v}return g;case"CREATE_WORKSPACE":var b=t.payload.page,w=t.payload.data,E=Ut({},e),O=[];return E.hasOwnProperty(b)?(O=[w].concat(Mt(E[b])),E[b]=O):E[b]=[w],E;case"WORKSPACES_TOTAL_PAGES":var k=t.payload,S=k.current_page,x=k.total_page,_=Ut(Ut({},e),{},{totalPages:x,currentPage:S});return _;case"WORKSPACES_CURRENT_PAGE":var j=t.payload,P=Ut(Ut({},e),{},{currentPage:j});return P;default:return e}},sharedWorkspaces:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:qt,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SHARED_WORKSPACE_QUERY":var n=t.payload,r=n.current_page,a=n.data,o=n.total_page,i=Ht(Ht({},e),{},{current_page:r,total_page:o});return null!==r&&(i[r]=a),i;case"SHARED_WORKSPACE_LIST":var l=t.payload;return null!=l&&l.length>0?Ht(Ht({},e),{},{sharedWorkspaceList:l}):Ht({},e);case"SHARED_WORKSPACES_TOTAL_PAGES":var c=t.payload,u=c.current_page,s=c.total_page,f=Ht(Ht({},e),{},{totalPages:s,currentPage:u});return f;case"SHARED_WORKSPACES_CURRENT_PAGE":var p=t.payload,d=Ht(Ht({},e),{},{currentPage:p});return d;default:return e}},workspacesDetails:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Jt,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ADD_WORKSPACE_WITH_DETAILS":var n=t.payload,r=n.slug,a=n.data,o=n.page,i=n.platform,l=Yt({},e),c={},u={};return a.hasOwnProperty("files")&&null!==a.files&&(a.files.hasOwnProperty("data")&&(c=a.files.data),u.total_page=a.files.total_page,u.current_page=a.files.current_page,u[o]=c),l.hasOwnProperty(r)?l[r].hasOwnProperty("files")&&null!==l[r].files?l[r].files.hasOwnProperty(i)?l[r].files[i]=Yt(Yt({},l[r].files[i]),u):l[r].files[i]=u:(l[r].files={},l[r].files[i]=u):(delete a.file,l[r]=a,l[r].files={},l[r].files[i]=u),l;case"ADD_FILES_PAGE_FOR_A_WORKSPACE":var s=t.payload,f=s.slug,p=s.data,d=s.page,m=s.platform,h=s.total_page,y=Yt({},e);return y.hasOwnProperty(f)&&y[f].hasOwnProperty("files")&&y[f].files.hasOwnProperty(m)&&(y[f].files[m][d]=p,y[f].files[m].total_page=h),y;case"REMOVE_FILES_PAGE_FOR_A_WORKSPACE":var g=t.payload,v=g.page,b=g.slug,w=g.platform,E=g.fileAdded,O=Yt({},e);if(O.hasOwnProperty(b)&&O[b].hasOwnProperty("files"))if(!0===E){var k={};k.total_page=O[b].files[w].total_page,k.current_page=O[b].files[w].current_page,delete O[b].files[w],O[b].files[w]=k}else O[b].files.hasOwnProperty(w)&&delete O[b].files[w][v];return O;case"ALL_CLOUDS_FILE_LIST":var S=t.payload,x=S.slug,_=S.data,j=S.platform,P=Yt({},e),C=Yt({},P.filesList);return C.hasOwnProperty(j)||(C[j]={}),C[j][x]=_,P=Yt(Yt({},P),{},{filesList:C});case"EDIT_WORKSPACE_DETAILS":var T=t.payload,A=T.slug,N=T.data,I=T.page,L=T.platform,D=Yt({},e),R={},M={};return N.hasOwnProperty("files")&&null!==N.files&&(N.files.hasOwnProperty("data")&&(R=N.files.data),M.total_page=N.files.total_page,M.current_page=N.files.current_page,M[I]=R),D.hasOwnProperty(A)?D[A].hasOwnProperty("files")&&null!==D[A].files?D[A].files.hasOwnProperty(L)?D[A].files[L]=Yt(Yt({},D[A].files[L]),M):D[A].files[L]=M:(D[A].files={},D[A].files[L]=M):(delete N.file,D[A]=N,D[A].files={},D[A].files[L]=M),D;case"ADD_FILE_TO_WORKSPACE":var F=t.payload,z=F.slug,U=F.data,B=Yt({},e),V=null;return B.hasOwnProperty(z)&&B[z].hasOwnProperty("files")&&B[z].files.hasOwnProperty("data")?(V=[].concat(Kt(B[z].files.data),Kt(U)),B[z].files.data=V):(V=U,B[z].files.data=V),B;case"DELETE_FILE_FROM_WORKSPACE":var W=t.payload,H=W.fileFrom,$=W.id,q=W.page,K=Yt({},e),Q=[];return K.hasOwnProperty(H)&&K[H].hasOwnProperty("files")&&null!=K[H].files&&K[H].files.hasOwnProperty(q)&&K[H].files[q]&&K[H].files[q].length>0&&(Q=K[H].files[q].filter((function(e){return e.id!==$})),K[H].files[q]=Q),K;default:return e}}}),!1),en={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},tn=o.createContext&&o.createContext(en),nn=function(){return(nn=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)},rn=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&(n[r[a]]=e[r[a]])}return n};function an(e){return function(t){return o.createElement(on,nn({attr:nn({},e.attr)},t),function e(t){return t&&t.map((function(t,n){return o.createElement(t.tag,nn({key:n},t.attr),e(t.child))}))}(e.child))}}function on(e){var t=function(t){var n,r=e.size||t.size||"1em";t.className&&(n=t.className),e.className&&(n=(n?n+" ":"")+e.className);var a=e.attr,i=e.title,l=rn(e,["attr","title"]);return o.createElement("svg",nn({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},t.attr,a,l,{className:n,style:nn({color:e.color||t.color},t.style,e.style),height:r,width:r,xmlns:"http://www.w3.org/2000/svg"}),i&&o.createElement("title",null,i),e.children)};return void 0!==tn?o.createElement(tn.Consumer,null,(function(e){return t(e)})):t(en)}function ln(e){return an({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M257.5 445.1l-22.2 22.2c-9.4 9.4-24.6 9.4-33.9 0L7 273c-9.4-9.4-9.4-24.6 0-33.9L201.4 44.7c9.4-9.4 24.6-9.4 33.9 0l22.2 22.2c9.5 9.5 9.3 25-.4 34.3L136.6 216H424c13.3 0 24 10.7 24 24v32c0 13.3-10.7 24-24 24H136.6l120.5 114.8c9.8 9.3 10 24.8.4 34.3z"}}]})(e)}function cn(e){return an({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M31.3 192h257.3c17.8 0 26.7 21.5 14.1 34.1L174.1 354.8c-7.8 7.8-20.5 7.8-28.3 0L17.2 226.1C4.6 213.5 13.5 192 31.3 192z"}}]})(e)}function un(e){return an({tag:"svg",attr:{viewBox:"0 0 192 512"},child:[{tag:"path",attr:{d:"M192 127.338v257.324c0 17.818-21.543 26.741-34.142 14.142L29.196 270.142c-7.81-7.81-7.81-20.474 0-28.284l128.662-128.662c12.599-12.6 34.142-3.676 34.142 14.142z"}}]})(e)}function sn(e){return an({tag:"svg",attr:{viewBox:"0 0 192 512"},child:[{tag:"path",attr:{d:"M0 384.662V127.338c0-17.818 21.543-26.741 34.142-14.142l128.662 128.662c7.81 7.81 7.81 20.474 0 28.284L34.142 398.804C21.543 411.404 0 402.48 0 384.662z"}}]})(e)}function fn(e){return an({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M288.662 352H31.338c-17.818 0-26.741-21.543-14.142-34.142l128.662-128.662c7.81-7.81 20.474-7.81 28.284 0l128.662 128.662c12.6 12.599 3.676 34.142-14.142 34.142z"}}]})(e)}function pn(e){return an({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M537.6 226.6c4.1-10.7 6.4-22.4 6.4-34.6 0-53-43-96-96-96-19.7 0-38.1 6-53.3 16.2C367 64.2 315.3 32 256 32c-88.4 0-160 71.6-160 160 0 2.7.1 5.4.2 8.1C40.2 219.8 0 273.2 0 336c0 79.5 64.5 144 144 144h368c70.7 0 128-57.3 128-128 0-61.9-44-113.6-102.4-125.4z"}}]})(e)}function dn(e){return an({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M528 0H48C21.5 0 0 21.5 0 48v320c0 26.5 21.5 48 48 48h192l-16 48h-72c-13.3 0-24 10.7-24 24s10.7 24 24 24h272c13.3 0 24-10.7 24-24s-10.7-24-24-24h-72l-16-48h192c26.5 0 48-21.5 48-48V48c0-26.5-21.5-48-48-48zm-16 352H64V64h448v288z"}}]})(e)}function mn(e){return an({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M216 0h80c13.3 0 24 10.7 24 24v168h87.7c17.8 0 26.7 21.5 14.1 34.1L269.7 378.3c-7.5 7.5-19.8 7.5-27.3 0L90.1 226.1c-12.6-12.6-3.7-34.1 14.1-34.1H192V24c0-13.3 10.7-24 24-24zm296 376v112c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V376c0-13.3 10.7-24 24-24h146.7l49 49c20.1 20.1 52.5 20.1 72.6 0l49-49H488c13.3 0 24 10.7 24 24zm-124 88c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20zm64 0c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20z"}}]})(e)}function hn(e){return an({tag:"svg",attr:{viewBox:"0 0 192 512"},child:[{tag:"path",attr:{d:"M96 184c39.8 0 72 32.2 72 72s-32.2 72-72 72-72-32.2-72-72 32.2-72 72-72zM24 80c0 39.8 32.2 72 72 72s72-32.2 72-72S135.8 8 96 8 24 40.2 24 80zm0 352c0 39.8 32.2 72 72 72s72-32.2 72-72-32.2-72-72-72-72 32.2-72 72z"}}]})(e)}function yn(e){return an({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M572.52 241.4C518.29 135.59 410.93 64 288 64S57.68 135.64 3.48 241.41a32.35 32.35 0 0 0 0 29.19C57.71 376.41 165.07 448 288 448s230.32-71.64 284.52-177.41a32.35 32.35 0 0 0 0-29.19zM288 400a144 144 0 1 1 144-144 143.93 143.93 0 0 1-144 144zm0-240a95.31 95.31 0 0 0-25.31 3.79 47.85 47.85 0 0 1-66.9 66.9A95.78 95.78 0 1 0 288 160z"}}]})(e)}function gn(e){return an({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M572.694 292.093L500.27 416.248A63.997 63.997 0 0 1 444.989 448H45.025c-18.523 0-30.064-20.093-20.731-36.093l72.424-124.155A64 64 0 0 1 152 256h399.964c18.523 0 30.064 20.093 20.73 36.093zM152 224h328v-48c0-26.51-21.49-48-48-48H272l-64-64H48C21.49 64 0 85.49 0 112v278.046l69.077-118.418C86.214 242.25 117.989 224 152 224z"}}]})(e)}function vn(e){return an({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M462.3 62.6C407.5 15.9 326 24.3 275.7 76.2L256 96.5l-19.7-20.3C186.1 24.3 104.5 15.9 49.7 62.6c-62.8 53.6-66.1 149.8-9.9 207.9l193.5 199.8c12.5 12.9 32.8 12.9 45.3 0l193.5-199.8c56.3-58.1 53-154.3-9.8-207.9z"}}]})(e)}function bn(e){return an({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M272 0H48C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h224c26.5 0 48-21.5 48-48V48c0-26.5-21.5-48-48-48zM160 480c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm112-108c0 6.6-5.4 12-12 12H60c-6.6 0-12-5.4-12-12V60c0-6.6 5.4-12 12-12h200c6.6 0 12 5.4 12 12v312z"}}]})(e)}function wn(e){return an({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z"}}]})(e)}function En(e){return an({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M505 442.7L405.3 343c-4.5-4.5-10.6-7-17-7H372c27.6-35.3 44-79.7 44-128C416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c48.3 0 92.7-16.4 128-44v16.3c0 6.4 2.5 12.5 7 17l99.7 99.7c9.4 9.4 24.6 9.4 33.9 0l28.3-28.3c9.4-9.4 9.4-24.6.1-34zM208 336c-70.7 0-128-57.2-128-128 0-70.7 57.2-128 128-128 70.7 0 128 57.2 128 128 0 70.7-57.2 128-128 128z"}}]})(e)}function On(e){return an({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M352 320c-22.608 0-43.387 7.819-59.79 20.895l-102.486-64.054a96.551 96.551 0 0 0 0-41.683l102.486-64.054C308.613 184.181 329.392 192 352 192c53.019 0 96-42.981 96-96S405.019 0 352 0s-96 42.981-96 96c0 7.158.79 14.13 2.276 20.841L155.79 180.895C139.387 167.819 118.608 160 96 160c-53.019 0-96 42.981-96 96s42.981 96 96 96c22.608 0 43.387-7.819 59.79-20.895l102.486 64.054A96.301 96.301 0 0 0 256 416c0 53.019 42.981 96 96 96s96-42.981 96-96-42.981-96-96-96z"}}]})(e)}function kn(e){return an({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M528.12 301.319l47.273-208C578.806 78.301 567.391 64 551.99 64H159.208l-9.166-44.81C147.758 8.021 137.93 0 126.529 0H24C10.745 0 0 10.745 0 24v16c0 13.255 10.745 24 24 24h69.883l70.248 343.435C147.325 417.1 136 435.222 136 456c0 30.928 25.072 56 56 56s56-25.072 56-56c0-15.674-6.447-29.835-16.824-40h209.647C430.447 426.165 424 440.326 424 456c0 30.928 25.072 56 56 56s56-25.072 56-56c0-22.172-12.888-41.332-31.579-50.405l5.517-24.276c3.413-15.018-8.002-29.319-23.403-29.319H218.117l-6.545-32h293.145c11.206 0 20.92-7.754 23.403-18.681z"}}]})(e)}function Sn(e){return an({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M259.3 17.8L194 150.2 47.9 171.5c-26.2 3.8-36.7 36.1-17.7 54.6l105.7 103-25 145.5c-4.5 26.3 23.2 46 46.4 33.7L288 439.6l130.7 68.7c23.2 12.2 50.9-7.4 46.4-33.7l-25-145.5 105.7-103c19-18.5 8.5-50.8-17.7-54.6L382 150.2 316.7 17.8c-11.7-23.6-45.6-23.9-57.4 0z"}}]})(e)}function xn(e){return an({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M400 0H48C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V48c0-26.5-21.5-48-48-48zM224 480c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm176-108c0 6.6-5.4 12-12 12H60c-6.6 0-12-5.4-12-12V60c0-6.6 5.4-12 12-12h328c6.6 0 12 5.4 12 12v312z"}}]})(e)}function _n(e){return an({tag:"svg",attr:{viewBox:"0 0 352 512"},child:[{tag:"path",attr:{d:"M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"}}]})(e)}function jn(e){return an({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 288c79.5 0 144-64.5 144-144S335.5 0 256 0 112 64.5 112 144s64.5 144 144 144zm128 32h-55.1c-22.2 10.2-46.9 16-72.9 16s-50.6-5.8-72.9-16H128C57.3 320 0 377.3 0 448v16c0 26.5 21.5 48 48 48h416c26.5 0 48-21.5 48-48v-16c0-70.7-57.3-128-128-128z"}}]})(e)}function Pn(e){return an({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M224 256c70.7 0 128-57.3 128-128S294.7 0 224 0 96 57.3 96 128s57.3 128 128 128zm89.6 32h-16.7c-22.2 10.2-46.9 16-72.9 16s-50.6-5.8-72.9-16h-16.7C60.2 288 0 348.2 0 422.4V464c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48v-41.6c0-74.2-60.2-134.4-134.4-134.4z"}}]})(e)}var Cn=function(e){return{type:"SET_RETRY",payload:e}},Tn=function(e){return{type:"USER_CAN_LOGOUT",payload:e}},An=function(e){return{type:"SET_GLOBAL_SIGN_IN",payload:e}},Nn=function(e){return{type:"IS_LINKED_LOGIN",payload:e}},In=function(e){return{type:"SET_RETRY_MSG",payload:e}},Ln=function(e){return{type:"ADD_PLATFORMS",payload:e}},Dn=function(e){return{type:"ALL_ITEMS",payload:e}},Rn=function(e){return{type:"ALL_PACKS",payload:e}},Mn=function(e){return{type:"ALL_TEMPLATES",payload:e}},Fn=function(e){return{type:"ALL_CLOUDS",payload:e}},zn=function(e){return{type:"PREVIEW",payload:e}},Un=function(e){return{type:"SET_LOADING",payload:e}},Bn=function(e){return{type:"SET_ITEM_LOADING",payload:e}},Vn=function(e){return{type:"SET_LOGGED_IN",payload:e}},Wn=function(e){return{type:"ERRORS",payload:e}},Hn=function(e){return{type:"ACTIVE_SIDEBAR",payload:e}},$n=function(e){return{type:"COMMON_ALL_ITEMS",payload:e}},qn=function(e){return{type:"COMMON_FILTERED_ITEMS",payload:e}},Kn=function(e){return{type:"PACK_BLOCK_OR_PAGE",payload:e}},Qn=function(e){return{type:"SET_PAGINATION",payload:e}},Gn=function(e){return{type:"NEED_PAGINATION",payload:e}},Yn=function(e){return{type:"PAGINATION_LOADING",payload:e}},Xn=function(e){return{type:"SET_USER",payload:e}},Jn=function(e){return{type:"SUCCESS_TEXT",payload:e}},Zn=function(e){return{type:"SET_CURRENT_ROUTE",payload:e}},er=function(e){return{type:"SET_PUSHED_TIME",payload:e}},tr=function(e){return{type:"ERROR_TEXT",payload:e}},nr=function(e){return{type:"SEARCH_QUERY",payload:e}},rr=function(e){return{type:"REMOVE_FILES_PAGE_FOR_A_WORKSPACE",payload:e}},ar=function(e){return{type:"ALL_WORKSPACE_LIST",payload:e}},or=function(e){return{type:"SHARED_WORKSPACE_LIST",payload:e}};function ir(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function lr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ir(Object(n),!0).forEach((function(t){cr(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ir(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function cr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ur(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return sr(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return sr(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function sr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var fr=wp.i18n.__,pr=tt((function(e){return{preview:e.preview}}))((function(e){var t=ur(Object(o.useState)(0),2),n=t[0],r=t[1];return Object(o.useEffect)((function(){var t=lr({deep:n},e.preview);n<=0&&(t=lr(lr({},t),{isOpen:!1,deep:0})),1===n&&(t=lr(lr({},t),{type:e.preview.previousType})),e.dispatch(zn(t))}),[n]),i.a.createElement("div",{className:"templately-logo"},i.a.createElement("svg",{width:"40px",enableBackground:"new 0 0 512 512",viewBox:"0 0 512 512",xmlns:"http://www.w3.org/2000/svg"},i.a.createElement("circle",{cx:"90.5",cy:"454.8",fill:"#ffb45a",r:"57.2"}),i.a.createElement("circle",{cx:"256",cy:"454.8",fill:"#ff7b8e",r:"57.2"}),i.a.createElement("circle",{cx:"421.5",cy:"454.8",fill:"#5ac0ff",r:"57.2"}),i.a.createElement("path",{d:"m356.5 94.5c-3.1 0-6.1.2-9.1.4-12.4-54.3-61-94.9-119.1-94.9-15.3 0-29.9 2.8-43.4 8 0 15.3.1 32.9.2 40.4 15.6.1 45.8.2 59.1.2v57.8c-19.9 0-39.2 0-58.8 0v97.7h60.5c-1.7 4.3-4.3 10.7-5.4 13.2-11 26.5-38.3 41.3-66.6 36.2-26.9-4.9-46.9-27.8-48.4-55.9-.4-8.2-.2-16.5-.2-24.7 0-12.6 0-54 0-66.9-7.1 0-13.9 0-20.7 0-41.8 19.4-70.9 61.7-70.9 110.8 0 67.5 54.7 122.2 122.2 122.2h202c66.9-.7 120.8-55.1 120.8-122.2 0-67.5-54.7-122.3-122.2-122.3z",fill:"#5633d1"})),!e.preview.isOpen&&i.a.createElement(i.a.Fragment,null,i.a.createElement("svg",{height:"28",viewBox:"0 0 143 28",width:"143",xmlns:"http://www.w3.org/2000/svg"},i.a.createElement("g",{fill:"#424c5e"},i.a.createElement("path",{d:"m6.6 18.5c-1.2 0-1.9-.7-1.9-2.1v-7h3.4v-3.1h-3.8l-.6-3h-2.9v14.2c0 2.8 1.3 4.1 3.8 4.1h3.4v-3.1z"}),i.a.createElement("path",{d:"m17.3 6.3c-4.8 0-7.2 2.5-7.2 7.5 0 5.2 2.8 7.8 8.3 7.8 1.9 0 3.6-.1 4.9-.4v-3.1c-1.5.3-3.1.4-4.6.4-3.2 0-4.8-1.1-4.8-3.2h10.2c.1-.6.1-1.3.1-1.9.1-4.7-2.3-7.1-6.9-7.1zm-3.3 6.3c.2-2.2 1.3-3.3 3.3-3.3 2.1 0 3.2 1.1 3.2 3.2v.1z"}),i.a.createElement("path",{d:"m44.4 6.3c-1.7 0-3.3.7-4.9 2.1-.7-1.4-2-2.1-4-2.1-1.9 0-3.6.7-4.9 2.2l-.5-2.2h-3v15.3h3.9v-10.6c1-1 2.1-1.5 3.2-1.5 1.4 0 2.1.9 2.1 2.6v9.6h3.9v-10.6c1.1-1 2.2-1.5 3.3-1.5 1.5 0 2.3.8 2.3 2.6v9.6h3.9v-9.5c0-4.1-1.8-6-5.3-6z"}),i.a.createElement("path",{d:"m59.8 6.3c-2.3 0-4.4.2-6.4.6v21.1h3.9v-7.1c1 .5 2.1.7 3.1.7 4.8 0 7.3-2.7 7.3-8-.1-4.9-2.7-7.3-7.9-7.3zm.5 12.1c-1.1 0-2.1-.3-3.1-.8v-8c.7-.1 1.6-.2 2.7-.2 2.5 0 3.8 1.4 3.8 4.1.1 3.3-1.1 4.9-3.4 4.9z"}),i.a.createElement("path",{d:"m70.5.7h3.9v20.8h-3.9z"}),i.a.createElement("path",{d:"m84.1 6.3c-1.7 0-3.5.2-5.6.7v3.1c2-.5 3.9-.7 5.6-.7 2 0 3 .7 3 2.1v1.2c-1-.2-2.1-.3-3.1-.3-4.4 0-6.6 1.5-6.6 4.6 0 3.2 1.9 4.8 5.6 4.8 1.6 0 3.1-.5 4.4-1.4l1.4 1.4h2.2v-10.3c-.1-3.6-2.4-5.2-6.9-5.2zm-.6 12.5c-1.6 0-2.3-.7-2.3-2s.9-1.9 2.8-1.9c1.1 0 2.1.1 3.1.3v2.4c-1.2.8-2.4 1.2-3.6 1.2z"}),i.a.createElement("path",{d:"m100 18.5c-1.2 0-1.9-.7-1.9-2.1v-7h3.4v-3.1h-3.8l-.6-3h-2.9v14.2c0 2.8 1.3 4.1 3.8 4.1h3.4v-3.1z"}),i.a.createElement("path",{d:"m110.7 6.3c-4.8 0-7.2 2.5-7.2 7.5 0 5.2 2.8 7.8 8.3 7.8 1.9 0 3.6-.1 4.9-.4v-3.1c-1.5.3-3.1.4-4.6.4-3.2 0-4.8-1.1-4.8-3.2h10.2c.1-.6.1-1.3.1-1.9.1-4.8-2.3-7.1-6.9-7.1zm-3.3 6.3c.2-2.2 1.3-3.3 3.3-3.3 2.1 0 3.2 1.1 3.2 3.2v.1z"}),i.a.createElement("path",{d:"m120.6.7h3.9v20.8h-3.9z"}),i.a.createElement("path",{d:"m138 6.2-3.8 11-3.9-11h-4.1l5.9 15.4c-.8 1.7-2 2.9-3.7 3.7l1.9 2.6c2.5-1.2 4.3-3.2 5.4-5.9l6.3-15.8z"}))),i.a.createElement("span",{className:"templately-beta-text"},"Beta")),e.preview.isOpen&&i.a.createElement("span",{className:"templately-back-2-library",onClick:function(){return r(--e.preview.deep)}},i.a.createElement(ln,{color:"#000"}),fr("Back to Library","templately")))})),dr=tt((function(e){return{preview:e.preview}}))((function(e){return i.a.createElement(Z,{exact:e.exact||!0,path:e.to,children:function(t){var n=t.match;return i.a.createElement("li",{className:n||e.active?"templately-active":""},i.a.createElement(he,{className:e.className,onClick:function(){e.dispatch(Wn(null)),e.dispatch(Bn(!0)),e.dispatch(tr(null)),e.dispatch(Zn(e.to)),e.dispatch(zn({isOpen:!1,deep:0})),e.dispatch(Hn({activeSidebarMenu:"all",activeParentSidebarMenu:""})),e.dispatch(qn([])),e.dispatch($n([])),e.dispatch(Qn(1)),e.dispatch(Gn(!1))},to:e.to},e.children,e.name))}})}));n(69),n(71),n(72),n(76),n(80);function mr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function hr(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function yr(e,t,n){return t&&hr(e.prototype,t),n&&hr(e,n),e}n(81);function gr(e,t){return(gr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function vr(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&gr(e,t)}var br=n(13);function wr(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Er(e,t){return!t||"object"!==Object(br.a)(t)&&"function"!=typeof t?wr(e):t}function Or(e){return(Or=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function kr(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}var Sr=function(e,t){var n;void 0===t&&(t=kr);var r,a=[],o=!1;return function(){for(var i=[],l=0;l<arguments.length;l++)i[l]=arguments[l];return o&&n===this&&t(i,a)||(r=e.apply(this,i),o=!0,n=this,a=i),r}},xr=n(3);n(83);function _r(e,t){if(null==e)return{};var n,r,a=z(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var jr=n(26);function Pr(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}}(e,t)||Object(jr.a)(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var Cr=n(7),Tr=n(2),Ar=n(15);var Nr=n(31),Ir=n.n(Nr),Lr=function(){};function Dr(e,t){return t?"-"===t[0]?e+t:e+"__"+t:e}function Rr(e,t,n){var r=[n];if(t&&e)for(var a in t)t.hasOwnProperty(a)&&t[a]&&r.push("".concat(Dr(e,a)));return r.filter((function(e){return e})).map((function(e){return String(e).trim()})).join(" ")}var Mr=function(e){return Array.isArray(e)?e.filter(Boolean):"object"===Object(br.a)(e)&&null!==e?[e]:[]};function Fr(e){return[document.documentElement,document.body,window].indexOf(e)>-1}function zr(e){return Fr(e)?window.pageYOffset:e.scrollTop}function Ur(e,t){Fr(e)?window.scrollTo(0,t):e.scrollTop=t}function Br(e,t,n,r){return n*((e=e/r-1)*e*e+1)+t}function Vr(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:200,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Lr,a=zr(e),o=t-a,i=10,l=0;function c(){var t=Br(l+=i,a,o,n);Ur(e,t),l<n?window.requestAnimationFrame(c):r(e)}c()}function Wr(){try{return document.createEvent("TouchEvent"),!0}catch(e){return!1}}function Hr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function $r(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Hr(Object(n),!0).forEach((function(t){Object(Tr.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Hr(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function qr(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Or(e);if(t){var a=Or(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Er(this,n)}}function Kr(e){var t=e.maxHeight,n=e.menuEl,r=e.minHeight,a=e.placement,o=e.shouldScroll,i=e.isFixedPosition,l=e.theme.spacing,c=function(e){var t=getComputedStyle(e),n="absolute"===t.position,r=/(auto|scroll)/,a=document.documentElement;if("fixed"===t.position)return a;for(var o=e;o=o.parentElement;)if(t=getComputedStyle(o),(!n||"static"!==t.position)&&r.test(t.overflow+t.overflowY+t.overflowX))return o;return a}(n),u={placement:"bottom",maxHeight:t};if(!n||!n.offsetParent)return u;var s=c.getBoundingClientRect().height,f=n.getBoundingClientRect(),p=f.bottom,d=f.height,m=f.top,h=n.offsetParent.getBoundingClientRect().top,y=window.innerHeight,g=zr(c),v=parseInt(getComputedStyle(n).marginBottom,10),b=parseInt(getComputedStyle(n).marginTop,10),w=h-b,E=y-m,O=w+g,k=s-g-m,S=p-y+g+v,x=g+m-b;switch(a){case"auto":case"bottom":if(E>=d)return{placement:"bottom",maxHeight:t};if(k>=d&&!i)return o&&Vr(c,S,160),{placement:"bottom",maxHeight:t};if(!i&&k>=r||i&&E>=r)return o&&Vr(c,S,160),{placement:"bottom",maxHeight:i?E-v:k-v};if("auto"===a||i){var _=t,j=i?w:O;return j>=r&&(_=Math.min(j-v-l.controlHeight,t)),{placement:"top",maxHeight:_}}if("bottom"===a)return Ur(c,S),{placement:"bottom",maxHeight:t};break;case"top":if(w>=d)return{placement:"top",maxHeight:t};if(O>=d&&!i)return o&&Vr(c,x,160),{placement:"top",maxHeight:t};if(!i&&O>=r||i&&w>=r){var P=t;return(!i&&O>=r||i&&w>=r)&&(P=i?w-b:O-b),o&&Vr(c,x,160),{placement:"top",maxHeight:P}}return{placement:"bottom",maxHeight:t};default:throw new Error('Invalid placement provided "'.concat(a,'".'))}return u}var Qr=function(e){return"auto"===e?"bottom":e},Gr=Object(o.createContext)({getPortalPlacement:null}),Yr=function(e){vr(n,e);var t=qr(n);function n(){var e;mr(this,n);for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];return(e=t.call.apply(t,[this].concat(a))).state={maxHeight:e.props.maxMenuHeight,placement:null},e.getPlacement=function(t){var n=e.props,r=n.minMenuHeight,a=n.maxMenuHeight,o=n.menuPlacement,i=n.menuPosition,l=n.menuShouldScrollIntoView,c=n.theme;if(t){var u="fixed"===i,s=Kr({maxHeight:a,menuEl:t,minHeight:r,placement:o,shouldScroll:l&&!u,isFixedPosition:u,theme:c}),f=e.context.getPortalPlacement;f&&f(s),e.setState(s)}},e.getUpdatedProps=function(){var t=e.props.menuPlacement,n=e.state.placement||Qr(t);return $r($r({},e.props),{},{placement:n,maxHeight:e.state.maxHeight})},e}return yr(n,[{key:"render",value:function(){return(0,this.props.children)({ref:this.getPlacement,placerProps:this.getUpdatedProps()})}}]),n}(o.Component);Yr.contextType=Gr;var Xr=function(e){var t=e.theme,n=t.spacing.baseUnit;return{color:t.colors.neutral40,padding:"".concat(2*n,"px ").concat(3*n,"px"),textAlign:"center"}},Jr=Xr,Zr=Xr,ea=function(e){var t=e.children,n=e.className,r=e.cx,a=e.getStyles,o=e.innerProps;return Object(xr.c)("div",s({css:a("noOptionsMessage",e),className:r({"menu-notice":!0,"menu-notice--no-options":!0},n)},o),t)};ea.defaultProps={children:"No options"};var ta=function(e){var t=e.children,n=e.className,r=e.cx,a=e.getStyles,o=e.innerProps;return Object(xr.c)("div",s({css:a("loadingMessage",e),className:r({"menu-notice":!0,"menu-notice--loading":!0},n)},o),t)};ta.defaultProps={children:"Loading..."};var na=function(e){vr(n,e);var t=qr(n);function n(){var e;mr(this,n);for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];return(e=t.call.apply(t,[this].concat(a))).state={placement:null},e.getPortalPlacement=function(t){var n=t.placement;n!==Qr(e.props.menuPlacement)&&e.setState({placement:n})},e}return yr(n,[{key:"render",value:function(){var e=this.props,t=e.appendTo,n=e.children,r=e.controlElement,a=e.menuPlacement,o=e.menuPosition,i=e.getStyles,c="fixed"===o;if(!t&&!c||!r)return null;var u=this.state.placement||Qr(a),s=function(e){var t=e.getBoundingClientRect();return{bottom:t.bottom,height:t.height,left:t.left,right:t.right,top:t.top,width:t.width}}(r),f=c?0:window.pageYOffset,p={offset:s[u]+f,position:o,rect:s},d=Object(xr.c)("div",{css:i("menuPortal",p)},n);return Object(xr.c)(Gr.Provider,{value:{getPortalPlacement:this.getPortalPlacement}},t?Object(l.createPortal)(d,t):d)}}]),n}(o.Component),ra=Array.isArray,aa=Object.keys,oa=Object.prototype.hasOwnProperty;function ia(e,t){try{return function e(t,n){if(t===n)return!0;if(t&&n&&"object"==Object(br.a)(t)&&"object"==Object(br.a)(n)){var r,a,o,i=ra(t),l=ra(n);if(i&&l){if((a=t.length)!=n.length)return!1;for(r=a;0!=r--;)if(!e(t[r],n[r]))return!1;return!0}if(i!=l)return!1;var c=t instanceof Date,u=n instanceof Date;if(c!=u)return!1;if(c&&u)return t.getTime()==n.getTime();var s=t instanceof RegExp,f=n instanceof RegExp;if(s!=f)return!1;if(s&&f)return t.toString()==n.toString();var p=aa(t);if((a=p.length)!==aa(n).length)return!1;for(r=a;0!=r--;)if(!oa.call(n,p[r]))return!1;for(r=a;0!=r--;)if(!("_owner"===(o=p[r])&&t.$$typeof||e(t[o],n[o])))return!1;return!0}return t!=t&&n!=n}(e,t)}catch(e){if(e.message&&e.message.match(/stack|recursion/i))return console.warn("Warning: react-fast-compare does not handle circular references.",e.name,e.message),!1;throw e}}function la(){var e,t,n=(e=["\n 0%, 80%, 100% { opacity: 0; }\n 40% { opacity: 1; }\n"],t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}})));return la=function(){return n},n}var ca={name:"19bqh2r",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0;"},ua=function(e){var t=e.size,n=_r(e,["size"]);return Object(xr.c)("svg",s({height:t,width:t,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:ca},n))},sa=function(e){return Object(xr.c)(ua,s({size:20},e),Object(xr.c)("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},fa=function(e){return Object(xr.c)(ua,s({size:20},e),Object(xr.c)("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},pa=function(e){var t=e.isFocused,n=e.theme,r=n.spacing.baseUnit,a=n.colors;return{label:"indicatorContainer",color:t?a.neutral60:a.neutral20,display:"flex",padding:2*r,transition:"color 150ms",":hover":{color:t?a.neutral80:a.neutral40}}},da=pa,ma=pa,ha=Object(xr.d)(la()),ya=function(e){var t=e.delay,n=e.offset;return Object(xr.c)("span",{css:Object(Ar.a)({animation:"".concat(ha," 1s ease-in-out ").concat(t,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:n?"1em":null,height:"1em",verticalAlign:"top",width:"1em"},"")})},ga=function(e){var t=e.className,n=e.cx,r=e.getStyles,a=e.innerProps,o=e.isRtl;return Object(xr.c)("div",s({},a,{css:r("loadingIndicator",e),className:n({indicator:!0,"loading-indicator":!0},t)}),Object(xr.c)(ya,{delay:0,offset:o}),Object(xr.c)(ya,{delay:160,offset:!0}),Object(xr.c)(ya,{delay:320,offset:!o}))};ga.defaultProps={size:4};function va(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ba(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?va(Object(n),!0).forEach((function(t){Object(Tr.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):va(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function wa(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ea(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?wa(Object(n),!0).forEach((function(t){Object(Tr.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wa(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Oa=function(e){return{label:"input",background:0,border:0,fontSize:"inherit",opacity:e?0:1,outline:0,padding:0,color:"inherit"}};function ka(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Sa(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ka(Object(n),!0).forEach((function(t){Object(Tr.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ka(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var xa=function(e){var t=e.children,n=e.innerProps;return Object(xr.c)("div",n,t)},_a=xa,ja=xa;var Pa=function(e){var t=e.children,n=e.className,r=e.components,a=e.cx,o=e.data,i=e.getStyles,l=e.innerProps,c=e.isDisabled,u=e.removeProps,s=e.selectProps,f=r.Container,p=r.Label,d=r.Remove;return Object(xr.c)(xr.b,null,(function(r){var m=r.css,h=r.cx;return Object(xr.c)(f,{data:o,innerProps:Sa(Sa({},l),{},{className:h(m(i("multiValue",e)),a({"multi-value":!0,"multi-value--is-disabled":c},n))}),selectProps:s},Object(xr.c)(p,{data:o,innerProps:{className:h(m(i("multiValueLabel",e)),a({"multi-value__label":!0},n))},selectProps:s},t),Object(xr.c)(d,{data:o,innerProps:Sa({className:h(m(i("multiValueRemove",e)),a({"multi-value__remove":!0},n))},u),selectProps:s}))}))};Pa.defaultProps={cropWithEllipsis:!0};function Ca(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ta(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ca(Object(n),!0).forEach((function(t){Object(Tr.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ca(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}for(var Aa={ClearIndicator:function(e){var t=e.children,n=e.className,r=e.cx,a=e.getStyles,o=e.innerProps;return Object(xr.c)("div",s({},o,{css:a("clearIndicator",e),className:r({indicator:!0,"clear-indicator":!0},n)}),t||Object(xr.c)(sa,null))},Control:function(e){var t=e.children,n=e.cx,r=e.getStyles,a=e.className,o=e.isDisabled,i=e.isFocused,l=e.innerRef,c=e.innerProps,u=e.menuIsOpen;return Object(xr.c)("div",s({ref:l,css:r("control",e),className:n({control:!0,"control--is-disabled":o,"control--is-focused":i,"control--menu-is-open":u},a)},c),t)},DropdownIndicator:function(e){var t=e.children,n=e.className,r=e.cx,a=e.getStyles,o=e.innerProps;return Object(xr.c)("div",s({},o,{css:a("dropdownIndicator",e),className:r({indicator:!0,"dropdown-indicator":!0},n)}),t||Object(xr.c)(fa,null))},DownChevron:fa,CrossIcon:sa,Group:function(e){var t=e.children,n=e.className,r=e.cx,a=e.getStyles,o=e.Heading,i=e.headingProps,l=e.label,c=e.theme,u=e.selectProps;return Object(xr.c)("div",{css:a("group",e),className:r({group:!0},n)},Object(xr.c)(o,s({},i,{selectProps:u,theme:c,getStyles:a,cx:r}),l),Object(xr.c)("div",null,t))},GroupHeading:function(e){var t=e.className,n=e.cx,r=e.getStyles,a=e.theme,o=(e.selectProps,_r(e,["className","cx","getStyles","theme","selectProps"]));return Object(xr.c)("div",s({css:r("groupHeading",ba({theme:a},o)),className:n({"group-heading":!0},t)},o))},IndicatorsContainer:function(e){var t=e.children,n=e.className,r=e.cx,a=e.getStyles;return Object(xr.c)("div",{css:a("indicatorsContainer",e),className:r({indicators:!0},n)},t)},IndicatorSeparator:function(e){var t=e.className,n=e.cx,r=e.getStyles,a=e.innerProps;return Object(xr.c)("span",s({},a,{css:r("indicatorSeparator",e),className:n({"indicator-separator":!0},t)}))},Input:function(e){var t=e.className,n=e.cx,r=e.getStyles,a=e.innerRef,o=e.isHidden,i=e.isDisabled,l=e.theme,c=(e.selectProps,_r(e,["className","cx","getStyles","innerRef","isHidden","isDisabled","theme","selectProps"]));return Object(xr.c)("div",{css:r("input",Ea({theme:l},c))},Object(xr.c)(Ir.a,s({className:n({input:!0},t),inputRef:a,inputStyle:Oa(o),disabled:i},c)))},LoadingIndicator:ga,Menu:function(e){var t=e.children,n=e.className,r=e.cx,a=e.getStyles,o=e.innerRef,i=e.innerProps;return Object(xr.c)("div",s({css:a("menu",e),className:r({menu:!0},n)},i,{ref:o}),t)},MenuList:function(e){var t=e.children,n=e.className,r=e.cx,a=e.getStyles,o=e.isMulti,i=e.innerRef;return Object(xr.c)("div",{css:a("menuList",e),className:r({"menu-list":!0,"menu-list--is-multi":o},n),ref:i},t)},MenuPortal:na,LoadingMessage:ta,NoOptionsMessage:ea,MultiValue:Pa,MultiValueContainer:_a,MultiValueLabel:ja,MultiValueRemove:function(e){var t=e.children,n=e.innerProps;return Object(xr.c)("div",n,t||Object(xr.c)(sa,{size:14}))},Option:function(e){var t=e.children,n=e.className,r=e.cx,a=e.getStyles,o=e.isDisabled,i=e.isFocused,l=e.isSelected,c=e.innerRef,u=e.innerProps;return Object(xr.c)("div",s({css:a("option",e),className:r({option:!0,"option--is-disabled":o,"option--is-focused":i,"option--is-selected":l},n),ref:c},u),t)},Placeholder:function(e){var t=e.children,n=e.className,r=e.cx,a=e.getStyles,o=e.innerProps;return Object(xr.c)("div",s({css:a("placeholder",e),className:r({placeholder:!0},n)},o),t)},SelectContainer:function(e){var t=e.children,n=e.className,r=e.cx,a=e.getStyles,o=e.innerProps,i=e.isDisabled,l=e.isRtl;return Object(xr.c)("div",s({css:a("container",e),className:r({"--is-disabled":i,"--is-rtl":l},n)},o),t)},SingleValue:function(e){var t=e.children,n=e.className,r=e.cx,a=e.getStyles,o=e.isDisabled,i=e.innerProps;return Object(xr.c)("div",s({css:a("singleValue",e),className:r({"single-value":!0,"single-value--is-disabled":o},n)},i),t)},ValueContainer:function(e){var t=e.children,n=e.className,r=e.cx,a=e.isMulti,o=e.getStyles,i=e.hasValue;return Object(xr.c)("div",{css:o("valueContainer",e),className:r({"value-container":!0,"value-container--is-multi":a,"value-container--has-value":i},n)},t)}},Na=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],Ia=new RegExp("["+Na.map((function(e){return e.letters})).join("")+"]","g"),La={},Da=0;Da<Na.length;Da++)for(var Ra=Na[Da],Ma=0;Ma<Ra.letters.length;Ma++)La[Ra.letters[Ma]]=Ra.base;var Fa=function(e){return e.replace(Ia,(function(e){return La[e]}))};function za(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var Ua=function(e){return e.replace(/^\s+|\s+$/g,"")},Ba=function(e){return"".concat(e.label," ").concat(e.value)};var Va={name:"1laao21-a11yText",styles:"label:a11yText;z-index:9999;border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0;white-space:nowrap;"},Wa=function(e){return Object(xr.c)("span",s({css:Va},e))};function Ha(e){e.in,e.out,e.onExited,e.appear,e.enter,e.exit;var t=e.innerRef,n=(e.emotion,_r(e,["in","out","onExited","appear","enter","exit","innerRef","emotion"]));return Object(xr.c)("input",s({ref:t},n,{css:Object(Ar.a)({label:"dummyInput",background:0,border:0,fontSize:"inherit",outline:0,padding:0,width:1,color:"transparent",left:-100,opacity:0,position:"relative",transform:"scale(0)"},"")}))}function $a(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Or(e);if(t){var a=Or(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Er(this,n)}}var qa=function(e){vr(n,e);var t=$a(n);function n(){return mr(this,n),t.apply(this,arguments)}return yr(n,[{key:"componentDidMount",value:function(){this.props.innerRef(Object(l.findDOMNode)(this))}},{key:"componentWillUnmount",value:function(){this.props.innerRef(null)}},{key:"render",value:function(){return this.props.children}}]),n}(o.Component),Ka=["boxSizing","height","overflow","paddingRight","position"],Qa={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function Ga(e){e.preventDefault()}function Ya(e){e.stopPropagation()}function Xa(){var e=this.scrollTop,t=this.scrollHeight,n=e+this.offsetHeight;0===e?this.scrollTop=1:n===t&&(this.scrollTop=e-1)}function Ja(){return"ontouchstart"in window||navigator.maxTouchPoints}function Za(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Or(e);if(t){var a=Or(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Er(this,n)}}var eo=!(!window.document||!window.document.createElement),to=0,no=function(e){vr(n,e);var t=Za(n);function n(){var e;mr(this,n);for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];return(e=t.call.apply(t,[this].concat(a))).originalStyles={},e.listenerOptions={capture:!1,passive:!1},e}return yr(n,[{key:"componentDidMount",value:function(){var e=this;if(eo){var t=this.props,n=t.accountForScrollbars,r=t.touchScrollTarget,a=document.body,o=a&&a.style;if(n&&Ka.forEach((function(t){var n=o&&o[t];e.originalStyles[t]=n})),n&&to<1){var i=parseInt(this.originalStyles.paddingRight,10)||0,l=document.body?document.body.clientWidth:0,c=window.innerWidth-l+i||0;Object.keys(Qa).forEach((function(e){var t=Qa[e];o&&(o[e]=t)})),o&&(o.paddingRight="".concat(c,"px"))}a&&Ja()&&(a.addEventListener("touchmove",Ga,this.listenerOptions),r&&(r.addEventListener("touchstart",Xa,this.listenerOptions),r.addEventListener("touchmove",Ya,this.listenerOptions))),to+=1}}},{key:"componentWillUnmount",value:function(){var e=this;if(eo){var t=this.props,n=t.accountForScrollbars,r=t.touchScrollTarget,a=document.body,o=a&&a.style;to=Math.max(to-1,0),n&&to<1&&Ka.forEach((function(t){var n=e.originalStyles[t];o&&(o[t]=n)})),a&&Ja()&&(a.removeEventListener("touchmove",Ga,this.listenerOptions),r&&(r.removeEventListener("touchstart",Xa,this.listenerOptions),r.removeEventListener("touchmove",Ya,this.listenerOptions)))}}},{key:"render",value:function(){return null}}]),n}(o.Component);function ro(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Or(e);if(t){var a=Or(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Er(this,n)}}no.defaultProps={accountForScrollbars:!0};var ao={name:"1dsbpcp",styles:"position:fixed;left:0;bottom:0;right:0;top:0;"},oo=function(e){vr(n,e);var t=ro(n);function n(){var e;mr(this,n);for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];return(e=t.call.apply(t,[this].concat(a))).state={touchScrollTarget:null},e.getScrollTarget=function(t){t!==e.state.touchScrollTarget&&e.setState({touchScrollTarget:t})},e.blurSelectInput=function(){document.activeElement&&document.activeElement.blur()},e}return yr(n,[{key:"render",value:function(){var e=this.props,t=e.children,n=e.isEnabled,r=this.state.touchScrollTarget;return n?Object(xr.c)("div",null,Object(xr.c)("div",{onClick:this.blurSelectInput,css:ao}),Object(xr.c)(qa,{innerRef:this.getScrollTarget},t),r?Object(xr.c)(no,{touchScrollTarget:r}):null):t}}]),n}(o.PureComponent);function io(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Or(e);if(t){var a=Or(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Er(this,n)}}var lo=function(e){vr(n,e);var t=io(n);function n(){var e;mr(this,n);for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];return(e=t.call.apply(t,[this].concat(a))).isBottom=!1,e.isTop=!1,e.scrollTarget=void 0,e.touchStart=void 0,e.cancelScroll=function(e){e.preventDefault(),e.stopPropagation()},e.handleEventDelta=function(t,n){var r=e.props,a=r.onBottomArrive,o=r.onBottomLeave,i=r.onTopArrive,l=r.onTopLeave,c=e.scrollTarget,u=c.scrollTop,s=c.scrollHeight,f=c.clientHeight,p=e.scrollTarget,d=n>0,m=s-f-u,h=!1;m>n&&e.isBottom&&(o&&o(t),e.isBottom=!1),d&&e.isTop&&(l&&l(t),e.isTop=!1),d&&n>m?(a&&!e.isBottom&&a(t),p.scrollTop=s,h=!0,e.isBottom=!0):!d&&-n>u&&(i&&!e.isTop&&i(t),p.scrollTop=0,h=!0,e.isTop=!0),h&&e.cancelScroll(t)},e.onWheel=function(t){e.handleEventDelta(t,t.deltaY)},e.onTouchStart=function(t){e.touchStart=t.changedTouches[0].clientY},e.onTouchMove=function(t){var n=e.touchStart-t.changedTouches[0].clientY;e.handleEventDelta(t,n)},e.getScrollTarget=function(t){e.scrollTarget=t},e}return yr(n,[{key:"componentDidMount",value:function(){this.startListening(this.scrollTarget)}},{key:"componentWillUnmount",value:function(){this.stopListening(this.scrollTarget)}},{key:"startListening",value:function(e){e&&("function"==typeof e.addEventListener&&e.addEventListener("wheel",this.onWheel,!1),"function"==typeof e.addEventListener&&e.addEventListener("touchstart",this.onTouchStart,!1),"function"==typeof e.addEventListener&&e.addEventListener("touchmove",this.onTouchMove,!1))}},{key:"stopListening",value:function(e){"function"==typeof e.removeEventListener&&e.removeEventListener("wheel",this.onWheel,!1),"function"==typeof e.removeEventListener&&e.removeEventListener("touchstart",this.onTouchStart,!1),"function"==typeof e.removeEventListener&&e.removeEventListener("touchmove",this.onTouchMove,!1)}},{key:"render",value:function(){return i.a.createElement(qa,{innerRef:this.getScrollTarget},this.props.children)}}]),n}(o.Component);function co(e){var t=e.isEnabled,n=void 0===t||t,r=_r(e,["isEnabled"]);return n?i.a.createElement(lo,r):r.children}var uo=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.isSearchable,r=t.isMulti,a=t.label,o=t.isDisabled;switch(e){case"menu":return"Use Up and Down to choose options".concat(o?"":", press Enter to select the currently focused option",", press Escape to exit the menu, press Tab to select the option and exit the menu.");case"input":return"".concat(a||"Select"," is focused ").concat(n?",type to refine list":"",", press Down to open the menu, ").concat(r?" press left to focus selected values":"");case"value":return"Use left and right to toggle between focused values, press Backspace to remove the currently focused value"}},so=function(e,t){var n=t.value,r=t.isDisabled;if(n)switch(e){case"deselect-option":case"pop-value":case"remove-value":return"option ".concat(n,", deselected.");case"select-option":return"option ".concat(n,r?" is disabled. Select another option.":", selected.")}},fo=function(e){return!!e.isDisabled};var po={clearIndicator:ma,container:function(e){var t=e.isDisabled;return{label:"container",direction:e.isRtl?"rtl":null,pointerEvents:t?"none":null,position:"relative"}},control:function(e){var t=e.isDisabled,n=e.isFocused,r=e.theme,a=r.colors,o=r.borderRadius,i=r.spacing;return{label:"control",alignItems:"center",backgroundColor:t?a.neutral5:a.neutral0,borderColor:t?a.neutral10:n?a.primary:a.neutral20,borderRadius:o,borderStyle:"solid",borderWidth:1,boxShadow:n?"0 0 0 1px ".concat(a.primary):null,cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:i.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms","&:hover":{borderColor:n?a.primary:a.neutral30}}},dropdownIndicator:da,group:function(e){var t=e.theme.spacing;return{paddingBottom:2*t.baseUnit,paddingTop:2*t.baseUnit}},groupHeading:function(e){var t=e.theme.spacing;return{label:"group",color:"#999",cursor:"default",display:"block",fontSize:"75%",fontWeight:"500",marginBottom:"0.25em",paddingLeft:3*t.baseUnit,paddingRight:3*t.baseUnit,textTransform:"uppercase"}},indicatorsContainer:function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},indicatorSeparator:function(e){var t=e.isDisabled,n=e.theme,r=n.spacing.baseUnit,a=n.colors;return{label:"indicatorSeparator",alignSelf:"stretch",backgroundColor:t?a.neutral10:a.neutral20,marginBottom:2*r,marginTop:2*r,width:1}},input:function(e){var t=e.isDisabled,n=e.theme,r=n.spacing,a=n.colors;return{margin:r.baseUnit/2,paddingBottom:r.baseUnit/2,paddingTop:r.baseUnit/2,visibility:t?"hidden":"visible",color:a.neutral80}},loadingIndicator:function(e){var t=e.isFocused,n=e.size,r=e.theme,a=r.colors,o=r.spacing.baseUnit;return{label:"loadingIndicator",color:t?a.neutral60:a.neutral20,display:"flex",padding:2*o,transition:"color 150ms",alignSelf:"center",fontSize:n,lineHeight:1,marginRight:n,textAlign:"center",verticalAlign:"middle"}},loadingMessage:Zr,menu:function(e){var t,n=e.placement,r=e.theme,a=r.borderRadius,o=r.spacing,i=r.colors;return t={label:"menu"},Object(Tr.a)(t,function(e){return e?{bottom:"top",top:"bottom"}[e]:"bottom"}(n),"100%"),Object(Tr.a)(t,"backgroundColor",i.neutral0),Object(Tr.a)(t,"borderRadius",a),Object(Tr.a)(t,"boxShadow","0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)"),Object(Tr.a)(t,"marginBottom",o.menuGutter),Object(Tr.a)(t,"marginTop",o.menuGutter),Object(Tr.a)(t,"position","absolute"),Object(Tr.a)(t,"width","100%"),Object(Tr.a)(t,"zIndex",1),t},menuList:function(e){var t=e.maxHeight,n=e.theme.spacing.baseUnit;return{maxHeight:t,overflowY:"auto",paddingBottom:n,paddingTop:n,position:"relative",WebkitOverflowScrolling:"touch"}},menuPortal:function(e){var t=e.rect,n=e.offset,r=e.position;return{left:t.left,position:r,top:n,width:t.width,zIndex:1}},multiValue:function(e){var t=e.theme,n=t.spacing,r=t.borderRadius;return{label:"multiValue",backgroundColor:t.colors.neutral10,borderRadius:r/2,display:"flex",margin:n.baseUnit/2,minWidth:0}},multiValueLabel:function(e){var t=e.theme,n=t.borderRadius,r=t.colors,a=e.cropWithEllipsis;return{borderRadius:n/2,color:r.neutral80,fontSize:"85%",overflow:"hidden",padding:3,paddingLeft:6,textOverflow:a?"ellipsis":null,whiteSpace:"nowrap"}},multiValueRemove:function(e){var t=e.theme,n=t.spacing,r=t.borderRadius,a=t.colors;return{alignItems:"center",borderRadius:r/2,backgroundColor:e.isFocused&&a.dangerLight,display:"flex",paddingLeft:n.baseUnit,paddingRight:n.baseUnit,":hover":{backgroundColor:a.dangerLight,color:a.danger}}},noOptionsMessage:Jr,option:function(e){var t=e.isDisabled,n=e.isFocused,r=e.isSelected,a=e.theme,o=a.spacing,i=a.colors;return{label:"option",backgroundColor:r?i.primary:n?i.primary25:"transparent",color:t?i.neutral20:r?i.neutral0:"inherit",cursor:"default",display:"block",fontSize:"inherit",padding:"".concat(2*o.baseUnit,"px ").concat(3*o.baseUnit,"px"),width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)",":active":{backgroundColor:!t&&(r?i.primary:i.primary50)}}},placeholder:function(e){var t=e.theme,n=t.spacing;return{label:"placeholder",color:t.colors.neutral50,marginLeft:n.baseUnit/2,marginRight:n.baseUnit/2,position:"absolute",top:"50%",transform:"translateY(-50%)"}},singleValue:function(e){var t=e.isDisabled,n=e.theme,r=n.spacing,a=n.colors;return{label:"singleValue",color:t?a.neutral40:a.neutral80,marginLeft:r.baseUnit/2,marginRight:r.baseUnit/2,maxWidth:"calc(100% - ".concat(2*r.baseUnit,"px)"),overflow:"hidden",position:"absolute",textOverflow:"ellipsis",whiteSpace:"nowrap",top:"50%",transform:"translateY(-50%)"}},valueContainer:function(e){var t=e.theme.spacing;return{alignItems:"center",display:"flex",flex:1,flexWrap:"wrap",padding:"".concat(t.baseUnit/2,"px ").concat(2*t.baseUnit,"px"),WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"}}};var mo={borderRadius:4,colors:{primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},spacing:{baseUnit:4,controlHeight:38,menuGutter:8}};function ho(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function yo(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ho(Object(n),!0).forEach((function(t){Object(Tr.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ho(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function go(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Or(e);if(t){var a=Or(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Er(this,n)}}var vo,bo={backspaceRemovesValue:!0,blurInputOnSelect:Wr(),captureMenuScroll:!Wr(),closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:function(e,t){var n=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?za(Object(n),!0).forEach((function(t){Object(Tr.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):za(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({ignoreCase:!0,ignoreAccents:!0,stringify:Ba,trim:!0,matchFrom:"any"},vo),r=n.ignoreCase,a=n.ignoreAccents,o=n.stringify,i=n.trim,l=n.matchFrom,c=i?Ua(t):t,u=i?Ua(o(e)):o(e);return r&&(c=c.toLowerCase(),u=u.toLowerCase()),a&&(c=Fa(c),u=Fa(u)),"start"===l?u.substr(0,c.length)===c:u.indexOf(c)>-1},formatGroupLabel:function(e){return e.label},getOptionLabel:function(e){return e.label},getOptionValue:function(e){return e.value},isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:fo,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!function(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch(e){return!1}}(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(e){var t=e.count;return"".concat(t," result").concat(1!==t?"s":""," available")},styles:{},tabIndex:"0",tabSelectsValue:!0},wo=1,Eo=function(e){vr(n,e);var t=go(n);function n(e){var r;mr(this,n),(r=t.call(this,e)).state={ariaLiveSelection:"",ariaLiveContext:"",focusedOption:null,focusedValue:null,inputIsHidden:!1,isFocused:!1,menuOptions:{render:[],focusable:[]},selectValue:[]},r.blockOptionHover=!1,r.isComposing=!1,r.clearFocusValueOnUpdate=!1,r.commonProps=void 0,r.components=void 0,r.hasGroups=!1,r.initialTouchX=0,r.initialTouchY=0,r.inputIsHiddenAfterUpdate=void 0,r.instancePrefix="",r.openAfterFocus=!1,r.scrollToFocusedOptionOnUpdate=!1,r.userIsDragging=void 0,r.controlRef=null,r.getControlRef=function(e){r.controlRef=e},r.focusedOptionRef=null,r.getFocusedOptionRef=function(e){r.focusedOptionRef=e},r.menuListRef=null,r.getMenuListRef=function(e){r.menuListRef=e},r.inputRef=null,r.getInputRef=function(e){r.inputRef=e},r.cacheComponents=function(e){var t;r.components=(t={components:e},Ta(Ta({},Aa),t.components))},r.focus=r.focusInput,r.blur=r.blurInput,r.onChange=function(e,t){var n=r.props,a=n.onChange,o=n.name;a(e,yo(yo({},t),{},{name:o}))},r.setValue=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"set-value",n=arguments.length>2?arguments[2]:void 0,a=r.props,o=a.closeMenuOnSelect,i=a.isMulti;r.onInputChange("",{action:"set-value"}),o&&(r.inputIsHiddenAfterUpdate=!i,r.onMenuClose()),r.clearFocusValueOnUpdate=!0,r.onChange(e,{action:t,option:n})},r.selectOption=function(e){var t=r.props,n=t.blurInputOnSelect,a=t.isMulti,o=r.state.selectValue;if(a)if(r.isOptionSelected(e,o)){var i=r.getOptionValue(e);r.setValue(o.filter((function(e){return r.getOptionValue(e)!==i})),"deselect-option",e),r.announceAriaLiveSelection({event:"deselect-option",context:{value:r.getOptionLabel(e)}})}else r.isOptionDisabled(e,o)?r.announceAriaLiveSelection({event:"select-option",context:{value:r.getOptionLabel(e),isDisabled:!0}}):(r.setValue([].concat(Object(Cr.a)(o),[e]),"select-option",e),r.announceAriaLiveSelection({event:"select-option",context:{value:r.getOptionLabel(e)}}));else r.isOptionDisabled(e,o)?r.announceAriaLiveSelection({event:"select-option",context:{value:r.getOptionLabel(e),isDisabled:!0}}):(r.setValue(e,"select-option"),r.announceAriaLiveSelection({event:"select-option",context:{value:r.getOptionLabel(e)}}));n&&r.blurInput()},r.removeValue=function(e){var t=r.state.selectValue,n=r.getOptionValue(e),a=t.filter((function(e){return r.getOptionValue(e)!==n}));r.onChange(a.length?a:null,{action:"remove-value",removedValue:e}),r.announceAriaLiveSelection({event:"remove-value",context:{value:e?r.getOptionLabel(e):""}}),r.focusInput()},r.clearValue=function(){var e=r.props.isMulti;r.onChange(e?[]:null,{action:"clear"})},r.popValue=function(){var e=r.state.selectValue,t=e[e.length-1],n=e.slice(0,e.length-1);r.announceAriaLiveSelection({event:"pop-value",context:{value:t?r.getOptionLabel(t):""}}),r.onChange(n.length?n:null,{action:"pop-value",removedValue:t})},r.getOptionLabel=function(e){return r.props.getOptionLabel(e)},r.getOptionValue=function(e){return r.props.getOptionValue(e)},r.getStyles=function(e,t){var n=po[e](t);n.boxSizing="border-box";var a=r.props.styles[e];return a?a(n,t):n},r.getElementId=function(e){return"".concat(r.instancePrefix,"-").concat(e)},r.getActiveDescendentId=function(){var e=r.props.menuIsOpen,t=r.state,n=t.menuOptions,a=t.focusedOption;if(a&&e){var o=n.focusable.indexOf(a),i=n.render[o];return i&&i.key}},r.announceAriaLiveSelection=function(e){var t=e.event,n=e.context;r.setState({ariaLiveSelection:so(t,n)})},r.announceAriaLiveContext=function(e){var t=e.event,n=e.context;r.setState({ariaLiveContext:uo(t,yo(yo({},n),{},{label:r.props["aria-label"]}))})},r.onMenuMouseDown=function(e){0===e.button&&(e.stopPropagation(),e.preventDefault(),r.focusInput())},r.onMenuMouseMove=function(e){r.blockOptionHover=!1},r.onControlMouseDown=function(e){var t=r.props.openMenuOnClick;r.state.isFocused?r.props.menuIsOpen?"INPUT"!==e.target.tagName&&"TEXTAREA"!==e.target.tagName&&r.onMenuClose():t&&r.openMenu("first"):(t&&(r.openAfterFocus=!0),r.focusInput()),"INPUT"!==e.target.tagName&&"TEXTAREA"!==e.target.tagName&&e.preventDefault()},r.onDropdownIndicatorMouseDown=function(e){if(!(e&&"mousedown"===e.type&&0!==e.button||r.props.isDisabled)){var t=r.props,n=t.isMulti,a=t.menuIsOpen;r.focusInput(),a?(r.inputIsHiddenAfterUpdate=!n,r.onMenuClose()):r.openMenu("first"),e.preventDefault(),e.stopPropagation()}},r.onClearIndicatorMouseDown=function(e){e&&"mousedown"===e.type&&0!==e.button||(r.clearValue(),e.stopPropagation(),r.openAfterFocus=!1,"touchend"===e.type?r.focusInput():setTimeout((function(){return r.focusInput()})))},r.onScroll=function(e){"boolean"==typeof r.props.closeMenuOnScroll?e.target instanceof HTMLElement&&Fr(e.target)&&r.props.onMenuClose():"function"==typeof r.props.closeMenuOnScroll&&r.props.closeMenuOnScroll(e)&&r.props.onMenuClose()},r.onCompositionStart=function(){r.isComposing=!0},r.onCompositionEnd=function(){r.isComposing=!1},r.onTouchStart=function(e){var t=e.touches,n=t&&t.item(0);n&&(r.initialTouchX=n.clientX,r.initialTouchY=n.clientY,r.userIsDragging=!1)},r.onTouchMove=function(e){var t=e.touches,n=t&&t.item(0);if(n){var a=Math.abs(n.clientX-r.initialTouchX),o=Math.abs(n.clientY-r.initialTouchY);r.userIsDragging=a>5||o>5}},r.onTouchEnd=function(e){r.userIsDragging||(r.controlRef&&!r.controlRef.contains(e.target)&&r.menuListRef&&!r.menuListRef.contains(e.target)&&r.blurInput(),r.initialTouchX=0,r.initialTouchY=0)},r.onControlTouchEnd=function(e){r.userIsDragging||r.onControlMouseDown(e)},r.onClearIndicatorTouchEnd=function(e){r.userIsDragging||r.onClearIndicatorMouseDown(e)},r.onDropdownIndicatorTouchEnd=function(e){r.userIsDragging||r.onDropdownIndicatorMouseDown(e)},r.handleInputChange=function(e){var t=e.currentTarget.value;r.inputIsHiddenAfterUpdate=!1,r.onInputChange(t,{action:"input-change"}),r.props.menuIsOpen||r.onMenuOpen()},r.onInputFocus=function(e){var t=r.props,n=t.isSearchable,a=t.isMulti;r.props.onFocus&&r.props.onFocus(e),r.inputIsHiddenAfterUpdate=!1,r.announceAriaLiveContext({event:"input",context:{isSearchable:n,isMulti:a}}),r.setState({isFocused:!0}),(r.openAfterFocus||r.props.openMenuOnFocus)&&r.openMenu("first"),r.openAfterFocus=!1},r.onInputBlur=function(e){r.menuListRef&&r.menuListRef.contains(document.activeElement)?r.inputRef.focus():(r.props.onBlur&&r.props.onBlur(e),r.onInputChange("",{action:"input-blur"}),r.onMenuClose(),r.setState({focusedValue:null,isFocused:!1}))},r.onOptionHover=function(e){r.blockOptionHover||r.state.focusedOption===e||r.setState({focusedOption:e})},r.shouldHideSelectedOptions=function(){var e=r.props,t=e.hideSelectedOptions,n=e.isMulti;return void 0===t?n:t},r.onKeyDown=function(e){var t=r.props,n=t.isMulti,a=t.backspaceRemovesValue,o=t.escapeClearsValue,i=t.inputValue,l=t.isClearable,c=t.isDisabled,u=t.menuIsOpen,s=t.onKeyDown,f=t.tabSelectsValue,p=t.openMenuOnFocus,d=r.state,m=d.focusedOption,h=d.focusedValue,y=d.selectValue;if(!(c||"function"==typeof s&&(s(e),e.defaultPrevented))){switch(r.blockOptionHover=!0,e.key){case"ArrowLeft":if(!n||i)return;r.focusValue("previous");break;case"ArrowRight":if(!n||i)return;r.focusValue("next");break;case"Delete":case"Backspace":if(i)return;if(h)r.removeValue(h);else{if(!a)return;n?r.popValue():l&&r.clearValue()}break;case"Tab":if(r.isComposing)return;if(e.shiftKey||!u||!f||!m||p&&r.isOptionSelected(m,y))return;r.selectOption(m);break;case"Enter":if(229===e.keyCode)break;if(u){if(!m)return;if(r.isComposing)return;r.selectOption(m);break}return;case"Escape":u?(r.inputIsHiddenAfterUpdate=!1,r.onInputChange("",{action:"menu-close"}),r.onMenuClose()):l&&o&&r.clearValue();break;case" ":if(i)return;if(!u){r.openMenu("first");break}if(!m)return;r.selectOption(m);break;case"ArrowUp":u?r.focusOption("up"):r.openMenu("last");break;case"ArrowDown":u?r.focusOption("down"):r.openMenu("first");break;case"PageUp":if(!u)return;r.focusOption("pageup");break;case"PageDown":if(!u)return;r.focusOption("pagedown");break;case"Home":if(!u)return;r.focusOption("first");break;case"End":if(!u)return;r.focusOption("last");break;default:return}e.preventDefault()}},r.buildMenuOptions=function(e,t){var n=e.inputValue,a=void 0===n?"":n,o=e.options,i=function(e,n){var o=r.isOptionDisabled(e,t),i=r.isOptionSelected(e,t),l=r.getOptionLabel(e),c=r.getOptionValue(e);if(!(r.shouldHideSelectedOptions()&&i||!r.filterOption({label:l,value:c,data:e},a))){var u=o?void 0:function(){return r.onOptionHover(e)},s=o?void 0:function(){return r.selectOption(e)},f="".concat(r.getElementId("option"),"-").concat(n);return{innerProps:{id:f,onClick:s,onMouseMove:u,onMouseOver:u,tabIndex:-1},data:e,isDisabled:o,isSelected:i,key:f,label:l,type:"option",value:c}}};return o.reduce((function(e,t,n){if(t.options){r.hasGroups||(r.hasGroups=!0);var a=t.options.map((function(t,r){var a=i(t,"".concat(n,"-").concat(r));return a&&e.focusable.push(t),a})).filter(Boolean);if(a.length){var o="".concat(r.getElementId("group"),"-").concat(n);e.render.push({type:"group",key:o,data:t,options:a})}}else{var l=i(t,"".concat(n));l&&(e.render.push(l),e.focusable.push(t))}return e}),{render:[],focusable:[]})};var a=e.value;r.cacheComponents=Sr(r.cacheComponents,ia).bind(wr(r)),r.cacheComponents(e.components),r.instancePrefix="react-select-"+(r.props.instanceId||++wo);var o=Mr(a);r.buildMenuOptions=Sr(r.buildMenuOptions,(function(e,t){var n=Pr(e,2),r=n[0],a=n[1],o=Pr(t,2),i=o[0];return ia(a,o[1])&&ia(r.inputValue,i.inputValue)&&ia(r.options,i.options)})).bind(wr(r));var i=e.menuIsOpen?r.buildMenuOptions(e,o):{render:[],focusable:[]};return r.state.menuOptions=i,r.state.selectValue=o,r}return yr(n,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput()}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){var t=this.props,n=t.options,r=t.value,a=t.menuIsOpen,o=t.inputValue;if(this.cacheComponents(e.components),e.value!==r||e.options!==n||e.menuIsOpen!==a||e.inputValue!==o){var i=Mr(e.value),l=e.menuIsOpen?this.buildMenuOptions(e,i):{render:[],focusable:[]},c=this.getNextFocusedValue(i),u=this.getNextFocusedOption(l.focusable);this.setState({menuOptions:l,selectValue:i,focusedOption:u,focusedValue:c})}null!=this.inputIsHiddenAfterUpdate&&(this.setState({inputIsHidden:this.inputIsHiddenAfterUpdate}),delete this.inputIsHiddenAfterUpdate)}},{key:"componentDidUpdate",value:function(e){var t,n,r,a,o,i=this.props,l=i.isDisabled,c=i.menuIsOpen,u=this.state.isFocused;(u&&!l&&e.isDisabled||u&&c&&!e.menuIsOpen)&&this.focusInput(),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(t=this.menuListRef,n=this.focusedOptionRef,r=t.getBoundingClientRect(),a=n.getBoundingClientRect(),o=n.offsetHeight/3,a.bottom+o>r.bottom?Ur(t,Math.min(n.offsetTop+n.clientHeight-t.offsetHeight+o,t.scrollHeight)):a.top-o<r.top&&Ur(t,Math.max(n.offsetTop-o,0)),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){var e=this.props,t=e.isSearchable,n=e.isMulti;this.announceAriaLiveContext({event:"input",context:{isSearchable:t,isMulti:n}}),this.onInputChange("",{action:"menu-close"}),this.props.onMenuClose()}},{key:"onInputChange",value:function(e,t){this.props.onInputChange(e,t)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(e){var t=this,n=this.state,r=n.selectValue,a=n.isFocused,o=this.buildMenuOptions(this.props,r),i=this.props.isMulti,l="first"===e?0:o.focusable.length-1;if(!i){var c=o.focusable.indexOf(r[0]);c>-1&&(l=c)}this.scrollToFocusedOptionOnUpdate=!(a&&this.menuListRef),this.inputIsHiddenAfterUpdate=!1,this.setState({menuOptions:o,focusedValue:null,focusedOption:o.focusable[l]},(function(){t.onMenuOpen(),t.announceAriaLiveContext({event:"menu"})}))}},{key:"focusValue",value:function(e){var t=this.props,n=t.isMulti,r=t.isSearchable,a=this.state,o=a.selectValue,i=a.focusedValue;if(n){this.setState({focusedOption:null});var l=o.indexOf(i);i||(l=-1,this.announceAriaLiveContext({event:"value"}));var c=o.length-1,u=-1;if(o.length){switch(e){case"previous":u=0===l?0:-1===l?c:l-1;break;case"next":l>-1&&l<c&&(u=l+1)}-1===u&&this.announceAriaLiveContext({event:"input",context:{isSearchable:r,isMulti:n}}),this.setState({inputIsHidden:-1!==u,focusedValue:o[u]})}}}},{key:"focusOption",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"first",t=this.props.pageSize,n=this.state,r=n.focusedOption,a=n.menuOptions,o=a.focusable;if(o.length){var i=0,l=o.indexOf(r);r||(l=-1,this.announceAriaLiveContext({event:"menu"})),"up"===e?i=l>0?l-1:o.length-1:"down"===e?i=(l+1)%o.length:"pageup"===e?(i=l-t)<0&&(i=0):"pagedown"===e?(i=l+t)>o.length-1&&(i=o.length-1):"last"===e&&(i=o.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:o[i],focusedValue:null}),this.announceAriaLiveContext({event:"menu",context:{isDisabled:fo(o[i])}})}}},{key:"getTheme",value:function(){return this.props.theme?"function"==typeof this.props.theme?this.props.theme(mo):yo(yo({},mo),this.props.theme):mo}},{key:"getCommonProps",value:function(){var e=this.clearValue,t=this.getStyles,n=this.setValue,r=this.selectOption,a=this.props,o=a.classNamePrefix,i=a.isMulti,l=a.isRtl,c=a.options,u=this.state.selectValue,s=this.hasValue();return{cx:Rr.bind(null,o),clearValue:e,getStyles:t,getValue:function(){return u},hasValue:s,isMulti:i,isRtl:l,options:c,selectOption:r,setValue:n,selectProps:a,theme:this.getTheme()}}},{key:"getNextFocusedValue",value:function(e){if(this.clearFocusValueOnUpdate)return this.clearFocusValueOnUpdate=!1,null;var t=this.state,n=t.focusedValue,r=t.selectValue.indexOf(n);if(r>-1){if(e.indexOf(n)>-1)return n;if(r<e.length)return e[r]}return null}},{key:"getNextFocusedOption",value:function(e){var t=this.state.focusedOption;return t&&e.indexOf(t)>-1?t:e[0]}},{key:"hasValue",value:function(){return this.state.selectValue.length>0}},{key:"hasOptions",value:function(){return!!this.state.menuOptions.render.length}},{key:"countOptions",value:function(){return this.state.menuOptions.focusable.length}},{key:"isClearable",value:function(){var e=this.props,t=e.isClearable,n=e.isMulti;return void 0===t?n:t}},{key:"isOptionDisabled",value:function(e,t){return"function"==typeof this.props.isOptionDisabled&&this.props.isOptionDisabled(e,t)}},{key:"isOptionSelected",value:function(e,t){var n=this;if(t.indexOf(e)>-1)return!0;if("function"==typeof this.props.isOptionSelected)return this.props.isOptionSelected(e,t);var r=this.getOptionValue(e);return t.some((function(e){return n.getOptionValue(e)===r}))}},{key:"filterOption",value:function(e,t){return!this.props.filterOption||this.props.filterOption(e,t)}},{key:"formatOptionLabel",value:function(e,t){if("function"==typeof this.props.formatOptionLabel){var n=this.props.inputValue,r=this.state.selectValue;return this.props.formatOptionLabel(e,{context:t,inputValue:n,selectValue:r})}return this.getOptionLabel(e)}},{key:"formatGroupLabel",value:function(e){return this.props.formatGroupLabel(e)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"constructAriaLiveMessage",value:function(){var e=this.state,t=e.ariaLiveContext,n=e.selectValue,r=e.focusedValue,a=e.focusedOption,o=this.props,i=o.options,l=o.menuIsOpen,c=o.inputValue,u=o.screenReaderStatus,s=r?function(e){var t=e.focusedValue,n=e.getOptionLabel,r=e.selectValue;return"value ".concat(n(t)," focused, ").concat(r.indexOf(t)+1," of ").concat(r.length,".")}({focusedValue:r,getOptionLabel:this.getOptionLabel,selectValue:n}):"",f=a&&l?function(e){var t=e.focusedOption,n=e.getOptionLabel,r=e.options;return"option ".concat(n(t)," focused").concat(t.isDisabled?" disabled":"",", ").concat(r.indexOf(t)+1," of ").concat(r.length,".")}({focusedOption:a,getOptionLabel:this.getOptionLabel,options:i}):"",p=function(e){var t=e.inputValue,n=e.screenReaderMessage;return"".concat(n).concat(t?" for search term "+t:"",".")}({inputValue:c,screenReaderMessage:u({count:this.countOptions()})});return"".concat(s," ").concat(f," ").concat(p," ").concat(t)}},{key:"renderInput",value:function(){var e=this.props,t=e.isDisabled,n=e.isSearchable,r=e.inputId,a=e.inputValue,o=e.tabIndex,l=e.form,c=this.components.Input,u=this.state.inputIsHidden,f=r||this.getElementId("input"),p={"aria-autocomplete":"list","aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"]};if(!n)return i.a.createElement(Ha,s({id:f,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:Lr,onFocus:this.onInputFocus,readOnly:!0,disabled:t,tabIndex:o,form:l,value:""},p));var d=this.commonProps,m=d.cx,h=d.theme,y=d.selectProps;return i.a.createElement(c,s({autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",cx:m,getStyles:this.getStyles,id:f,innerRef:this.getInputRef,isDisabled:t,isHidden:u,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,selectProps:y,spellCheck:"false",tabIndex:o,form:l,theme:h,type:"text",value:a},p))}},{key:"renderPlaceholderOrValue",value:function(){var e=this,t=this.components,n=t.MultiValue,r=t.MultiValueContainer,a=t.MultiValueLabel,o=t.MultiValueRemove,l=t.SingleValue,c=t.Placeholder,u=this.commonProps,f=this.props,p=f.controlShouldRenderValue,d=f.isDisabled,m=f.isMulti,h=f.inputValue,y=f.placeholder,g=this.state,v=g.selectValue,b=g.focusedValue,w=g.isFocused;if(!this.hasValue()||!p)return h?null:i.a.createElement(c,s({},u,{key:"placeholder",isDisabled:d,isFocused:w}),y);if(m)return v.map((function(t,l){var c=t===b;return i.a.createElement(n,s({},u,{components:{Container:r,Label:a,Remove:o},isFocused:c,isDisabled:d,key:e.getOptionValue(t),index:l,removeProps:{onClick:function(){return e.removeValue(t)},onTouchEnd:function(){return e.removeValue(t)},onMouseDown:function(e){e.preventDefault(),e.stopPropagation()}},data:t}),e.formatOptionLabel(t,"value"))}));if(h)return null;var E=v[0];return i.a.createElement(l,s({},u,{data:E,isDisabled:d}),this.formatOptionLabel(E,"value"))}},{key:"renderClearIndicator",value:function(){var e=this.components.ClearIndicator,t=this.commonProps,n=this.props,r=n.isDisabled,a=n.isLoading,o=this.state.isFocused;if(!this.isClearable()||!e||r||!this.hasValue()||a)return null;var l={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return i.a.createElement(e,s({},t,{innerProps:l,isFocused:o}))}},{key:"renderLoadingIndicator",value:function(){var e=this.components.LoadingIndicator,t=this.commonProps,n=this.props,r=n.isDisabled,a=n.isLoading,o=this.state.isFocused;if(!e||!a)return null;return i.a.createElement(e,s({},t,{innerProps:{"aria-hidden":"true"},isDisabled:r,isFocused:o}))}},{key:"renderIndicatorSeparator",value:function(){var e=this.components,t=e.DropdownIndicator,n=e.IndicatorSeparator;if(!t||!n)return null;var r=this.commonProps,a=this.props.isDisabled,o=this.state.isFocused;return i.a.createElement(n,s({},r,{isDisabled:a,isFocused:o}))}},{key:"renderDropdownIndicator",value:function(){var e=this.components.DropdownIndicator;if(!e)return null;var t=this.commonProps,n=this.props.isDisabled,r=this.state.isFocused,a={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return i.a.createElement(e,s({},t,{innerProps:a,isDisabled:n,isFocused:r}))}},{key:"renderMenu",value:function(){var e=this,t=this.components,n=t.Group,r=t.GroupHeading,a=t.Menu,o=t.MenuList,l=t.MenuPortal,c=t.LoadingMessage,u=t.NoOptionsMessage,f=t.Option,p=this.commonProps,d=this.state,m=d.focusedOption,h=d.menuOptions,y=this.props,g=y.captureMenuScroll,v=y.inputValue,b=y.isLoading,w=y.loadingMessage,E=y.minMenuHeight,O=y.maxMenuHeight,k=y.menuIsOpen,S=y.menuPlacement,x=y.menuPosition,_=y.menuPortalTarget,j=y.menuShouldBlockScroll,P=y.menuShouldScrollIntoView,C=y.noOptionsMessage,T=y.onMenuScrollToTop,A=y.onMenuScrollToBottom;if(!k)return null;var N,I=function(t){var n=m===t.data;return t.innerRef=n?e.getFocusedOptionRef:void 0,i.a.createElement(f,s({},p,t,{isFocused:n}),e.formatOptionLabel(t.data,"menu"))};if(this.hasOptions())N=h.render.map((function(t){if("group"===t.type){t.type;var a=_r(t,["type"]),o="".concat(t.key,"-heading");return i.a.createElement(n,s({},p,a,{Heading:r,headingProps:{id:o},label:e.formatGroupLabel(t.data)}),t.options.map((function(e){return I(e)})))}if("option"===t.type)return I(t)}));else if(b){var L=w({inputValue:v});if(null===L)return null;N=i.a.createElement(c,p,L)}else{var D=C({inputValue:v});if(null===D)return null;N=i.a.createElement(u,p,D)}var R={minMenuHeight:E,maxMenuHeight:O,menuPlacement:S,menuPosition:x,menuShouldScrollIntoView:P},M=i.a.createElement(Yr,s({},p,R),(function(t){var n=t.ref,r=t.placerProps,l=r.placement,c=r.maxHeight;return i.a.createElement(a,s({},p,R,{innerRef:n,innerProps:{onMouseDown:e.onMenuMouseDown,onMouseMove:e.onMenuMouseMove},isLoading:b,placement:l}),i.a.createElement(co,{isEnabled:g,onTopArrive:T,onBottomArrive:A},i.a.createElement(oo,{isEnabled:j},i.a.createElement(o,s({},p,{innerRef:e.getMenuListRef,isLoading:b,maxHeight:c}),N))))}));return _||"fixed"===x?i.a.createElement(l,s({},p,{appendTo:_,controlElement:this.controlRef,menuPlacement:S,menuPosition:x}),M):M}},{key:"renderFormField",value:function(){var e=this,t=this.props,n=t.delimiter,r=t.isDisabled,a=t.isMulti,o=t.name,l=this.state.selectValue;if(o&&!r){if(a){if(n){var c=l.map((function(t){return e.getOptionValue(t)})).join(n);return i.a.createElement("input",{name:o,type:"hidden",value:c})}var u=l.length>0?l.map((function(t,n){return i.a.createElement("input",{key:"i-".concat(n),name:o,type:"hidden",value:e.getOptionValue(t)})})):i.a.createElement("input",{name:o,type:"hidden"});return i.a.createElement("div",null,u)}var s=l[0]?this.getOptionValue(l[0]):"";return i.a.createElement("input",{name:o,type:"hidden",value:s})}}},{key:"renderLiveRegion",value:function(){return this.state.isFocused?i.a.createElement(Wa,{"aria-live":"polite"},i.a.createElement("span",{id:"aria-selection-event"}," ",this.state.ariaLiveSelection),i.a.createElement("span",{id:"aria-context"}," ",this.constructAriaLiveMessage())):null}},{key:"render",value:function(){var e=this.components,t=e.Control,n=e.IndicatorsContainer,r=e.SelectContainer,a=e.ValueContainer,o=this.props,l=o.className,c=o.id,u=o.isDisabled,f=o.menuIsOpen,p=this.state.isFocused,d=this.commonProps=this.getCommonProps();return i.a.createElement(r,s({},d,{className:l,innerProps:{id:c,onKeyDown:this.onKeyDown},isDisabled:u,isFocused:p}),this.renderLiveRegion(),i.a.createElement(t,s({},d,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:u,isFocused:p,menuIsOpen:f}),i.a.createElement(a,s({},d,{isDisabled:u}),this.renderPlaceholderOrValue(),this.renderInput()),i.a.createElement(n,s({},d,{isDisabled:u}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}]),n}(o.Component);Eo.defaultProps=bo;n(84);function Oo(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Or(e);if(t){var a=Or(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Er(this,n)}}var ko={defaultInputValue:"",defaultMenuIsOpen:!1,defaultValue:null},So=n(20);function xo(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Or(e);if(t){var a=Or(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Er(this,n)}}o.Component;var _o,jo,Po,Co=(_o=Eo,Po=jo=function(e){vr(n,e);var t=Oo(n);function n(){var e;mr(this,n);for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];return(e=t.call.apply(t,[this].concat(a))).select=void 0,e.state={inputValue:void 0!==e.props.inputValue?e.props.inputValue:e.props.defaultInputValue,menuIsOpen:void 0!==e.props.menuIsOpen?e.props.menuIsOpen:e.props.defaultMenuIsOpen,value:void 0!==e.props.value?e.props.value:e.props.defaultValue},e.onChange=function(t,n){e.callProp("onChange",t,n),e.setState({value:t})},e.onInputChange=function(t,n){var r=e.callProp("onInputChange",t,n);e.setState({inputValue:void 0!==r?r:t})},e.onMenuOpen=function(){e.callProp("onMenuOpen"),e.setState({menuIsOpen:!0})},e.onMenuClose=function(){e.callProp("onMenuClose"),e.setState({menuIsOpen:!1})},e}return yr(n,[{key:"focus",value:function(){this.select.focus()}},{key:"blur",value:function(){this.select.blur()}},{key:"getProp",value:function(e){return void 0!==this.props[e]?this.props[e]:this.state[e]}},{key:"callProp",value:function(e){if("function"==typeof this.props[e]){for(var t,n=arguments.length,r=new Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];return(t=this.props)[e].apply(t,r)}}},{key:"render",value:function(){var e=this,t=this.props,n=(t.defaultInputValue,t.defaultMenuIsOpen,t.defaultValue,_r(t,["defaultInputValue","defaultMenuIsOpen","defaultValue"]));return i.a.createElement(_o,s({},n,{ref:function(t){e.select=t},inputValue:this.getProp("inputValue"),menuIsOpen:this.getProp("menuIsOpen"),onChange:this.onChange,onInputChange:this.onInputChange,onMenuClose:this.onMenuClose,onMenuOpen:this.onMenuOpen,value:this.getProp("value")}))}}]),n}(o.Component),jo.defaultProps=ko,Po);function To(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Ao(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ao(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ao(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var No=wp.i18n.__,Io=tt((function(e){return{currentPath:e.common.currentPath,platform:e.common.platform}}))((function(e){var t=ie(V),n=[{value:"pages",label:i.a.createElement(i.a.Fragment,null,i.a.createElement("span",{className:"tswitcher-icon tswitch-pages"}),No("Pages","templately"))},{value:"blocks",label:i.a.createElement(i.a.Fragment,null,i.a.createElement("span",{className:"tswitcher-icon tswitch-blocks"}),No("Blocks","templately"))},{value:"",label:i.a.createElement(i.a.Fragment,null,i.a.createElement("span",{className:"tswitcher-icon tswitch-packs"}),No("Packs","templately"))},{value:"templates",label:i.a.createElement(i.a.Fragment,null,i.a.createElement("span",{className:"tswitcher-icon tswitch-templates"}),No("Templates","templately"))},{value:"clouds",label:i.a.createElement(i.a.Fragment,null,i.a.createElement("span",{className:"tswitcher-icon tswitch-myclouds"}),No("My Clouds","templately"))}],r=To(Object(o.useState)({value:"blocks",label:i.a.createElement(i.a.Fragment,null,i.a.createElement("span",{className:"tswitcher-icon tswitch-blocks"}),No("Blocks","templately"))}),2),a=r[0],l=r[1];Object(o.useEffect)((function(){for(var e=window.location.href.replace(/^.*\/+/,""),t=i.a.createElement(i.a.Fragment,null,i.a.createElement("span",{className:"tswitcher-icon tswitch-pages"}),No("Packs","templately")),r="",a=0;a<n.length;a++)if(n[a].value===e){r=n[a].value,t=n[a].label;break}l({value:r,label:t})}),[]);return i.a.createElement(i.a.Fragment,null,i.a.createElement("div",{className:"templately-modal-menu"},i.a.createElement("ul",null,"gutenberg"!==e.platform&&i.a.createElement(dr,{to:"/pages",name:No("Pages","templately")}),i.a.createElement(dr,{to:"gutenberg"===e.platform?"/":"/blocks",name:No("Blocks","templately")}),"gutenberg"!==e.platform&&i.a.createElement(dr,{to:"/",name:No("Packs","templately")}),"gutenberg"!==e.platform&&i.a.createElement(dr,{to:"/templates",name:No("Templates","templately")}),i.a.createElement(dr,{className:"efy-clouds-nav",to:"/clouds",name:No("My Cloud","templately")},i.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:"30",height:"30",viewBox:"0 0 30 30"},i.a.createElement("rect",{width:"30",height:"30",fill:"#2fc1e1",rx:"15"}),i.a.createElement("image",{width:"17",height:"12",x:"7",y:"9",xlinkHref:"data:img/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAMCAYAAACEJVa/AAAA4UlEQVQokZ3SsSuFcRTG8efKZJXU3QyY3MHkP7AoEwZlUTYZzP4Co0E2i3/AwiqlbMwGiUW3FCUy+OjNew2398177zOe8/y+nXOeX6qEddz51RN20Ko01wA20MUqJrCIe+wNAnnAUl+tg3eM/fd4Epv4wkhF/xFXWKkD7OKjNJ3UeBawhRcs9zfX8Iz5husWR74tgeO94k2RRhNA6Z/DAS7KADpF8fuPOKCKxHCZ8upTQ0LaxRBFCmdJtoeBJGkneW1hOsl1kuMkh0m6DQGzSY6SnPfGmsEpPsuv3kRv2MfoD02ICAa3FEOHAAAAAElFTkSuQmCC"}))))),i.a.createElement("div",{className:"templately-modal-mobile-menu"},i.a.createElement(Co,{options:n,classNamePrefix:"templately-switcher",onChange:function(n){return function(n){t.push("/"+n.value),l({value:n.value,label:n.label}),e.dispatch(Wn(null)),e.dispatch(Bn(!0)),e.dispatch(tr(null)),e.dispatch(Zn(e.to)),e.dispatch(zn({isOpen:!1,deep:0})),e.dispatch(Hn({activeSidebarMenu:"all",activeParentSidebarMenu:""})),e.dispatch(qn([])),e.dispatch($n([])),e.dispatch(Qn(1)),e.dispatch(Gn(!1))}(n)},value:a,isSearchable:!1})))})),Lo=n(4),Do=n.n(Lo),Ro={open:function(e){c.a.render(e,document.getElementById("templately-gutenberg"))},close:function(){c.a.unmountComponentAtNode(document.getElementById("templately-gutenberg"))}};function Mo(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Fo(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Fo(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Fo(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var zo=wp.i18n.__,Uo=tt((function(e){return{searchQuery:e.common.searchQuery.query,results:e.common.searchQuery.results}}))((function(e){var t=Mo(Object(o.useState)(""),2),n=t[0],r=t[1],a=Mo(Object(o.useState)(!1),2),l=a[0],c=a[1];return Object(o.useEffect)((function(){l&&e.searchQuery.length>0&&(e.dispatch(zn({isOpen:!1,deep:0})),e.dispatch(Zn("/search/".concat(e.searchQuery))),e.dispatch(nr({query:e.searchQuery,isSearching:!0,results:e.results})),c(!1))}),[l]),Object(o.useEffect)((function(){e.dispatch(nr({query:n,isSearching:!1,results:e.results}))}),[n]),i.a.createElement("div",{className:"templately-search-action"},i.a.createElement("input",{type:"text",onKeyDown:function(e){return c(13===e.keyCode)},value:e.searchQuery,onChange:function(e){return r(e.currentTarget.value)},placeholder:zo("Search...","templately")}))}));function Bo(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Vo(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Vo(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Vo(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Wo=tt((function(e){return{platform:e.common.platform}}))((function(e){var t=Bo(Object(o.useState)([{value:"elementor",label:i.a.createElement(i.a.Fragment,null,i.a.createElement("span",{className:"tswitcher-icon tswitch-elementor"}),"Elementor")},{value:"gutenberg",label:i.a.createElement(i.a.Fragment,null,i.a.createElement("span",{className:"tswitcher-icon tswitch-gutenberg"}),"Gutenberg")}]),2),n=t[0],r=(t[1],Bo(Object(o.useState)({value:"elementor",label:i.a.createElement(i.a.Fragment,null,i.a.createElement("span",{className:"tswitcher-icon tswitch-elementor"}),"Elementor")}),2)),a=r[0],l=r[1];return Object(o.useEffect)((function(){e.dispatch({type:"SET_PLATFORM",payload:a.value}),e.dispatch(Qn(1))}),[a]),i.a.createElement(Co,{options:n,classNamePrefix:"templately-switcher",onChange:function(e){return l(e)},value:a,isSearchable:!1})})),Ho=n(8),$o=n.n(Ho),qo=n(52),Ko=n.n(qo);function Qo(e,t,n,r,a,o,i){try{var l=e[o](i),c=l.value}catch(e){return void n(e)}l.done?t(c):Promise.resolve(c).then(r,a)}function Go(e){return(Go="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Yo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Xo(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Yo(Object(n),!0).forEach((function(t){Jo(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Yo(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Jo(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Zo=n(101),ei=Ko()($o.a),ti=TemplatelyAdmin,ni=ti.platform,ri=ti.post_id,ai=ti.nonce,oi=ti.is_editor,ii=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={heightAuto:!1,customClass:{container:"templately-swal"},showConfirmButton:!1};if("string"==typeof e){var r=e;n=Xo(Xo({},n),{},{text:r})}else{var a=e;n=Xo(Xo({},n),{},{html:a})}return t=t!={}?Xo(Xo({},n),t):n,ei.fire(t)},li=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"remote",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r={fileType:"elementor"};n=Xo(Xo({},r),n);var a=new FormData;a.append("action","get_templately"),a.append("content_type","template_content"),a.append("nonce",ai),a.append("source",t),a.append("id",e),void 0!==n.fileType&&a.append("file_type",n.fileType),void 0!==n.is_editor&&a.append("is_editor",n.is_editor);var o=n.fileType;return Do.a.post(ajaxurl,a).then((function(e){if("elementor"===o){if(e.data.success&&e.data.hasOwnProperty("data")){if("undefined"!=typeof elementor){var t=window.TemplatelyIndex;if("undefined"!=typeof $e)for(var n=0;n<e.data.data.content.length;n++)$e.run("document/elements/create",{container:elementor.getPreviewContainer(),model:e.data.data.content[n],options:t>=0?{at:t++}:{}});else{var r=new Backbone.Model({getTitle:function(){return"Test"}});elementor.channels.data.trigger("template:before:insert",r);for(var a=window.TemplatelyIndex,i=0;i<e.data.data.content.length;i++)elementor.getPreviewView().addChildElement(e.data.data.content[i],a>=0?{at:a++}:null);elementor.channels.data.trigger("template:after:insert",{})}}return!0}return e}if("gutenberg"===o){var l=wp.blocks.parse,c=wp.data.dispatch("core/block-editor").insertBlocks;return e.data.success&&e.data.hasOwnProperty("data")?(c(l(e.data.data.content)),!0):e}})).catch((function(e){return console.error("Insert Error: ",e)}))},ci=function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=new FormData;o.append("action","get_templately"),o.append("content_type","save_template"),o.append("nonce",ai),n=r.model?r.model.get("elType"):elementor.config.document.library&&elementor.config.document.library.save_as_same_type?elementor.config.document.type:"page",t=r.hasOwnProperty("model")?[r.model.toJSON({remove:["default"]})]:elementor.elements.toJSON({remove:["default"]}),o.append("content",JSON.stringify(t)),o.append("source","local"),o.append("type",n),o.append("title",e),o.append("post_id",ri);var i="templately"===ni?"elementor":ni;return o.append("file_type",i),null!=a.thumbnail&&o.append("thumbnail",a.thumbnail),null!=a.workspace_id&&(o.append("workspace_id",a.workspace_id),o.append("workspaceActivity",a.workspaceActivity)),Do.a.post(ajaxurl,o).then((function(e){return e})).catch((function(e){return e}))},ui=function(e){window.open(e,"_blank"),window.focus()},si=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"set_favourite",r=new FormData;return r.append("action","get_templately"),r.append("content_type",n),r.append("nonce",ai),r.append("id",e),r.append("type",t),Do.a.post(ajaxurl,r).then((function(e){return e})).catch((function(e){return"Something went wrong."}))},fi=function(e,t){for(var n=0,r=0;r<t.length;r++)if(t[r].id===e){n=t[r].count;break}return n},pi=function(e,t){return t.filter((function(t){return t.id!=e}))},di=function(e,t){for(var n=!1,r=0;r<t.length;r++)if(t[r].template_id===e){n=!0;break}return n},mi=function(e){return/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(String(e).toLowerCase())},hi=function(e){var t={elementor:"https://assets.templately.com/frontend/Elementor.png",gutenberg:"https://assets.templately.com/frontend/Gutenberg.png"};return t.hasOwnProperty(e)&&t[e]},yi=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r={page:-1};n=Xo(Xo({},r),n);var a=new FormData;if(a.append("action","get_templately"),a.append("content_type","get_workspace"),void 0!==n.page&&a.append("pagenum",n.page),void 0!==n.per_page&&a.append("per_page",n.per_page),!0===e&&a.append("shared",!0),a.append("nonce",ai),t)return Do.a.post(ajaxurl,a).then((function(e){return e}));var o={};return null!=n.cancelToken&&(o.cancelToken=n.cancelToken),Do.a.post(ajaxurl,a,o).then((function(e){return e.data.success?e.data.data.data:e.data.data})).catch((function(e){return console.error("Error Getting WorkSpace List: ",e)}))},gi=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=[];return null!=e&&e.length>0&&"object"==Go(e)&&e.map((function(e){n.push({value:e.id,slug:e.slug,label:e.name,shared:t})})),n},vi=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=new FormData;return t.append("action","get_templately"),t.append("content_type","clouds_sync"),null!=e.per_page&&t.append("per_page",e.per_page),null!=e.page&&t.append("page",e.page),null!=e.platform&&t.append("fileType",e.platform),null!=e.search&&t.append("search",e.search),t.append("nonce",ai),Do.a.post(ajaxurl,t).then((function(e){return e})).catch((function(e){return e}))},bi=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=new FormData;return n.append("action","get_templately"),n.append("content_type","workspace_details"),n.append("slug",e),null!=t.per_page&&n.append("per_page",t.per_page),null!=t.page&&n.append("page",t.page),null!=t.search&&n.append("search",t.search),null!=t.platform&&n.append("file_type",t.platform),n.append("nonce",ai),Do.a.post(ajaxurl,n).then((function(e){return e})).catch((function(e){return e}))},wi=function(){var e,t=(e=regeneratorRuntime.mark((function e(){var t,n,r=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=r.length>0&&void 0!==r[0]?r[0]:{},r.length>1&&void 0!==r[1]&&r[1],null!=t.slug){e.next=4;break}return e.abrupt("return",{success:!1,loading:!1,error:!0,data:{errorMessage:"Something errormessage."}});case 4:return(n=new FormData).append("action","get_templately"),n.append("nonce",ai),n.append("content_type","install_requirements"),n.append("requirements",JSON.stringify(t)),e.next=11,Do.a.post(ajaxurl,n).then((function(e){return e.data.data.hasOwnProperty("success")&&e.data.data.success?{success:!0,loading:!1,error:!1}:{success:!1,loading:!1,error:!0,data:{errorMessage:"Something went wrong."}}})).catch((function(e){return{loading:!1,error:!0,data:{errorMessage:e.response}}}));case 11:return e.abrupt("return",e.sent);case 12:case"end":return e.stop()}}),e)})),function(){var t=this,n=arguments;return new Promise((function(r,a){var o=e.apply(t,n);function i(e){Qo(o,r,a,i,l,"next",e)}function l(e){Qo(o,r,a,i,l,"throw",e)}i(void 0)}))});return function(){return t.apply(this,arguments)}}(),Ei=function(e){if(e.length<8)return!1;return!!(/[A-Z]/g.test(e)&&/[a-z]/g.test(e)&&/[0-9]/g.test(e))};function Oi(e){return(Oi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var ki=function(e){return i.a.createElement("div",{className:"templately-modal-message ".concat(void 0!==e.className&&e.className)},e.icon&&e.icon,e.title&&i.a.createElement("h3",null," ",e.title," "),i.a.createElement("div",{className:"tmm-body"},"string"==typeof e.content&&i.a.createElement("p",null,e.content),"object"===Oi(e.content)&&e.content))};function Si(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return xi(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return xi(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function xi(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var _i=TemplatelyAdmin,ji=_i.nonce,Pi=_i.is_editor,Ci=_i.platform,Ti=wp.i18n.__,Ai=tt((function(e){return{preview:e.preview,items:e.items,packs:e.packs,errors:e.errors,successText:e.common.successText,user:e.admin.user}}))((function(e){var t=Si(Object(o.useState)(!1),2),n=t[0],r=t[1],a=Si(Object(o.useState)(!1),2),l=a[0],c=a[1],u=le();return Object(o.useEffect)((function(){n&&(e.dispatch(Dn([])),e.dispatch(Rn([])),e.dispatch(Fn([])),"elementor"===Ci&&window.TemplatelyModal.destroy(),"gutenberg"===Ci&&Ro.close(),r(!1))}),[n]),Object(o.useEffect)((function(){if(l){var t=new FormData;t.append("action","get_templately"),t.append("content_type","clouds_sync"),t.append("nonce",ji);var n="templately"===Ci?"elementor":Ci;Do.a.post(ajaxurl,t).then((function(t){if(200===t.status&&t.data.success){var r=t.data.data.data.filter((function(e){return n===e.file_type}));e.dispatch(Fn({current_page:t.data.data.current_page,data:r,total_page:t.data.data.total_page,platform:e.platform})),ii("",{icon:"success",timer:1500,html:i.a.createElement(ki,{title:"Successfully Synced",content:i.a.createElement("p",null,Ti("Your Cloud is Successfully Synced with Your Templately Account.","templately"))})})}})).catch((function(e){return console.error("Sync Error From Actions: ",e)})),c(!1)}}),[l]),i.a.createElement("div",{className:"templately-modal-action-button"},"templately"===Ci&&i.a.createElement(Wo,null),i.a.createElement(Uo,null),0!==e.user.length&&"/clouds"===u.pathname&&i.a.createElement("button",{className:"templately-button templately-cloud-sync",onClick:function(){return c(!0)}},i.a.createElement("svg",{width:"28px",viewBox:"0 0 512 338",xmlns:"http://www.w3.org/2000/svg"},i.a.createElement("g",{fill:"none"},i.a.createElement("path",{d:"m357.74 291.15c-85.88 0-155.499-69.619-155.499-155.499 0-47.336 21.156-89.725 54.523-118.245-20.397-11.367-43.345-17.35-66.911-17.35-75.901 0-137.65 61.75-137.65 137.65 0 3.896.167 7.81.497 11.709-32.323 17.257-52.7 50.784-52.7 88.042 0 55.056 44.792 99.848 99.848 99.848h259.212c49.056 0 89.963-35.561 98.296-82.259-26.981 22.537-61.712 36.104-99.616 36.104z",fill:"#a3b0c0"}),i.a.createElement("g",{id:"templatelySyncs",fill:"#6d7988",transform:"translate(260 22)"},i.a.createElement("path",{d:"m71.409 103.365c-5.149-.234-10.317-.044-16.028-.044.77-25.252 10.37-45.087 30.462-58.479 21.943-14.626 43.882-16.65 65.44-7.828l16.061-27.998c-19.512-8.663-43.811-11.42-64.794-5.614-49.805 13.781-75.191 48.182-79.428 99.25-2.572 0-4.796.005-7.02-.001-2.429-.007-4.861-.117-7.285-.02-7.518.303-10.035 4.264-6.208 10.621 9.825 16.317 19.826 32.532 30.05 48.601 4.071 6.399 9.574 6.356 13.822-.012 10.467-15.689 20.775-31.488 30.891-47.406 4.201-6.609 1.861-10.715-5.963-11.07z"}),i.a.createElement("path",{d:"m250.088 84.992c-9.643-15.988-19.451-31.88-29.423-47.666-4.464-7.066-9.893-7.168-14.476-.301-10.26 15.376-20.364 30.86-30.321 46.435-4.742 7.417-2.366 11.519 6.522 11.784 4.93.147 9.868.026 15.186.026-1.078 26.367-11.36 46.663-32.694 59.894-20.076 12.451-39.981 14.628-59.477 7.832l-16.036 27.955c19.301 8.094 39.797 9.856 61.332 4.011 49.675-13.483 74.817-48.093 79.01-98.99 4.881 0 9.533.111 14.178-.025 7.778-.228 10.221-4.288 6.199-10.955z"}))))),!Pi&&0!==e.user.length&&i.a.createElement(Z,{exact:e.exact||!0,path:"/settings",children:function(t){var n=t.match;return i.a.createElement("button",{className:n?"templately-active templately-button":"templately-button",onClick:function(e){return e.preventDefault()}},i.a.createElement(he,{className:e.className,onClick:function(){e.dispatch(zn({isOpen:!1,deep:0})),e.dispatch(Hn({activeSidebarMenu:"all",activeParentSidebarMenu:""})),e.dispatch(qn([])),e.dispatch($n([])),e.dispatch(Qn(1))},to:"/settings"},e.user.hasOwnProperty("profile_photo")&&""!=e.user.profile_photo?i.a.createElement("img",{src:e.user.profile_photo}):i.a.createElement(Pn,{color:"#a4b0c1"})))}}),("elementor"===Ci||"gutenberg"===Ci)&&i.a.createElement("button",{className:"templately-button templately-close",onClick:function(){return r(!0)}},i.a.createElement(_n,{color:"#a4b0c1"})))})),Ni=function(){return i.a.createElement("div",{className:"templately-modal-header"},i.a.createElement(pr,null),i.a.createElement(Io,null),i.a.createElement(Ai,null))},Ii=n(6),Li=n(12),Di=n.n(Li),Ri=n(1);var Mi=function(e){return"string"!=typeof e||""===e?(console.error("The namespace must be a non-empty string."),!1):!!/^[a-zA-Z][a-zA-Z0-9_.\-\/]*$/.test(e)||(console.error("The namespace can only contain numbers, letters, dashes, periods, underscores and slashes."),!1)};var Fi=function(e){return"string"!=typeof e||""===e?(console.error("The hook name must be a non-empty string."),!1):/^__/.test(e)?(console.error("The hook name cannot begin with `__`."),!1):!!/^[a-zA-Z][a-zA-Z0-9_.-]*$/.test(e)||(console.error("The hook name can only contain numbers, letters, dashes, periods and underscores."),!1)};var zi=function(e){return function(t,n,r){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:10;if(Fi(t)&&Mi(n))if("function"==typeof r)if("number"==typeof a){var o={callback:r,priority:a,namespace:n};if(e[t]){var i,l=e[t].handlers;for(i=l.length;i>0&&!(a>=l[i-1].priority);i--);i===l.length?l[i]=o:l.splice(i,0,o),(e.__current||[]).forEach((function(e){e.name===t&&e.currentIndex>=i&&e.currentIndex++}))}else e[t]={handlers:[o],runs:0};"hookAdded"!==t&&Ki("hookAdded",t,n,r,a)}else console.error("If specified, the hook priority must be a number.");else console.error("The hook callback must be a function.")}};var Ui=function(e,t){return function(n,r){if(Fi(n)&&(t||Mi(r))){if(!e[n])return 0;var a=0;if(t)a=e[n].handlers.length,e[n]={runs:e[n].runs,handlers:[]};else for(var o=e[n].handlers,i=function(t){o[t].namespace===r&&(o.splice(t,1),a++,(e.__current||[]).forEach((function(e){e.name===n&&e.currentIndex>=t&&e.currentIndex--})))},l=o.length-1;l>=0;l--)i(l);return"hookRemoved"!==n&&Ki("hookRemoved",n,r),a}}};var Bi=function(e){return function(t,n){return void 0!==n?t in e&&e[t].handlers.some((function(e){return e.namespace===n})):t in e}};var Vi=function(e,t){return function(n){e[n]||(e[n]={handlers:[],runs:0}),e[n].runs++;var r=e[n].handlers;for(var a=arguments.length,o=new Array(a>1?a-1:0),i=1;i<a;i++)o[i-1]=arguments[i];if(!r||!r.length)return t?o[0]:void 0;var l={name:n,currentIndex:0};for(e.__current.push(l);l.currentIndex<r.length;){var c=r[l.currentIndex],u=c.callback.apply(null,o);t&&(o[0]=u),l.currentIndex++}return e.__current.pop(),t?o[0]:void 0}};var Wi=function(e){return function(){return e.__current&&e.__current.length?e.__current[e.__current.length-1].name:null}};var Hi=function(e){return function(t){return void 0===t?void 0!==e.__current[0]:!!e.__current[0]&&t===e.__current[0].name}};var $i=function(e){return function(t){if(Fi(t))return e[t]&&e[t].runs?e[t].runs:0}};var qi=function(){var e=Object.create(null),t=Object.create(null);return e.__current=[],t.__current=[],{addAction:zi(e),addFilter:zi(t),removeAction:Ui(e),removeFilter:Ui(t),hasAction:Bi(e),hasFilter:Bi(t),removeAllActions:Ui(e,!0),removeAllFilters:Ui(t,!0),doAction:Vi(e),applyFilters:Vi(t,!0),currentAction:Wi(e),currentFilter:Wi(t),doingAction:Hi(e),doingFilter:Hi(t),didAction:$i(e),didFilter:$i(t),actions:e,filters:t}}(),Ki=(qi.addAction,qi.addFilter,qi.removeAction,qi.removeFilter,qi.hasAction,qi.hasFilter,qi.removeAllActions,qi.removeAllFilters,qi.doAction),Qi=(qi.applyFilters,qi.currentAction,qi.currentFilter,qi.doingAction,qi.doingFilter,qi.didAction,qi.didFilter,qi.actions,qi.filters,Object.create(null));function Gi(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.version,r=t.alternative,a=t.plugin,o=t.link,i=t.hint,l=a?" from ".concat(a):"",c=n?" and will be removed".concat(l," in version ").concat(n):"",u=r?" Please use ".concat(r," instead."):"",s=o?" See: ".concat(o):"",f=i?" Note: ".concat(i):"",p="".concat(e," is deprecated").concat(c,".").concat(u).concat(s).concat(f);p in Qi||(Ki("deprecated",e,t,p),console.warn(p),Qi[p]=!0)}function Yi(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.reduce((function(e,t,n){return Ii.Children.forEach(t,(function(t,r){t&&"string"!=typeof t&&(t=Object(Ii.cloneElement)(t,{key:[n,r].join()})),e.push(t)})),e}),[])}function Xi(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ji(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Xi(Object(n),!0).forEach((function(t){Object(Tr.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Xi(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Zi={strong:{},em:{},s:{},del:{},ins:{},a:{attributes:["href","target","rel"]},code:{},abbr:{attributes:["title"]},sub:{},sup:{},br:{},small:{},q:{attributes:["cite"]},dfn:{attributes:["title"]},data:{attributes:["value"]},time:{attributes:["datetime"]},var:{},samp:{},kbd:{},i:{},b:{},u:{},mark:{},ruby:{},rt:{},rp:{},bdi:{attributes:["dir"]},bdo:{attributes:["dir"]},wbr:{},"#text":{}};Object(Ri.without)(Object.keys(Zi),"#text","br").forEach((function(e){Zi[e].children=Object(Ri.omit)(Zi,e)}));Ji(Ji({},Zi),{audio:{attributes:["src","preload","autoplay","mediagroup","loop","muted"]},canvas:{attributes:["width","height"]},embed:{attributes:["src","type","width","height"]},img:{attributes:["alt","src","srcset","usemap","ismap","width","height"]},object:{attributes:["data","type","name","usemap","form","width","height"]},video:{attributes:["src","poster","preload","autoplay","mediagroup","loop","muted","controls","width","height"]}});function el(e){return e.ownerDocument.defaultView.getComputedStyle(e)}function tl(e){if(!e.collapsed)return e.getBoundingClientRect();var t=e.startContainer,n=t.ownerDocument;if("BR"===t.nodeName){var r=t.parentNode,a=Array.from(r.childNodes).indexOf(t);(e=n.createRange()).setStart(r,a),e.setEnd(r,a)}var o=e.getClientRects()[0];if(!o){var i=n.createTextNode("");(e=e.cloneRange()).insertNode(i),o=e.getClientRects()[0],i.parentNode.removeChild(i)}return o}var nl=["[tabindex]","a[href]","button:not([disabled])",'input:not([type="hidden"]):not([disabled])',"select:not([disabled])","textarea:not([disabled])","iframe","object","embed","area[href]","[contenteditable]:not([contenteditable=false])"].join(",");function rl(e){return e.offsetWidth>0||e.offsetHeight>0||e.getClientRects().length>0}function al(e){var t=e.querySelectorAll(nl);return Array.from(t).filter((function(e){return!(!rl(e)||function(e){return"iframe"===e.nodeName.toLowerCase()&&"-1"===e.getAttribute("tabindex")}(e))&&("AREA"!==e.nodeName||function(e){var t=e.closest("map[name]");if(!t)return!1;var n=e.ownerDocument.querySelector('img[usemap="#'+t.name+'"]');return!!n&&rl(n)}(e))}))}function ol(e){var t=e.getAttribute("tabindex");return null===t?0:parseInt(t,10)}function il(e){return-1!==ol(e)}function ll(e,t){return{element:e,index:t}}function cl(e){return e.element}function ul(e,t){var n=ol(e.element),r=ol(t.element);return n===r?e.index-t.index:n-r}function sl(e){return e.filter(il).map(ll).sort(ul).map(cl).reduce((t={},function(e,n){var r=n.nodeName,a=n.type,o=n.checked,i=n.name;if("INPUT"!==r||"radio"!==a||!i)return e.concat(n);var l=t.hasOwnProperty(i);if(!o&&l)return e;if(l){var c=t[i];e=Object(Ri.without)(e,c)}return t[i]=n,e.concat(n)}),[]);var t}function fl(e){return sl(al(e))}function pl(e){var t=al(e.ownerDocument.body),n=t.indexOf(e);return t.length=n,Object(Ri.last)(sl(t))}function dl(e){var t=al(e.ownerDocument.body),n=t.indexOf(e),r=t.slice(n+1).filter((function(t){return!e.contains(t)}));return Object(Ri.first)(sl(r))}var ml={focusable:r,tabbable:a},hl=n(27);function yl(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window,t=e.navigator.platform;return-1!==t.indexOf("Mac")||Object(Ri.includes)(["iPad","iPhone"],t)}var gl="alt",vl="ctrl",bl="meta",wl="shift",El={primary:function(e){return e()?[bl]:[vl]},primaryShift:function(e){return e()?[wl,bl]:[vl,wl]},primaryAlt:function(e){return e()?[gl,bl]:[vl,gl]},secondary:function(e){return e()?[wl,gl,bl]:[vl,wl,gl]},access:function(e){return e()?[vl,gl]:[wl,gl]},ctrl:function(){return[vl]},alt:function(){return[gl]},ctrlShift:function(){return[vl,wl]},shift:function(){return[wl]},shiftAlt:function(){return[wl,gl]}},Ol=(Object(Ri.mapValues)(El,(function(e){return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:yl;return[].concat(Object(Cr.a)(e(n)),[t.toLowerCase()]).join("+")}})),Object(Ri.mapValues)(El,(function(e){return function(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:yl,a=r(),o=(n={},Object(Tr.a)(n,gl,a?"⌥":"Alt"),Object(Tr.a)(n,vl,a?"⌃":"Ctrl"),Object(Tr.a)(n,bl,"⌘"),Object(Tr.a)(n,wl,a?"⇧":"Shift"),n),i=e(r).reduce((function(e,t){var n=Object(Ri.get)(o,t,t);return[].concat(Object(Cr.a)(e),a?[n]:[n,"+"])}),[]),l=Object(Ri.capitalize)(t);return[].concat(Object(Cr.a)(i),[l])}})));Object(Ri.mapValues)(Ol,(function(e){return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:yl;return e(t,n).join("")}})),Object(Ri.mapValues)(El,(function(e){return function(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:yl,a=r(),o=(n={},Object(Tr.a)(n,wl,"Shift"),Object(Tr.a)(n,bl,a?"Command":"Control"),Object(Tr.a)(n,vl,"Control"),Object(Tr.a)(n,gl,a?"Option":"Alt"),Object(Tr.a)(n,",",Object(hl.a)("Comma")),Object(Tr.a)(n,".",Object(hl.a)("Period")),Object(Tr.a)(n,"`",Object(hl.a)("Backtick")),n);return[].concat(Object(Cr.a)(e(r)),[t]).map((function(e){return Object(Ri.capitalize)(Object(Ri.get)(o,e,e))})).join(a?" ":" + ")}}));function kl(e){return[gl,vl,bl,wl].filter((function(t){return e["".concat(t,"Key")]}))}Object(Ri.mapValues)(El,(function(e){return function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:yl,a=e(r),o=kl(t);return!Object(Ri.xor)(a,o).length&&(n?t.key===n:Object(Ri.includes)(a,t.key.toLowerCase()))}}));function Sl(e){var t=Pr(Object(Ii.useState)(e&&window.matchMedia(e).matches),2),n=t[0],r=t[1];return Object(Ii.useEffect)((function(){if(e){var t=function(){return r(window.matchMedia(e).matches)};t();var n=window.matchMedia(e);return n.addListener(t),function(){n.removeListener(t)}}}),[e]),e&&n}var xl={huge:1440,wide:1280,large:960,medium:782,small:600,mobile:480},_l={">=":"min-width","<":"max-width"},jl={">=":function(e,t){return t>=e},"<":function(e,t){return t<e}},Pl=Object(Ii.createContext)(null),Cl=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:">=",n=Object(Ii.useContext)(Pl),r=!n&&"(".concat(_l[t],": ").concat(xl[e],"px)"),a=Sl(r);return n?jl[t](xl[e],n):a};Cl.__experimentalWidthProvider=Pl.Provider;var Tl=Cl,Al=n(55),Nl=n.n(Al).a;function Il(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ll(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Il(Object(n),!0).forEach((function(t){Object(Tr.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Il(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Dl=function(e){var t=e.className,n=e.isPressed,r=Ll(Ll({},_r(e,["className","isPressed"])),{},{className:Di()(t,{"is-pressed":n})||void 0,role:"img","aria-hidden":!0,focusable:!1});return Object(Ii.createElement)("svg",r)},Rl=Object(Ii.createElement)(Dl,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(Ii.createElement)((function(e){return Object(Ii.createElement)("path",e)}),{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"}));function Ml(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Fl(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ml(Object(n),!0).forEach((function(t){Object(Tr.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ml(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function zl(e,t,n,r,a,o,i){var l=t.width,c="rtl"===document.documentElement.dir;"left"===n&&c?n="right":"right"===n&&c&&(n="left"),"left"===r&&c?r="right":"right"===r&&c&&(r="left");var u=Math.round(e.left+e.width/2),s={popoverLeft:u,contentWidth:(u-l/2>0?l/2:u)+(u+l/2>window.innerWidth?window.innerWidth-u:l/2)},f=e.left;"right"===r?f=e.right:"middle"!==o&&(f=u);var p=e.right;"left"===r?p=e.left:"middle"!==o&&(p=u);var d,m={popoverLeft:f,contentWidth:f-l>0?l:f},h={popoverLeft:p,contentWidth:p+l>window.innerWidth?window.innerWidth-p:l},y=n,g=null;if(!a)if("center"===n&&s.contentWidth===l)y="center";else if("left"===n&&m.contentWidth===l)y="left";else if("right"===n&&h.contentWidth===l)y="right";else{var v="left"===(y=m.contentWidth>h.contentWidth?"left":"right")?m.contentWidth:h.contentWidth;g=v!==l?v:null}if(d="center"===y?s.popoverLeft:"left"===y?m.popoverLeft:h.popoverLeft,i){var b=i.getBoundingClientRect();d=Math.min(d,b.right-l)}return{xAxis:y,popoverLeft:d,contentWidth:g}}function Ul(e,t,n,r,a,o,i){var l=t.height;if(a){var c=(function e(t){if(t){if(t.scrollHeight>t.clientHeight){var n=el(t).overflowY;if(/(auto|scroll)/.test(n))return t}return e(t.parentNode)}}(o)||document.body).getBoundingClientRect().top+l-i;if(e.top<=c)return{yAxis:n,popoverTop:Math.min(e.bottom,c)}}var u=e.top+e.height/2;"bottom"===r?u=e.bottom:"top"===r&&(u=e.top);var s={popoverTop:u,contentHeight:(u-l/2>0?l/2:u)+(u+l/2>window.innerHeight?window.innerHeight-u:l/2)},f={popoverTop:e.top,contentHeight:e.top-10-l>0?l:e.top-10},p={popoverTop:e.bottom,contentHeight:e.bottom+10+l>window.innerHeight?window.innerHeight-10-e.bottom:l},d=n,m=null;if(!a)if("middle"===n&&s.contentHeight===l)d="middle";else if("top"===n&&f.contentHeight===l)d="top";else if("bottom"===n&&p.contentHeight===l)d="bottom";else{var h="top"===(d=f.contentHeight>p.contentHeight?"top":"bottom")?f.contentHeight:p.contentHeight;m=h!==l?h:null}return{yAxis:d,popoverTop:"middle"===d?s.popoverTop:"top"===d?f.popoverTop:p.popoverTop,contentHeight:m}}var Bl=function(e,t){return function(n){var r=e(n),a=n.displayName,o=void 0===a?n.name||"Component":a;return r.displayName="".concat(Object(Ri.upperFirst)(Object(Ri.camelCase)(t)),"(").concat(o,")"),r}};function Vl(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Or(e);if(t){var a=Or(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Er(this,n)}}var Wl=Object(Ii.createContext)({focusHistory:[]}),Hl=Wl.Provider,$l=Wl.Consumer;Hl.displayName="FocusReturnProvider",$l.displayName="FocusReturnConsumer";Ii.Component;function ql(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Or(e);if(t){var a=Or(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Er(this,n)}}var Kl=Bl((function e(t){if((r=t)instanceof Ii.Component||"function"==typeof r){var n=t;return e({})(n)}var r,a=t.onFocusReturn,o=void 0===a?Ri.stubTrue:a;return function(e){var t=function(t){vr(r,t);var n=ql(r);function r(){var e;return mr(this,r),(e=n.apply(this,arguments)).ownFocusedElements=new Set,e.activeElementOnMount=document.activeElement,e.setIsFocusedFalse=function(){return e.isFocused=!1},e.setIsFocusedTrue=function(t){e.ownFocusedElements.add(t.target),e.isFocused=!0},e}return yr(r,[{key:"componentWillUnmount",value:function(){var e=this.activeElementOnMount,t=this.isFocused,n=this.ownFocusedElements;if(t&&!1!==o())for(var r,a=[].concat(Object(Cr.a)(Ri.without.apply(void 0,[this.props.focus.focusHistory].concat(Object(Cr.a)(n)))),[e]);r=a.pop();)if(document.body.contains(r))return void r.focus()}},{key:"render",value:function(){return Object(Ii.createElement)("div",{onFocus:this.setIsFocusedTrue,onBlur:this.setIsFocusedFalse},Object(Ii.createElement)(e,this.props.childProps))}}]),r}(Ii.Component);return function(e){return Object(Ii.createElement)($l,null,(function(n){return Object(Ii.createElement)(t,{childProps:e,focus:n})}))}}}),"withFocusReturn");function Ql(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Or(e);if(t){var a=Or(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Er(this,n)}}var Gl=Bl((function(e){return function(t){vr(r,t);var n=Ql(r);function r(){var e;return mr(this,r),(e=n.apply(this,arguments)).focusContainRef=Object(Ii.createRef)(),e.handleTabBehaviour=e.handleTabBehaviour.bind(wr(e)),e}return yr(r,[{key:"handleTabBehaviour",value:function(e){if(9===e.keyCode){var t=ml.tabbable.find(this.focusContainRef.current);if(t.length){var n=t[0],r=t[t.length-1];e.shiftKey&&e.target===n?(e.preventDefault(),r.focus()):(e.shiftKey||e.target!==r)&&t.includes(e.target)||(e.preventDefault(),n.focus())}}}},{key:"render",value:function(){return Object(Ii.createElement)("div",{onKeyDown:this.handleTabBehaviour,ref:this.focusContainRef,tabIndex:"-1"},Object(Ii.createElement)(e,this.props))}}]),r}(Ii.Component)}),"withConstrainedTabbing");function Yl(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Or(e);if(t){var a=Or(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Er(this,n)}}var Xl=["button","submit"];function Jl(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Or(e);if(t){var a=Or(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Er(this,n)}}var Zl=Bl((function(e){return function(t){vr(r,t);var n=Yl(r);function r(){var e;return mr(this,r),(e=n.apply(this,arguments)).bindNode=e.bindNode.bind(wr(e)),e.cancelBlurCheck=e.cancelBlurCheck.bind(wr(e)),e.queueBlurCheck=e.queueBlurCheck.bind(wr(e)),e.normalizeButtonFocus=e.normalizeButtonFocus.bind(wr(e)),e}return yr(r,[{key:"componentWillUnmount",value:function(){this.cancelBlurCheck()}},{key:"bindNode",value:function(e){e?this.node=e:(delete this.node,this.cancelBlurCheck())}},{key:"queueBlurCheck",value:function(e){var t=this;e.persist(),this.preventBlurCheck||(this.blurCheckTimeout=setTimeout((function(){document.hasFocus()?"function"==typeof t.node.handleFocusOutside&&t.node.handleFocusOutside(e):e.preventDefault()}),0))}},{key:"cancelBlurCheck",value:function(){clearTimeout(this.blurCheckTimeout)}},{key:"normalizeButtonFocus",value:function(e){var t=e.type,n=e.target;Object(Ri.includes)(["mouseup","touchend"],t)?this.preventBlurCheck=!1:function(e){switch(e.nodeName){case"A":case"BUTTON":return!0;case"INPUT":return Object(Ri.includes)(Xl,e.type)}return!1}(n)&&(this.preventBlurCheck=!0)}},{key:"render",value:function(){return Object(Ii.createElement)("div",{onFocus:this.cancelBlurCheck,onMouseDown:this.normalizeButtonFocus,onMouseUp:this.normalizeButtonFocus,onTouchStart:this.normalizeButtonFocus,onTouchEnd:this.normalizeButtonFocus,onBlur:this.queueBlurCheck},Object(Ii.createElement)(e,s({ref:this.bindNode},this.props)))}}]),r}(Ii.Component)}),"withFocusOutside")(function(e){vr(n,e);var t=Jl(n);function n(){return mr(this,n),t.apply(this,arguments)}return yr(n,[{key:"handleFocusOutside",value:function(e){this.props.onFocusOutside(e)}},{key:"render",value:function(){return this.props.children}}]),n}(Ii.Component));function ec(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Or(e);if(t){var a=Or(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Er(this,n)}}var tc=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.htmlDocument,n=void 0===t?document:t,r=e.className,a=void 0===r?"lockscroll":r,o=0,i=0;function l(e){var t=n.scrollingElement||n.body;e&&(i=t.scrollTop);var r=e?"add":"remove";t.classList[r](a),n.documentElement.classList[r](a),e||(t.scrollTop=i)}function c(){0===o&&l(!0),++o}function u(){1===o&&l(!1),--o}return function(e){vr(n,e);var t=ec(n);function n(){return mr(this,n),t.apply(this,arguments)}return yr(n,[{key:"componentDidMount",value:function(){c()}},{key:"componentWillUnmount",value:function(){u()}},{key:"render",value:function(){return null}}]),n}(Ii.Component)}();function nc(e){e.stopPropagation()}var rc=Object(Ii.forwardRef)((function(e,t){var n=e.children,r=_r(e,["children"]);return Object(Ii.createElement)("div",s({},r,{ref:t,onMouseDown:nc}),n)})),ac=n(19);function oc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ic(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?oc(Object(n),!0).forEach((function(t){Object(Tr.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function lc(e){var t=Object(Ii.useContext)(ac.a),n=t.slots[e]||{},r=t.fills[e],a=Object(Ii.useMemo)((function(){return r||[]}),[r]),o=Object(Ii.useCallback)((function(n){t.updateSlot(e,n)}),[e,t.updateSlot]),i=Object(Ii.useCallback)((function(n){t.unregisterSlot(e,n)}),[e,t.unregisterSlot]),l=Object(Ii.useCallback)((function(n){t.registerFill(e,n)}),[e,t.registerFill]),c=Object(Ii.useCallback)((function(n){t.unregisterFill(e,n)}),[e,t.unregisterFill]);return ic(ic({},n),{},{updateSlot:o,unregisterSlot:i,fills:a,registerFill:l,unregisterFill:c})}function cc(e,t,n){return(cc="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Or(e)););return e}(e,t);if(r){var a=Object.getOwnPropertyDescriptor(r,t);return a.get?a.get.call(n):a.value}})(e,t,n||e)}var uc=function(e){return!Object(Ri.isNumber)(e)&&(Object(Ri.isString)(e)||Object(Ri.isArray)(e)?!e.length:!e)},sc=n(56),fc=n.n(sc);function pc(e){var t=function(e,t){if("object"!==Object(br.a)(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==Object(br.a)(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===Object(br.a)(t)?t:String(t)}function dc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function mc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?dc(Object(n),!0).forEach((function(t){Object(Tr.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function hc(e){var t,n,r,a,o,i,l,c,u,s,f,p=e.children,d=(t=Pr(Object(Ii.useState)({}),2),n=t[0],r=t[1],a=Pr(Object(Ii.useState)({}),2),o=a[0],i=a[1],l=Object(Ii.useCallback)((function(e,t,n){r((function(r){var a=r[e]||{};return mc(mc({},r),{},Object(Tr.a)({},e,mc(mc({},a),{},{ref:t||a.ref,fillProps:n||a.fillProps||{}})))}))}),[]),c=Object(Ii.useCallback)((function(e,t){r((function(n){var r=n[e],a=_r(n,[e].map(pc));return(null==r?void 0:r.ref)===t?a:n}))}),[]),u=Object(Ii.useCallback)((function(e,t){var r=n[e];if(r&&!fc()(r.fillProps,t)){r.fillProps=t;var a=o[e];a&&a.map((function(e){return e.current.rerender()}))}}),[n,o]),s=Object(Ii.useCallback)((function(e,t){i((function(n){return mc(mc({},n),{},Object(Tr.a)({},e,[].concat(Object(Cr.a)(n[e]||[]),[t])))}))}),[]),f=Object(Ii.useCallback)((function(e,t){i((function(n){return n[e]?mc(mc({},n),{},Object(Tr.a)({},e,n[e].filter((function(e){return e!==t})))):n}))}),[]),Object(Ii.useMemo)((function(){return{slots:n,fills:o,registerSlot:l,updateSlot:u,unregisterSlot:c,registerFill:s,unregisterFill:f}}),[n,o,l,u,c,s,f]));return Object(Ii.createElement)(ac.a.Provider,{value:d},p)}function yc(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Or(e);if(t){var a=Or(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Er(this,n)}}var gc=Object(Ii.createContext)({registerSlot:function(){},unregisterSlot:function(){},registerFill:function(){},unregisterFill:function(){},getSlot:function(){},getFills:function(){},subscribe:function(){}}),vc=gc.Provider,bc=gc.Consumer;Ii.Component;function wc(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Or(e);if(t){var a=Or(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Er(this,n)}}var Ec=function(e){vr(n,e);var t=wc(n);function n(){var e;return mr(this,n),(e=t.apply(this,arguments)).isUnmounted=!1,e.bindNode=e.bindNode.bind(wr(e)),e}return yr(n,[{key:"componentDidMount",value:function(){(0,this.props.registerSlot)(this.props.name,this)}},{key:"componentWillUnmount",value:function(){var e=this.props.unregisterSlot;this.isUnmounted=!0,e(this.props.name,this)}},{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.name,r=t.unregisterSlot,a=t.registerSlot;e.name!==n&&(r(e.name),a(n,this))}},{key:"bindNode",value:function(e){this.node=e}},{key:"forceUpdate",value:function(){this.isUnmounted||cc(Or(n.prototype),"forceUpdate",this).call(this)}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.name,r=e.fillProps,a=void 0===r?{}:r,o=e.getFills,i=Object(Ri.map)(o(n,this),(function(e){var t=e.occurrence,n=Object(Ri.isFunction)(e.children)?e.children(a):e.children;return Ii.Children.map(n,(function(e,n){if(!e||Object(Ri.isString)(e))return e;var r="".concat(t,"---").concat(e.key||n);return Object(Ii.cloneElement)(e,{key:r})}))})).filter(Object(Ri.negate)(uc));return Object(Ii.createElement)(Ii.Fragment,null,Object(Ri.isFunction)(t)?t(i):i)}}]),n}(Ii.Component),Oc=function(e){return Object(Ii.createElement)(bc,null,(function(t){var n=t.registerSlot,r=t.unregisterSlot,a=t.getFills;return Object(Ii.createElement)(Ec,s({},e,{registerSlot:n,unregisterSlot:r,getFills:a}))}))},kc=n(119),Sc=0;function xc(e){var t=e.name,n=e.children,r=e.registerFill,a=e.unregisterFill,o=function(e){var t=Object(Ii.useContext)(gc),n=t.getSlot,r=t.subscribe,a=Pr(Object(Ii.useState)(n(e)),2),o=a[0],i=a[1];return Object(Ii.useEffect)((function(){return i(n(e)),r((function(){i(n(e))}))}),[e]),o}(t),i=Object(Ii.useRef)({name:t,children:n});return i.current.occurrence||(i.current.occurrence=++Sc),Object(Ii.useLayoutEffect)((function(){return r(t,i.current),function(){return a(t,i.current)}}),[]),Object(Ii.useLayoutEffect)((function(){i.current.children=n,o&&o.forceUpdate()}),[n]),Object(Ii.useLayoutEffect)((function(){t!==i.current.name&&(a(i.current.name,i.current),i.current.name=t,r(t,i.current))}),[t]),o&&o.node?(Object(Ri.isFunction)(n)&&(n=n(o.props.fillProps)),Object(kc.createPortal)(n,o.node)):null}var _c=function(e){return Object(Ii.createElement)(bc,null,(function(t){var n=t.registerFill,r=t.unregisterFill;return Object(Ii.createElement)(xc,s({},e,{registerFill:n,unregisterFill:r}))}))};function jc(e){var t=e.name,n=e.fillProps,r=void 0===n?{}:n,a=e.as,o=void 0===a?"div":a,i=_r(e,["name","fillProps","as"]),l=Object(Ii.useContext)(ac.a),c=Object(Ii.useRef)();return Object(Ii.useLayoutEffect)((function(){return l.registerSlot(t,c,r),function(){l.unregisterSlot(t,c)}}),[l.registerSlot,l.unregisterSlot,t]),Object(Ii.useLayoutEffect)((function(){l.updateSlot(t,r)})),Object(Ii.createElement)(o,s({ref:c},i))}function Pc(e){var t,n=e.name,r=e.children,a=lc(n),o=Object(Ii.useRef)({rerender:(t=Pr(Object(Ii.useState)({}),2)[1],function(){return t({})})});return Object(Ii.useEffect)((function(){return a.registerFill(o),function(){a.unregisterFill(o)}}),[a.registerFill,a.unregisterFill]),a.ref&&a.ref.current?("function"==typeof r&&(r=r(a.fillProps)),Object(kc.createPortal)(r,a.ref.current)):null}function Cc(e){var t=e.bubblesVirtually,n=_r(e,["bubblesVirtually"]);return t?Object(Ii.createElement)(jc,n):Object(Ii.createElement)(Oc,n)}function Tc(e){return Object(Ii.createElement)(Ii.Fragment,null,Object(Ii.createElement)(_c,e),Object(Ii.createElement)(Pc,e))}function Ac(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Nc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ac(Object(n),!0).forEach((function(t){Object(Tr.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ac(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ic(e){var t=e.type,n=e.origin,r=void 0===n?function(e){return"appear"===e?"top":"left"}(t):n;if("appear"===t){var a,o=Pr(r.split(" "),2),i=o[0],l=o[1],c=void 0===l?"center":l;return Di()("components-animate__appear",(a={},Object(Tr.a)(a,"is-from-"+c,"center"!==c),Object(Tr.a)(a,"is-from-"+i,"middle"!==i),a))}return"slide-in"===t?Di()("components-animate__slide-in","is-from-"+r):"loading"===t?Di()("components-animate__loading"):void 0}function Lc(e){var t=e.type,n=e.options,r=void 0===n?{}:n;return(0,e.children)({className:Ic(Nc({type:t},r))})}var Dc=Gl(Kl((function(e){return e.children})));function Rc(e,t){var n,r=(n=t).ownerDocument.defaultView.getComputedStyle(n),a=r.paddingTop,o=r.paddingBottom,i=r.paddingLeft,l=r.paddingRight,c=a?parseInt(a,10):0,u=o?parseInt(o,10):0,s=i?parseInt(i,10):0,f=l?parseInt(l,10):0;return{x:e.left+s,y:e.top+c,width:e.width-s-f,height:e.height-c-u,left:e.left+s,right:e.right-f,top:e.top+c,bottom:e.bottom-u}}function Mc(e,t,n){n?e.getAttribute(t)!==n&&e.setAttribute(t,n):e.hasAttribute(t)&&e.removeAttribute(t)}function Fc(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";e.style[t]!==n&&(e.style[t]=n)}function zc(e,t,n){n?e.classList.contains(t)||e.classList.add(t):e.classList.contains(t)&&e.classList.remove(t)}var Uc=function(e){var t=e.headerTitle,n=e.onClose,r=e.onKeyDown,a=e.children,o=e.className,i=e.noArrow,l=void 0===i||i,c=e.isAlternate,u=e.position,f=void 0===u?"bottom right":u,p=(e.range,e.focusOnMount),d=void 0===p?"firstElement":p,m=e.anchorRef,h=e.shouldAnchorIncludePadding,y=e.anchorRect,g=e.getAnchorRect,v=e.expandOnMobile,b=e.animate,w=void 0===b||b,E=e.onClickOutside,O=e.onFocusOutside,k=e.__unstableSticky,S=e.__unstableSlotName,x=void 0===S?"Popover":S,_=e.__unstableObserveElement,j=e.__unstableBoundaryParent,P=_r(e,["headerTitle","onClose","onKeyDown","children","className","noArrow","isAlternate","position","range","focusOnMount","anchorRef","shouldAnchorIncludePadding","anchorRect","getAnchorRect","expandOnMobile","animate","onClickOutside","onFocusOutside","__unstableSticky","__unstableSlotName","__unstableObserveElement","__unstableBoundaryParent"]),C=Object(Ii.useRef)(null),T=Object(Ii.useRef)(null),A=Object(Ii.useRef)(),N=Tl("medium","<"),I=Pr(Object(Ii.useState)(),2),L=I[0],D=I[1],R=lc(x),M=v&&N,F=Pr(Nl(),2),z=F[0],U=F[1];l=M||l,Object(Ii.useLayoutEffect)((function(){if(M)return zc(A.current,"is-without-arrow",l),zc(A.current,"is-alternate",c),Mc(A.current,"data-x-axis"),Mc(A.current,"data-y-axis"),Fc(A.current,"top"),Fc(A.current,"left"),Fc(T.current,"maxHeight"),void Fc(T.current,"maxWidth");var e=function(){if(A.current&&T.current){var e=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=arguments.length>4?arguments[4]:void 0;if(t)return t;if(n){if(!e.current)return;return n(e.current)}if(!1!==r){if(!(r&&window.Range&&window.Element&&window.DOMRect))return;if(r instanceof window.Range)return tl(r);if(r instanceof window.Element){var o=r.getBoundingClientRect();return a?o:Rc(o,r)}var i=r.top,l=r.bottom,c=i.getBoundingClientRect(),u=l.getBoundingClientRect(),s=new window.DOMRect(c.left,c.top,c.width,u.bottom-c.top);return a?s:Rc(s,r)}if(e.current){var f=e.current.parentNode,p=f.getBoundingClientRect();return a?p:Rc(p,f)}}(C,y,g,m,h);if(e){var t,n,r=A.current,a=r.offsetParent,o=r.ownerDocument,i=0;if(a&&a!==o.body){var u=a.getBoundingClientRect();i=u.top,e=new window.DOMRect(e.left-u.left,e.top-u.top,e.width,e.height)}if(j)t=null===(n=A.current.closest(".popover-slot"))||void 0===n?void 0:n.parentNode;var s=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"top",r=arguments.length>3?arguments[3]:void 0,a=arguments.length>4?arguments[4]:void 0,o=arguments.length>5?arguments[5]:void 0,i=arguments.length>6?arguments[6]:void 0,l=n.split(" "),c=Pr(l,3),u=c[0],s=c[1],f=void 0===s?"center":s,p=c[2],d=Ul(e,t,u,p,r,a,o),m=zl(e,t,f,p,r,d.yAxis,i);return Fl(Fl({},m),d)}(e,U.height?U:T.current.getBoundingClientRect(),f,k,A.current,i,t),p=s.popoverTop,d=s.popoverLeft,v=s.xAxis,b=s.yAxis,w=s.contentHeight,E=s.contentWidth;"number"==typeof p&&"number"==typeof d&&(Fc(A.current,"top",p+"px"),Fc(A.current,"left",d+"px")),zc(A.current,"is-without-arrow",l||"center"===v&&"middle"===b),zc(A.current,"is-alternate",c),Mc(A.current,"data-x-axis",v),Mc(A.current,"data-y-axis",b),Fc(T.current,"maxHeight","number"==typeof w?w+"px":""),Fc(T.current,"maxWidth","number"==typeof E?E+"px":"");D(({left:"right",right:"left"}[v]||"center")+" "+({top:"bottom",bottom:"top"}[b]||"middle"))}}};e();var t,n,r=window.setInterval(e,500),a=function(){window.cancelAnimationFrame(t),t=window.requestAnimationFrame(e)};return window.addEventListener("click",a),window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),_&&(n=new window.MutationObserver(e)).observe(_,{attributes:!0}),function(){window.clearInterval(r),window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0),window.removeEventListener("click",a),window.cancelAnimationFrame(t),n&&n.disconnect()}}),[M,y,g,m,h,f,U,k,_,j]),function(e,t){Object(Ii.useEffect)((function(){var n=setTimeout((function(){if(e&&t.current)if("firstElement"!==e)"container"===e&&t.current.focus();else{var n=ml.tabbable.find(t.current)[0];n?n.focus():t.current.focus()}}),0);return function(){return clearTimeout(n)}}),[])}(d,T);var B=function(e){27===e.keyCode&&n&&(e.stopPropagation(),n()),r&&r(e)};var V=Object(Ii.createElement)(Zl,{onFocusOutside:function(e){if(O)O(e);else if(E){var t;try{t=new window.MouseEvent("click")}catch(e){(t=document.createEvent("MouseEvent")).initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null)}Object.defineProperty(t,"target",{get:function(){return e.relatedTarget}}),Gi("Popover onClickOutside prop",{alternative:"onFocusOutside"}),E(t)}else n&&n()}},Object(Ii.createElement)(Lc,{type:w&&L?"appear":null,options:{origin:L}},(function(e){var r=e.className;return Object(Ii.createElement)(rc,s({className:Di()("components-popover",o,r,{"is-expanded":M,"is-without-arrow":l,"is-alternate":c})},P,{onKeyDown:B,ref:A}),M&&Object(Ii.createElement)(tc,null),M&&Object(Ii.createElement)("div",{className:"components-popover__header"},Object(Ii.createElement)("span",{className:"components-popover__header-title"},t),Object(Ii.createElement)(Jc,{className:"components-popover__close",icon:Rl,onClick:n})),Object(Ii.createElement)("div",{ref:T,className:"components-popover__content",tabIndex:"-1"},Object(Ii.createElement)("div",{style:{position:"relative"}},z,a)))})));return d&&(V=Object(Ii.createElement)(Dc,null,V)),R.ref&&(V=Object(Ii.createElement)(Tc,{name:x},V)),m||y?V:Object(Ii.createElement)("span",{ref:C},V)};Uc.Slot=function(e){var t=e.name,n=void 0===t?"Popover":t;return Object(Ii.createElement)(Cc,{bubblesVirtually:!0,name:n,className:"popover-slot"})};var Bc=Uc;var Vc=function(e){var t,n,r=e.shortcut,a=e.className;return r?(Object(Ri.isString)(r)&&(t=r),Object(Ri.isObject)(r)&&(t=r.display,n=r.ariaLabel),Object(Ii.createElement)("span",{className:a,"aria-label":n},t)):null};function Wc(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Or(e);if(t){var a=Or(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Er(this,n)}}var Hc=function(e){vr(n,e);var t=Wc(n);function n(){var e;return mr(this,n),(e=t.apply(this,arguments)).delayedSetIsOver=Object(Ri.debounce)((function(t){return e.setState({isOver:t})}),700),e.cancelIsMouseDown=e.createSetIsMouseDown(!1),e.isInMouseDown=!1,e.state={isOver:!1},e}return yr(n,[{key:"componentWillUnmount",value:function(){this.delayedSetIsOver.cancel(),document.removeEventListener("mouseup",this.cancelIsMouseDown)}},{key:"emitToChild",value:function(e,t){var n=this.props.children;if(1===Ii.Children.count(n)){var r=Ii.Children.only(n);"function"==typeof r.props[e]&&r.props[e](t)}}},{key:"createToggleIsOver",value:function(e,t){var n=this;return function(r){if(n.emitToChild(e,r),!(r.currentTarget.disabled||"focus"===r.type&&n.isInMouseDown)){n.delayedSetIsOver.cancel();var a=Object(Ri.includes)(["focus","mouseenter"],r.type);a!==n.state.isOver&&(t?n.delayedSetIsOver(a):n.setState({isOver:a}))}}}},{key:"createSetIsMouseDown",value:function(e){var t=this;return function(n){t.emitToChild(e?"onMouseDown":"onMouseUp",n),document[e?"addEventListener":"removeEventListener"]("mouseup",t.cancelIsMouseDown),t.isInMouseDown=e}}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.position,r=e.text,a=e.shortcut;if(1!==Ii.Children.count(t))return t;var o=Ii.Children.only(t),i=this.state.isOver;return Object(Ii.cloneElement)(o,{onMouseEnter:this.createToggleIsOver("onMouseEnter",!0),onMouseLeave:this.createToggleIsOver("onMouseLeave"),onClick:this.createToggleIsOver("onClick"),onFocus:this.createToggleIsOver("onFocus"),onBlur:this.createToggleIsOver("onBlur"),onMouseDown:this.createSetIsMouseDown(!0),children:Yi(o.props.children,i&&Object(Ii.createElement)(Bc,{focusOnMount:!1,position:n,className:"components-tooltip","aria-hidden":"true",animate:!1,noArrow:!0},r,Object(Ii.createElement)(Vc,{className:"components-tooltip__shortcut",shortcut:a})))})}}]),n}(Ii.Component);var $c=function(e){var t=e.icon,n=e.className,r=_r(e,["icon","className"]),a=["dashicon","dashicons","dashicons-"+t,n].filter(Boolean).join(" ");return Object(Ii.createElement)("span",s({className:a},r))};function qc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Kc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?qc(Object(n),!0).forEach((function(t){Object(Tr.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Qc=function(e){var t=e.icon,n=void 0===t?null:t,r=e.size,a=_r(e,["icon","size"]);if("string"==typeof n)return Object(Ii.createElement)($c,s({icon:n},a));if(n&&$c===n.type)return Object(Ii.cloneElement)(n,Kc({},a));var o=r||24;if("function"==typeof n)return n.prototype instanceof Ii.Component?Object(Ii.createElement)(n,Kc({size:o},a)):n(Kc({size:o},a));if(n&&("svg"===n.type||n.type===Dl)){var i=Kc(Kc({width:o,height:o},n.props),a);return Object(Ii.createElement)(Dl,i)}return Object(Ii.isValidElement)(n)?Object(Ii.cloneElement)(n,Kc({size:o},a)):n};function Gc(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Yc(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Yc(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,l=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return i=e.done,e},e:function(e){l=!0,o=e},f:function(){try{i||null==n.return||n.return()}finally{if(l)throw o}}}}function Yc(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Xc=["onMouseDown","onClick"];var Jc=Object(Ii.forwardRef)((function(e,t){var n=e.href,r=e.target,a=e.isPrimary,o=e.isSmall,i=e.isTertiary,l=e.isPressed,c=e.isBusy,u=e.isDefault,f=e.isSecondary,p=e.isLink,d=e.isDestructive,m=e.className,h=e.disabled,y=e.icon,g=e.iconSize,v=e.showTooltip,b=e.tooltipPosition,w=e.shortcut,E=e.label,O=e.children,k=e.__experimentalIsFocusable,S=_r(e,["href","target","isPrimary","isSmall","isTertiary","isPressed","isBusy","isDefault","isSecondary","isLink","isDestructive","className","disabled","icon","iconSize","showTooltip","tooltipPosition","shortcut","label","children","__experimentalIsFocusable"]);u&&Gi("Button isDefault prop",{alternative:"isSecondary"});var x=Di()("components-button",m,{"is-secondary":u||f,"is-primary":a,"is-small":o,"is-tertiary":i,"is-pressed":l,"is-busy":c,"is-link":p,"is-destructive":d,"has-text":!!y&&!!O,"has-icon":!!y}),_=h&&!k,j=void 0===n||_?"button":"a",P="a"===j?{href:n,target:r}:{type:"button",disabled:_,"aria-pressed":l};if(h&&k){P["aria-disabled"]=!0;var C,T=Gc(Xc);try{for(T.s();!(C=T.n()).done;){S[C.value]=function(e){e.stopPropagation(),e.preventDefault()}}}catch(e){T.e(e)}finally{T.f()}}var A=!_&&(v&&E||w||!!E&&(!O||Object(Ri.isArray)(O)&&!O.length)&&!1!==v),N=Object(Ii.createElement)(j,s({},P,S,{className:x,"aria-label":S["aria-label"]||E,ref:t}),y&&Object(Ii.createElement)(Qc,{icon:y,size:g}),O);return A?Object(Ii.createElement)(Hc,{text:E,shortcut:w,position:b},N):N})),Zc=function(e){return i.a.createElement("div",{onScroll:e.onScroll,className:"templately-modal-content-wrapper"},e.children)},eu=tt()((function(e){return i.a.createElement("div",{className:"templately-table ".concat(e.className&&e.className," ")},e.children)})),tu=tt()((function(e){return i.a.createElement("div",{className:"templately-table-row ".concat(void 0!==e.className?e.className:"")},e.children)})),nu=tt()((function(e){return i.a.createElement("div",{className:"templately-table-col ".concat(null!=e.className?e.className:"")},e.children)})),ru=wp.i18n.__,au=function(e){return i.a.createElement(tu,{className:"templately-table-head"},i.a.createElement(nu,null,i.a.createElement("p",null,ru("Name"))),i.a.createElement(nu,null,i.a.createElement(tu,null,i.a.createElement(nu,null,i.a.createElement("p",null,ru("Last Modified"))),i.a.createElement(nu,null,i.a.createElement("p",null,ru("Action"))))))},ou=TemplatelyAdmin.loadingImage,iu=function(e){return i.a.createElement("div",{className:"templately-pre-loader"},i.a.createElement("img",{src:ou}))};function lu(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return cu(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return cu(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function cu(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var uu=wp.i18n.__,su=TemplatelyAdmin,fu=su.nonce,pu=su.platform,du=su.is_block_editor,mu=su.is_editor,hu=tt((function(e){return{cloud_map:e.common.cloud_map,pagination:e.common.pagination,platform:e.common.platform}}))((function(e){var t=lu(Object(o.useState)(!1),2),n=t[0],r=t[1],a=lu(Object(o.useState)(!1),2),l=a[0],c=a[1],u=lu(Object(o.useState)(!1),2),s=u[0],f=u[1],p=lu(Object(o.useState)(!1),2),d=p[0],m=p[1],h=Object(o.useRef)(null),y=Object(o.useRef)(null),g=Object(o.useRef)(null),v=Object(o.useRef)(null),b=function(e){var t=h.current&&h.current.contains(e.target),n=y.current&&y.current.contains(e.target);t||n||r(!1)};return Object(o.useEffect)((function(){if(0!=s){var t=new FormData;t.append("action","get_templately"),t.append("content_type","push_to_cloud"),t.append("nonce",fu),t.append("id",s);var n="templately"===pu?"elementor":pu;t.append("file_type",n),ii("",{showConfirmButton:!1,showCloseButton:!0,html:i.a.createElement(iu,null)}),Do.a.post(ajaxurl,t).then((function(t){t.data.success?("success"==t.data.data.status&&(e.dispatch({type:"ALL_CLOUDS_MAP",payload:{template_id:s,cloud_item_id:t.data.data.data.myCloud_item}}),ii(uu("Successfully Pushed to Cloud.","templately"),{timer:1500,icon:"success"})),"error"==t.data.data.status&&ii(uu("Something went wrong.","templately"),{timer:1500,icon:"error"})):ii(uu(t.data.data,"templately"),{timer:1500,icon:"error"})})).catch((function(e){return console.error("Pushed Related Issue: ",e)})),f(!1)}}),[s]),Object(o.useEffect)((function(){var t,n;0!=d&&(r(!1),(t=d,(n=new FormData).append("action","get_templately"),n.append("content_type","delete_template"),n.append("nonce",ai),n.append("id",t),n.append("type","template"),Do.a.post(ajaxurl,n).then((function(e){return e.data})).catch((function(e){return{success:!1,data:"Something went wrong regarding delete this template."}}))).then((function(t){t.success?(e.dispatch({type:"REMOVE_TEMPLATE",payload:{id:d,page:e.pagination}}),ii(t.data,{timer:2e3,icon:"success"})):ii(t.data,{timer:2e3,icon:"error"})})),m(!1))}),[d]),Object(o.useEffect)((function(){return document.addEventListener("mousedown",b),function(){return document.removeEventListener("mousedown",b)}}),[]),Object(o.useEffect)((function(){0!=l&&(e.isLoading(!0),li(e.template.id,"local",{fileType:e.platform}).then((function(t){!0===t?(window.TemplatelyModal.destroy(),e.dispatch(setLoading(!0))):(e.dispatch(setLoading(!1)),e.isLoading(!1),ii(t,{timer:2e3,icon:"error"}))})))}),[l]),i.a.createElement("div",{ref:v},i.a.createElement(tu,null,i.a.createElement(nu,null,i.a.createElement("div",{className:"ttcol-header"},hi("elementor")&&i.a.createElement("img",{src:hi("elementor"),alt:e.name}),i.a.createElement("p",null,uu(e.name)))),i.a.createElement(nu,null,i.a.createElement(tu,null,i.a.createElement(nu,null,i.a.createElement("p",null,uu(e.date))),i.a.createElement(nu,{className:"templately-col-actions-btn"},(!mu||!du)&&i.a.createElement("button",{className:"templately-cloud-item-action-btn tw-preview",onClick:function(){return ui(e.template.preview_url)}},i.a.createElement("i",null),uu("Preview","templately")),(!mu||!du)&&i.a.createElement("button",{className:"templately-cloud-item-action-btn tw-push-to-cloud",disabled:di(e.template.id,e.cloud_map)||!1!==s,onClick:function(){return f(e.template.id)}},i.a.createElement("i",null),uu("Push to Cloud","templately")),(mu||du)&&i.a.createElement(Jc,{className:"templately-cloud-item-action-btn tw-download",ref:g,onClick:function(){return c(e.template.id)}},i.a.createElement("i",null),uu("Insert","templately")),i.a.createElement(Jc,{className:"templately-cloud-item-action-btn",ref:h,onClick:function(){return r(!n)}},i.a.createElement(hn,null)),n&&i.a.createElement("div",{ref:y,className:"templately-sw-cxt-menu ".concat(!0===n?"topen":"")},i.a.createElement("ul",null,(mu||du)&&i.a.createElement(i.a.Fragment,null,i.a.createElement("li",{className:"tw-preview",onClick:function(){return ui(e.template.preview_url)}},i.a.createElement("i",null)," ",uu("Preview","templately")),i.a.createElement("li",{className:"tw-push-to-cloud",disabled:di(e.template.id,e.cloud_map)||!1!==s,onClick:function(){return f(e.template.id)}},i.a.createElement("i",null)," ",uu("Push to Cloud","templately"))),i.a.createElement("li",{className:"twm-preview",onClick:function(){return ui(e.template.preview_url)}},i.a.createElement("i",null)," ",uu("Preview","templately")),i.a.createElement("li",{className:"twm-push-to-cloud",disabled:di(e.template.id,e.cloud_map)||!1!==s,onClick:function(){return f(e.template.id)}},i.a.createElement("i",null)," ",uu("Push To Cloud","templately")),i.a.createElement("li",{className:"tw-export"},i.a.createElement("a",{href:e.template.export_url},i.a.createElement("i",null)," ",uu("Export","templately"))),i.a.createElement("li",{className:"tw-delete",onClick:function(){return m(e.template.id)}},i.a.createElement("i",null)," ",uu("Delete","templately")))))))))})),yu=function(e){return i.a.createElement("div",e,e.children)};n(109);function gu(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return vu(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return vu(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function vu(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var bu=wp.i18n.__,wu=tt((function(e){return{pagination:e.common.pagination,need_pagination:e.common.need_pagination}}))((function(e){var t=gu(Object(o.useState)(1),2),n=t[0],r=t[1],a=gu(Object(o.useState)(!1),2),l=a[0],c=a[1],u=gu(Object(o.useState)([]),2),s=u[0],f=u[1];Object(o.useEffect)((function(){r(e.count)}),[e.type,e.count]),Object(o.useEffect)((function(){l&&(e.dispatch(Qn(l)),e.dispatch(tr(null)),e.categoryPagination||e.dispatch(Hn({activeSidebarMenu:"all",activeParentSidebarMenu:""})),e.dispatch(Yn(!0)))}),[l]),Object(o.useEffect)((function(){var t=1,r=n;n>10&&(t=Math.max(1,e.pagination-3),r=Math.min(e.pagination+3,n),e.pagination-1<=3&&(r=7),n-e.pagination<=3&&(t=n-6));var a=[];a.push(i.a.createElement("li",{className:1==e.pagination?"epage-link epage-active":"epage-link",key:1,onClick:function(){return c(1)}},bu(1,"templately"))),t>1?a.push(i.a.createElement("li",{className:"epage-link",key:"dotdotdot"},bu("...","templately"))):a.filter((function(e){return"dotdotdot"!=e.key}));for(var o=function(t){a.push(i.a.createElement("li",{className:e.pagination==t?"epage-link epage-active":"epage-link",key:t,onClick:function(){return c(t)}},bu(t,"templately")))},l=t+1;l<r;l+=1)o(l);e.pagination+3<n&&r!==n&&a.push(i.a.createElement("li",{className:"epage-link",key:"dotdotdotdot"},bu("...","templately"))),a.push(i.a.createElement("li",{className:e.pagination==n?"epage-link epage-active":"epage-link",key:n,onClick:function(){return c(n)}},bu(n,"templately"))),n>=2?(e.dispatch(Gn(!0)),f(a)):e.dispatch(Gn(!1))}),[n,e.pagination]);var p,d=function(){var t=e.pagination-1>0?e.pagination-1:0;e.dispatch(Qn(t))},m=function(){var t=e.pagination+1<n?e.pagination+1:n;e.dispatch(Qn(t))};return i.a.createElement(i.a.Fragment,null,!(s.length<2||!e.need_pagination)&&i.a.createElement("div",{className:"templately-pagination"},i.a.createElement("ul",null,(p=!(e.pagination>1),i.a.createElement("li",{className:"epage-link pagination-arrow"},i.a.createElement("button",{onClick:function(){return d()},disabled:p},i.a.createElement(un,null)))),s,function(){var t=!(e.pagination<n);return i.a.createElement("li",{className:"epage-link pagination-arrow"},i.a.createElement("button",{onClick:function(){return m()},disabled:t},i.a.createElement(sn,null)))}())))})),Eu=TemplatelyAdmin.loadingImage,Ou=tt((function(e){return{retry:e.common.retry,retryMessage:e.common.retryMessage}}))((function(e){return i.a.createElement("div",{className:"templately-pre-loader"},e.retryMessage.length>0?i.a.createElement("div",{className:"templately-retry"},i.a.createElement("p",null,e.retryMessage),i.a.createElement("button",{className:"templately-retry-button button-primary",onClick:function(){e.dispatch(Bn(!0)),e.dispatch(Cn(!e.retry)),e.dispatch(In(""))}},"Retry")):i.a.createElement("img",{src:Eu}))}));function ku(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Su(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Su(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Su(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var xu=TemplatelyAdmin.templates,_u=tt((function(e){return{templates:e.common.templates,isTemplate:e.common.isTemplate||!1,userID:e.admin.user.id||null,platform:e.common.platform,need_pagination:e.common.need_pagination,pagination_loading:e.common.pagination_loading,pagination:e.common.pagination}}))((function(e){var t=ku(Object(o.useState)([]),2),n=t[0],r=t[1],a=ku(Object(o.useState)(1),2),l=a[0],c=a[1],u=ku(Object(o.useState)(!1),2),s=u[0],f=u[1];return Object(o.useEffect)((function(){e.pagination>1&&!e.templates.hasOwnProperty(e.pagination)&&(f(!0),function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=new FormData;return t.append("action","get_templately"),t.append("nonce",ai),t.append("content_type","get_templates"),null!=e.page&&t.append("page",e.page),null!=e.platform&&t.append("platform",e.platform),Do.a.post(ajaxurl,t).then((function(e){return e})).catch((function(e){return e}))}({page:e.pagination,platform:e.platform}).then((function(t){t.data.success&&e.dispatch(Mn(t.data.data)),f(!1)})).catch((function(e){console.error(e.response)})))}),[e.pagination]),Object(o.useEffect)((function(){e.isTemplate||(e.dispatch(Mn(xu)),e.dispatch({type:"TEMPLATE_TRIGGER",payload:{isTemplate:!0}}))}),[e.templates,e.isTemplate]),Object(o.useEffect)((function(){if("elementor"===e.platform){var t=[];e.templates.hasOwnProperty(e.pagination)&&(e.templates[e.pagination].map((function(e){t.push(i.a.createElement(hu,{isLoading:function(e){return f(e)},key:e.id,file_type:e.type,id:e.id,name:e.title,date:e.date,template:e}))})),r(t),c(e.templates.total_page))}}),[e.templates,e.pagination]),i.a.createElement(Zc,null,i.a.createElement("div",{className:"templately-modal-content templately-templates"},s&&i.a.createElement(Ou,null),!s&&i.a.createElement(i.a.Fragment,null,i.a.createElement(eu,{className:"templately-clouds-table"},i.a.createElement(au,null),i.a.createElement(yu,{className:"templately-table-body"},n)),i.a.createElement(wu,{type:"templates",count:l}))))})),ju=n(57),Pu=n.n(ju);function Cu(e){return(Cu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Tu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Au(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Nu(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Iu(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Iu(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Iu(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Lu=wp.i18n.__,Du=TemplatelyAdmin,Ru=Du.nonce,Mu=Du.cloud_activity,Fu=wp.apiFetch,zu=tt((function(e){return{user:e.admin.user||!1,isLoggedIn:e.common.isLoggedIn,platform:e.common.platform,workspaceList:e.workspaces.workspacesList,sharedWorkspaceList:e.sharedWorkspaces.sharedWorkspaceList}}))((function(e){var t=Nu(Object(o.useState)(""),2),n=t[0],r=t[1],a=Nu(Object(o.useState)(!0),2),l=a[0],c=a[1],u=Nu(Object(o.useState)(!1),2),s=u[0],f=u[1],p=Nu(Object(o.useState)(!1),2),d=p[0],m=p[1],h=Nu(Object(o.useState)(!1),2),y=h[0],g=h[1],v=Nu(Object(o.useState)([Mu]),2),b=v[0],w=v[1],E=Nu(Object(o.useState)(Mu),2),O=E[0],k=E[1],S=Nu(Object(o.useState)(!1),2),x=S[0],_=S[1],j=Nu(Object(o.useState)("/clouds?refresh"),2),P=j[0],C=j[1],T=Nu(Object(o.useState)([]),2),A=T[0],N=T[1];return Object(o.useEffect)((function(){e.dispatch({type:"SET_NEXT_ROUTE",payload:"/templates/save"}),e.isLoggedIn||e.dispatch(Zn("/sign-in"));!function(t,n){if(A.length<=0)Promise.all([yi(!1,!1),yi(!0,!1)]).then((function(t){if(t.length>0){var n=[];n.push({label:Lu("My Clouds","templately"),value:"clouds"}),null!==t[0]&&(e.dispatch(ar(t[0])),n.push({label:Lu("My WorkSpace","templately"),options:gi(t[0])})),null!==t[1]&&(e.dispatch(or(t[1])),n.push({label:Lu("Shared WorkSpace","templately"),options:gi(t[1],!0)})),w(n),N(n)}})).catch((function(e){Do.a.isCancel(e)||console.error("Something went wrong: regarding fetching WorkSpace list",e)}));else{var r=[];if(r.push({label:Lu("My Clouds","templately"),value:"clouds"}),e.workspaceList.length>0&&r.push({label:Lu("My WorkSpace","templately"),options:gi(e.workspaceList)}),e.sharedWorkspaceList.length>0&&r.push({label:Lu("Shared WorkSpace","templately"),options:gi(e.sharedWorkspaceList)}),r.length>0){var a=[];r.map((function(e){e&&null!=e.options&&(e.options=e.options.filter((function(e){return e.slug&&-1!==e.slug.indexOf(t.toLowerCase())}))),a.push(e)})),w(r)}}}()}),[]),Object(o.useEffect)((function(){c(!(n.length>0))}),[n]),Object(o.useEffect)((function(){f(d)}),[d]),Object(o.useEffect)((function(){if("gutenberg"===e.platform&&s){var t=parseInt(O.value),r=wp.data.select("core/editor").getEditedPostAttribute("title"),a=wp.data.select("core/editor").getEditedPostContent(),o=wp.data.select("core/editor").getCurrentPostId(),i=wp.data.select("core/editor").getCurrentPostType(),l=wp.data.select("core/editor").isEditedPostEmpty(),c={title:r,content:a};0===c.content.length&&ii("You have no content to save in Templately.",{timer:2e3,icon:"warning"}),l||(wp.data.dispatch("core/editor").savePost(),Fu({path:"/wp/v2/".concat(i,"s/").concat(o),method:"POST",data:c}).then((function(r){var a=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Tu(Object(n),!0).forEach((function(t){Au(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Tu(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({__file:"wp_block"},c),o=new FormData;o.append("action","get_templately"),o.append("content_type","push_to_cloud"),o.append("nonce",Ru),isNaN(t)||(o.append("workspace_id",t),o.append("workspaceActivity",JSON.stringify(O)),O.shared?C("/shared/workspace/"+O.slug+"?refresh"):C("/workspace/"+O.slug+"?refresh")),o.append("title",n),o.append("data",JSON.stringify(a)),o.append("file_type","gutenberg"),_(!0),Do.a.post(ajaxurl,o).then((function(t){if(t.data.success){var n=JSON.parse(t.data.data.data);null!=n?(n.hasOwnProperty("myCloud_item")&&e.dispatch(er(n.myCloud_item)),_("redirect")):(ii("Something went wrong.",{timer:2e3,icon:"error"}),C("/templates/save"),_("redirect"))}else ii(t.data.data,{timer:2e3,icon:"error"}),_("redirect"),C("/templates/save")}))}))),f(!1)}if(s&&"elementor"===e.platform){var u=parseInt(O.value),p={};isNaN(u)||((p={workspace_id:u}).workspaceActivity=JSON.stringify(O),O.shared?C("/shared/workspace/"+O.slug+"?refresh"):C("/workspace/"+O.slug+"?refresh")),_(!0);var d=null==e.page||!0===e.page?elementor.previewView.el.firstElementChild.firstElementChild:e.currentElement.el,m=navigator.userAgent.toLowerCase().indexOf("firefox")>-1;if(null==d||m){if(null!=d)ci(n,d,p).then((function(t){if(t.data.success&&null!=t.data.data.data){var n=JSON.parse(t.data.data.data);"object"==Cu(n)&&(n.hasOwnProperty("myCloud_item")&&e.dispatch(er(n.myCloud_item)),_("redirect"),ii(t.data.data.message,{timer:2e3,icon:"success"}))}else ii("Something went wrong.",{timer:2e3,icon:"error"}),_("redirect"),C("/templates/save")})).catch((function(e){return console.error("Pushed Error: ",e)}))}else Pu.a.toJpeg(d,{width:d.clientWidth,bgcolor:"#fff"}).then((function(t){p.thumbnail=t,ci(n,d,p).then((function(t){if(t.data.success&&null!=t.data.data.data){var n=JSON.parse(t.data.data.data);"object"==Cu(n)&&(n.hasOwnProperty("myCloud_item")&&e.dispatch(er(n.myCloud_item)),_("redirect"),ii(t.data.data.message,{timer:2e3,icon:"success"}))}else ii("Something went wrong.",{timer:2e3,icon:"error"}),_("redirect"),C("/templates/save")})).catch((function(e){return console.error("Pushed Error: ",e)}))})).catch((function(e){return console.error("DOMtoIMAGE ERROR: ",e)}));f(!1)}}),[s]),Object(o.useEffect)((function(){y&&k(y)}),[y]),i.a.createElement(Zc,null,i.a.createElement("div",{className:"templately-modal-content templately-templates-save"},x&&i.a.createElement(Ou,null),"redirect"===x&&i.a.createElement(G,{to:P}),!1===x&&i.a.createElement("div",null,i.a.createElement("h3",null,Lu("Save Your Template And Push to Cloud","templately")," "),i.a.createElement("div",{className:"templately-save-form"},i.a.createElement("div",null,i.a.createElement("input",{autoFocus:!0,type:"text",onKeyDown:function(e){return m(13===e.keyCode)},onChange:function(e){return r(e.currentTarget.value)},value:n,placeholder:"Template Name"}),i.a.createElement(Co,{maxMenuHeight:"200px",options:b,value:O,onChange:function(e){return g(e)}})),i.a.createElement("button",{disabled:l,className:"templately-button",onClick:function(){return f(!0)}},Lu("Save & Push","templately"))))))}));n(110);function Uu(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Bu(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Bu(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Bu(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Vu=wp.i18n.__,Wu=function(e){return i.a.createElement("input",{type:e.type||"text",className:"widefat templately-input",placeholder:e.placeholder,name:e.name,value:e.value,onBlur:function(t){return e.onBlur&&e.onBlur(t.target.value)},onChange:function(t){return e.onChange(t.target.value)}})},Hu=tt()((function(e){var t=Uu(Object(o.useState)(""),2),n=t[0],r=t[1],a=Uu(Object(o.useState)(""),2),l=a[0],c=a[1],u=Uu(Object(o.useState)(""),2),s=u[0],f=u[1],p=Uu(Object(o.useState)(""),2),d=p[0],m=p[1],h=Uu(Object(o.useState)(null),2),y=h[0],g=h[1],v=Uu(Object(o.useState)(""),2),b=v[0],w=v[1],E=Uu(Object(o.useState)(!0),2),O=E[0],k=E[1],S=Uu(Object(o.useState)(!1),2),x=S[0],_=S[1],j=Uu(Object(o.useState)(!1),2),P=j[0],C=j[1],T=Uu(Object(o.useState)(!1),2),A=T[0],N=T[1],I=Uu(Object(o.useState)(!1),2),L=I[0],D=I[1];return Object(o.useEffect)((function(){k(!0),""!=n&&""!=l&&""!=d&&""!=b&&""!=s&&x&&P&&mi(s)&&d===b&&Ei(d)&&k(!1)}),[n,l,s,d,b,x,P]),Object(o.useEffect)((function(){null!==y&&("password"!==y&&"confirm_password"!==y||!(d.length>0||b.length>0)||(Ei(d)||ii(Vu("Password must contain at least 8 characters, uppercase, lowercase and numbers."),{icon:"warning",showCloseButton:!0}),"confirm_password"===y&&d!==b&&ii(Vu("Passwords do not match."),{icon:"warning",showCloseButton:!0})),"email"===y&&s.length>0&&!mi(s)&&ii(Vu("Please insert a valid email address."),{icon:"warning",showCloseButton:!0}),g(null))}),[y]),Object(o.useEffect)((function(){A&&(D(!0),function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=new FormData;return null!=e.first_name&&t.append("first_name",e.first_name),null!=e.last_name&&t.append("last_name",e.last_name),null!=e.email&&t.append("email",e.email),null!=e.password&&t.append("password",e.password),t.append("nonce",ai),t.append("action","get_templately"),t.append("content_type","create_user"),Do.a.post(ajaxurl,t).then((function(e){return e})).catch((function(e){return e}))}({first_name:n,last_name:l,email:s,password:d}).then((function(t){if(void 0!==t&&void 0!==t.data&&t.data.success)TemplatelyAdmin.is_logged_in=!0,e.dispatch(Vn(!0)),null!==e.next_route?e.dispatch(Zn(e.next_route)):e.dispatch(Zn("/settings")),e.dispatch(Jn(t.data.data)),e.dispatch(Xn(t.data.data.admin));else if(D(!1),"string"==typeof t.data.data)ii(t.data.data,{timer:2e3,icon:"error"});else{var n=Object.keys(t.data.data).map((function(e){return i.a.createElement("div",null,t.data.data[e])}));ii(i.a.createElement("div",null,n),{timer:2e3,icon:"error"})}})).catch((function(e){return console.error("Error:",e)})),N(!1))}),[A]),i.a.createElement(i.a.Fragment,null,L&&i.a.createElement(Ou,null),i.a.createElement("h3",null,Vu("Create Account!","templately")),i.a.createElement("div",{className:"tadmin-form-row"},i.a.createElement("div",{className:"templately-left"},i.a.createElement(Wu,{placeholder:"First Name",name:"first_name",value:n,onChange:function(e){return r(e)}})),i.a.createElement("div",{className:"templately-right"},i.a.createElement(Wu,{placeholder:"Last Name",name:"last_name",value:l,onChange:function(e){return c(e)}}))),i.a.createElement(Wu,{placeholder:"Email",name:"email",value:s,onBlur:function(){return g("email")},onChange:function(e){return f(e)}}),i.a.createElement("div",{className:"tadmin-form-row"},i.a.createElement("div",{className:"templately-left"},i.a.createElement(Wu,{placeholder:"Password",name:"password",type:"password",value:d,onBlur:function(){return g("password")},onChange:function(e){return m(e)}})),i.a.createElement("div",{className:"templately-right"},i.a.createElement(Wu,{placeholder:"Confirm Password",name:"confirm_password",type:"password",value:b,onBlur:function(){return g("confirm_password")},onChange:function(e){return w(e)}}))),i.a.createElement("div",{className:"widefat templately-input-consent"},i.a.createElement("input",{id:"elem-consent",type:"checkbox",onChange:function(e){return _(e.currentTarget.checked)},name:"consent"}),i.a.createElement("label",{htmlFor:"elem-consent"},"I agree to the Templately"," ",i.a.createElement("a",{href:"https://templately.com/privacy-policy",target:"_blank"},"Privacy Policy"),".")),i.a.createElement("div",{className:"widefat templately-input-consent"},i.a.createElement("input",{id:"elem-consent-terms",type:"checkbox",onChange:function(e){return C(e.currentTarget.checked)},name:"consent"}),i.a.createElement("label",{htmlFor:"elem-consent-terms"},"I agree to the Templately"," ",i.a.createElement("a",{href:"https://templately.com/terms-of-services",target:"_blank"},"Terms of Services"),".")),i.a.createElement("button",{disabled:O,onClick:function(){return N(!0)},className:"button button-primary templately-button",type:"submit"},Vu("Create Account","templately")),i.a.createElement("p",{className:"templately-new-here"},i.a.createElement("span",{onClick:function(){return e.tab(1)}}," ",Vu("Already have an account?","templately"))))}));function $u(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return qu(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return qu(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function qu(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Ku=wp.i18n.__,Qu=tt((function(e){return{isLoggedIn:e.common.isLoggedIn,errorText:e.admin.errorText,next_route:e.common.next_route,is_global_login:e.common.is_global_login,user_can_logout:e.common.user_can_logout,is_linked_login:e.common.is_linked_login}}))((function(e){var t,n=$u(Object(o.useState)(""),2),r=n[0],a=n[1],l=$u(Object(o.useState)(""),2),c=l[0],u=l[1],s=$u(Object(o.useState)(""),2),f=s[0],p=s[1],d=$u(Object(o.useState)("password"),2),m=d[0],h=d[1],y=$u(Object(o.useState)(!0),2),g=y[0],v=y[1],b=$u(Object(o.useState)(!1),2),w=b[0],E=b[1],O=$u(Object(o.useState)(!1),2),k=O[0],S=O[1],x=$u(Object(o.useState)(null),2),_=x[0],j=x[1],P=$u(Object(o.useState)(!1),2),C=P[0],T=P[1];return Object(o.useEffect)((function(){return function(){clearTimeout(t)}}),[]),Object(o.useEffect)((function(){null!==_&&("email"===_&&r.length>0&&!mi(r)&&ii(Ku("Please insert a valid email address."),{icon:"warning",showCloseButton:!0}),j(null))}),[_]),Object(o.useEffect)((function(){if(w){var n={};"api"===m?n.api_key=f:(n.email=r,n.password=c),n.global_signin=C,S(!0),function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=new FormData;return n.append("withApi",t),t?null!=e.api_key&&n.append("api_key",e.api_key):(null!=e.email&&n.append("email",e.email),null!=e.password&&n.append("password",e.password)),null!=e.global_signin&&n.append("global_signin",e.global_signin),n.append("nonce",ai),n.append("action","get_templately"),n.append("content_type","login_user"),Do.a.post(ajaxurl,n).then((function(e){return e})).catch((function(e){return e}))}(n,"api"===m).then((function(t){t.hasOwnProperty("data")?t.data.success?(S(!1),TemplatelyAdmin.is_logged_in=!0,e.is_linked_login||C?C&&e.dispatch(Tn(!0)):(e.dispatch(Tn(!1)),e.dispatch(Nn(!0))),e.dispatch(In("")),e.dispatch(Vn(!0)),null!==e.next_route?e.dispatch(Zn(e.next_route)):e.user_can_logout||e.is_linked_login?e.dispatch(Zn("/settings")):e.dispatch(Zn("/settings?refresh")),e.dispatch(Jn(t.data.data)),e.dispatch(Xn(t.data.data.admin))):(ii(t.data.data,{timer:1500,icon:"error"}),S(!1)):(S(!1),ii(Ku("Something went wrong.","elmentorify"),{timer:1500,icon:"error"}))})).catch((function(e){S(!1),ii(Ku("Something went wrong.","elmentorify"),{timer:1500,icon:"error"})})).finally((function(){t=setTimeout((function(){e.dispatch(Jn(null))}),5e3)})),E(!1)}}),[w]),Object(o.useEffect)((function(){e.errorText&&e.dispatch(tr(null)),v(!0),"api"===m?f.length>=20&&v(!1):mi(r)&&c.length>=8&&v(!1)}),[c,r,f]),i.a.createElement(i.a.Fragment,null,"password"===m&&i.a.createElement(i.a.Fragment,null,i.a.createElement("h3",null,Ku("Great to have you back!","templately")),i.a.createElement("button",{className:"button templately-connect-btn",onClick:function(){return h("api")}},"Connect via API"),i.a.createElement("input",{className:"widefat templately-input",placeholder:"Email",name:"email",onBlur:function(){return j("email")},value:r,onChange:function(e){return a(e.target.value)}}),i.a.createElement("input",{type:"password",className:"widefat templately-input",placeholder:"Password",name:"password",value:c,onChange:function(e){return u(e.target.value)}}),!e.is_global_login&&i.a.createElement(i.a.Fragment,null,i.a.createElement("label",{htmlFor:"global-sign-in",className:"global-sign-in"},i.a.createElement("input",{type:"checkbox",className:"templately-input",id:"global-sign-in",name:"global-sign-in",onChange:function(){return T(!C)}}),i.a.createElement("span",null,Ku("Global Sign In","templately"))),i.a.createElement("p",{className:"templately-helptext"},Ku("All the sitewide users will be logged in with this Templately account","templately"))),i.a.createElement("button",{disabled:g,onClick:function(){return E(!0)},className:"button templately-button",type:"submit"},Ku(k?"Signing In...":"Sign In","templately"))),"api"===m&&i.a.createElement(i.a.Fragment,null,i.a.createElement("button",{className:"button templately-connect-btn",onClick:function(){return h("password")}},"Connect via Login Credentials"),i.a.createElement("div",{className:"templately-api-input-wrapper"},i.a.createElement("input",{className:"widefat templately-input",placeholder:"API Key",name:"api_key",value:f,onChange:function(e){return p(e.target.value)}}),i.a.createElement("a",{href:"https://templately.com/manageapis",target:"_blank"},Ku("Get API Key","templately"))),i.a.createElement("button",{disabled:g,onClick:function(){return E(!0)},className:"button templately-button",type:"submit"},Ku("Connect","templately"))),i.a.createElement("p",{className:"templately-new-here"},Ku("New here?","templately")," ",i.a.createElement("span",{onClick:function(){return e.tab(2)}}," ",Ku("Create an account!","templately")),i.a.createElement("a",{href:"https://templately.com/forgot-password",target:"_blank"},Ku("Forgot Password?","templately"))))}));function Gu(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Yu(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Yu(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Yu(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Xu=wp.i18n.__,Ju=tt((function(e){return{isLoggedIn:e.common.isLoggedIn}}))((function(e){var t=Gu(Object(o.useState)(1),2),n=t[0],r=t[1];return Object(o.useEffect)((function(){e.isLoggedIn&&e.dispatch(Zn("/settings"))}),[]),Object(o.useEffect)((function(){e.isLoggedIn&&e.dispatch(Zn("/settings"))}),[e.isLoggedIn]),i.a.createElement("div",{className:"templately-admin-form-inner"},i.a.createElement("div",{className:"templately-login-form"},i.a.createElement("div",{className:"templately-admin-header"},i.a.createElement("div",{className:"templately-admin-title"},i.a.createElement("h1",null,Xu("Explore 100+ Free Templates","templately")),i.a.createElement("p",null,Xu("From multipurpose themes to niche templates, you’ll always find something that catches your eye.","templately")))),i.a.createElement("div",{className:"templately-admin-content"},i.a.createElement("div",{className:"templately-left"},i.a.createElement("div",{className:"templately-cloud-video-container"},i.a.createElement("iframe",{height:"350",src:"https://www.youtube.com/embed/coLxfjnrm3I",frameBorder:"0",allow:"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0}))),i.a.createElement("div",{className:"templately-right"},i.a.createElement("div",{className:"templately-admin-tab"},i.a.createElement("ul",null,i.a.createElement("li",{onClick:function(){return r(1)},className:"".concat(1===n?"active":""," ")},Xu("Sign In","templately")),i.a.createElement("li",{onClick:function(){return r(2)},className:"".concat(2===n?"active":""," ")},Xu("Sign Up","templately"))),i.a.createElement("div",{className:"templately-admin-tab-content"},i.a.createElement("div",{className:"templately-admin-tcontent ".concat(1===n?"active":"")},i.a.createElement(Qu,{tab:function(e){return r(e)}})),i.a.createElement("div",{className:"templately-admin-tcontent ".concat(2===n?"active":"")},i.a.createElement(Hu,{tab:function(e){return r(e)}}))))))))}));function Zu(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return es(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return es(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function es(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var ts=wp.i18n.__,ns=tt((function(e){return{user:e.admin.user,isLoggedIn:e.common.isLoggedIn,user_can_logout:e.common.user_can_logout,is_linked_login:e.common.is_linked_login}}))((function(e){var t=Zu(Object(o.useState)(!1),2),n=t[0],r=t[1],a=e.user;return Object(o.useEffect)((function(){e.isLoggedIn||e.dispatch(Zn("/sign-in"))}),[]),Object(o.useEffect)((function(){var t;0!=n&&(((t=new FormData).append("action","get_templately"),t.append("content_type","logout"),t.append("nonce",ai),Do.a.post(ajaxurl,t).then((function(e){return e})).catch((function(e){return console.error("Fav Error: ",e.response)}))).then((function(t){t.data.success?(TemplatelyAdmin.is_logged_in=!1,e.dispatch(Vn(!1)),e.dispatch(An(!1)),e.dispatch(Xn([])),ii(ts("Successfully Logged Out.","templately"),{icon:"success",timer:1500}),e.dispatch(Zn("/sign-in"))):ii(ts("Something went wrong.","templately"),{icon:"error",timer:1500})})),r(!1))}),[n]),i.a.createElement("div",{className:"templately-admin-form-inner templately-profile"},i.a.createElement("div",{className:"templately-login-form"},i.a.createElement("div",{className:"templately-manage-accounts"},i.a.createElement("h1",null,ts("Hey","templately")," ",a.display_name||a.name,","," ",ts("Welcome Back!","templately")),i.a.createElement("div",{className:"templately-account-details"},i.a.createElement("strong",null,ts("Account Details","templately"),":"),i.a.createElement("table",{bgcolor:"transparent",border:"0",cellPadding:"0",cellSpacing:"0"},i.a.createElement("tbody",null,a.email&&i.a.createElement("tr",null,i.a.createElement("th",null,i.a.createElement("strong",null,ts("Email","templately"),":")),i.a.createElement("td",null,a.email)),a.plan&&i.a.createElement("tr",null,i.a.createElement("th",null,i.a.createElement("strong",null,ts("Plan","templately"),":")),i.a.createElement("td",{className:"templately-plan"},"free"===a.plan?"Starter":a.plan)),a.joined&&i.a.createElement("tr",null,i.a.createElement("th",null,i.a.createElement("strong",null,ts("Joining Date","templately"),":")),i.a.createElement("td",null,a.joined)),""!=a.plan_expire_at&&i.a.createElement("tr",null,i.a.createElement("th",null,i.a.createElement("strong",null,ts("Expiry Date","templately"),":")),i.a.createElement("td",null,a.plan_expire_at))))),i.a.createElement("div",null,i.a.createElement("a",{className:"button templately-button",target:"_blank",href:"https://templately.com/profile"},ts("Manage Account","templately")),e.user_can_logout&&i.a.createElement(i.a.Fragment,null,i.a.createElement("button",{onClick:function(){return r(!0)},className:"button templately-button"},ts("Logout","templately"))),e.is_linked_login&&!e.user_can_logout&&i.a.createElement("button",{onClick:function(){return r(!0)},className:"button templately-button"},ts("Unlink My Account","templately")),!e.user_can_logout&&!e.is_linked_login&&i.a.createElement(he,{className:"button templately-button",to:"/sign-in"},ts("Link My Account","templately"))))))})),rs=n(58),as=wp.i18n.__,os=function(e){return i.a.createElement("div",{className:"templately-item-badge ".concat(e.pro?"templately-pro":"templately-free")},i.a.createElement("span",null,e.pro?as("Pro","templately"):as("Starter","templately")))};function is(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return ls(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ls(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ls(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var cs=wp.i18n.__,us=TemplatelyAdmin,ss=us.loadingImage,fs=(us.is_editor,function(e){var t=e.content,n=is(Object(o.useState)(!1),2),r=n[0],a=n[1],l=is(Object(o.useState)(!1),2),c=l[0],u=l[1],s=is(Object(o.useState)(""),2),f=s[0],p=s[1],d=is(Object(o.useState)(!1),2),m=d[0],h=d[1],y=is(Object(o.useState)(!1),2),g=y[0],v=y[1],b=is(Object(o.useState)(""),2),w=b[0],E=b[1],O=is(Object(o.useState)(!1),2),k=O[0],S=O[1],x=is(Object(o.useState)(!1),2),_=x[0],j=x[1];return Object(o.useEffect)((function(){var t,n,r,o;0!=g&&(a(!0),(t=g,n=w,r=e.platform,(o=new FormData).append("action","get_templately"),o.append("content_type","create_page"),o.append("title",n),o.append("nonce",ai),o.append("id",t),o.append("platform",r),Do.a.post(ajaxurl,o).then((function(e){return e.data.success?e.data.data:e})).catch((function(e){return e}))).then((function(e){e.hasOwnProperty("data")&&e.data.hasOwnProperty("success")&&!1===e.data.success?(e.data.hasOwnProperty("data")&&e.data.data.hasOwnProperty("errorCode")?(u("required_pro"===e.data.data.errorCode),p(e.data.data.message)):p(e.data.data),a(!1)):(a(!1),S(e))})),v(!1),E(""))}),[g]),Object(o.useEffect)((function(){var e,t;0!=m&&(a(!0),(e=m,(t=new FormData).append("action","get_templately"),t.append("content_type","import_to_library"),t.append("nonce",ai),t.append("id",e),t.append("is_editor",Boolean(oi)),Do.a.post(ajaxurl,t).then((function(e){return e.data.success?e.data.data:e})).catch((function(e){return e}))).then((function(e){u(!1),e.hasOwnProperty("data")&&e.data.hasOwnProperty("success")&&!1===e.data.success?(e.data.hasOwnProperty("data")&&e.data.data.hasOwnProperty("errorCode")?(u("required_pro"===e.data.data.errorCode),p(e.data.data.message)):p(e.data.data),a(!1)):(a(!1),S(e))})).catch((function(e){return console.error("Importing went wrong: ",e)})),h(!1))}),[m]),Object(o.useEffect)((function(){a(!0),function(e){if(e.length<=0)return!1;var t=new FormData;return t.append("action","get_templately"),t.append("nonce",ai),t.append("content_type","platform_exists"),t.append("platform",e),Do.a.post(ajaxurl,t).then((function(e){return e})).catch((function(e){return e}))}(e.platform).then((function(e){a(!1),e.data.data?j(!0):j(!1)}))}),[]),i.a.createElement(i.a.Fragment,null,r&&i.a.createElement("div",{className:"templately-pre-loader templately-platform-check"},i.a.createElement("img",{src:ss}),i.a.createElement("p",null,"Checking platform exists or not...")),!r&&i.a.createElement("div",{className:"templately-import-modal"},i.a.createElement("div",{className:"templately-im-header"},i.a.createElement("h3",null,e.title)),i.a.createElement("div",{className:"templately-im-body"},!1!==k&&i.a.createElement("div",{className:"templately-imb-section"},i.a.createElement("p",null,cs("Template imported successfully! You can now edit or preview the template and push to Templately cloud.","templately")),i.a.createElement("a",{className:"templately-modal-button button",href:k.edit_link},cs("Edit Template","templately")),0!=k.elementor_edit_link&&i.a.createElement("a",{className:"templately-modal-button button",href:k.elementor_edit_link},cs("Edit Template with Elementor","templately")),i.a.createElement("a",{className:"templately-modal-button button",href:k.visit},cs("Preview Template","templately"))),""!==f&&i.a.createElement("div",{className:"templately-imb-section"},i.a.createElement("p",null,f),c&&i.a.createElement("a",{href:"https://templately.com",target:"_blank"},cs("Upgrade to Pro","templately"))),0==k&&_&&""===f&&i.a.createElement(i.a.Fragment,null,"elementor"===e.platform&&i.a.createElement("div",{className:"templately-imb-section"},i.a.createElement("p",null,"Import this template to your library to make it available in your Elementor Saved Templates(opens in a new tab) list for future use."),i.a.createElement("button",{className:"templately-modal-button button",onClick:function(){return h(t.id)}},cs("Import to Library","templately"))),i.a.createElement("div",{className:"templately-imb-section"},i.a.createElement("p",null,"Create a new page from this template to make it available as a draft page in your Pages list."),i.a.createElement("div",{className:"templately-imb-new-form"},i.a.createElement("input",{className:"widefat",type:"text",value:w,onChange:function(e){return E(e.currentTarget.value)}}),i.a.createElement("button",{className:"templately-modal-button button",disabled:""===w,onClick:function(){return v(t.id)}},cs("Create a Page","templately"))))),0==k&&!_&&i.a.createElement(i.a.Fragment,null,i.a.createElement("p",null,"You should have install"," ",cs(e.platform,"templately")," first.")))))});function ps(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ds(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ps(Object(n),!0).forEach((function(t){ms(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ps(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ms(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hs(e){return function(e){if(Array.isArray(e))return vs(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||gs(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ys(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||gs(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function gs(e,t){if(e){if("string"==typeof e)return vs(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?vs(e,t):void 0}}function vs(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var bs=wp.i18n.__,ws=TemplatelyAdmin,Es=ws.loadingImage,Os=ws.is_editor,ks=ws.is_block_editor,Ss=function(e){var t=e.requirement,n=e.completeCallback,r=e.setErrors,a=e.errors,l=ys(Object(o.useState)(!0),2),c=l[0],u=l[1],s=ys(Object(o.useState)(!1),2),f=s[0],p=s[1],d=ys(Object(o.useState)(!1),2),m=d[0],h=d[1],y=ys(Object(o.useState)({}),2),g=y[0],v=y[1];return t?(Object(o.useEffect)((function(){wi(t).then((function(e){u(e.loading),p(e.error),v(e.data)}))}),[]),Object(o.useEffect)((function(){m&&(u(!0),p(!1),wi(t).then((function(e){if(!e.error){var n=a.filter((function(e){return e.id!==t.id}));r(n)}u(e.loading),p(e.error),v(e.data)})),h(!1))}),[m]),Object(o.useEffect)((function(){c||n(f)}),[c]),Object(o.useEffect)((function(){f&&r([].concat(hs(a),[t]))}),[f]),i.a.createElement(i.a.Fragment,null,c?i.a.createElement("span",{className:"templately-installing"},i.a.createElement("span",{className:"dashicons dashicons-update"}),"Installing..."):null,f?g&&g.errorMessage?i.a.createElement("span",{className:"templately-error"},i.a.createElement("span",{className:"dashicons dashicons-no"}),g.errorMessage):i.a.createElement("button",{className:"button button-small templately-retry",onClick:function(){return h(!0)}},i.a.createElement("span",{className:"dashicons dashicons-no"}),"Retry & Proceed to Import"):null,c||f?null:i.a.createElement("span",{className:"templately-success"},i.a.createElement("span",{className:"dashicons dashicons-yes-alt"})," Success"))):(Object(o.useEffect)((function(){n()}),[]),bs("Ignored","templately"))},xs=function(e){var t=ys(Object(o.useState)(!1),2),n=t[0],r=t[1],a=ys(Object(o.useState)(!0),2),l=a[0],c=a[1],u=ys(Object(o.useState)([]),2),s=u[0],f=u[1],p=ys(Object(o.useState)(!1),2),d=p[0],m=p[1],h=ys(Object(o.useState)(null),2),y=h[0],g=h[1],v=ys(Object(o.useState)({}),2),b=v[0],w=v[1],E=ys(Object(o.useState)([]),2),O=E[0],k=E[1];Object(o.useEffect)((function(){var t,n,a;return(n=e.dependencyList,(a=new FormData).append("action","get_templately"),a.append("content_type","check_dependency"),a.append("nonce",ai),a.append("dependency",JSON.stringify(n)),Do.a.post(ajaxurl,a).then((function(e){return e.data.success?e.data.data.dependency:[]}))).then((function(n){var a,o=[];n.length>0&&(n.map((function(e,t){o.push(e)})),a="name",o.sort(Zo(a)),f(o)),o.length>0?c(!1):t=setTimeout((function(){"elementor"===e.platform&&Boolean(Os)||Boolean(ks)&&"gutenberg"===e.platform?$o.a.close({insert:!0}):(c(!1),r(!0))}),1500)})),function(){return clearTimeout(t)}}),[]);var S=function(e){return void 0===b[e]||b[e]},x=function(){g((function(e){return e+1}))},_=function(e){k(e)};return Object(o.useEffect)((function(){null!=y&&y>s.length-1&&0===O.length&&("elementor"===e.platform&&Boolean(Os)||Boolean(ks)&&"gutenberg"===e.platform?$o.a.close({insert:!0}):r(!0))}),[y]),Object(o.useEffect)((function(){d&&$o.a.close({cancel:!0})}),[d]),i.a.createElement("div",{className:"templately-global-modal"},l&&i.a.createElement("div",{className:"templately-pre-loader templately-dependencies"},i.a.createElement("img",{src:Es}),i.a.createElement("p",null,"Checking dependecies...")),n&&!l&&i.a.createElement(fs,{platform:e.platform,title:e.title,content:e.content}),!l&&!n&&i.a.createElement("div",{className:"templately-installer-widget align-left"},i.a.createElement("h4",null,"To import this item you need to install all the Plugin(s) listed below:"),s.length>0&&i.a.createElement("ul",null,s.map((function(e,t){return i.a.createElement("li",{key:t},i.a.createElement("div",{className:"templately-checkbox"},i.a.createElement("input",{value:"1",type:"checkbox",id:"requirement".concat(t),disabled:null!==y&&!e.is_pro,checked:S(t)&&!e.is_pro,onChange:function(n){if(!e.is_pro){var r=!!n.target.checked;w((function(e){return ds(ds({},e),{},ms({},t,r))}))}}}),i.a.createElement("label",{htmlFor:"requirement".concat(t)},i.a.createElement("span",null,e.link&&"#"!=e.link&&""!=e.link?i.a.createElement("a",{target:"_blank",rel:"nofollow",href:e.link},e.name):e.name))),y===t||y>t?i.a.createElement(Ss,{key:"installing".concat(t),requirement:S(t)?e:null,completeCallback:x,errors:O,setErrors:function(e){return _(e)}}):null)}))),i.a.createElement("p",null,i.a.createElement("strong",null,"Note:")," Make sure you have manually installed the ",i.a.createElement("em",null,"Pro Plugin(s)")," necessary and listed above."),i.a.createElement("div",{className:"templately-btn-group"},i.a.createElement("button",{disabled:null!==y,onClick:function(){return m(!0)},className:"button button-large templately-installer-btn"},bs("Cancel","templately")),i.a.createElement("button",{disabled:null!==y,onClick:function(){return g(0)},className:"button button-large templately-installer-btn"},bs("Install & Proceed to Import","templately")))))};function _s(e){return(_s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function js(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ps(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?js(Object(n),!0).forEach((function(t){Cs(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):js(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Cs(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ts(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return As(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return As(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function As(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Ns=wp.i18n.__,Is=TemplatelyAdmin,Ls=Is.default_image,Ds=Is.is_editor,Rs=Is.platform,Ms=tt((function(e){return{preview:e.preview,favourites:e.admin.user.favourites,isLoggedIn:e.common.isLoggedIn,platform:e.common.platform,platform_exists:e.common.platforms}}))((function(e){var t=e.content,n=Ts(Object(o.useState)(!1),2),r=n[0],a=n[1],l=Ts(Object(o.useState)(!1),2),c=l[0],u=l[1],s=Ts(Object(o.useState)(!1),2),f=s[0],p=s[1],d=Ts(Object(o.useState)(!1),2),m=d[0],h=d[1],y=Ts(Object(o.useState)([]),2),g=y[0],v=y[1],b=Ts(Object(o.useState)(t.favourite_count),2),w=b[0],E=b[1];Object(o.useEffect)((function(){if(0!=r){if(!e.isLoggedIn)return e.dispatch(Zn("/sign-in")),void a(!1);ii("",{showCloseButton:!0,allowOutsideClick:!1,target:Ds?"#templately-app-modal":"#templatelyAdmin",html:i.a.createElement(xs,{dependencyList:t.dependencies,platform:e.platform,title:t.name,content:t})}).then((function(t){null!=t.insert&&t.insert&&(e.dispatch(Ln(Ps(Ps({},e.platform_exists),{},Cs({},"elementor",!0)))),e.dispatch(Un(!0)),li(r,"remote",{fileType:e.platform,is_editor:Boolean(Ds)}).then((function(t){if(!0===t)e.dispatch(Un(!1)),"gutenberg"!==Rs?window.TemplatelyModal.destroy():Ro.close();else{e.dispatch(Un(!1));var n="",r=!1;t.data&&t.data.data&&t.data.data.errorCode?("required_pro"===t.data.data.errorCode&&(r=!0),n=t.data.data.message):"string"==typeof t.data.data&&(n=t.data.data),ii("",{icon:"error",html:i.a.createElement(ki,{content:i.a.createElement("div",null,i.a.createElement("p",null,n),r&&i.a.createElement("a",{href:"https://templately.com",target:"_blank"},"Upgrade to Pro"))})})}})))})),a(!1)}}),[r]),Object(o.useEffect)((function(){if(!1!==c){var n={isOpen:!0,type:e.type,itemID:t.id,deep:++e.preview.deep,content:t};e.pack&&(n=Ps(Ps({},n),{type:2===n.deep?t.type:e.type})),"block"!==t.type&&"page"!==t.type&&(n=Ps(Ps({},n),{packSlug:t.slug})),"page"===t.type&&(n=Ps(Ps({},n),{pageSlug:t.slug})),"block"===t.type&&(n=Ps(Ps({},n),{itemSlug:t.slug})),e.dispatch(zn(n)),u(!1)}}),[c]),Object(o.useEffect)((function(){var n;m&&(f?(n=si(t.id,e.type,"set_unfavourite"),p(!1),E(w-1)):(n=si(t.id,e.type),p(!0),E(w+1)),n.then((function(t){t.data.success&&e.dispatch(Xn(t.data.data))})),h(!1))}),[m]);var O="block"===e.type||"page"===e.type?"item":"pack";return Object(o.useEffect)((function(){if(p(void 0!==e.favourites&&e.favourites[O].includes(t.id)),t.dependencies&&t.dependencies.length>0){var n=[];t.dependencies.map((function(e,t){null!=e.icon&&n.push(i.a.createElement("img",{key:t,src:e.icon,alt:e.name}))})),v(n)}}),[]),i.a.createElement(i.a.Fragment,null,"object"==_s(t)&&i.a.createElement("div",{className:"templately-single-item templately-".concat(e.pack?"pack":"block"," ").concat(e.preview.isOpen?"templately-preview-item":"")},i.a.createElement("div",null,i.a.createElement("div",{className:"templately-item-image"},i.a.createElement(os,{pro:0!=t.price}),i.a.createElement(rs.LazyLoadImage,{height:"200px",effect:"blur",width:"100%",delayTime:"500",visibleByDefault:!0,alt:t.name,src:t.thumbnail||Ls}),i.a.createElement("div",{className:"templately-item-image-hover"},i.a.createElement("span",{onClick:function(){return u(!0)}},i.a.createElement(yn,{size:"20",color:"#fff"})),g.length>0&&i.a.createElement("div",{className:"templately-item-dependencies-icon"},g))),i.a.createElement("div",{className:"templately-single-item-details"},i.a.createElement("div",{className:"templately-single-item-details-content"},i.a.createElement("p",{className:"item-title"},i.a.createElement("strong",null,t.name),!e.preview.isOpen&&i.a.createElement("span",{className:"item-author"},Ns("by","templately")," ",t.author.display_name||t.author.name)),!e.preview.isOpen&&i.a.createElement("p",{className:"item-price"},!e.pack&&i.a.createElement("button",{className:"templately-button",onClick:function(){return a(t.id)}},i.a.createElement(mn,{color:"#6072ff"})))),i.a.createElement("div",{className:"templately-single-item-details-hover"},i.a.createElement("div",{className:"templately-fav-rating"},i.a.createElement("button",{className:"templately-button templately-fav",onClick:function(){return h(!0)}},i.a.createElement(vn,{size:"16px",color:f?"#f5365b":"#ddd"}),i.a.createElement("span",null,w)),i.a.createElement("span",{className:"templately-ratings"},i.a.createElement(Sn,{size:"16px",color:"#ffdc63"}),i.a.createElement("span",null,null==t.rating?0:t.rating.toFixed(1)))),("block"==e.type||"page"==e.type||e.preview.isOpen)&&i.a.createElement("button",{className:"templately-button",onClick:function(){return a(t.id)}},i.a.createElement(mn,{color:"#6072ff"})))))))}));function Fs(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return zs(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return zs(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function zs(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Us=function(e){var t=Fs(Object(o.useState)(!1),2),n=t[0],r=t[1],a=Object(o.useRef)(null),l=function(){a.current&&r(a.current.getBoundingClientRect().top<=0)};return Object(o.useEffect)((function(){return window.addEventListener("scroll",l),function(){window.addEventListener("scroll",(function(){return l}))}}),[]),i.a.createElement("div",{className:"templately-modal-sidebar".concat(n?" sticky":""),ref:a},i.a.createElement("div",{className:"templately-modal-sidebar-inner"},e.children))};n(111);function Bs(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Vs(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Vs(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Vs(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Ws=tt((function(e){return{activeSidebar:e.common.activeSidebar}}))((function(e){var t=e.name,n=e.child||[],r=Bs(Object(o.useState)(!1),2),a=r[0],l=r[1],c=[];return n.map((function(t,n){c.push(i.a.createElement("li",{className:"templately-sidebar-menu-item ".concat(e.activeSidebar.activeSidebarMenu===t.id?"templately-smenu-active":""),key:t.id},i.a.createElement("span",{onClick:function(){e.dispatch(Hn({activeSidebarMenu:t.id,activeParentSidebarMenu:e.id})),e.dispatch(Qn(1)),e.dispatch(Bn(!0)),e.dispatch(tr(null))}},t.name)))})),i.a.createElement("li",{className:"templately-sidebar-menu-item ".concat(n.length>0?"templately-has-sub":""," ").concat(e.activeSidebar.activeSidebarMenu===e.id||e.activeSidebar.activeParentSidebarMenu===e.id?"templately-smenu-active":"")},i.a.createElement("span",{onClick:function(){e.dispatch(Hn({activeSidebarMenu:e.id,activeParentSidebarMenu:e.id})),e.dispatch(tr(null)),e.dispatch(Bn(!0)),e.dispatch(Qn(1))}},t),n.length>0&&(a?i.a.createElement(fn,{onClick:function(){return l(!a)}}):i.a.createElement(cn,{onClick:function(){return l(!a)}})),n.length>0&&i.a.createElement("ul",{className:"templately-sidebar-submenu".concat(a?" tcollapse-submenu":"")},c))}));function Hs(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return $s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return $s(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function $s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var qs=function(e){var t=e.item,n=e.isSelected,r=Hs(Object(o.useState)(t.selected),2),a=r[0],l=r[1];return Object(o.useEffect)((function(){l(t.selected)}),[t.selected]),Object(o.useEffect)((function(){null!==a&&n({id:t.id,selected:a,is_pro:t.is_pro})}),[a]),i.a.createElement("li",{key:t.id},i.a.createElement("input",{id:"tsdf-".concat(t.id),type:"checkbox",checked:a,onChange:function(){return l(!t.selected)}}),i.a.createElement("label",{htmlFor:"tsdf-".concat(t.id)},i.a.createElement("span",null,t.name)))};function Ks(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Qs(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ks(Object(n),!0).forEach((function(t){Gs(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ks(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Gs(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ys(e){return function(e){if(Array.isArray(e))return Zs(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||Js(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Xs(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||Js(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Js(e,t){if(e){if("string"==typeof e)return Zs(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Zs(e,t):void 0}}function Zs(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var ef=wp.i18n.__,tf=tt((function(e){return{}}))((function(e){var t=Xs(Object(o.useState)(null),2),n=t[0],r=t[1],a=Xs(Object(o.useState)([]),2),l=a[0],c=a[1],u=Xs(Object(o.useState)([]),2),s=u[0],f=u[1],p=Xs(Object(o.useState)([]),2),d=p[0],m=p[1],h=Xs(Object(o.useState)(!0),2),y=h[0],g=h[1];return Object(o.useEffect)((function(){if(!e.button){c(e.dependencies);var t=e.dependencies.map((function(e){return e.id}));m(t),e.setSelected(t)}}),[e.dependencies]),Object(o.useEffect)((function(){if(!e.button&&l.length>0){var t=[];l.map((function(e){t.push(i.a.createElement(qs,{checked:e.selected,isSelected:function(e){return r(e)},key:e.id,item:e}))})),f(t)}}),[l,y]),Object(o.useEffect)((function(){if(!e.button){var t=d.length>0?Ys(d):[],n=Ys(l);n=n.map((function(e){return-1===t.indexOf(e.id)&&y?t.push(e.id):-1!==t.indexOf(e.id)&&!1===y&&(t=t.filter((function(t){return t!==e.id}))),Qs(Qs({},e),{},{selected:y})})),c(n),m(t),e.setSelected(t)}}),[y]),Object(o.useEffect)((function(){if(!e.button){var t=d.length>0?Ys(d):[],r=Ys(l);null!==n&&(!1===n.selected&&t.length>0?t=t.filter((function(e){return e!==n.id})):-1===t.indexOf(n.id)&&!0===n.selected&&t.push(n.id),r=r.map((function(e){return e.id===n.id?Qs(Qs({},e),{},{selected:n.selected}):e})),0===t.length&&g(!1),e.setSelected(t),c(r),m(t))}}),[n]),e.button?i.a.createElement("div",{className:"templately-sidebar-dependency-filter"},i.a.createElement("button",{className:"templately-filter-button button button-medium button-primary",onClick:function(){return e.setFilter(!0)}},ef("Filter","templately")),e.isReset&&i.a.createElement("button",{className:"templately-filter-button button button-medium button-primary templately-filter-clear",onClick:function(){return e.setReset(!1)}},ef("Reset","templately"))):0===s.length?"":i.a.createElement("div",{className:"templately-sidebar-dependency-filter ".concat("free"===e.active&&e.free||"pro"===e.active&&e.pro?"tsdf-open":"")},i.a.createElement("div",{className:"templately-sidebar-filter-head"},i.a.createElement("div",{className:"templately-pro-batch-select"},i.a.createElement("h4",null,i.a.createElement("input",{id:"tsdf-".concat(e.pro?"pro":"free","-batch-check"),type:"checkbox",checked:y,onChange:function(){r(null),g(!y)}}),i.a.createElement("label",{htmlFor:"tsdf-".concat(e.pro?"pro":"free","-batch-check")},i.a.createElement("span",null,ef("".concat(e.pro?"Pro":"Free"," Plugins Dependencies"),"templately"))),i.a.createElement("span",{className:"tsdf-actions",onClick:function(){return e.setActive(e.pro?"pro"===e.active?"":"pro":e.free?"free"===e.active?"":"free":"")}},"free"===e.active&&e.free||"pro"===e.active&&e.pro?i.a.createElement(fn,null):i.a.createElement(cn,null))))),i.a.createElement("ul",{className:"templately-sidebar-dependency-filter-list"},s))}));function nf(e){return function(e){if(Array.isArray(e))return uf(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||cf(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function rf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function af(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?rf(Object(n),!0).forEach((function(t){of(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rf(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function of(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lf(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||cf(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function cf(e,t){if(e){if("string"==typeof e)return uf(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?uf(e,t):void 0}}function uf(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var sf=wp.i18n.__,ff=tt((function(e){return{dependencyFilterActive:e.common.dependencyFilter.filterActive,platform:e.common.platform,tags:e.common.tags}}),(function(e){return{setSidebar:function(t){return e(Hn(t))},setItemLoading:function(t){return e(Bn(t))},setDependenciesFilterActive:function(t){return e({type:"FILTER_DEPENDENCIES_ACTIVE",payload:t})},setDependenciesIdForFilter:function(t){return e({type:"FILTER_DEPENDENCIES_ID",payload:t})},setFilteredTags:function(t){return e({type:"FILTERED_TAGS",payload:t})}}}))((function(e){var t=[],n=lf(Object(o.useState)("free"),2),r=n[0],a=n[1],l=lf(Object(o.useState)(!1),2),c=l[0],u=l[1],s=lf(Object(o.useState)(!1),2),f=s[0],p=s[1],d=lf(Object(o.useState)([]),2),m=d[0],h=d[1],y=lf(Object(o.useState)([]),2),g=y[0],v=y[1],b=lf(Object(o.useState)([]),2),w=b[0],E=b[1],O=lf(Object(o.useState)([]),2),k=O[0],S=O[1],x=lf(Object(o.useState)([]),2),_=x[0],j=x[1],P=lf(Object(o.useState)([]),2),C=P[0],T=P[1],A=lf(Object(o.useState)([]),2),N=A[0],I=A[1],L=lf(Object(o.useState)([]),2),D=L[0],R=L[1],M=lf(Object(o.useState)([]),2),F=M[0],z=M[1];return Object(o.useEffect)((function(){var t;(function(){var e=new FormData;return e.append("action","get_templately"),e.append("nonce",ai),e.append("content_type","get_dependencies"),e.append("platform",ni),Do.a.post(ajaxurl,e).then((function(e){return e})).catch((function(e){return e}))})().then((function(t){if(t.hasOwnProperty("data")&&t.data.hasOwnProperty("data")){var n=t.data.data.filter((function(t){return t.platform===e.platform})),r=[],a=[],o=[],i=[],l=n.map((function(e){var t=af(af({},e),{},{selected:!0});return e.is_pro?i.push(t):o.push(t),e.is_pro?a.push(t.id):r.push(t.id),t}));h(l),E(o),v(i)}})).catch((function(e){return console.error("On Getting Dependencies: ",e)})),(t=new FormData,t.append("action","get_templately"),t.append("nonce",ai),t.append("content_type","get_tags"),Do.a.post(ajaxurl,t).then((function(e){return e})).catch((function(e){return e}))).then((function(e){e.hasOwnProperty("data")&&e.data.hasOwnProperty("data")&&I(function(e){return e.map((function(e){return{value:e.id,label:sf(e.name,"templately")}}))}(e.data.data))})).catch((function(e){return console.error("On Gettings Tags: ",e)}))}),[]),Object(o.useEffect)((function(){var e=[],t=[];m.map((function(n){var r=af(af({},n),{},{selected:!0});n.is_pro?t.push(r):e.push(r)})),E(e),v(t)}),[m]),Object(o.useEffect)((function(){S([].concat(nf(_),nf(C)))}),[_,C]),Object(o.useEffect)((function(){if(!f){var t=[],n=m.map((function(e){return t.push(e.id),af(af({},e),{},{selected:!0})}));h(n),S(t),e.setDependenciesIdForFilter(t),e.setDependenciesFilterActive(!1),e.setFilteredTags([]),z([]),p(!1)}}),[f]),Object(o.useEffect)((function(){c&&(e.setDependenciesIdForFilter(k),e.setDependenciesFilterActive(!0),e.setFilteredTags(D),p(!0),u(!1))}),[c]),t.push(i.a.createElement("li",{className:"templately-sidebar-menu-item ".concat("all"==e.activeSidebar.activeSidebarMenu?"templately-smenu-active":""),key:"all"},i.a.createElement("span",{onClick:function(){e.setItemLoading(!0),e.setSidebar({activeSidebarMenu:"all",activeParentSidebarMenu:""})}},sf("All Categories","templately")))),e.categories.map((function(e,n){e.hasOwnProperty("child")?t.push(i.a.createElement(Ws,{key:e.id,id:e.id,name:sf(e.name,"templately"),child:e.child})):t.push(i.a.createElement(Ws,{key:e.id,id:e.id,name:sf(e.name,"templately")}))})),i.a.createElement(i.a.Fragment,null,i.a.createElement("ul",{className:"templately-sidebar-menu"},t),i.a.createElement(tf,{pro:!0,dependencies:g,active:r,setSelected:function(e){return T(e)},setActive:function(e){return a(e)}}),i.a.createElement(tf,{free:!0,dependencies:w,active:r,setSelected:function(e){return j(e)},setActive:function(e){return a(e)}}),i.a.createElement("div",{className:"templately-sidebar-dependency-filter templately-tags-filter"},i.a.createElement("label",{htmlFor:"templately_tags"},"Filter Items by Tags"),i.a.createElement(Co,{isMulti:!0,placeholder:"Select Tags",name:"templately_tags",options:N,classNamePrefix:"templately-tags",onChange:function(e){return function(e){null!=e?(z(e),e=e.map((function(e){return e.value})),R(e)):(z([]),R([]))}(e)},value:F,maxMenuHeight:200})),i.a.createElement(tf,{button:!0,setFilter:function(e){return u(e)},setReset:function(e){return p(e)},isFilter:c,isReset:f}))})),pf=TemplatelyAdmin.default_image,df=wp.i18n.__,mf=function(e){var t=e.author,n=e.price||"";return i.a.createElement(i.a.Fragment,null,null!=t&&i.a.createElement("div",{className:"templately-author-box"},i.a.createElement("div",{className:"templately-author-image-name"},i.a.createElement("div",{className:"templately-author-image"},i.a.createElement("img",{src:t.profile_photo||pf,alt:t.name})),i.a.createElement("div",{className:"templately-author-name"},i.a.createElement("h3",null,t.display_name||t.name),i.a.createElement("p",null,df("Member since","templately")," ",t.joined))),i.a.createElement("div",{className:"templately-author-item-favs"},i.a.createElement("ul",null,i.a.createElement("li",null,i.a.createElement(vn,{color:"rgb(245, 54, 91)"})," ",null!=e.favourite?e.favourite:0),i.a.createElement("li",null,i.a.createElement(Sn,{color:"rgb(255, 220, 99)"})," ",null!=e.rating?e.rating.toFixed(2):0),i.a.createElement("li",null,i.a.createElement(kn,{color:"rgb(96, 114, 255)"})," ",null!=e.downloads?e.downloads:0," ",df("Purchased","templately")))),i.a.createElement("div",{className:"templately-item-price"},n)))},hf=tt((function(e){return{all_items:e.common.all_items,filtered:e.common.filtered_items}}))((function(e){var t=e.items,n=null!=t.items&&t.items,r=[];return Object(o.useEffect)((function(){if(n){n.filter((function(e){return"block"==e.type}));e.dispatch($n(n)),e.dispatch(qn(n))}}),[e.items]),n.length>0&&n&&e.filtered.map((function(t,n){r.push(i.a.createElement(Ms,{pack:"pack"===e.rootType,block:"block"===e.rootType,page:"page"===e.rootType,type:e.rootType,key:n,content:t}))})),i.a.createElement("div",{className:"templately-item-details-preview"},n.length>0&&null!=n.length&&r,!1===n&&i.a.createElement(Ms,{pack:"pack"===e.rootType,block:"block"===e.rootType,page:"page"===e.rootType,key:t.id,type:e.rootType,content:t}))}));function yf(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return gf(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return gf(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function gf(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var vf=wp.i18n.__,bf=function(e){var t=yf(Object(o.useState)([]),2),n=t[0],r=t[1],a=e.content,l=[];return a&&a.tags.map((function(e,t){l.push(i.a.createElement("span",{key:t},e.name," "))})),Object(o.useEffect)((function(){if(a.dependencies.length>0){var e=[];a.dependencies.map((function(t,n){null!=t.icon&&e.push(i.a.createElement("li",{key:n},i.a.createElement("img",{src:t.icon,alt:t.name}),t.name))})),r(e)}}),[]),i.a.createElement("div",{className:"templately-item-details-box"},l.length>0&&i.a.createElement("div",null,i.a.createElement("h3",null,vf("Tags","templately")),i.a.createElement("p",null,l)),i.a.createElement("div",null,i.a.createElement("h3",null,vf("Details","templately")),i.a.createElement("ul",null,i.a.createElement("li",null,vf("Retina Ready","templately")," ",i.a.createElement("span",null,a.retina_ready)),i.a.createElement("li",null,vf("Documentation Ready","templately")," ",i.a.createElement("span",null,a.documentation_ready)))),n.length>0&&i.a.createElement("div",null,i.a.createElement("h3",null,vf("Dependencies","templately")),i.a.createElement("ul",{className:"templately-preview-dependency-list"},n)))};function wf(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Ef(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ef(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ef(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Of=tt((function(e){return{all_items:e.common.all_items,filtered:e.common.filtered_items}}))((function(e){var t=wf(Object(o.useState)(!1),2),n=t[0],r=t[1];return Object(o.useEffect)((function(){if(!1!==n){var t=e.all_items.filter((function(e){return e.category.id===n}));e.dispatch(qn(t)),e.dispatch(Kn({ulActive:!1})),r(!1)}}),[n]),i.a.createElement("li",null,i.a.createElement("span",{onClick:function(){return r(e.catID)}},e.name,i.a.createElement("span",null,"( ",e.count," )")))}));function kf(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Sf(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Sf(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Sf(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var xf=wp.i18n.__,_f=tt((function(e){return{all_items:e.common.all_items,ulActive:e.common.activeBlockOrPage.ulActive,blockClick:e.common.activeBlockOrPage.blocksBtnClick,pageClick:e.common.activeBlockOrPage.pagesBtnClick}}))((function(e){var t=kf(Object(o.useState)("all"),2),n=t[0],r=t[1],a=kf(Object(o.useState)(!1),2),l=a[0],c=a[1],u=kf(Object(o.useState)(!1),2),s=u[0],f=u[1],p=kf(Object(o.useState)(!1),2),d=(p[0],p[1],e.items.items),m=[],h=[],y=0,g=0;null!=d&&d.map((function(e,t){var n=e.category&&null!=e.category.name?e.category.name:"None",r={};if("block"==e.type&&null!==e.category){var a=fi(e.category.id,m),o=pi(e.category.id,m);m=o,y++,r.name=n,r.id=e.category.id,r.count=++a,m.push(r),r={}}if("page"==e.type&&null!==e.category){var i=fi(e.category.id,h),l=pi(e.category.id,h);h=l,g++,r.name=n,r.id=e.category.id,r.count=++i,h.push(r),r={}}}));var v=[],b=[];return m.map((function(e){v.push(i.a.createElement(Of,{key:e.id,name:e.name,count:e.count,catID:e.id}))})),h.map((function(e){b.push(i.a.createElement(Of,{key:e.id,name:e.name,count:e.count,catID:e.id}))})),Object(o.useEffect)((function(){e.ulActive||(f(!1),c(!1))}),[e.ulActive]),Object(o.useEffect)((function(){"blocks"===n&&l&&e.dispatch(Kn({ulActive:"blocks"})),"blocks"!==n||l||e.dispatch(Kn({ulActive:!1})),"pages"===n&&s&&e.dispatch(Kn({ulActive:"pages"})),"pages"!==n||s||e.dispatch(Kn({ulActive:!1}))}),[s,l,n]),i.a.createElement("div",{className:"templately-pack-preview-header"},i.a.createElement("div",{className:"epp-left epp-button"},i.a.createElement("button",{className:"templately-preview-button templately-preview-blocks ".concat("all"===n?"epp-btn-active":""),onClick:function(){r("all"),f(!1),c(!1),e.dispatch(qn(e.all_items))}},xf("All","templately"))),y>0&&i.a.createElement("div",{className:"epp-left epp-button"},i.a.createElement("button",{className:"templately-preview-button templately-preview-blocks ".concat("blocks"===n?"epp-btn-active":""),onClick:function(){r("blocks"),f(!1),c(!l)}},i.a.createElement("span",{className:"epp-item-count"},"(",y,")"),xf("Blocks","templately")," ",i.a.createElement(cn,null)),v.length>0&&i.a.createElement("ul",{className:"epp-type-child ".concat("blocks"===e.ulActive&&"epp-active")},v)),g>0&&i.a.createElement("div",{className:"epp-right epp-button"},i.a.createElement("button",{className:"templately-preview-button templately-preview-pages ".concat("pages"===n?"epp-btn-active":""),onClick:function(){r("pages"),c(!1),f(!s)}},i.a.createElement("span",{className:"epp-item-count"},"(",g,")"),xf("Pages","templately")," ",i.a.createElement(cn,null)),b.length>0&&i.a.createElement("ul",{className:"epp-type-child ".concat("pages"===e.ulActive&&"epp-active")},b)))}));function jf(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Pf(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Pf(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Pf(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Cf=TemplatelyAdmin.nonce,Tf=tt((function(e){return{common:e.common,preview:e.preview}}))((function(e){var t=jf(Object(o.useState)(!1),2),n=t[0],r=t[1],a=jf(Object(o.useState)(!1),2),l=a[0],c=a[1];return Object(o.useEffect)((function(){var t=e.preview.itemSlug;"block"===e.preview.type&&(t=e.preview.itemSlug),"pack"===e.preview.type&&(t=e.preview.packSlug),"page"===e.preview.type&&(t=e.preview.pageSlug);var n=new FormData;n.append("id",e.preview.itemID),n.append("slug",t),n.append("type",e.preview.type),n.append("action","get_templately"),n.append("nonce",Cf),n.append("content_type","get_item"),Do.a.post(ajaxurl,n).then((function(t){t.data.success&&("block"!=e.preview.type&&"page"!=e.preview.type||(r(t.data.data[0].author),c(t.data.data[0])),"pack"==e.preview.type&&(r(t.data.data[0].author),c(t.data.data[0])))})).catch((function(e){return console.error("Preview Layout Error: ",e)}))}),[e.preview]),i.a.createElement(Zc,null,(!l||!n)&&i.a.createElement(Ou,null),l&&n&&i.a.createElement("div",{className:"templately-preview-wrapper",onClick:function(){return e.dispatch(Kn({ulActive:!1}))}},i.a.createElement("div",{className:"templately-preview-body"},"pack"===e.rootType&&i.a.createElement(i.a.Fragment,null,i.a.createElement(_f,{items:l})),i.a.createElement(hf,{rootType:e.rootType,items:l})),i.a.createElement("div",{className:"templately-preview-sidebar"},i.a.createElement(mf,{author:n,rating:l.rating,favourite:l.favourite_count,downloads:l.downloads}),("block"===e.preview.type||"page"===e.preview.type)&&i.a.createElement(bf,{content:l}))))}));function Af(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Nf(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Af(Object(n),!0).forEach((function(t){If(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Af(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function If(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Lf(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Df(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Df(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Df(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Rf=wp.i18n.__,Mf=TemplatelyAdmin,Ff=Mf.is_editor,zf=Mf.platform,Uf=tt((function(e){return{preview:e.preview,platform:e.common.platform,platform_exists:e.common.platforms}}))((function(e){var t=Lf(Object(o.useState)(!1),2),n=t[0],r=t[1],a=Lf(Object(o.useState)(!1),2),l=a[0],c=a[1];return Object(o.useEffect)((function(){if(n){var t=--e.preview.deep,a={deep:t};t<=0&&(a=Nf(Nf({},a),{isOpen:!1,deep:0})),1===t&&(a=Nf(Nf({},a),{type:e.preview.previousType})),e.dispatch(zn(a)),r(!1)}}),[n]),Object(o.useEffect)((function(){0!=l&&(ii("",{showCloseButton:!0,allowOutsideClick:!1,target:Ff?"#templately-app-modal":"#templatelyAdmin",html:i.a.createElement(xs,{dependencyList:e.content.dependencies,platform:e.platform,title:e.content.name,content:e.content})}).then((function(t){null!=t.insert&&t.insert&&(e.dispatch(Ln(Nf(Nf({},e.platform_exists),{},If({},"elementor",!0)))),e.dispatch(Un(!0)),li(l,"remote",{fileType:e.platform,is_editor:Boolean(Ff)}).then((function(t){if(!0===t)"gutenberg"!==zf?window.TemplatelyModal.destroy():Ro.close(),e.dispatch(Un(!0));else{e.dispatch(Un(!1));var n="",r=!1;t.data&&t.data.data&&t.data.data.errorCode?("required_pro"===t.data.data.errorCode&&(r=!0),n=t.data.data.message):"string"==typeof t.data.data&&(n=t.data.data),ii("",{icon:"error",html:i.a.createElement(ki,{content:i.a.createElement("div",null,i.a.createElement("p",null,n),r&&i.a.createElement("a",{href:"https://templately.com",target:"_blank"},"Upgrade to Pro"))})})}})))})),c(!1))}),[l]),i.a.createElement("div",{className:"templately-block-preview-header"},i.a.createElement("div",{className:"ep-left"},i.a.createElement("button",{className:"templately-preview-back",onClick:function(){return r(!0)}},i.a.createElement(ln,null)," ",Rf("Back","templately"))),i.a.createElement("div",{className:"ep-right"},i.a.createElement("button",{onClick:function(){return c(e.itemID)},className:"ep-preview-insert"},Rf("Insert","templately")," ",i.a.createElement(mn,null))))}));n(112);function Bf(e){return(Bf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Vf(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Wf(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Wf(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Wf(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Hf=TemplatelyAdmin.nonce,$f=tt()((function(e){var t=Vf(Object(o.useState)(!1),2),n=t[0],r=t[1],a=Vf(Object(o.useState)("desktop"),2),l=a[0],c=a[1],u=Vf(Object(o.useState)("100%"),2),s=u[0],f=u[1];return Object(o.useEffect)((function(){"mobile"==l&&f("480px"),"tablet"==l&&f("786px"),"desktop"==l&&f("100%")}),[l,n]),Object(o.useEffect)((function(){var t=new FormData;"page"===e.preview.type&&t.append("slug",e.preview.pageSlug),"block"===e.preview.type&&t.append("slug",e.preview.itemSlug),"pack"===e.preview.type&&t.append("slug",e.preview.packSlug),t.append("type",e.preview.type),t.append("action","get_templately"),t.append("nonce",Hf),t.append("content_type","get_item"),Do.a.post(ajaxurl,t).then((function(e){e.data.success&&r(e.data.data[0])})).catch((function(e){return console.error("Error",e)}))}),[e]),i.a.createElement("div",{className:"templately-preview-html-or-image"},!n&&i.a.createElement(Ou,null),"object"==Bf(n)&&i.a.createElement(i.a.Fragment,null,i.a.createElement(Uf,{itemID:n.id,content:n}),i.a.createElement("div",{className:"templately-preview-image-wrapper"},i.a.createElement("div",{className:"templately-preview-hover"},i.a.createElement("button",{onClick:function(){return c("mobile")},className:"mobile"==l?"preview-active":""},i.a.createElement(bn,null)),i.a.createElement("button",{onClick:function(){return c("tablet")},className:"tablet"==l?"preview-active":""},i.a.createElement(xn,null)),i.a.createElement("button",{onClick:function(){return c("desktop")},className:"desktop"==l?"preview-active":""},i.a.createElement(dn,null))),i.a.createElement("iframe",{id:"templately-preview-iframe",width:s,height:"100%",src:n.live_url}))))}));n(113);function qf(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Kf(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Kf(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Kf(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Qf=tt((function(e){return{plan:e.common.plan}}))((function(e){var t=qf(Object(o.useState)(e.plan),2),n=t[0],r=t[1];return Object(o.useEffect)((function(){n!=e.plan&&(e.dispatch({type:"SET_PLAN",payload:n}),e.dispatch(Qn(1)))}),[n]),i.a.createElement("div",{className:"templately-items-header-wrapper".concat(" ".concat(e.sticky))},i.a.createElement("div",{className:"templately-items-header-wrapper-inner"},i.a.createElement("div",{className:"templately-items-header"},i.a.createElement("h3",null,"All ",e.title)),i.a.createElement("div",{className:"templately-plan-switcher"},i.a.createElement("button",{onClick:function(){return r("all")},className:"components-button templately-plan-all ".concat("all"===e.plan?"tactive":"")},"All"),i.a.createElement("button",{onClick:function(){return r("starter")},className:"components-button templately-plan-starter ".concat("starter"===e.plan?"tactive":"")},"Starter"),i.a.createElement("button",{onClick:function(){return r("pro")},className:"components-button templately-plan-pro ".concat("pro"===e.plan?"tactive":"")},"Pro"))))}));function Gf(){return(Gf=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Yf(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Xf(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Xf(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Xf(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Jf=TemplatelyAdmin,Zf=Jf.categories,ep=Jf.not_found,tp=Jf.platform,np=tt((function(e){return{blocks:e.blocks,pages:e.pages,packs:e.packs,preview:e.preview,sidebar:e.common.activeSidebar,need_pagination:e.common.need_pagination,pagination_loading:e.common.pagination_loading,pagination:e.common.pagination,activeSidebar:e.common.activeSidebar,loading:e.common.loading,platform:e.common.platform,plan:e.common.plan,itemLoading:e.common.itemLoading,retry:e.common.retry,dependencyFiltersID:e.common.dependencyFilter.filtersID,dependencyFilterActive:e.common.dependencyFilter.filterActive,dependencyFilterResults:e.common.dependencyFilter.filtersResults,selectedTags:e.common.tags}}))((function(e){var t=e.location.pathname.replace(/^\/+/,"")||("gutenberg"===e.platform?"blocks":"packs"),n=t.substring(0,t.length-1),r=Yf(Object(o.useState)([]),2),a=r[0],l=r[1],c=Yf(Object(o.useState)(1),2),u=c[0],s=c[1],f=Yf(Object(o.useState)(""),2),p=f[0],d=f[1];return Object(o.useEffect)((function(){if(null!==e.pagination){if(!1===e.dependencyFilterActive)if("all"===e.sidebar.activeSidebarMenu){if(e[t].hasOwnProperty(e.plan)&&e[t][e.plan].hasOwnProperty(e.platform)&&e[t][e.plan][e.platform].hasOwnProperty(e.pagination))return s(e[t][e.plan][e.platform].total_page),e.dispatch(Un(!1)),e.dispatch(Bn(!1)),void e.dispatch(Yn(!1))}else if(e[t].hasOwnProperty(e.plan)&&e[t][e.plan].hasOwnProperty(e.platform)&&e[t][e.plan][e.platform].hasOwnProperty("categoryData")&&e[t][e.plan][e.platform].categoryData.hasOwnProperty(e.sidebar.activeSidebarMenu)&&e[t][e.plan][e.platform].categoryData[e.sidebar.activeSidebarMenu].hasOwnProperty(e.pagination)&&e[t][e.plan][e.platform].categoryData[e.sidebar.activeSidebarMenu][e.pagination].length>0)return s(e[t][e.plan][e.platform].categoryData[e.sidebar.activeSidebarMenu].total_page),e.dispatch(Un(!1)),e.dispatch(Bn(!1)),void e.dispatch(Yn(!1));e.dispatch(Bn(!0));try{(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={content_type:"blocks",per_page:48,page:1};e=Xo(Xo({},t),e);var n=new FormData;return n.append("action","get_templately"),n.append("nonce",ai),n.append("content_type",e.content_type),n.append("pagenum",e.page),n.append("per_page",e.per_page),null!=e.platform&&n.append("platform",e.platform),null!=e.category_id&&n.append("category_id",e.category_id),null!=e.dependencies&&e.dependencies.length>0&&n.append("dependencies",JSON.stringify(e.dependencies)),null!=e.tag_id&&e.tag_id.length>0&&n.append("tag_id",JSON.stringify(e.tag_id)),null!=e.plan_type&&"all"!==e.plan_type&&n.append("plan_type",e.plan_type),Do.a.post(ajaxurl,n).then((function(e){return e})).catch((function(e){return e}))})({content_type:t,page:e.pagination,platform:e.platform,plan_type:e.plan,per_page:"templately"===tp?52:51,category_id:"all"!==e.sidebar.activeSidebarMenu?e.sidebar.activeSidebarMenu:void 0,dependencies:e.dependencyFiltersID,tag_id:e.selectedTags}).then((function(n){if(n.data.success){if(n.data.data.hasOwnProperty("data"))return e.dependencyFilterActive?(s(n.data.data.total_page),e.dispatch({type:"FILTER_DEPENDENCIES_RESULTS",payload:{current_page:e.pagination,data:n.data.data.data,platform:e.platform,plan:e.plan,total_page:n.data.data.total_page}}),e.dispatch(Bn(!1)),e.dispatch(Un(!1)),void e.dispatch(Yn(!1))):("blocks"===t&&(s(n.data.data.total_page),"all"===e.sidebar.activeSidebarMenu?e.dispatch(Dn({current_page:e.pagination,data:n.data.data.data,platform:e.platform,plan:e.plan,total_page:n.data.data.total_page})):e.dispatch(function(e){return{type:"ALL_CATEGORY_ITEMS",payload:e}}({categoryID:e.sidebar.activeSidebarMenu,current_page:e.pagination,data:n.data.data.data,platform:e.platform,plan:e.plan,total_page:n.data.data.total_page}))),"packs"===t&&(s(n.data.data.total_page),"all"===e.sidebar.activeSidebarMenu?e.dispatch(Rn({current_page:e.pagination,data:n.data.data.data,platform:e.platform,plan:e.plan,total_page:n.data.data.total_page})):e.dispatch(function(e){return{type:"ALL_CATEGORY_PACKS",payload:e}}({categoryID:e.sidebar.activeSidebarMenu,current_page:e.pagination,data:n.data.data.data,platform:e.platform,plan:e.plan,total_page:n.data.data.total_page}))),"pages"===t&&(s(n.data.data.total_page),"all"===e.sidebar.activeSidebarMenu?e.dispatch(function(e){return{type:"ALL_PAGES",payload:e}}({current_page:e.pagination,data:n.data.data.data,platform:e.platform,plan:e.plan,total_page:n.data.data.total_page})):e.dispatch(function(e){return{type:"ALL_CATEGORY_PAGES",payload:e}}({categoryID:e.sidebar.activeSidebarMenu,current_page:e.pagination,data:n.data.data.data,platform:e.platform,plan:e.plan,total_page:n.data.data.total_page}))),e.dispatch(Bn(!1)),e.dispatch(Un(!1)),void e.dispatch(Yn(!1)));e.dispatch(In(n.data.data))}else e.dispatch(In(n.data.data))}))}catch(t){return e.dispatch(In(res.data.data)),void console.error("Catched Error: ",t)}}}),[e.pagination,e.sidebar,e.platform,e.plan,e.retry,e.dependencyFilterActive,e.dependencyFiltersID,e.selectedTags]),Object(o.useEffect)((function(){var r=[];!0!==e.dependencyFilterActive?"all"!=e.sidebar.activeSidebarMenu?e[t].hasOwnProperty(e.plan)&&e[t][e.plan].hasOwnProperty(e.platform)&&e[t][e.plan][e.platform].hasOwnProperty("categoryData")&&e[t][e.plan][e.platform].categoryData.hasOwnProperty(e.sidebar.activeSidebarMenu)&&e[t][e.plan][e.platform].categoryData[e.sidebar.activeSidebarMenu].hasOwnProperty(e.pagination)&&(e[t][e.plan][e.platform].categoryData[e.sidebar.activeSidebarMenu][e.pagination].map((function(e,t){r.push(i.a.createElement(Ms,{type:n,pack:"pack"===n,page:"page"===n,block:"block"===n,key:t,content:e}))})),l(r)):(e[t].hasOwnProperty(e.plan)&&e[t][e.plan].hasOwnProperty(e.platform)&&e[t][e.plan][e.platform].hasOwnProperty(e.pagination)&&void 0!==e[t][e.plan][e.platform][e.pagination]&&e[t][e.plan][e.platform][e.pagination].map((function(e,t){r.push(i.a.createElement(Ms,{type:n,pack:"pack"===n,page:"page"===n,block:"block"===n,key:t,content:e}))})),l(r)):e.dependencyFilterResults.hasOwnProperty(e.plan)&&e.dependencyFilterResults[e.plan].hasOwnProperty(e.platform)&&e.dependencyFilterResults[e.plan][e.platform].hasOwnProperty(e.pagination)&&(e.dependencyFilterResults[e.plan][e.platform][e.pagination].map((function(e,t){r.push(i.a.createElement(Ms,{type:n,pack:"pack"===n,page:"page"===n,block:"block"===n,key:t,content:e}))})),l(r))}),[e.blocks,e.pages,e.packs,e.pagination,e.sidebar,e.platform,e.plan,e.dependencyFilterActive,e.dependencyFilterResults]),i.a.createElement(i.a.Fragment,null,e.loading&&i.a.createElement(Zc,null,i.a.createElement(Ou,null)),!e.loading&&!e.preview.isOpen&&Zf[t].length>0&&i.a.createElement(Us,null,i.a.createElement(ff,{categories:Zf[t],activeSidebar:e.activeSidebar})),!e.loading&&!e.preview.isOpen&&i.a.createElement(i.a.Fragment,null,e.itemLoading&&i.a.createElement(Ou,null),!e.itemLoading&&i.a.createElement(Zc,{onScroll:function(e){e.target.scrollTop>200?d("templately-header-sticky"):d("")}},i.a.createElement(Qf,{sticky:p,title:t}),0===a.length&&!e.itemLoading&&!e.pagination_loading&&i.a.createElement("div",{className:"templately-empty-clouds"},i.a.createElement("img",{src:ep,alt:"Items Not Found"})),i.a.createElement("div",{className:"templately-modal-content templately-blocks ".concat(e.need_pagination?"templately-has-pagination":""," templately-tab-").concat(t)},!e.pagination_loading&&a,e.pagination_loading&&i.a.createElement(Ou,null)),"all"===e.sidebar.activeSidebarMenu&&i.a.createElement(wu,{type:n,count:u}),"all"!==e.sidebar.activeSidebarMenu&&i.a.createElement(wu,{categoryPagination:!0,type:n,count:u}))),!e.loading&&e.preview.isOpen&&1===e.preview.deep&&i.a.createElement(Tf,Gf({rootType:n},e)),!e.loading&&e.preview.isOpen&&2===e.preview.deep&&i.a.createElement($f,Gf({rootType:n},e)))}));function rp(){return(rp=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function ap(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return op(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return op(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function op(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var ip=wp.i18n.__,lp=TemplatelyAdmin,cp=lp.nonce,up=lp.not_found,sp=tt((function(e){return{searchQuery:e.common.searchQuery.query,isSearching:e.common.searchQuery.isSearching||!1,searchResults:e.common.searchQuery.results,preview:e.preview,loading:e.common.loading,platform:e.common.platform}}))((function(e){var t=ce().query,n=ap(Object(o.useState)([]),2),r=n[0],a=n[1],l=ap(Object(o.useState)(!0),2),c=l[0],u=l[1];return Object(o.useEffect)((function(){null!=t&&t.length>0&&e.dispatch(nr({query:t,isSearching:!0}))}),[]),Object(o.useEffect)((function(){0==e.isSearching&&e.searchQuery.length>0&&e.dispatch(nr({query:e.searchQuery,isSearching:!0}))}),[e.platform]),Object(o.useEffect)((function(){if(e.searchQuery.length>0&&e.isSearching){var t=new FormData;t.append("action","get_templately"),t.append("nonce",cp),t.append("content_type","search"),t.append("search",e.searchQuery),t.append("platform",e.platform),u(!0),Do.a.post(ajaxurl,t).then((function(t){200==t.status&&t.data.success&&e.dispatch(nr({query:e.searchQuery,results:t.data.data,isSearching:!1})),u(!1)})).catch((function(e){console.error(e.response),u(!1)}))}}),[e.searchQuery,e.isSearching]),Object(o.useEffect)((function(){var t=[];e.searchResults&&e.searchResults.length>0&&e.searchResults.map((function(e,n){t.push(i.a.createElement(Ms,{type:e.type,pack:"pack"===e.type,page:"page"===e.type,block:"block"===e.type,key:n,content:e}))})),a(t)}),[e.searchResults]),Object(o.useEffect)((function(){e.loading&&u(!0)}),[e.loading]),i.a.createElement(i.a.Fragment,null,c&&i.a.createElement(Zc,null,i.a.createElement(Ou,null)),!e.preview.isOpen&&!1===c&&i.a.createElement("div",{className:"templately-modal-search"},i.a.createElement("div",{className:"templately-searched"},i.a.createElement("p",null,i.a.createElement("strong",null,ip("You are looking for: ","templately")),t)),i.a.createElement("div",{className:"templately-searched-items templately-modal-content templately-blocks"},r.length>0&&r,r.length<=0&&!c&&i.a.createElement("div",{className:"templately-search-not-found"},i.a.createElement("div",null,i.a.createElement("img",{src:up,alt:"Searched Item Not Found"}))),c&&i.a.createElement(Ou,null))),!e.loading&&0==c&&e.preview.isOpen&&1===e.preview.deep&&i.a.createElement(i.a.Fragment,null,i.a.createElement(Tf,rp({rootType:e.preview.type&&e.preview.type},e))),!e.loading&&0==c&&e.preview.isOpen&&2===e.preview.deep&&i.a.createElement($f,rp({rootType:e.preview.type&&e.preview.type},e)))}));n(114),n(47),n(115);function fp(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return pp(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return pp(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function pp(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var dp=wp.i18n.__,mp=TemplatelyAdmin,hp=mp.nonce,yp=(mp.platform,function(e,t){return t.path===e}),gp=tt((function(e){return{cloudUsageLimit:e.common.cloud_usage_limit}}))((function(e){var t=function(e){var t=le(),n=ie(W).match;return e?J(t.pathname,e):n}(),n=fp(Object(o.useState)(0),2),r=n[0],a=n[1];return Object(o.useEffect)((function(){if(void 0===e.cloudUsageLimit.plan){var t=new FormData;t.append("action","get_templately"),t.append("content_type","cloud_usage_limit"),t.append("nonce",hp);Do.a.post(ajaxurl,t).then((function(t){200===t.status&&t.data.success&&"success"===t.data.data.status&&e.dispatch({type:"CLOUD_USAGE_LIMIT",payload:JSON.parse(t.data.data.data)})})).catch((function(e){console.error("Usages Limit: ",e)}))}}),[]),Object(o.useEffect)((function(){a(100*e.cloudUsageLimit.files/e.cloudUsageLimit.limit)}),[e.cloudUsageLimit]),i.a.createElement("div",{className:"templately-workspace-sidebar"},i.a.createElement("div",{className:"tws-menu-list"},i.a.createElement("ul",null,i.a.createElement(dr,{to:"/clouds"},i.a.createElement(pn,{size:"16"}),i.a.createElement("span",null,dp("My Cloud","templately"))),i.a.createElement(dr,{to:"/workspace",active:yp("/workspace/:slug",t)},i.a.createElement(gn,{size:"16"}),i.a.createElement("span",null,dp("My WorkSpace","templately"))),i.a.createElement(dr,{to:"/shared/workspace",active:yp("/shared/workspace/:slug",t)},i.a.createElement(On,{size:"16"}),i.a.createElement("span",null,dp("Shared with Me","templately"))),i.a.createElement(dr,{to:"/settings"},i.a.createElement(jn,{size:"16"}),i.a.createElement("span",null,dp("Profile","templately"))))),i.a.createElement("div",{className:"tws-size"},i.a.createElement(pn,{size:"20"}),i.a.createElement("div",null,i.a.createElement("p",null,"File Details Count"),i.a.createElement("div",null,i.a.createElement("span",{style:{width:"".concat(r,"%")}})),i.a.createElement("p",null,"".concat(e.cloudUsageLimit&&e.cloudUsageLimit.files," of ").concat(e.cloudUsageLimit&&(-1===e.cloudUsageLimit.limit?"Unlimited":e.cloudUsageLimit.limit)," Files")))))})),vp=tt()((function(e){return i.a.createElement("div",{className:"templately-workspace"},i.a.createElement(gp,null),i.a.createElement("div",{className:"templately-workspace-content"},e.children))}));function bp(){return(bp=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var Ep=function(e){return i.a.createElement("div",{className:e.className},i.a.createElement("div",null,i.a.createElement("input",bp({type:"text"},e))))};function Op(e){return function(e){if(Array.isArray(e))return xp(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||Sp(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function kp(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||Sp(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Sp(e,t){if(e){if("string"==typeof e)return xp(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?xp(e,t):void 0}}function xp(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var _p=wp.i18n.__,jp=TemplatelyAdmin,Pp=jp.loadingImage,Cp=jp.nonce,Tp=function(e){var t=kp(Object(o.useState)(e.isLoading||!1),2),n=t[0],r=t[1],a=kp(Object(o.useState)(!0),2),l=a[0],c=a[1],u=kp(Object(o.useState)(!1),2),s=u[0],f=u[1],p=kp(Object(o.useState)(e.content.name),2),d=p[0],m=p[1],h=kp(Object(o.useState)([]),2),y=h[0],g=h[1],v=kp(Object(o.useState)([]),2),b=v[0],w=v[1],E=kp(Object(o.useState)(!1),2),O=E[0],k=E[1],S=kp(Object(o.useState)(!1),2),x=S[0],_=S[1],j=kp(Object(o.useState)(!1),2),P=j[0],C=j[1],T=kp(Object(o.useState)(""),2),A=T[0],N=T[1],I=kp(Object(o.useState)(!1),2),L=I[0],D=I[1],R=kp(Object(o.useState)([]),2),M=R[0],F=R[1],z=kp(Object(o.useState)([]),2),U=z[0],B=z[1],V=kp(Object(o.useState)([]),2),W=(V[0],V[1]),H=kp(Object(o.useState)([]),2),$=H[0],q=H[1];return Object(o.useEffect)((function(){var t=[],n=[];if(e.content.sharedWith&&e.content.sharedWith.length>0&&(e.content.sharedWith.map((function(e,r){n.push(e.email),t.push(i.a.createElement("li",{key:r},e.profile_photo&&i.a.createElement("img",{src:e.profile_photo}),i.a.createElement("span",{className:"tae-name "},e.name),i.a.createElement("span",{className:"tae-remove",onClick:function(t){_({email:e.email,currentTarget:t.currentTarget.parentElement})}}),i.a.createElement("span",{className:"tae-undo",onClick:function(t){C({email:e.email,currentTarget:t.currentTarget.parentElement})}})))})),F(n),g(t)),e.content.pending_invitations&&e.content.pending_invitations.length>0){var r=JSON.parse(e.content.pending_invitations),a=[],o=[];r.map((function(e){mi(e)&&(o.push(e),a.push(i.a.createElement("li",{key:e},i.a.createElement("span",{className:"tae-name "},e,i.a.createElement("em",null,_p("invited","templately"))),i.a.createElement("span",{className:"tae-remove",onClick:function(t){_({email:e,currentTarget:t.currentTarget.parentElement})}}),i.a.createElement("span",{className:"tae-undo",onClick:function(t){C({email:e,currentTarget:t.currentTarget.parentElement})}}))))})),W(o),F([].concat(n,o)),g([].concat(t,a))}}),[]),Object(o.useEffect)((function(){if(O){var e=Op(U),t=A.toLowerCase();mi(t)&&(e.includes(t)||(e.push(t),B(e)),N("")),k(!1)}}),[O]),Object(o.useEffect)((function(){if(!1!==L){var e=Op(U).filter((function(e){return L!=e}));B(e),D(!1)}}),[L]),Object(o.useEffect)((function(){if(!1!==x||!1!==P){var e=Op(M),t=Op($);if(0!=x&&(x.currentTarget.classList.add("removed"),t.push(x.email),e=e.filter((function(e){return x.email!=e})),F(e),q(t),_(!1)),0!=P){P.currentTarget.classList.remove("removed"),e.push(P.email);var n=t.filter((function(e){return P.email!=e}));F(e),q(n),C(!1)}}}),[x,P]),Object(o.useEffect)((function(){var e=[];U.length>0&&U.map((function(t,n){return e.push(i.a.createElement("li",{key:n},t,i.a.createElement("span",{onClick:function(){return D(t)}})))})),w(e)}),[U]),Object(o.useEffect)((function(){c(!(M.length!==(e.content.sharedWith?e.content.sharedWith.length:0)||U.length>0))}),[M,U]),Object(o.useEffect)((function(){if(!0===s){r(!0);var t=U,n=Op($),a=new FormData;a.append("action","get_templately"),a.append("content_type","edit_workspace"),a.append("id",e.content.id),a.append("title",d),a.append("share_with",t.join()),a.append("remove",n.join()),a.append("nonce",Cp),a.append("platform",e.platform),Do.a.post(ajaxurl,a).then((function(t){t.data.success&&("success"===t.data.data.status?(e.singleDispatch(t.data.data.workspace),$o.a.close({saved:!0})):$o.a.close({saved:!1}))})),f(!1)}}),[s]),i.a.createElement(i.a.Fragment,null,n&&i.a.createElement("div",{className:"templately-pre-loader"},i.a.createElement("img",{src:Pp})),!n&&i.a.createElement("div",{className:"templately-workspace-edit-modal"},i.a.createElement("div",{className:"templately-wem-row"},i.a.createElement("div",{className:"templately-wem-title"},i.a.createElement("span",{className:"wem-title-icon"})),i.a.createElement("div",{className:"templately-wem-input templately-workspace-name"},i.a.createElement(Ep,{value:d,onChange:function(e){c(!1),m(e.target.value)}}))),y.length>0&&i.a.createElement("div",{className:"templately-wem-row"},i.a.createElement("div",{className:"templately-wem-title"},i.a.createElement("p",null,_p("Shared with","templately"),": ")),i.a.createElement("div",{className:"templately-wem-input templately-shared-with"},i.a.createElement("ul",{className:"templately-added-email-list"},y))),i.a.createElement("div",{className:"templately-wem-row"},i.a.createElement("div",{className:"templately-wem-title"},i.a.createElement("p",null,_p("Add People","templately"),": ")),i.a.createElement("div",{className:"templately-wem-input templately-new-shared"},i.a.createElement("ul",{className:"templately-wem-new-email-list"},b),i.a.createElement("div",null,i.a.createElement(Ep,{onKeyUp:function(e){return k(13===e.keyCode)},onChange:function(e){return N(e.target.value)},value:A,placeholder:_p("Type email to add","templately")}),i.a.createElement(Jc,{disabled:0===A.length,onClick:function(){return k(!0)}},_p("Add","templately"))))),i.a.createElement("div",{className:"templately-wem-row templately-wem-save-btn"},i.a.createElement(Jc,{disabled:l,onClick:function(){return f(!0)}},_p("Save","templately")))))},Ap=function(e){return i.a.createElement("div",{className:"templately-delete-confirm-text"},i.a.createElement("h3",null,"Are You Sure?"),i.a.createElement("p",null,"The WorkSpace will be permanently deleted including the files."))};function Np(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Ip(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ip(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ip(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Lp=wp.i18n.__,Dp=tt((function(e){return{pagination:e.common.pagination,userID:e.admin.user.id||null}}))((function(e){var t=Np(Object(o.useState)(!1),2),n=t[0],r=t[1],a=Np(Object(o.useState)(!1),2),l=a[0],c=a[1],u=Np(Object(o.useState)(!1),2),s=u[0],f=u[1],p=Np(Object(o.useState)([]),2),d=p[0],m=p[1],h=Np(Object(o.useState)(!1),2),y=h[0],g=h[1],v=le(),b=Object(o.useRef)(null),w=Object(o.useRef)(null),E=function(t){if(e.userID===e.content.owner.id){var n=b.current.contains(t.target),a=w.current&&w.current.contains(t.target);n||a||r(!1)}};return Object(o.useEffect)((function(){l&&(ii("",{showConfirmButton:!1,showCloseButton:!0,allowOutsideClick:!1,html:i.a.createElement(Tp,{singleDispatch:function(t){e.dispatch({type:"EDIT_WORKSPACE",payload:{page:e.pagination,slug:t.slug,data:t,platform:e.platform}}),e.dispatch(function(e){return{type:"EDIT_WORKSPACE_DETAILS",payload:e}}({page:e.pagination,slug:t.slug,data:t,platform:e.platform}))},pagination:e.pagination,content:e.content,platform:e.platform})}).then((function(e){return e.saved?ii("",{icon:"success",timer:1500,html:i.a.createElement(ki,{title:"Successfully Saved",content:"You have succesfully saved your WorkSpace changes."})}):e.dismiss?void 0:ii("",{icon:"error",timer:1500,html:i.a.createElement(ki,{title:"Something went wrong.",content:"Something went wrong regarding changes in your WorkSpace. Try Later or Contact support."})})})),c(!1))}),[l]),Object(o.useEffect)((function(){s&&(ii("",{showConfirmButton:!0,allowOutsideClick:!1,confirmButtonText:"Delete",cancelButtonText:"Cancel",showCancelButton:!0,showCloseButton:!0,showLoaderOnConfirm:!0,reverseButtons:!0,customClass:{container:"templately-delete-modal",confirmButton:"templately-delete-confirm",cancelButton:"templately-delete-cancel"},html:i.a.createElement(Ap,null),input:"checkbox",inputValue:0,inputPlaceholder:"Delete WorkSpace Files?",preConfirm:function(t){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(null!==e){var n=new FormData;return n.append("action","get_templately"),n.append("content_type","delete_workspace"),n.append("id",e),n.append("withFiles",t),n.append("nonce",ai),Do.a.post(ajaxurl,n).then((function(e){return e}))}}(s,t).then((function(t){return t.data.success&&"success"==t.data.data?(e.dispatch({type:"DELETE_WORKSPACE",payload:{page:e.pagination,data:s}}),{delete:!0}):{delete:!1}}))}}).then((function(t){if(t.hasOwnProperty("value")&&t.value.hasOwnProperty("delete")){if(t.value.delete){var n=v.pathname.replace(e.content.slug,"");return e.dispatch(Zn(n)),ii("",{icon:"success",timer:1500,html:i.a.createElement(ki,{title:"Successfully Deleted",content:"You have deleted a WorkSpace from your account."})})}return ii("",{icon:"error",timer:1500,html:i.a.createElement(ki,{title:"Something went wrong.",content:"Something went wrong regarding deleting your WorkSpace. Try Later."})})}})),f(!1))}),[s]),Object(o.useEffect)((function(){var t=[];e.content.sharedWith&&e.content.sharedWith.length>0&&(e.content.sharedWith.slice(0,e.shared||e.userID!==e.content.owner.id?5:4).map((function(e,n){null!=e.profile_photo?t.push(i.a.createElement("img",{key:n,src:e.profile_photo,alt:e.name})):t.push(i.a.createElement("span",{key:n},e.name.slice(0,1)))})),m(t));return document.addEventListener("mousedown",E),function(){return document.removeEventListener("mousedown",E)}}),[]),Object(o.useEffect)((function(){e.details||(!1!==y&&!1===n&&!1===l&&e.dispatch(Zn(e.shared?"/shared/workspace/".concat(y):"/workspace/".concat(y))),g(!1))}),[y]),i.a.createElement("div",{onClick:function(){return g(e.content.slug)},className:"".concat(e.details?"tsw-active ":"","templately-single-workspace").concat(!0===n?" templately-ctxmenu-open":"")},i.a.createElement("div",{className:"templately-single-workspace-inner"},e.userID===e.content.owner.id&&i.a.createElement("div",{className:"templately-sw-cxt-menu-wrapper"},i.a.createElement(Jc,{ref:b,className:"templately-sw-action-btn",onClick:function(){return r(!n)}},i.a.createElement(hn,null)),n&&i.a.createElement("div",{ref:w,className:"templately-sw-cxt-menu".concat(!0===n?" topen":"")},i.a.createElement("ul",null,i.a.createElement("li",{className:"tw-edit",onClick:function(){return c(e.content.id)}},i.a.createElement("i",null),Lp("Edit","templately")),i.a.createElement("li",{className:"tw-delete",onClick:function(){return f(e.content.id)}},i.a.createElement("i",null),Lp("Delete","templately"))))),i.a.createElement("header",null,i.a.createElement("span",{className:"tw-icon"}),i.a.createElement("div",null,i.a.createElement("span",{className:"tw-title"},Lp(e.content.name,"templately")),(e.shared||e.details)&&i.a.createElement("span",{className:"tw-author"},Lp("by "+e.content.owner.name,"templately")))),i.a.createElement("div",{className:"templately-workspace-sharewith"},i.a.createElement("p",null,Lp("Shared with","templately")," "),i.a.createElement("div",{className:"templately-workspace-sharewith-image"},d,e.userID===e.content.owner.id&&i.a.createElement(Jc,{onClick:function(){return c(!0)}},i.a.createElement(wn,null))))))}));function Rp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Mp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Rp(Object(n),!0).forEach((function(t){Fp(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Rp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Fp(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zp(e){return function(e){if(Array.isArray(e))return Vp(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||Bp(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Up(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||Bp(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Bp(e,t){if(e){if("string"==typeof e)return Vp(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Vp(e,t):void 0}}function Vp(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Wp=wp.i18n.__,Hp=TemplatelyAdmin.loadingImage,$p=function(e){var t=Up(Object(o.useState)(!1),2),n=t[0],r=t[1],a=Up(Object(o.useState)(!0),2),l=a[0],c=a[1],u=Up(Object(o.useState)(!1),2),s=u[0],f=u[1],p=Up(Object(o.useState)(""),2),d=p[0],m=p[1],h=Up(Object(o.useState)([]),2),y=h[0],g=h[1],v=Up(Object(o.useState)(!1),2),b=v[0],w=v[1],E=Up(Object(o.useState)(""),2),O=E[0],k=E[1],S=Up(Object(o.useState)(!1),2),x=S[0],_=S[1],j=Up(Object(o.useState)([]),2),P=j[0],C=j[1];return Object(o.useEffect)((function(){if(b){var e=zp(P),t=O.toLowerCase();mi(t)&&(e.includes(t)||(e.push(t),C(e)),k("")),w(!1)}}),[b]),Object(o.useEffect)((function(){if(!1!==x){var e=zp(P).filter((function(e){return x!=e}));C(e),_(!1)}}),[x]),Object(o.useEffect)((function(){var e=[];P.length>0&&P.map((function(t,n){return e.push(i.a.createElement("li",{key:n},t,i.a.createElement("span",{onClick:function(){return _(t)}})))})),g(e)}),[P]),Object(o.useEffect)((function(){c(!(P.length>0||d.length>0))}),[P,d]),Object(o.useEffect)((function(){s&&(r(!0),function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(null!==e){var n=new FormData;return n.append("action","get_templately"),n.append("content_type","create_workspace"),n.append("title",e),n.append("share_with",t.join()),n.append("nonce",ai),Do.a.post(ajaxurl,n).then((function(e){return e})).catch((function(e){return e}))}}(d,P).then((function(t){t.data.success?"success"===t.data.data.status?(e.singleDispatch(t.data.data.workspace),$o.a.close(Mp({created:!0},t.data.data))):$o.a.close(Mp({created:!1},t.data.data)):r(!1)})),f(!1))}),[s]),i.a.createElement(i.a.Fragment,null,i.a.createElement("div",{className:"templately-workspace-edit-modal templately-workspace-create-modal"},n&&i.a.createElement("div",{className:"templately-pre-loader"},i.a.createElement("img",{src:Hp})),i.a.createElement("div",{className:"templately-wem-row"},i.a.createElement("div",{className:"templately-wem-title"},i.a.createElement("span",{className:"wem-title-icon"})),i.a.createElement("div",{className:"templately-wem-input templately-workspace-name"},i.a.createElement("input",{autoFocus:!0,type:"text",value:d,onChange:function(e){return m(e.target.value)},placeholder:Wp("WorkSpace Name","templately")}))),i.a.createElement("div",{className:"templately-wem-row"},i.a.createElement("div",{className:"templately-wem-title"},i.a.createElement("p",null,Wp("Add People","templately"),": ")),i.a.createElement("div",{className:"templately-wem-input templately-new-shared"},i.a.createElement("ul",{className:"templately-wem-new-email-list"},y),i.a.createElement("div",null,i.a.createElement(Ep,{onChange:function(e){return k(e.currentTarget.value)},onKeyUp:function(e){return w(13===e.keyCode)},value:O,placeholder:Wp("Type email to add","templately")}),i.a.createElement(Jc,{disabled:0===O.length,onClick:function(){return w(!0)}},Wp("Add","templately"))))),i.a.createElement("div",{className:"templately-wem-row templately-wem-save-btn"},i.a.createElement(Jc,{disabled:l,onClick:function(){return f(!0)}},Wp("Create WorkSpace","templately")))))};function qp(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Kp(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Kp(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Kp(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Qp=function(e){var t=qp(Object(o.useState)(!0),2),n=t[0],r=t[1];return Object(o.useEffect)((function(){var t=setTimeout((function(){r(!1)}),[e.delay]);return function(){return clearTimeout(t)}}),[]),n?i.a.createElement("div",{className:"templately-single-workspace templately-single-workspace-placeholder"},i.a.createElement("svg",{"aria-labelledby":"loading-aria",preserveAspectRatio:"none",viewBox:"0 0 305 159"},i.a.createElement("rect",{width:"100%",height:"100%",fill:'url("#fill")',clipPath:"url(#clip-path)"}),i.a.createElement("defs",null,i.a.createElement("clipPath",{id:"clip-path"},i.a.createElement("circle",{cx:"300",cy:"22",r:"3"}),i.a.createElement("circle",{cx:"300",cy:"29",r:"3"}),i.a.createElement("circle",{cx:"300",cy:"36",r:"3"}),i.a.createElement("path",{d:"M207.4 72.6H5.1c-2.8 0-5.1-2.3-5.1-5.1s2.3-5.1 5.1-5.1h202.2c2.8 0 5.1 2.3 5.1 5.1.1 2.7-2.1 5-4.8 5.1h-.2zM82.3 97.4H5.1c-2.8 0-5.1-2.3-5.1-5.1s2.3-5.1 5.1-5.1h77.3c2.8 0 5.1 2.3 5.1 5.1-.1 2.8-2.3 5.1-5.2 5.1.1 0 .1 0 0 0z"}),i.a.createElement("circle",{cx:"21",cy:"22",r:"21"}),i.a.createElement("path",{d:"M34.8 125C27 118 15 118.6 8 126.4c-7 7.8-6.4 19.8 1.4 26.8 3.5 3.1 8 4.9 12.7 4.9 4.7 0 9.2-1.7 12.7-4.8-6.6-8.4-6.6-20.1 0-28.3z"}),i.a.createElement("path",{d:"M59.8 138.9c0-5.1 1.7-10 5-14-7.8-7-19.8-6.4-26.8 1.4-7 7.8-6.4 19.8 1.4 26.8 3.5 3.1 8 4.9 12.7 4.9 4.7 0 9.2-1.7 12.7-4.8-3.2-4.1-4.9-9.1-5-14.3z"}),i.a.createElement("path",{d:"M90 138.9c0-5.1 1.7-10 5-14-7.8-7-19.8-6.4-26.8 1.4-7 7.8-6.4 19.8 1.4 26.8 3.5 3.1 8 4.9 12.7 4.9 4.7 0 9.2-1.7 12.7-4.8-3.2-4.1-5-9.1-5-14.3z"}),i.a.createElement("path",{d:"M120 138.9c0-5.1 1.7-10 5-14-7.8-7-19.8-6.4-26.8 1.4-7 7.8-6.4 19.8 1.4 26.8 3.5 3.1 8 4.9 12.7 4.9 4.7 0 9.2-1.7 12.7-4.8-3.2-4.1-5-9.1-5-14.3z"}),i.a.createElement("circle",{cx:"142",cy:"139",r:"19"})),i.a.createElement("linearGradient",{id:"fill"},i.a.createElement("stop",{offset:"0.6",stopColor:"#f3f3f3"},i.a.createElement("animate",{attributeName:"offset",dur:"2s",keyTimes:"0; 0.25; 1",repeatCount:"indefinite",values:"-2; -2; 1"})),i.a.createElement("stop",{offset:"1.6",stopColor:"#6c7dff"},i.a.createElement("animate",{attributeName:"offset",dur:"2s",keyTimes:"0; 0.25; 1",repeatCount:"indefinite",values:"-1; -1; 2"})),i.a.createElement("stop",{offset:"2.6",stopColor:"#f3f3f3"},i.a.createElement("animate",{attributeName:"offset",dur:"2s",keyTimes:"0; 0.25; 1",repeatCount:"indefinite",values:"0; 0; 3"})))))):i.a.createElement("div",null)};function Gp(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Yp(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Yp(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Yp(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Xp=wp.i18n.__,Jp=function(e){var t=Gp(Object(o.useState)(!1),2),n=t[0],r=t[1];return Object(o.useEffect)((function(){var t=setTimeout((function(){r(!0)}),[e.delay]);return function(){return clearTimeout(t)}}),[]),n?i.a.createElement("div",{className:"templately-single-workspace templately-add-workspace no-workspace-found-wrapper"},i.a.createElement("div",{className:"templately-add-workspace-inner"},i.a.createElement("span",{className:"tw-icon"}),i.a.createElement("span",{className:"tw-title"},Xp("No Workspaces Found.","templately")))):i.a.createElement("div",null)},Zp=function(e){return void 0===e.visibility||e.visibility||e.title&&e.title.length<=0?"":i.a.createElement("div",{className:"templately-workspace-header"},i.a.createElement("h1",null,e.title),e.children)};function ed(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return td(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return td(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function td(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var nd=wp.i18n.__,rd=tt((function(e){return{workspaces:e.workspaces||null,need_pagination:e.common.need_pagination,pagination_loading:e.common.pagination_loading,pagination:e.common.pagination,workspaceList:e.workspaces.workspacesList}}))((function(e){var t=ed(Object(o.useState)(!1),2),n=t[0],r=t[1],a=ed(Object(o.useState)([]),2),l=a[0],c=a[1],u=ed(Object(o.useState)(1),2),s=u[0],f=u[1];return Object(o.useEffect)((function(){e.workspaces.hasOwnProperty(e.pagination)&&e.workspaces[e.pagination].length>0||yi(!1,!0,{page:e.pagination}).then((function(t){t.data.success&&(t.data.hasOwnProperty("data")&&t.data.data.hasOwnProperty("total_page")&&f(t.data.data.total_page),e.dispatch({type:"ALL_WORKSPACE_QUERY",payload:{current_page:t.data.data.current_page,data:t.data.data.data,total_page:t.data.data.total_page}}))})).catch((function(e){return console.error("Something went wrong: regarding fetching WorkSpace list",e)}))}),[e.pagination]),Object(o.useEffect)((function(){if(null!=e.workspaces){var t=[];e.workspaces.hasOwnProperty(e.pagination)&&e.workspaces[e.pagination].length>0&&e.workspaces[e.pagination].map((function(e,n){t.push(i.a.createElement(Dp,{key:e.id,content:e}))})),c(t)}}),[e.workspaces,e.pagination]),Object(o.useEffect)((function(){n&&(ii("",{showConfirmButton:!1,showCloseButton:!0,allowOutsideClick:!1,html:i.a.createElement($p,{singleDispatch:function(t,n){e.workspaceList.length>0&&e.dispatch({type:"ADD_WORKSPACE_IN_LIST",payload:[{id:t.id,name:t.name,slug:t.slug}]}),e.dispatch(function(e){return{type:"CREATE_WORKSPACE",payload:e}}({page:e.pagination,data:t}))}})}).then((function(e){if(e.hasOwnProperty("created"))return e.created?ii("",{icon:"success",timer:2e3,html:i.a.createElement(ki,{title:"Successfully Created",content:i.a.createElement("p",null,"You have created a WorkSpace called"," ",i.a.createElement("strong",null,e.workspace.name))})}):ii("",{icon:"error",showCloseButton:!0,html:i.a.createElement(ki,{title:"Something went wrong.",content:i.a.createElement("div",null,i.a.createElement("p",null,e.message),i.a.createElement("a",{href:"https://templately.com/subscription",target:"_blank"},nd("Upgrade to Pro","templately")))})})})),r(!1))}),[n]),i.a.createElement(vp,null,i.a.createElement(Zp,{title:"My WorkSpace"}),i.a.createElement("div",{className:"templately-my-workspace templately-workspace-list"},i.a.createElement("div",{className:"templately-single-workspace templately-add-workspace",onClick:function(){return r(!0)}},i.a.createElement("div",{className:"templately-add-workspace-inner"},i.a.createElement("span",{className:"tw-icon"}),i.a.createElement("span",{className:"tw-title"},nd("Add New WorkSpace","templately"))))," ",l.length>0?l:i.a.createElement(i.a.Fragment,null,i.a.createElement(Qp,{delay:3e3}),i.a.createElement(Qp,{delay:3e3}),i.a.createElement(Qp,{delay:3e3}),i.a.createElement(Jp,{delay:3e3}))),i.a.createElement(wu,{type:"workspace",count:s}))}));n(48),n(49);function ad(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return od(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return od(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function od(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var id=wp.i18n.__,ld=TemplatelyAdmin,cd=ld.loadingImage,ud=(ld.platform,ld.nonce,function(e){var t=ad(Object(o.useState)(!1),2),n=t[0],r=t[1],a=ad(Object(o.useState)(!1),2),l=a[0],c=a[1],u=ad(Object(o.useState)(""),2),s=u[0],f=u[1],p=ad(Object(o.useState)(!0),2),d=p[0],m=p[1],h=ad(Object(o.useState)(!1),2),y=h[0],g=h[1],v=ad(Object(o.useState)(!1),2),b=v[0],w=v[1],E=ad(Object(o.useState)([]),2),O=E[0],k=E[1];return Object(o.useEffect)((function(){if(e.workspaceList.length<=0||e.sharedWorkspaceList.length<=0)r(!0),Promise.all([yi(),yi(!0)]).then((function(t){if(t.length>0){var n=[];null!==t[0]&&"string"!=typeof t[0]&&(e.singleDispatch(t[0],"workspace"),n.push({label:id("My WorkSpace","templately"),options:gi(t[0])})),null!==t[1]&&"string"!=typeof t[1]&&(e.singleDispatch(t[1]),n.push({label:id("Shared WorkSpace","templately"),options:gi(t[1],!0)})),n.length>0?(r(!1),k(n)):f("string"==typeof t[0]?t[0]:"string"==typeof t[1]?t[1]:"")}})).catch((function(e){return console.error("Something went wrong: regarding fetching WorkSpace list",e)}));else{var t=[];e.workspaceList.length>0&&t.push({label:id("My WorkSpace","templately"),options:gi(e.workspaceList)}),e.sharedWorkspaceList.length>0&&t.push({label:id("Shared WorkSpace","templately"),options:gi(e.sharedWorkspaceList,!0)}),t.length>0&&k(t)}}),[l]),Object(o.useEffect)((function(){m(!1===b)}),[b]),Object(o.useEffect)((function(){y&&(r(!0),function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"copy";if(null===e||null===t)return!1;var r=new FormData;return r.append("action","get_templately"),r.append("content_type","copy_or_move"),r.append("cloud_file_id",e),r.append("workspace_id",t),r.append("trigger_action",n),r.append("nonce",ai),Do.a.post(ajaxurl,r).then((function(e){return e}))}(e.itemID,b.value,e.action).then((function(t){t.data.success&&"success"==t.data.data?$o.a.close({triggered:!0,action:e.action,name:b.label,fileTo:b.slug}):r(!1)})),g(!1))}),[y]),i.a.createElement(i.a.Fragment,null,i.a.createElement("div",{className:"templately-workspace-edit-modal templately-workspace-copy-modal"},n&&i.a.createElement("div",{className:"templately-pre-loader"},s.length>0?i.a.createElement("div",{className:"templately-retry"},i.a.createElement("p",null,s),i.a.createElement("button",{className:"templately-retry-button button-primary",onClick:function(){r(!0),c(!l),f("")}},"Retry")):i.a.createElement("img",{src:cd})),i.a.createElement("div",{className:"templately-wem-row"},i.a.createElement("div",{className:"templately-wem-title"},i.a.createElement("p",null,id("Item Name","templately"),": ")),i.a.createElement("div",{className:"templately-wem-input"},i.a.createElement("h3",null,e.title))),i.a.createElement("div",{className:"templately-wem-row"},i.a.createElement("div",{className:"templately-wem-title"},i.a.createElement("p",null,"copy"===e.action?id("Copy to","templately"):id("Move to","templately"),": ")),i.a.createElement("div",{className:"templately-wem-input"},i.a.createElement(Co,{options:O,onChange:function(e){return w(e)}}))),i.a.createElement("div",{className:"templately-wem-row templately-wem-save-btn"},i.a.createElement(Jc,{disabled:d,onClick:function(){return g(!0)}},id("Done","templately")))))});function sd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function fd(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?sd(Object(n),!0).forEach((function(t){pd(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sd(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function pd(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dd(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return md(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return md(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function md(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var hd=wp.i18n.__,yd=TemplatelyAdmin,gd=yd.platform,vd=yd.is_block_editor,bd=yd.is_editor,wd=tt((function(e){return{clouds:e.common.cloud_files,workspaceList:e.workspaces.workspacesList,sharedWorkspaceList:e.sharedWorkspaces.sharedWorkspaceList,userID:e.admin.user.id||null,pagination:e.common.pagination,platform:e.common.platform}}))((function(e){var t=dd(Object(o.useState)(!1),2),n=t[0],r=t[1],a=dd(Object(o.useState)(!1),2),l=a[0],c=a[1],u=dd(Object(o.useState)(!1),2),s=u[0],f=u[1],p=dd(Object(o.useState)(!1),2),d=p[0],m=p[1],h=dd(Object(o.useState)(!1),2),y=h[0],g=h[1],v=Object(o.useRef)(null),b=Object(o.useRef)(null),w=Object(o.useRef)(null),E=Object(o.useRef)(null),O=function(e){var t=v.current&&v.current.contains(e.target),n=b.current&&b.current.contains(e.target);t||n||r(!1)};return Object(o.useEffect)((function(){return document.addEventListener("mousedown",O),function(){return document.removeEventListener("mousedown",O)}}),[]),Object(o.useEffect)((function(){!1!==l&&(e.isLoading(!0),li(l,"cloud",{fileType:e.platform}).then((function(t){!0===t?(e.isLoading(!1),"gutenberg"!==gd?window.TemplatelyModal.destroy():Ro.close()):(e.isLoading(!1),ii(t,{icon:"error",timer:2e3}))})))}),[l]),Object(o.useEffect)((function(){if(!1!==s||!1!==d){var t=!1!==d?"move":"copy",n="copy"===t?"Copied":"Moved",r=!1!==d?d:s;ii("",{html:i.a.createElement(ud,{title:e.name,singleDispatch:function(t,n){"workspace"===n?e.dispatch(ar(t)):e.dispatch(or(t))},itemID:r,currentWorkspace:e.currentWorkspace,action:t,workspaceList:e.workspaceList,sharedWorkspaceList:e.sharedWorkspaceList})}).then((function(t){if(t.triggered){if("move"!==t.action||e.details)"move"===t.action&&e.details&&(e.itemDelete(!0),e.isLoading(!0));else{var a=e.clouds[e.platform][e.pagination].filter((function(e){return e.id!==r})),o=e.clouds.hasOwnProperty(e.platform)?e.clouds[e.platform].total_page:1;e.dispatch(Fn({current_page:e.pagination,data:a,total_page:o,platform:e.platform})),e.isDelete(!0)}return ii("",{icon:"success",timer:1500,html:i.a.createElement(ki,{title:"Successfully ".concat(n),content:i.a.createElement("p",null,"Your file has been ".concat(n.toLowerCase()," to a WorkSpace called")," ",i.a.createElement("strong",null,t.name))})})}})),"copy"===t?f(!1):m(!1)}}),[s,d]),Object(o.useEffect)((function(){if(!1!==y){ii("",fd(fd({showConfirmButton:!0,confirmButtonText:"Delete",cancelButtonText:"Cancel",showCancelButton:!0,showCloseButton:!0,showLoaderOnConfirm:!0,reverseButtons:!0,html:i.a.createElement(ki,{title:"Are You Sure?",content:"You want to delete the file from your cloud."})},{}),{},{preConfirm:function(t){return t?function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"cloud",n=new FormData;n.append("action","get_templately"),n.append("content_type","remove_from_cloud"),n.append("remove_from",t);var r="templately"===ni?"elementor":ni;return n.append("file_type",r),n.append("id",e),n.append("nonce",ai),Do.a.post(ajaxurl,n).then((function(e){return e})).catch((function(e){return e}))}(y,e.details?"workspace":"cloud").then((function(t){return t.data.success?(e.details?(e.itemDelete(!0),e.dispatch(function(e){return{type:"DELETE_FILE_FROM_WORKSPACE",payload:e}}({fileFrom:e.currentWorkspace,id:y,page:e.pagination}))):(e.isDelete(!0),e.dispatch({type:"REMOVE_CLOUD_FILE",payload:{page:e.pagination,id:t.data.data,platform:e.platform}})),{delete:!0,fileFrom:e.currentWorkspace}):{delete:!1}})):{delete:!1}}})).then((function(e){if(!e.dismiss){if(e.value&&e.value.delete){var t=e.value.fileFrom?"You have deleted a file from your WorkSpace called ".concat(e.value.fileFrom):"You have deleted a file from your cloud.";return ii("",{icon:"success",timer:1500,html:i.a.createElement(ki,{title:"Successfully Deleted",content:t})})}return ii("",{icon:"error",timer:1500,html:i.a.createElement(ki,{title:"Something went wrong.",content:"Something went wrong regarding deleting your file. Try Later or Contact for Support."})})}})),g(!1)}}),[y]),i.a.createElement("div",{ref:E},i.a.createElement(tu,null,i.a.createElement(nu,null,i.a.createElement("div",{className:"ttcol-header"},hi(e.file_type)&&i.a.createElement("img",{src:hi(e.file_type),alt:e.name}),i.a.createElement("p",null,hd(e.name)))),i.a.createElement(nu,null,i.a.createElement(tu,null,i.a.createElement(nu,null,i.a.createElement("p",null,hd(e.date))),i.a.createElement(nu,{className:"templately-col-actions-btn"},(bd||vd)&&i.a.createElement(Jc,{className:"templately-cloud-item-action-btn tw-download",ref:w,onClick:function(){return c(e.details?e.cloud_id:e.id)}},i.a.createElement("i",null),"Insert"),i.a.createElement(Jc,{className:"templately-cloud-item-action-btn",ref:v,onClick:function(){return r(!n)}},i.a.createElement(hn,null)),n&&i.a.createElement("div",{ref:b,className:"templately-sw-cxt-menu ".concat(!0===n?"topen":"")},i.a.createElement("ul",null,i.a.createElement("li",{className:"tw-copy".concat(e.owner.id!==e.userID?" tw-disable":""),onClick:function(){return f(e.owner.id===e.userID&&(e.details?e.cloud_id:e.id))}},i.a.createElement("i",null),"Copy to WorkSpace"),i.a.createElement("li",{className:"tw-move".concat(e.owner.id!==e.userID?" tw-disable":""),onClick:function(){return m(e.owner.id===e.userID&&(e.details?e.cloud_id:e.id))}},i.a.createElement("i",null),"Move to WorkSpace"),i.a.createElement("li",{className:"tw-delete".concat(e.owner.id!==e.userID?" tw-disable":""),onClick:function(){return g(e.owner.id===e.userID&&e.id)}},i.a.createElement("i",null),"Delete"))))))))})),Ed=TemplatelyAdmin.not_found,Od=tt((function(e){return{retry:e.common.retry,retryMessage:e.common.retryMessage}}))((function(e){return i.a.createElement("div",{className:"templately-nothing-is-there"},""!=e.retryMessage?i.a.createElement("div",{className:"templately-retry"},i.a.createElement("p",null,e.retryMessage),i.a.createElement("button",{className:"templately-retry-button button-primary",onClick:function(){e.dispatch(Cn(!e.retry)),e.dispatch(In(""))}},"Retry")):i.a.createElement("img",{src:Ed}))}));function kd(e){return function(e){if(Array.isArray(e))return Cd(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||Pd(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Sd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function xd(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Sd(Object(n),!0).forEach((function(t){_d(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Sd(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function _d(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jd(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||Pd(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Pd(e,t){if(e){if("string"==typeof e)return Cd(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Cd(e,t):void 0}}function Cd(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Td=wp.i18n.__,Ad=TemplatelyAdmin.loadingImage,Nd=function(e){var t=jd(Object(o.useState)(!1),2),n=t[0],r=t[1],a=jd(Object(o.useState)(!1),2),l=a[0],c=a[1],u=jd(Object(o.useState)(""),2),s=u[0],f=u[1],p=jd(Object(o.useState)(!0),2),d=p[0],m=p[1],h=jd(Object(o.useState)(!1),2),y=h[0],g=h[1],v=jd(Object(o.useState)(!1),2),b=v[0],w=v[1],E=jd(Object(o.useState)(!1),2),O=E[0],k=E[1],S=jd(Object(o.useState)({value:"clouds",label:Td("My Clouds","templately")}),2),x=S[0],_=S[1],j=jd(Object(o.useState)([]),2),P=j[0],C=j[1],T=jd(Object(o.useState)([]),2),A=T[0],N=T[1],I=jd(Object(o.useState)([]),2),L=I[0],D=I[1],R=jd(Object(o.useState)([]),2),M=R[0],F=R[1],z=jd(Object(o.useState)(e.cloudFiles),2),U=z[0],B=z[1];Object(o.useEffect)((function(){if(F([]),"clouds"==x.value)if(U.hasOwnProperty("clouds")){var t=[];U.clouds.map((function(e){t.push({label:e.name,value:e.id,file_type:e.file_type})})),D(t)}else D([]);if("workspaces"==x.value&&!1!==O)if(U.hasOwnProperty(O.slug)){var n=[];U[O.slug].map((function(e){n.push({label:e.name,value:e.my_cloud_id,file_type:e.file_type})})),D(n)}else{r(!0),bi(O.slug,{per_page:-1,platform:e.platform}).then((function(t){if(t.data.success)if(r(!1),null!==t.data.data.files){var n=xd({},U);n[O.slug]=t.data.data.files.data,B(n),e.singleDispatch({data:t.data.data.files.data,slug:O.slug});var a=[];t.data.data.files.data.map((function(e){a.push({label:e.name,value:e.my_cloud_id,file_type:e.file_type})})),D(a)}else D([]);else f("string"==typeof t.data.data?t.data.data:"")}))}if("shared_workspaces"==x.value&&!1!==b)if(U.hasOwnProperty(b.slug)){var a=[];U[b.slug].map((function(e){a.push({label:e.name,value:e.my_cloud_id,file_type:e.file_type})})),D(a)}else{r(!0),bi(b.slug,{per_page:-1,platform:e.platform}).then((function(t){if(t.data.success)if(r(!1),null!==t.data.data.files){var n=xd({},U);n[b.slug]=t.data.data.files.data,B(n),e.singleDispatch({data:t.data.data.files.data,slug:b.slug});var a=[];t.data.data.files.data.map((function(e){a.push({label:e.name,value:e.my_cloud_id,file_type:e.file_type})})),D(a)}else D([]);else f("string"==typeof t.data.data?t.data.data:"")}))}}),[x,O,b,U,l]),Object(o.useEffect)((function(){if(r(!0),U.hasOwnProperty("clouds")){if(U.hasOwnProperty("clouds")){var t=[];U.clouds.map((function(e){t.push({label:e.name,value:e.id,file_type:e.file_type})})),D(t)}}else vi({per_page:-1,platform:e.platform}).then((function(t){if(t.data.success){if(t.data.data.data.length>0){var n=[];t.data.data.data.map((function(e){n.push({label:e.name,value:e.id,file_type:e.file_type})})),D(n);var a=xd({},U);a.clouds=t.data.data.data,B(a),e.singleDispatch({slug:"clouds",data:t.data.data.data}),r(!1)}}else r(!0),f("string"==typeof t.data.data?t.data.data:"")}));e.workspaceList.length<=0||e.sharedWorkspaceList.length<=0?Promise.all([yi(),yi(!0)]).then((function(t){if(t.length>0){var n=[],a=[];null!==t[0]&&"string"!=typeof t[0]?(e.singleDispatch(t[0],"workspace"),n=gi(t[0])):f("string"==typeof t[0]?t[0]:""),null!==t[1]&&"string"!=typeof t[1]?(e.singleDispatch(t[1]),a=gi(t[1],!0)):f("string"==typeof t[1]?t[1]:""),n.length>0&&C(n),a.length>0&&N(a),(a.length>0||n.length>0)&&r(!1)}})).catch((function(e){return console.error("Error Regarding Fetching WorkSpace List:",e)})):(e.workspaceList.length>0&&C(gi(e.workspaceList)),e.sharedWorkspaceList.length>0&&N(gi(e.sharedWorkspaceList)),r(!1))}),[l]),Object(o.useEffect)((function(){null!==M?("workspaces"===x.value&&!1!==O&&M.length>0&&m(!1),"shared_workspaces"===x.value&&!1!==b&&M.length>0&&m(!1),"clouds"===x.value&&!b&&!O&&M.length>0&&m(!1)):m(!0)}),[b,O,M]),Object(o.useEffect)((function(){if(y){var t=M.reduce((function(e,t){var n=kd(e);return n.push(t.value),n}),[]);r(!0),function(e,t){var n=new FormData;return n.append("action","get_templately"),n.append("content_type","add_files_to_workspace"),n.append("workspace_id",e),n.append("files",t),n.append("nonce",ai),Do.a.post(ajaxurl,n).then((function(e){return e})).catch((function(e){return e}))}(e.workspaceID,JSON.stringify(t)).then((function(t){if(t.data.success){if("success"===t.data.data.status){var n=JSON.parse(t.data.data.data);if(n.files.length>0){var a=[];n.files.map((function(e){a.push({id:e.id,my_cloud_id:e.my_cloud_item_id,name:e.name,file_type:e.file_type,created_at:e.created_at,last_modified:e.last_modified,owner:e.owner})})),e.singleDispatch({slug:e.workspaceSlug,data:a},"workspace_details"),$o.a.close({added:!0})}}}else r(!1)})),g(!1)}}),[y]);return i.a.createElement(i.a.Fragment,null,i.a.createElement("div",{className:"templately-workspace-edit-modal templately-workspace-copy-modal"},n&&i.a.createElement("div",{className:"templately-pre-loader"},s.length>0?i.a.createElement("div",{className:"templately-retry"},i.a.createElement("p",null,s),i.a.createElement("button",{className:"templately-retry-button button-primary",onClick:function(){r(!0),c(!l),f("")}},"Retry")):i.a.createElement("img",{src:Ad})),i.a.createElement("div",{className:"templately-wem-row"},i.a.createElement("div",{className:"templately-wem-title"},i.a.createElement("p",null,Td("Add Template to WorkSpace","templately"),": "))),i.a.createElement("div",{className:"templately-wem-row"},i.a.createElement("div",{className:"templately-wem-title"},i.a.createElement("p",null,Td("Select Source","templately"),": ")),i.a.createElement("div",{className:"templately-wem-input"},i.a.createElement(Co,{isSearchable:!1,defaultValue:{value:"clouds",label:Td("My Clouds","templately")},options:[{value:"clouds",label:Td("My Clouds","templately")},{value:"workspaces",label:Td("My Workspaces","templately")},{value:"shared_workspaces",label:Td("Shared Workspaces","templately")}],onChange:function(e){return _(e)}}))),"workspaces"===x.value&&i.a.createElement("div",{className:"templately-wem-row"},i.a.createElement("div",{className:"templately-wem-title"},i.a.createElement("p",null,Td("Select WorkSpace","templately"),": ")),i.a.createElement("div",{className:"templately-wem-input"},i.a.createElement(Co,{options:P,noOptionsMessage:function(){return Td("No WorkSpace Found","templately")},onChange:function(e){return k(e)}}))),"shared_workspaces"===x.value&&i.a.createElement("div",{className:"templately-wem-row"},i.a.createElement("div",{className:"templately-wem-title"},i.a.createElement("p",null,Td("Select WorkSpace","templately"),": ")),i.a.createElement("div",{className:"templately-wem-input"},i.a.createElement(Co,{options:A,noOptionsMessage:function(){return Td("No Shared WorkSpace Found","templately")},onChange:function(e){return w(e)}}))),("shared_workspaces"===x.value&&!1!==b||"workspaces"===x.value&&!1!==O||"clouds"===x.value)&&i.a.createElement("div",{className:"templately-wem-row"},i.a.createElement("div",{className:"templately-wem-title"},i.a.createElement("p",null,Td("Select Templates","templately"),": ")),i.a.createElement("div",{className:"templately-wem-input"},i.a.createElement(Co,{value:M,noOptionsMessage:function(){return Td("No Saved Templates Found","templately")},classNamePrefix:"templately",isMulti:!0,options:L,onChange:function(e){return F(e)}}))),i.a.createElement("div",{className:"templately-wem-row templately-wem-save-btn"},i.a.createElement(Jc,{disabled:d,onClick:function(){return g(!0)}},Td("Add To WorkSpace","templately")))))};function Id(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Ld(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ld(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ld(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Dd=wp.i18n.__,Rd=tt((function(e){return{workspaceList:e.workspaces.workspacesList,sharedWorkspaceList:e.sharedWorkspaces.sharedWorkspaceList,clouds_file_list:e.workspacesDetails.filesList,platform:e.common.platform}}))((function(e){var t=Id(Object(o.useState)(!1),2),n=t[0],r=t[1],a=Id(Object(o.useState)(!1),2),l=a[0],c=a[1],u=Id(Object(o.useState)(""),2),s=u[0],f=u[1],p=Id(Object(o.useState)(!1),2),d=p[0],m=p[1],h=Id(Object(o.useState)([]),2),y=h[0],g=h[1];return Object(o.useEffect)((function(){!1!==n&&e.workspaceSlug!==n.slug&&(e.setSearch(!1),e.setLoading(!0),e.dispatch(Qn(1)),e.dispatch(Zn(n.shared?"/shared/workspace/".concat(n.slug):"/workspace/".concat(n.slug))),e.dispatch({type:"WORKSPACE_SLUG",payload:n.slug}),r(!1))}),[n]),Object(o.useEffect)((function(){d&&s.length>0&&(e.setItemLoading(!0),e.setSearch(!0),bi(e.workspaceSlug,{search:s,per_page:-1}).then((function(t){t.data.success&&(t.data.data.files.data&&e.setSearchedItem(t.data.data.files.data),e.setItemLoading(!1))})),m(!1)),d&&0===s.length&&e.setSearch(!1)}),[d]),Object(o.useEffect)((function(){if(e.workspaceList.length<=0||e.sharedWorkspaceList.length<=0)Promise.all([yi(),yi(!0)]).then((function(t){if(t.length>0){var n=[];null!==t[0]&&"string"!=typeof t[0]&&(e.dispatch(ar(t[0])),n.push({label:Dd("My WorkSpace","templately"),options:gi(t[0])})),null!==t[1]&&"string"!=typeof t[1]&&(e.dispatch(or(t[1])),n.push({label:Dd("Shared WorkSpace","templately"),options:gi(t[1],!0)})),n.length>0&&g(n)}})).catch((function(e){return console.error("Something went wrong: regarding fetching WorkSpace list",e)}));else{var t=[];e.workspaceList.length>0&&t.push({label:Dd("My WorkSpace","templately"),options:gi(e.workspaceList)}),e.sharedWorkspaceList.length>0&&t.push({label:Dd("Shared WorkSpace","templately"),options:gi(e.sharedWorkspaceList,!0)}),t.length>0&&g(t)}}),[e.retry]),Object(o.useEffect)((function(){l&&(ii("",{html:i.a.createElement(Nd,{title:e.name,singleDispatch:function(t,n){"workspace_details"===n||e.dispatch({type:"ALL_CLOUDS_FILE_LIST",payload:{slug:t.slug,data:t.data,platform:e.platform}})},platform:e.platform,workspaceSlug:e.workspaceSlug,workspaceID:e.workspaceID,cloudFiles:e.clouds_file_list[e.platform]||[],currentWorkspace:e.currentWorkspace,workspaceList:e.workspaceList,sharedWorkspaceList:e.sharedWorkspaceList})}).then((function(t){if(t.added)return e.setFileAdded(!0),ii("",{icon:"success",timer:1500,html:i.a.createElement(ki,{title:"Successfully Added.",content:i.a.createElement("p",null,"Your file has been added to this workspace."," ",i.a.createElement("strong",null,t.name))})})})),c(!1))}),[l]),i.a.createElement("div",{className:"templately-workspace-file-add"},i.a.createElement("div",{className:"twfa-header twfa-action"},i.a.createElement("h3",null,Dd("My Files","templately"))),i.a.createElement("div",{className:"twfa-search twfa-action"},i.a.createElement("div",null,i.a.createElement(Co,{className:"templately-select-workspace",classNamePrefix:"templately",options:y,defaultValue:e.currentDetails,onChange:function(e){return r(e)}}),i.a.createElement(Ep,{onChange:function(e){return f(e)},onKeyDown:function(e){var t=e.keyCode;return m(13===t)},placeholder:Dd("Search...","templately")}))),i.a.createElement("div",{className:"twfa-add twfa-action"},i.a.createElement(Jc,{onClick:function(){return c(!0)}},i.a.createElement(wn,null))))}));function Md(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Fd(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Fd(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Fd(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var zd=tt((function(e){return{isLoggedIn:e.common.isLoggedIn,clouds:e.common.cloud_files,workspace_slug:e.common.workspace_slug,workspacesDetails:e.workspacesDetails||!1,pagination_loading:e.common.pagination_loading,pagination:e.common.pagination,platform:e.common.platform,retry:e.common.retry}}))((function(e){var t=Md(Object(o.useState)({}),2),n=t[0],r=t[1],a=Md(Object(o.useState)([]),2),l=a[0],c=a[1],u=Md(Object(o.useState)([]),2),s=u[0],f=u[1],p=Md(Object(o.useState)([]),2),d=p[0],m=p[1],h=Md(Object(o.useState)(!0),2),y=h[0],g=h[1],v=Md(Object(o.useState)(!1),2),b=v[0],w=v[1],E=Md(Object(o.useState)(!1),2),O=E[0],k=E[1],S=Md(Object(o.useState)(!1),2),x=S[0],_=S[1],j=Md(Object(o.useState)(!1),2),P=j[0],C=j[1],T=Md(Object(o.useState)(!1),2),A=T[0],N=T[1],I=Md(Object(o.useState)(1),2),L=I[0],D=I[1],R=ce(),M=le(),F=Md(Object(o.useState)(!1!==e.workspace_slug?e.workspace_slug:R.slug),2),z=F[0],U=F[1];return Object(o.useEffect)((function(){!1!==e.workspace_slug&&U(e.workspace_slug)}),[e.workspace_slug]),Object(o.useEffect)((function(){if(!1!==z&&!(e.workspacesDetails.hasOwnProperty(z)&&null!==e.workspacesDetails[z].files&&e.workspacesDetails[z].files.hasOwnProperty(e.platform)&&e.workspacesDetails[z].files[e.platform].hasOwnProperty(e.pagination)&&0===M.search.length||e.workspacesDetails.hasOwnProperty(z)&&e.workspacesDetails[z].files.hasOwnProperty(e.platform)&&e.workspacesDetails[z].files[e.platform].hasOwnProperty(e.pagination)&&0===M.search.length)){var t=!1;y||(t=!0,_(!0)),bi(z,{page:e.pagination,platform:e.platform}).then((function(n){if(200===n.status){if(n.data.success)if(n.data.hasOwnProperty("data")&&null!==n.data.data){if(n.data.data.hasOwnProperty("files")&&null!==n.data.data.files){if("refresh"===b&&e.pagination===L)return e.dispatch(Qn(n.data.data.files.total_page)),void _(!1);D(n.data.data.files.total_page)}r({label:n.data.data.name,slug:n.data.data.slug,value:n.data.data.id}),e.dispatch({type:"ADD_WORKSPACE_WITH_DETAILS",payload:{slug:z,data:n.data.data,platform:e.platform,page:e.pagination,iLoading:t}})}else{var a=M.pathname.replace(R.slug,"");e.dispatch(Zn(a))}else e.dispatch(In("string"==typeof n.data.data?n.data.data:""));g(!1),_(!1)}else g(!1),_(!1)})).catch((function(e){g(!1),console.error("WorkSpace Details Error: ",e)}))}}),[z,e.pagination,b,O,e.platform,e.retry]),Object(o.useEffect)((function(){!0===O&&(e.dispatch(rr({page:e.pagination,slug:z,platform:e.platform,fileAdded:!0})),k("refresh")),!0===b&&(e.dispatch(rr({page:e.pagination,slug:z,platform:e.platform})),w("refresh"))}),[b,O]),Object(o.useEffect)((function(){if(!1!==z&&e.workspacesDetails.hasOwnProperty(z)){if(N(e.workspacesDetails[z].id),e.workspacesDetails[z].hasOwnProperty("files")&&null!=e.workspacesDetails[z].files){var t=[];if(!e.workspacesDetails[z].files.hasOwnProperty(e.platform))return void c([]);e.workspacesDetails[z].files[e.platform].hasOwnProperty(e.pagination)&&e.workspacesDetails[z].files[e.platform][e.pagination].length>0?(e.workspacesDetails[z].files[e.platform][e.pagination].map((function(e){t.push(i.a.createElement(wd,{details:!0,itemDelete:function(e){return w(e)},isLoading:function(e){return g(e)},key:e.id,currentWorkspace:z,owner:e.owner,file_type:e.file_type,cloud_id:e.my_cloud_id,id:e.id,name:e.name,date:e.last_modified}))})),c(t)):c([])}else c([]);g(!1),"refresh"===b&&w(!1)}}),[e.workspacesDetails,z,e.pagination,e.platform]),Object(o.useEffect)((function(){if(s.length>0){if(!1===z)return;var e=[];s.map((function(t){e.push(i.a.createElement(wd,{details:!0,isLoading:function(e){return g(e)},key:t.id,currentWorkspace:z,owner:t.owner,file_type:t.file_type,cloud_id:t.my_cloud_id,id:t.id,name:t.name,date:t.last_modified}))})),m(e)}else m([])}),[s]),Object(o.useEffect)((function(){e.workspacesDetails.hasOwnProperty(z)&&e.workspacesDetails[z].hasOwnProperty("files")&&e.workspacesDetails[z].files.hasOwnProperty(e.platform)&&D(e.workspacesDetails[z].files[e.platform].total_page)}),[e.platform,e.workspacesDetails,z,b,O]),i.a.createElement(vp,null,i.a.createElement("div",{className:"".concat(L>1?"thas-pagination ":"","templately-my-workspace templately-workspace-details templately-list-view").concat(y?" templately-loading":"")},y&&i.a.createElement(Ou,null),e.workspacesDetails[R.slug]&&!y&&i.a.createElement(Dp,{details:!0,content:e.workspacesDetails[R.slug],platform:e.platform}),!y&&i.a.createElement(i.a.Fragment,null,i.a.createElement(Rd,{retry:e.retry,setFileAdded:function(e){return k(e)},setLoading:function(e){return g(e)},setItemLoading:function(e){return _(e)},setSearch:function(e){return C(e)},setSearchedItem:function(e){return f(e)},workspaceSlug:z,workspaceID:A,currentDetails:n}),i.a.createElement(eu,{className:"templately-clouds-table"},(l.length>0&&!P||d.length>0&&P)&&i.a.createElement(i.a.Fragment,null,i.a.createElement(au,null),x&&i.a.createElement(Ou,{small:!0}),P&&!x&&i.a.createElement(yu,{className:"templately-table-body"},d),!x&&!P&&i.a.createElement(yu,{className:"templately-table-body"},l)),(0===l.length&&x||0===d.length&&x)&&i.a.createElement(i.a.Fragment,null,x&&i.a.createElement(Ou,{small:!0})),!P&&0===l.length&&!x&&i.a.createElement(Od,null),P&&0===d.length&&!x&&i.a.createElement(Od,null)),L>1&&i.a.createElement(wu,{type:"workspace",count:L}))))})),Ud=wp.i18n.__,Bd=function(e){return i.a.createElement("div",{className:"ttemplately-loggein-message"},i.a.createElement("div",null,i.a.createElement("p",null,Ud("You have to logged in, in order to visit this page or view your items from cloud.","templately")),i.a.createElement(he,{className:"templately-button",to:"/sign-in"},Ud("Login","templately"))))};function Vd(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Wd(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Wd(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Wd(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Hd=wp.i18n.__,$d=tt((function(e){return{isLoggedIn:e.common.isLoggedIn,clouds:e.common.cloud_files,platform:e.common.platform,loading:e.common.loading,pushed_time:e.common.pushed_time,userID:e.admin.user.id||null,pagination:e.common.pagination,retry:e.common.retry}}))((function(e){var t=Vd(Object(o.useState)(!0),2),n=t[0],r=t[1],a=Vd(Object(o.useState)(!1),2),l=a[0],c=a[1],u=Vd(Object(o.useState)(!1),2),s=u[0],f=u[1],p=Vd(Object(o.useState)([]),2),d=p[0],m=p[1],h=Vd(Object(o.useState)(1),2),y=h[0],g=h[1],v=Vd(Object(o.useState)(""),2),b=v[0],w=v[1],E=Vd(Object(o.useState)(""),2),O=E[0],k=E[1],S=Vd(Object(o.useState)(!1),2),x=S[0],_=S[1],j=Vd(Object(o.useState)(!1),2),P=j[0],C=j[1],T=Vd(Object(o.useState)(!1),2),A=T[0],N=T[1],I=Vd(Object(o.useState)({}),2),L=I[0],D=I[1],R=Vd(Object(o.useState)(1),2),M=R[0],F=R[1],z=le();return Object(o.useEffect)((function(){A&&(e.dispatch(Qn(1)),C(!1),w(""),k(""),D({}),N(!1))}),[A]),Object(o.useEffect)((function(){if(M!==e.pagination||x){if(b.length>0){if(L.hasOwnProperty(e.pagination)&&O===b)return void f(!1);k(b),F(e.pagination),f(!0),vi({per_page:10,page:e.pagination,platform:e.platform,search:b}).then((function(t){if(200===t.status)if(t.data.success){C(!0),g(t.data.data.total_page);var n={};n[e.pagination]=t.data.data.data,D(n),f(!1)}else f(!1)})).catch((function(e){return console.error("Search MyClouds Error: ",e)}))}_(!1)}}),[x,e.pagination]),Object(o.useEffect)((function(){if(!P){if(e.clouds.hasOwnProperty(e.platform)&&e.clouds[e.platform].hasOwnProperty(e.pagination)&&!l&&"?refresh"!==z.search)return f(!1),void r(!1);r(!0),f(!0),vi({page:e.pagination,platform:e.platform,per_page:10}).then((function(t){200===t.status&&t.data.success&&(g(t.data.data.total_page),e.dispatch(Fn({current_page:t.data.data.current_page,data:t.data.data.data,total_page:t.data.data.total_page,platform:e.platform})),f(!1),r(!1),e.dispatch({type:"SET_SUCCESS_TEXT",payload:Hd("Successfully Synced","templately")}))})).catch((function(e){return console.error("Sync Error From MyClouds: ",e)}))}}),[e.pagination,l,e.platform,e.retry]),Object(o.useEffect)((function(){if(P){if(!L.hasOwnProperty(e.pagination))return;if(L.hasOwnProperty(e.pagination)){var t=[];L[e.pagination]&&L[e.pagination].length>0&&L[e.pagination].map((function(n){t.push(i.a.createElement(wd,{isDelete:function(e){return c(e)},isLoading:function(e){return r(e)},key:n.id,file_type:n.file_type,owner:{id:e.userID},id:n.id,name:n.name,date:n.created_at}))})),m(t)}}else if(e.clouds.hasOwnProperty(e.platform)&&e.clouds[e.platform].hasOwnProperty(e.pagination)&&(l||s||!1===n)){g(e.clouds[e.platform].total_page);var a=[];e.clouds[e.platform][e.pagination].length>0&&e.clouds[e.platform][e.pagination].map((function(t){a.push(i.a.createElement(wd,{isDelete:function(e){return c(e)},isLoading:function(e){return r(e)},key:t.id,file_type:t.file_type,owner:{id:e.userID},id:t.id,name:t.name,date:t.created_at}))})),m(a),c(!1)}}),[e.clouds,s,n,e.pagination,l,e.platform,A,x]),Object(o.useEffect)((function(){e.clouds.hasOwnProperty(e.platform)&&g(e.clouds[e.platform].total_page||0)}),[e.platform]),i.a.createElement(i.a.Fragment,null,!e.isLoggedIn&&i.a.createElement(Bd,null),e.isLoggedIn&&i.a.createElement(vp,null,n&&i.a.createElement(Ou,null),!n&&i.a.createElement(i.a.Fragment,null,i.a.createElement(Zp,{visibility:!1,title:"My Cloud"},i.a.createElement("div",{className:"templately-cloud-searchbox"},i.a.createElement(Ep,{className:"templately-cloud-search",value:b,onChange:function(e){return w(e.target.value)},onKeyDown:function(e){return _(13===e.keyCode)},placeholder:Hd("Type and press enter...","templately")}),!P&&i.a.createElement(Jc,{onClick:function(){return _(!0)},className:"templately-cloud-search-clear tsearch"},i.a.createElement(En,null)),P&&i.a.createElement(Jc,{onClick:function(){return N(!0)},className:"templately-cloud-search-clear"},i.a.createElement(_n,null)))),i.a.createElement("div",{className:"templately-my-clouds"},i.a.createElement(eu,{className:"templately-clouds-table"},d.length>0&&i.a.createElement(i.a.Fragment,null,i.a.createElement(au,null),!s&&i.a.createElement(yu,{className:"templately-table-body"},d),s&&i.a.createElement(Ou,null)),0===d.length&&!s&&i.a.createElement(Od,null)),i.a.createElement(wu,{type:"clouds",count:y})))))}));function qd(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Kd(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Kd(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Kd(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Qd=tt((function(e){return{workspaces:e.sharedWorkspaces||null,need_pagination:e.common.need_pagination,pagination_loading:e.common.pagination_loading,pagination:e.common.pagination,retry:e.common.retry}}))((function(e){var t=qd(Object(o.useState)([]),2),n=t[0],r=t[1],a=qd(Object(o.useState)(!0),2),l=a[0],c=a[1],u=qd(Object(o.useState)(1),2),s=u[0],f=u[1];return Object(o.useEffect)((function(){e.workspaces.hasOwnProperty(e.pagination)&&e.workspaces[e.pagination].length>0?c(!1):(c(!0),yi(!0,!0,{page:1}).then((function(t){t.data.success?(t.data.hasOwnProperty("data")&&t.data.data.hasOwnProperty("total_page")&&f(t.data.data.total_page),e.dispatch({type:"SHARED_WORKSPACE_QUERY",payload:{current_page:t.data.data.current_page,data:t.data.data.data,total_page:t.data.data.total_page}}),c(!1)):(c(!1),e.dispatch(In("string"==typeof t.data.data?t.data.data:"")))})).catch((function(e){return console.error("Something went wrong: regarding fetching Shared WorkSpace list",e)})))}),[e.retry]),Object(o.useEffect)((function(){if(null!=e.workspaces){var t=[];e.workspaces.hasOwnProperty(e.pagination)&&e.workspaces[e.pagination].length>0&&e.workspaces[e.pagination].map((function(e,n){t.push(i.a.createElement(Dp,{key:n,shared:!0,content:e}))})),r(t)}}),[e.workspaces]),i.a.createElement(vp,null,i.a.createElement("div",{className:"templately-my-workspace templately-shared-workspace-wrapper templately-list-view"},!l&&n,!l&&0===n.length&&i.a.createElement(Od,null),l&&i.a.createElement(Ou,null)),i.a.createElement(wu,{type:"shared_workspace",count:s}))}));function Gd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Yd(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Xd(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Jd(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Jd(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Jd(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Zd=TemplatelyAdmin.is_editor,em=wp.i18n.__,tm=tt((function(e){return{user:e.admin.user||!1,isLoggedIn:e.common.isLoggedIn,currentRoutes:e.common.current_route,platform:e.common.platform}}))((function(e){var t=le(),n=Xd(Object(o.useState)(!1),2),r=n[0],a=n[1];return Object(o.useEffect)((function(){var t;r&&(t=new FormData,t.append("action","get_templately"),t.append("nonce",ai),t.append("content_type","verification_done"),Do.a.post(ajaxurl,t).then((function(e){return e})).catch((function(e){return e}))).then((function(t){if(t.data.data){a(!1);var n=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Gd(Object(n),!0).forEach((function(t){Yd(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Gd(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},e.user);delete n.is_verified,e.dispatch(Xn(n))}}))}),[r]),Object(o.useEffect)((function(){e.isLoggedIn||"/"!==t.pathname||window.elementorFrontend||e.dispatch(Zn("/sign-in"))}),[]),Object(o.useEffect)((function(){"/templates"!==t.pathname&&"/blocks"!==t.pathname&&"/packs"!==t.pathname||"gutenberg"===e.platform&&e.dispatch(Zn("/"))}),[e.platform]),i.a.createElement("div",{className:"templately-modal-body templately-".concat(e.platform,"-platform ").concat(!Zd&&!e.user.hasOwnProperty("status")&&e.isLoggedIn||"/settings"===t.pathname||"/sign-in"===t.pathname?"templately-admin-form":"")},null!=e.currentRoutes&&i.a.createElement(G,{to:"".concat(e.currentRoutes)}),i.a.createElement(oe,null,i.a.createElement(Z,{exact:!0,path:"/sign-in",component:Ju}),i.a.createElement(Z,{exact:!0,path:"/pages",component:np}),i.a.createElement(Z,{exact:!0,path:"/search/:query",component:sp}),i.a.createElement(Z,{exact:!0,path:"/blocks",component:np}),i.a.createElement(Z,{exact:!0,path:"/",component:np}),i.a.createElement(Z,{exact:!0,path:"/templates",component:_u}),i.a.createElement(Z,{exact:!0,path:"/templates/save",component:function(){return i.a.createElement(zu,e)}}),i.a.createElement(Z,{exact:!0,path:"/clouds",component:$d}),i.a.createElement(Z,{exact:!0,path:"/workspace",component:rd}),i.a.createElement(Z,{exact:!0,path:"/workspace/:slug",component:zd}),i.a.createElement(Z,{exact:!0,path:"/shared/workspace",component:Qd}),i.a.createElement(Z,{exact:!0,path:"/shared/workspace/:slug",component:zd}),i.a.createElement(Z,{exact:!0,path:"/settings",component:ns})),!1===e.user.is_verified&&i.a.createElement("div",{className:"templately-verification"},i.a.createElement("p",null,em("Please check your email & verify your account. Otherwise, account will be deleted.","templately")),i.a.createElement(Jc,{onClick:function(){return a(!0)}},em("Close","template"))))}));function nm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function rm(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var am=TemplatelyAdmin,om=am.is_logged_in,im=am.platform_exists,lm=am.user_can_logout,cm=am.is_linked_login,um=am.is_global_login,sm=function(e){var t=e.toggle,n=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?nm(Object(n),!0).forEach((function(t){rm(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nm(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},e);return delete n.toggle,Zt.dispatch(Ln(im)),Zt.dispatch(Zn(e.route)),Zt.dispatch(Vn(Boolean(om))),Zt.dispatch(Tn(Boolean(lm))),Zt.dispatch(Nn(Boolean(cm))),Zt.dispatch(An(Boolean(um))),t&&i.a.createElement(ke,{store:Zt},i.a.createElement(ue,null,i.a.createElement("div",{className:"templately-modal-templately"},i.a.createElement(Ni,null),i.a.createElement(tm,n))))};function fm(){return(fm=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var pm=function(e){var t=e.toggle;return i.a.createElement("div",{id:"templatelyGutenberg"},i.a.createElement("div",{className:"templately-modal-templately-overlay",onClick:function(){return Ro.close()}}),i.a.createElement(sm,fm({toggle:t},e)))};function dm(){return(dm=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var mm=TemplatelyAdmin.platform;if(window.Templately={modalOpen:function(e,t,n){c.a.render(i.a.createElement(sm,dm({toggle:e},t)),n)}},null!=document.getElementById("templatelyAdmin")&&c.a.render(i.a.createElement(sm,{toggle:!0}),document.getElementById("templatelyAdmin")),"gutenberg"===mm){var hm=function(){Ro.open(i.a.createElement(pm,{toggle:!0}))},ym=function(){Ro.open(i.a.createElement(pm,{toggle:!0,route:"/templates/save",editor:"gutenberg"}))};window.addEventListener("load",(function(){var e=wp.data.select("core/editor").getCurrentPostType().toLowerCase().replace("/(?<= )[^s]|^./g",(function(e){return e.toUpperCase()})),t=document.querySelector(".edit-post-header-toolbar"),n=document.createElement("div");n.id="templately-guten-icon",n.innerHTML="<button class='gutenberg-add-templately-button' id='templatelyGutenbergButton'><span class='gutenberg-templately-icon'></span>Templately</button><button id='templatelyGutenbergPushButton' class='gutenberg-add-templately-button'>Save "+e+" in Templately</button>",t.appendChild(n),document.getElementById("templatelyGutenbergButton").addEventListener("click",hm),document.getElementById("templatelyGutenbergPushButton").addEventListener("click",ym)}))}},,function(e,t,n){"use strict";!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE){0;try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}}(),e.exports=n(106)}]);
|
core/api/class-api.php
CHANGED
@@ -419,7 +419,14 @@ class API {
|
|
419 |
Helper::send_error( $data->get_error_code() . ': ' . $data->get_error_message() );
|
420 |
}
|
421 |
if ( isset( $data['data'], $data['data']['getItemsAndPacks'] ) ) {
|
422 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
423 |
}
|
424 |
}
|
425 |
|
419 |
Helper::send_error( $data->get_error_code() . ': ' . $data->get_error_message() );
|
420 |
}
|
421 |
if ( isset( $data['data'], $data['data']['getItemsAndPacks'] ) ) {
|
422 |
+
$this->data = [];
|
423 |
+
if( isset( $data['data']['getItemsAndPacks']['data'] ) && ! empty( $data['data']['getItemsAndPacks']['data'] ) ) {
|
424 |
+
array_walk( $data['data']['getItemsAndPacks']['data'], function( $item ) {
|
425 |
+
$item['id'] = intval(\str_replace( " {$item['type']}", '', $item['id']));
|
426 |
+
$this->data[] = $item;
|
427 |
+
});
|
428 |
+
}
|
429 |
+
return $this->data;
|
430 |
}
|
431 |
}
|
432 |
|
templately.php
CHANGED
@@ -1,17 +1,17 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* Plugin Name: Templately
|
4 |
-
* Description:
|
5 |
* Plugin URI: https://templately.com
|
6 |
* Author: Templately
|
7 |
-
* Version: 1.1.
|
8 |
* Author URI: https://templately.com/
|
9 |
* Text Domain: templately
|
10 |
* Domain Path: /languages
|
11 |
*/
|
12 |
|
13 |
define('TEMPLATELY_FILE', __FILE__);
|
14 |
-
define('TEMPLATELY_VERSION', '1.1.
|
15 |
define('TEMPLATELY_PATH', plugin_dir_path(TEMPLATELY_FILE));
|
16 |
define('TEMPLATELY_URL', plugin_dir_url(TEMPLATELY_FILE));
|
17 |
define('TEMPLATELY_ASSETS', TEMPLATELY_URL . 'assets/');
|
1 |
<?php
|
2 |
/**
|
3 |
* Plugin Name: Templately
|
4 |
+
* Description: The Best Templates Cloud for Elementor & Gutenberg. Get access to stunning templates, WorkSpace, Cloud Library & many more.
|
5 |
* Plugin URI: https://templately.com
|
6 |
* Author: Templately
|
7 |
+
* Version: 1.1.6
|
8 |
* Author URI: https://templately.com/
|
9 |
* Text Domain: templately
|
10 |
* Domain Path: /languages
|
11 |
*/
|
12 |
|
13 |
define('TEMPLATELY_FILE', __FILE__);
|
14 |
+
define('TEMPLATELY_VERSION', '1.1.6');
|
15 |
define('TEMPLATELY_PATH', plugin_dir_path(TEMPLATELY_FILE));
|
16 |
define('TEMPLATELY_URL', plugin_dir_url(TEMPLATELY_FILE));
|
17 |
define('TEMPLATELY_ASSETS', TEMPLATELY_URL . 'assets/');
|