Gutenberg Blocks – ACF Blocks Suite - Version 2.6.4

Version Description

  • New: Toggle to enable/disable Extendify library
  • Improved: Updates to the pattern and template library
Download this release

Release Info

Developer munirkamal
Plugin Icon 128x128 Gutenberg Blocks – ACF Blocks Suite
Version 2.6.4
Comparing to
See all releases

Code changes from version 2.6.3 to 2.6.4

acf-blocks.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin Name: ACF Blocks Suite
5
  * Plugin URI: https://acfblocks.com/
6
  * Description: Supercharge your Gutenberg editor with high quality beautiful WordPress blocks. Ready-to-use ACF Blocks!
7
- * Version: 2.6.3
8
  * Author: munirkamal
9
  * Author URI: https://munirkamal.wordpress.com
10
  * License: GPL2
4
  * Plugin Name: ACF Blocks Suite
5
  * Plugin URI: https://acfblocks.com/
6
  * Description: Supercharge your Gutenberg editor with high quality beautiful WordPress blocks. Ready-to-use ACF Blocks!
7
+ * Version: 2.6.4
8
  * Author: munirkamal
9
  * Author URI: https://munirkamal.wordpress.com
10
  * License: GPL2
extendify-sdk/app/Controllers/{CategoryController.php → TaxonomyController.php} RENAMED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Controls Categories
4
  */
5
 
6
  namespace Extendify\ExtendifySdk\Controllers;
@@ -12,19 +12,19 @@ if (!defined('ABSPATH')) {
12
  }
13
 
14
  /**
15
- * The controller for dealing with categories
16
  */
17
- class CategoryController
18
  {
19
 
20
  /**
21
- * Return all categories
22
  *
23
  * @return WP_REST_Response|WP_Error
24
  */
25
  public static function index()
26
  {
27
- $response = Http::get('/airtable-categories', []);
28
  return new \WP_REST_Response($response);
29
  }
30
  }
1
  <?php
2
  /**
3
+ * Controls Taxonomies
4
  */
5
 
6
  namespace Extendify\ExtendifySdk\Controllers;
12
  }
13
 
14
  /**
15
+ * The controller for dealing with taxonomies
16
  */
17
+ class TaxonomyController
18
  {
19
 
20
  /**
21
+ * Return all taxonomies
22
  *
23
  * @return WP_REST_Response|WP_Error
24
  */
25
  public static function index()
26
  {
27
+ $response = Http::get('/airtable-taxonomies', []);
28
  return new \WP_REST_Response($response);
29
  }
30
  }
extendify-sdk/app/Controllers/TemplateController.php CHANGED
@@ -12,7 +12,7 @@ if (!defined('ABSPATH')) {
12
  }
13
 
14
  /**
15
- * The controller for dealing with categories
16
  */
17
  class TemplateController
18
  {
@@ -30,12 +30,12 @@ class TemplateController
30
  }
31
 
32
  /**
33
- * Return info about a template
34
  *
35
  * @param \WP_REST_Request $request - The request.
36
  * @return WP_REST_Response|WP_Error
37
  */
38
- public static function single($request)
39
  {
40
  $response = Http::post('/airtable-data', $request->get_params());
41
  return new \WP_REST_Response($response);
12
  }
13
 
14
  /**
15
+ * The controller for dealing with templates
16
  */
17
  class TemplateController
18
  {
30
  }
31
 
32
  /**
33
+ * Send data about a specific template
34
  *
35
  * @param \WP_REST_Request $request - The request.
36
  * @return WP_REST_Response|WP_Error
37
  */
38
+ public static function ping($request)
39
  {
40
  $response = Http::post('/airtable-data', $request->get_params());
41
  return new \WP_REST_Response($response);
extendify-sdk/app/Http.php CHANGED
@@ -55,7 +55,10 @@ class Http
55
  return;
56
  }
57
 
 
58
  $this->baseUrl = $request->get_header('x_extendify_dev_mode') !== 'false' ? App::$config['api']['dev'] : App::$config['api']['live'];
 
 
59
  $this->data = [
60
  'mode' => App::$environment,
61
  'uuid' => User::data('uuid'),
55
  return;
56
  }
57
 
58
+ // Some special cases for development.
59
  $this->baseUrl = $request->get_header('x_extendify_dev_mode') !== 'false' ? App::$config['api']['dev'] : App::$config['api']['live'];
60
+ $this->baseUrl = $request->get_header('x_extendify_local_mode') !== 'false' ? App::$config['api']['local'] : $this->baseUrl;
61
+
62
  $this->data = [
63
  'mode' => App::$environment,
64
  'uuid' => User::data('uuid'),
extendify-sdk/config.json CHANGED
@@ -1,6 +1,7 @@
1
  {
2
  "api": {
3
  "live": "https://dashboard.extendify.com/api",
4
- "dev": "https://testing.extendify.com/api"
 
5
  }
6
  }
1
  {
2
  "api": {
3
  "live": "https://dashboard.extendify.com/api",
4
+ "dev": "https://testing.extendify.com/api",
5
+ "local": "http://templates.test/api"
6
  }
7
  }
extendify-sdk/extendify-sdk.php CHANGED
@@ -1,5 +1,4 @@
1
  <?php
2
-
3
  if (!defined('ABSPATH')) {
4
  exit;
5
  }
@@ -27,6 +26,10 @@ if (!class_exists('ExtendifySdk')) :
27
  */
28
  public function __invoke()
29
  {
 
 
 
 
30
  if (version_compare(PHP_VERSION, '5.6', '<') || version_compare($GLOBALS['wp_version'], '5.4', '<')) {
31
  return;
32
  }
1
  <?php
 
2
  if (!defined('ABSPATH')) {
3
  exit;
4
  }
26
  */
27
  public function __invoke()
28
  {
29
+ if (!apply_filters('extendifysdk_load_library', true)) {
30
+ return;
31
+ }
32
+
33
  if (version_compare(PHP_VERSION, '5.6', '<') || version_compare($GLOBALS['wp_version'], '5.4', '<')) {
34
  return;
35
  }
extendify-sdk/public/build/extendify-sdk.css CHANGED
@@ -1 +1 @@
1
- .extendify-sdk .space-x-1>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(0.25rem*var(--tw-space-x-reverse));margin-left:calc(0.25rem*(1 - var(--tw-space-x-reverse)))}.extendify-sdk .space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(0.5rem*var(--tw-space-x-reverse));margin-left:calc(0.5rem*(1 - var(--tw-space-x-reverse)))}.extendify-sdk .space-x-3>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(0.75rem*var(--tw-space-x-reverse));margin-left:calc(0.75rem*(1 - var(--tw-space-x-reverse)))}.extendify-sdk .space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(1rem*(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem*var(--tw-space-y-reverse))}.extendify-sdk .space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(1.5rem*(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem*var(--tw-space-y-reverse))}.extendify-sdk .space-x-12>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(3rem*var(--tw-space-x-reverse));margin-left:calc(3rem*(1 - var(--tw-space-x-reverse)))}.extendify-sdk .space-x-1\.5>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(0.375rem*var(--tw-space-x-reverse));margin-left:calc(0.375rem*(1 - var(--tw-space-x-reverse)))}.extendify-sdk .divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse:0;border-top-width:calc(1px*(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px*var(--tw-divide-y-reverse))}.extendify-sdk .sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.extendify-sdk .focus\:not-sr-only:focus{position:static;width:auto;height:auto;padding:0;margin:0;overflow:visible;clip:auto;white-space:normal}.extendify-sdk .bg-transparent{background-color:transparent}.extendify-sdk .bg-black{--tw-bg-opacity:1;background-color:rgba(0,0,0,var(--tw-bg-opacity))}.extendify-sdk .bg-white{--tw-bg-opacity:1;background-color:rgba(255,255,255,var(--tw-bg-opacity))}.extendify-sdk .bg-gray-50{--tw-bg-opacity:1;background-color:rgba(250,250,250,var(--tw-bg-opacity))}.extendify-sdk .bg-gray-100{--tw-bg-opacity:1;background-color:rgba(240,240,240,var(--tw-bg-opacity))}.extendify-sdk .bg-gray-200{--tw-bg-opacity:1;background-color:rgba(224,224,224,var(--tw-bg-opacity))}.extendify-sdk .bg-gray-900{--tw-bg-opacity:1;background-color:rgba(30,30,30,var(--tw-bg-opacity))}.extendify-sdk .bg-extendify-lightest{--tw-bg-opacity:1;background-color:rgba(248,255,254,var(--tw-bg-opacity))}.extendify-sdk .bg-extendify-light{--tw-bg-opacity:1;background-color:rgba(231,248,245,var(--tw-bg-opacity))}.extendify-sdk .bg-extendify-main{--tw-bg-opacity:1;background-color:rgba(0,129,96,var(--tw-bg-opacity))}.extendify-sdk .group:hover .group-hover\:bg-transparent{background-color:transparent}.extendify-sdk .active\:bg-gray-900:active,.extendify-sdk .hover\:bg-gray-900:hover{--tw-bg-opacity:1;background-color:rgba(30,30,30,var(--tw-bg-opacity))}.extendify-sdk .bg-opacity-30{--tw-bg-opacity:0.3}.extendify-sdk .border-transparent{border-color:transparent}.extendify-sdk .border-black{--tw-border-opacity:1;border-color:rgba(0,0,0,var(--tw-border-opacity))}.extendify-sdk .border-gray-200{--tw-border-opacity:1;border-color:rgba(224,224,224,var(--tw-border-opacity))}.extendify-sdk .border-gray-300{--tw-border-opacity:1;border-color:rgba(221,221,221,var(--tw-border-opacity))}.extendify-sdk .border-gray-900{--tw-border-opacity:1;border-color:rgba(30,30,30,var(--tw-border-opacity))}.extendify-sdk .border-extendify-main{--tw-border-opacity:1;border-color:rgba(0,129,96,var(--tw-border-opacity))}.extendify-sdk .border-wp-alert-red{--tw-border-opacity:1;border-color:rgba(204,24,24,var(--tw-border-opacity))}.extendify-sdk .group:hover .group-hover\:border-wp-theme-500{border-color:var(--wp-admin-theme-color)}.extendify-sdk .border-solid{border-style:solid}.extendify-sdk .border-0{border-width:0}.extendify-sdk .border{border-width:1px}.extendify-sdk .border-t-0{border-top-width:0}.extendify-sdk .border-b-0{border-bottom-width:0}.extendify-sdk .border-t{border-top-width:1px}.extendify-sdk .border-r{border-right-width:1px}.extendify-sdk .border-b{border-bottom-width:1px}.extendify-sdk .border-l{border-left-width:1px}.extendify-sdk .cursor-pointer{cursor:pointer}.extendify-sdk .block{display:block}.extendify-sdk .inline-block{display:inline-block}.extendify-sdk .inline{display:inline}.extendify-sdk .flex{display:flex}.extendify-sdk .inline-flex{display:inline-flex}.extendify-sdk .table{display:table}.extendify-sdk .grid{display:grid}.extendify-sdk .hidden{display:none}.extendify-sdk .flex-col{flex-direction:column}.extendify-sdk .items-start{align-items:flex-start}.extendify-sdk .items-end{align-items:flex-end}.extendify-sdk .items-center{align-items:center}.extendify-sdk .justify-items-center{justify-items:center}.extendify-sdk .justify-start{justify-content:flex-start}.extendify-sdk .justify-end{justify-content:flex-end}.extendify-sdk .justify-center{justify-content:center}.extendify-sdk .justify-between{justify-content:space-between}.extendify-sdk .flex-grow{flex-grow:1}.extendify-sdk .flex-shrink-0{flex-shrink:0}.extendify-sdk .font-normal{font-weight:400}.extendify-sdk .font-medium{font-weight:500}.extendify-sdk .font-bold{font-weight:700}.extendify-sdk .h-16{height:4rem}.extendify-sdk .h-80{height:20rem}.extendify-sdk .h-auto{height:auto}.extendify-sdk .h-px{height:1px}.extendify-sdk .h-full{height:100%}.extendify-sdk .h-screen{height:100vh}.extendify-sdk .text-xs{font-size:.75rem;line-height:1rem}.extendify-sdk .text-sm{font-size:.875rem;line-height:1.25rem}.extendify-sdk .text-lg{font-size:1.125rem;line-height:1.75rem}.extendify-sdk .leading-none{line-height:1}.extendify-sdk .leading-tight{line-height:1.25}.extendify-sdk .m-0{margin:0}.extendify-sdk .m-6{margin:1.5rem}.extendify-sdk .m-auto{margin:auto}.extendify-sdk .my-2{margin-top:.5rem;margin-bottom:.5rem}.extendify-sdk .my-4{margin-top:1rem;margin-bottom:1rem}.extendify-sdk .mx-auto{margin-left:auto;margin-right:auto}.extendify-sdk .mr-2{margin-right:.5rem}.extendify-sdk .mb-2{margin-bottom:.5rem}.extendify-sdk .mb-4{margin-bottom:1rem}.extendify-sdk .ml-4{margin-left:1rem}.extendify-sdk .mt-5{margin-top:1.25rem}.extendify-sdk .mt-6{margin-top:1.5rem}.extendify-sdk .mb-6{margin-bottom:1.5rem}.extendify-sdk .ml-8{margin-left:2rem}.extendify-sdk .mb-12{margin-bottom:3rem}.extendify-sdk .mt-px{margin-top:1px}.extendify-sdk .mb-2\.5{margin-bottom:.625rem}.extendify-sdk .-mt-6{margin-top:-1.5rem}.extendify-sdk .-ml-px{margin-left:-1px}.extendify-sdk .max-w-lg{max-width:32rem}.extendify-sdk .max-w-xl{max-width:36rem}.extendify-sdk .max-w-full{max-width:100%}.extendify-sdk .max-w-screen-xl{max-width:1280px}.extendify-sdk .max-w-screen-4xl{max-width:1920px}.extendify-sdk .min-h-screen{min-height:100vh}.extendify-sdk .object-cover{-o-object-fit:cover;object-fit:cover}.extendify-sdk .opacity-0{opacity:0}.extendify-sdk .focus\:opacity-100:focus,.extendify-sdk .group:hover .group-hover\:opacity-100,.extendify-sdk .opacity-100{opacity:1}.extendify-sdk .outline-none{outline:2px solid transparent;outline-offset:2px}.extendify-sdk .overflow-hidden{overflow:hidden}.extendify-sdk .overflow-y-auto{overflow-y:auto}.extendify-sdk .p-0{padding:0}.extendify-sdk .p-1{padding:.25rem}.extendify-sdk .p-3{padding:.75rem}.extendify-sdk .p-4{padding:1rem}.extendify-sdk .p-6{padding:1.5rem}.extendify-sdk .p-1\.5{padding:.375rem}.extendify-sdk .p-3\.5{padding:.875rem}.extendify-sdk .py-0{padding-top:0;padding-bottom:0}.extendify-sdk .py-1{padding-top:.25rem;padding-bottom:.25rem}.extendify-sdk .py-2{padding-top:.5rem;padding-bottom:.5rem}.extendify-sdk .px-2{padding-left:.5rem;padding-right:.5rem}.extendify-sdk .px-3{padding-left:.75rem;padding-right:.75rem}.extendify-sdk .py-4{padding-top:1rem;padding-bottom:1rem}.extendify-sdk .px-4{padding-left:1rem;padding-right:1rem}.extendify-sdk .py-6{padding-top:1.5rem;padding-bottom:1.5rem}.extendify-sdk .px-6{padding-left:1.5rem;padding-right:1.5rem}.extendify-sdk .py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.extendify-sdk .pt-0{padding-top:0}.extendify-sdk .pb-2{padding-bottom:.5rem}.extendify-sdk .pt-4{padding-top:1rem}.extendify-sdk .pb-4{padding-bottom:1rem}.extendify-sdk .pl-4{padding-left:1rem}.extendify-sdk .pb-6{padding-bottom:1.5rem}.extendify-sdk .pl-12{padding-left:3rem}.extendify-sdk .pt-20{padding-top:5rem}.extendify-sdk .pb-20{padding-bottom:5rem}.extendify-sdk .pb-24{padding-bottom:6rem}.extendify-sdk .pb-32{padding-bottom:8rem}.extendify-sdk .static{position:static}.extendify-sdk .fixed{position:fixed}.extendify-sdk .absolute{position:absolute}.extendify-sdk .relative{position:relative}.extendify-sdk .sticky{position:sticky}.extendify-sdk .inset-0{top:0;right:0;bottom:0;left:0}.extendify-sdk .top-0{top:0}.extendify-sdk .right-0{right:0}.extendify-sdk .bottom-0{bottom:0}.extendify-sdk .left-0{left:0}.extendify-sdk .top-16{top:4rem}*{--tw-shadow:0 0 transparent}.extendify-sdk .shadow-xl{--tw-shadow:0 20px 25px -5px rgba(0,0,0,0.1),0 10px 10px -5px rgba(0,0,0,0.04);box-shadow:var(--tw-ring-offset-shadow,0 0 transparent),var(--tw-ring-shadow,0 0 transparent),var(--tw-shadow)}*{--tw-ring-inset:var(--tw-empty,/*!*/ /*!*/);--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,0.5);--tw-ring-offset-shadow:0 0 transparent;--tw-ring-shadow:0 0 transparent}.extendify-sdk .focus\:ring-2:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 transparent)}.extendify-sdk .ring-offset-1{--tw-ring-offset-width:1px}.extendify-sdk .focus\:ring-wp-theme-500:focus{--tw-ring-color:var(--wp-admin-theme-color)}.extendify-sdk .fill-current{fill:currentColor}.extendify-sdk .stroke-current{stroke:currentColor}.extendify-sdk .text-left{text-align:left}.extendify-sdk .text-center{text-align:center}.extendify-sdk .text-black{--tw-text-opacity:1;color:rgba(0,0,0,var(--tw-text-opacity))}.extendify-sdk .text-white{--tw-text-opacity:1;color:rgba(255,255,255,var(--tw-text-opacity))}.extendify-sdk .text-gray-900{--tw-text-opacity:1;color:rgba(30,30,30,var(--tw-text-opacity))}.extendify-sdk .text-extendify-main{--tw-text-opacity:1;color:rgba(0,129,96,var(--tw-text-opacity))}.extendify-sdk .text-wp-theme-500{color:var(--wp-admin-theme-color)}.extendify-sdk .text-wp-alert-red{--tw-text-opacity:1;color:rgba(204,24,24,var(--tw-text-opacity))}.extendify-sdk .hover\:text-white:hover{--tw-text-opacity:1;color:rgba(255,255,255,var(--tw-text-opacity))}.extendify-sdk .hover\:text-wp-theme-500:hover{color:var(--wp-admin-theme-color)}.extendify-sdk .focus\:text-blue-500:focus{--tw-text-opacity:1;color:rgba(59,130,246,var(--tw-text-opacity))}.extendify-sdk .active\:text-white:active{--tw-text-opacity:1;color:rgba(255,255,255,var(--tw-text-opacity))}.extendify-sdk .no-underline{text-decoration:none}.extendify-sdk .whitespace-nowrap{white-space:nowrap}.extendify-sdk .w-32{width:8rem}.extendify-sdk .w-72{width:18rem}.extendify-sdk .w-96{width:24rem}.extendify-sdk .w-full{width:100%}.extendify-sdk .w-screen{width:100vw}.extendify-sdk .z-0{z-index:0}.extendify-sdk .z-20{z-index:20}.extendify-sdk .z-30{z-index:30}.extendify-sdk .z-50{z-index:50}.extendify-sdk .z-high{z-index:1000000}.extendify-sdk .gap-6{gap:1.5rem}.extendify-sdk .transform{--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;transform:translateX(var(--tw-translate-x)) translateY(var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.extendify-sdk .-translate-x-3{--tw-translate-x:-0.75rem}.extendify-sdk .translate-y-0{--tw-translate-y:0px}.extendify-sdk .translate-y-4{--tw-translate-y:1rem}.extendify-sdk .translate-y-0\.5{--tw-translate-y:0.125rem}.extendify-sdk .-translate-y-full{--tw-translate-y:-100%}.extendify-sdk .transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.extendify-sdk .transition{transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.extendify-sdk .transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.extendify-sdk .ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}.extendify-sdk .duration-150{transition-duration:.15s}.extendify-sdk .duration-200{transition-duration:.2s}.extendify-sdk .duration-300{transition-duration:.3s}@-webkit-keyframes spin{to{transform:rotate(1turn)}}@keyframes spin{to{transform:rotate(1turn)}}@-webkit-keyframes ping{75%,to{transform:scale(2);opacity:0}}@keyframes ping{75%,to{transform:scale(2);opacity:0}}@-webkit-keyframes pulse{50%{opacity:.5}}@keyframes pulse{50%{opacity:.5}}@-webkit-keyframes bounce{0%,to{transform:translateY(-25%);-webkit-animation-timing-function:cubic-bezier(.8,0,1,1);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;-webkit-animation-timing-function:cubic-bezier(0,0,.2,1);animation-timing-function:cubic-bezier(0,0,.2,1)}}@keyframes bounce{0%,to{transform:translateY(-25%);-webkit-animation-timing-function:cubic-bezier(.8,0,1,1);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;-webkit-animation-timing-function:cubic-bezier(0,0,.2,1);animation-timing-function:cubic-bezier(0,0,.2,1)}}.extendify-sdk .filter{--tw-blur:var(--tw-empty,/*!*/ /*!*/);--tw-brightness:var(--tw-empty,/*!*/ /*!*/);--tw-contrast:var(--tw-empty,/*!*/ /*!*/);--tw-grayscale:var(--tw-empty,/*!*/ /*!*/);--tw-hue-rotate:var(--tw-empty,/*!*/ /*!*/);--tw-invert:var(--tw-empty,/*!*/ /*!*/);--tw-saturate:var(--tw-empty,/*!*/ /*!*/);--tw-sepia:var(--tw-empty,/*!*/ /*!*/);--tw-drop-shadow:var(--tw-empty,/*!*/ /*!*/);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.extendify-sdk *,.extendify-sdk :after,.extendify-sdk :before{box-sizing:border-box;border:0 solid #e5e7eb}.extendify-sdk .button-focus{outline:2px solid transparent;outline-offset:2px}.extendify-sdk .button-focus:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 transparent)}.extendify-sdk .button-focus{--tw-ring-offset-width:1px}.extendify-sdk .button-focus:focus{--tw-ring-color:var(--wp-admin-theme-color)}.button-extendify-main{--tw-bg-opacity:1;background-color:rgba(0,129,96,var(--tw-bg-opacity))}.button-extendify-main:active,.button-extendify-main:hover{--tw-bg-opacity:1;background-color:rgba(30,30,30,var(--tw-bg-opacity))}.button-extendify-main{cursor:pointer;padding:.375rem .75rem}.button-extendify-main,.button-extendify-main:active,.button-extendify-main:focus,.button-extendify-main:hover{--tw-text-opacity:1;color:rgba(255,255,255,var(--tw-text-opacity))}.button-extendify-main{text-decoration:none;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s;transition-duration:.2s}.extendify-sdk .button-extendify-main{outline:2px solid transparent;outline-offset:2px}.extendify-sdk .button-extendify-main:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 transparent)}.extendify-sdk .button-extendify-main{--tw-ring-offset-width:1px}.extendify-sdk .button-extendify-main:focus{--tw-ring-color:var(--wp-admin-theme-color)}@media (min-width:600px){.extendify-sdk .sm\:space-x-12>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(3rem*var(--tw-space-x-reverse));margin-left:calc(3rem*(1 - var(--tw-space-x-reverse)))}.extendify-sdk .sm\:border-0{border-width:0}.extendify-sdk .sm\:block{display:block}.extendify-sdk .sm\:flex{display:flex}.extendify-sdk .sm\:hidden{display:none}.extendify-sdk .sm\:h-auto{height:auto}.extendify-sdk .sm\:text-2xl{font-size:1.5rem;line-height:2rem}.extendify-sdk .sm\:text-3xl{font-size:2rem;line-height:2.5rem}.extendify-sdk .sm\:m-0{margin:0}.extendify-sdk .sm\:my-6{margin-top:1.5rem;margin-bottom:1.5rem}.extendify-sdk .sm\:mt-1{margin-top:.25rem}.extendify-sdk .sm\:mr-1{margin-right:.25rem}.extendify-sdk .sm\:mb-6{margin-bottom:1.5rem}.extendify-sdk .sm\:mb-12{margin-bottom:3rem}.extendify-sdk .sm\:mt-64{margin-top:16rem}.extendify-sdk .sm\:ml-px{margin-left:1px}.extendify-sdk .sm\:min-h-0{min-height:0}.extendify-sdk .sm\:opacity-0{opacity:0}.extendify-sdk .sm\:p-0{padding:0}.extendify-sdk .sm\:px-0{padding-left:0;padding-right:0}.extendify-sdk .sm\:py-2{padding-top:.5rem;padding-bottom:.5rem}.extendify-sdk .sm\:px-5{padding-left:1.25rem;padding-right:1.25rem}.extendify-sdk .sm\:py-6{padding-top:1.5rem;padding-bottom:1.5rem}.extendify-sdk .sm\:px-12{padding-left:3rem;padding-right:3rem}.extendify-sdk .sm\:py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.extendify-sdk .sm\:pt-0{padding-top:0}.extendify-sdk .sm\:pl-0{padding-left:0}.extendify-sdk .sm\:pt-6{padding-top:1.5rem}.extendify-sdk .sm\:pb-6{padding-bottom:1.5rem}.extendify-sdk .sm\:pr-8{padding-right:2rem}.extendify-sdk .sm\:pl-12{padding-left:3rem}.extendify-sdk .sm\:static{position:static}.extendify-sdk .sm\:top-auto{top:auto}.extendify-sdk .sm\:w-auto{width:auto}.extendify-sdk .sm\:w-full{width:100%}.extendify-sdk .sm\:translate-x-8{--tw-translate-x:2rem}.extendify-sdk .sm\:translate-y-5{--tw-translate-y:1.25rem}}@media (min-width:782px){.extendify-sdk .md\:flex{display:flex}.extendify-sdk .md\:-mt-32{margin-top:-8rem}}@media (min-width:1080px){.extendify-sdk .lg\:block{display:block}.extendify-sdk .lg\:hidden{display:none}.extendify-sdk .lg\:flex-row{flex-direction:row}.extendify-sdk .lg\:items-center{align-items:center}.extendify-sdk .lg\:justify-between{justify-content:space-between}.extendify-sdk .lg\:h-full{height:100%}.extendify-sdk .lg\:-ml-px{margin-left:-1px}.extendify-sdk .lg\:overflow-hidden{overflow:hidden}.extendify-sdk .lg\:p-10{padding:2.5rem}.extendify-sdk .lg\:pt-5{padding-top:1.25rem}.extendify-sdk .lg\:pl-px{padding-left:1px}.extendify-sdk .lg\:static{position:static}.extendify-sdk .lg\:absolute{position:absolute}.extendify-sdk .lg\:w-72{width:18rem}}@media (min-width:1280px){.extendify-sdk .xl\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (min-width:1440px){.extendify-sdk .\32xl\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}
1
+ .extendify-sdk .space-x-1>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(0.25rem*var(--tw-space-x-reverse));margin-left:calc(0.25rem*(1 - var(--tw-space-x-reverse)))}.extendify-sdk .space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(0.5rem*var(--tw-space-x-reverse));margin-left:calc(0.5rem*(1 - var(--tw-space-x-reverse)))}.extendify-sdk .space-x-3>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(0.75rem*var(--tw-space-x-reverse));margin-left:calc(0.75rem*(1 - var(--tw-space-x-reverse)))}.extendify-sdk .space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(1rem*(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem*var(--tw-space-y-reverse))}.extendify-sdk .space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(1rem*var(--tw-space-x-reverse));margin-left:calc(1rem*(1 - var(--tw-space-x-reverse)))}.extendify-sdk .space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(1.5rem*(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem*var(--tw-space-y-reverse))}.extendify-sdk .space-x-12>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(3rem*var(--tw-space-x-reverse));margin-left:calc(3rem*(1 - var(--tw-space-x-reverse)))}.extendify-sdk .space-x-1\.5>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(0.375rem*var(--tw-space-x-reverse));margin-left:calc(0.375rem*(1 - var(--tw-space-x-reverse)))}.extendify-sdk .divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse:0;border-top-width:calc(1px*(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px*var(--tw-divide-y-reverse))}.extendify-sdk .sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.extendify-sdk .focus\:not-sr-only:focus{position:static;width:auto;height:auto;padding:0;margin:0;overflow:visible;clip:auto;white-space:normal}.extendify-sdk .bg-transparent{background-color:transparent}.extendify-sdk .bg-black{--tw-bg-opacity:1;background-color:rgba(0,0,0,var(--tw-bg-opacity))}.extendify-sdk .bg-white{--tw-bg-opacity:1;background-color:rgba(255,255,255,var(--tw-bg-opacity))}.extendify-sdk .bg-gray-50{--tw-bg-opacity:1;background-color:rgba(250,250,250,var(--tw-bg-opacity))}.extendify-sdk .bg-gray-100{--tw-bg-opacity:1;background-color:rgba(240,240,240,var(--tw-bg-opacity))}.extendify-sdk .bg-gray-200{--tw-bg-opacity:1;background-color:rgba(224,224,224,var(--tw-bg-opacity))}.extendify-sdk .bg-gray-900{--tw-bg-opacity:1;background-color:rgba(30,30,30,var(--tw-bg-opacity))}.extendify-sdk .bg-extendify-lightest{--tw-bg-opacity:1;background-color:rgba(248,255,254,var(--tw-bg-opacity))}.extendify-sdk .bg-extendify-light{--tw-bg-opacity:1;background-color:rgba(231,248,245,var(--tw-bg-opacity))}.extendify-sdk .bg-extendify-main{--tw-bg-opacity:1;background-color:rgba(0,129,96,var(--tw-bg-opacity))}.extendify-sdk .group:hover .group-hover\:bg-transparent{background-color:transparent}.extendify-sdk .active\:bg-gray-900:active,.extendify-sdk .hover\:bg-gray-900:hover{--tw-bg-opacity:1;background-color:rgba(30,30,30,var(--tw-bg-opacity))}.extendify-sdk .bg-opacity-30{--tw-bg-opacity:0.3}.extendify-sdk .border-transparent{border-color:transparent}.extendify-sdk .border-black{--tw-border-opacity:1;border-color:rgba(0,0,0,var(--tw-border-opacity))}.extendify-sdk .border-gray-200{--tw-border-opacity:1;border-color:rgba(224,224,224,var(--tw-border-opacity))}.extendify-sdk .border-gray-300{--tw-border-opacity:1;border-color:rgba(221,221,221,var(--tw-border-opacity))}.extendify-sdk .border-gray-900{--tw-border-opacity:1;border-color:rgba(30,30,30,var(--tw-border-opacity))}.extendify-sdk .border-extendify-main{--tw-border-opacity:1;border-color:rgba(0,129,96,var(--tw-border-opacity))}.extendify-sdk .border-wp-alert-red{--tw-border-opacity:1;border-color:rgba(204,24,24,var(--tw-border-opacity))}.extendify-sdk .group:hover .group-hover\:border-wp-theme-500{border-color:var(--wp-admin-theme-color)}.extendify-sdk .border-solid{border-style:solid}.extendify-sdk .border-0{border-width:0}.extendify-sdk .border{border-width:1px}.extendify-sdk .border-t-0{border-top-width:0}.extendify-sdk .border-b-0{border-bottom-width:0}.extendify-sdk .border-t{border-top-width:1px}.extendify-sdk .border-r{border-right-width:1px}.extendify-sdk .border-b{border-bottom-width:1px}.extendify-sdk .border-l{border-left-width:1px}.extendify-sdk .cursor-pointer{cursor:pointer}.extendify-sdk .block{display:block}.extendify-sdk .inline-block{display:inline-block}.extendify-sdk .inline{display:inline}.extendify-sdk .flex{display:flex}.extendify-sdk .inline-flex{display:inline-flex}.extendify-sdk .table{display:table}.extendify-sdk .grid{display:grid}.extendify-sdk .hidden{display:none}.extendify-sdk .flex-col{flex-direction:column}.extendify-sdk .items-start{align-items:flex-start}.extendify-sdk .items-end{align-items:flex-end}.extendify-sdk .items-center{align-items:center}.extendify-sdk .justify-items-center{justify-items:center}.extendify-sdk .justify-start{justify-content:flex-start}.extendify-sdk .justify-end{justify-content:flex-end}.extendify-sdk .justify-center{justify-content:center}.extendify-sdk .justify-between{justify-content:space-between}.extendify-sdk .flex-grow{flex-grow:1}.extendify-sdk .flex-shrink-0{flex-shrink:0}.extendify-sdk .font-normal{font-weight:400}.extendify-sdk .font-medium{font-weight:500}.extendify-sdk .font-bold{font-weight:700}.extendify-sdk .h-16{height:4rem}.extendify-sdk .h-80{height:20rem}.extendify-sdk .h-auto{height:auto}.extendify-sdk .h-px{height:1px}.extendify-sdk .h-full{height:100%}.extendify-sdk .h-screen{height:100vh}.extendify-sdk .text-xs{font-size:.75rem;line-height:1rem}.extendify-sdk .text-sm{font-size:.875rem;line-height:1.25rem}.extendify-sdk .text-lg{font-size:1.125rem;line-height:1.75rem}.extendify-sdk .leading-none{line-height:1}.extendify-sdk .leading-tight{line-height:1.25}.extendify-sdk .m-0{margin:0}.extendify-sdk .m-6{margin:1.5rem}.extendify-sdk .m-auto{margin:auto}.extendify-sdk .my-2{margin-top:.5rem;margin-bottom:.5rem}.extendify-sdk .my-4{margin-top:1rem;margin-bottom:1rem}.extendify-sdk .mx-auto{margin-left:auto;margin-right:auto}.extendify-sdk .mb-1{margin-bottom:.25rem}.extendify-sdk .mr-2{margin-right:.5rem}.extendify-sdk .mb-2{margin-bottom:.5rem}.extendify-sdk .mb-4{margin-bottom:1rem}.extendify-sdk .ml-4{margin-left:1rem}.extendify-sdk .mt-5{margin-top:1.25rem}.extendify-sdk .mb-6{margin-bottom:1.5rem}.extendify-sdk .ml-8{margin-left:2rem}.extendify-sdk .mb-12{margin-bottom:3rem}.extendify-sdk .mt-px{margin-top:1px}.extendify-sdk .mb-2\.5{margin-bottom:.625rem}.extendify-sdk .-mt-1{margin-top:-.25rem}.extendify-sdk .-mt-2{margin-top:-.5rem}.extendify-sdk .-mt-6{margin-top:-1.5rem}.extendify-sdk .-ml-px{margin-left:-1px}.extendify-sdk .max-w-lg{max-width:32rem}.extendify-sdk .max-w-xl{max-width:36rem}.extendify-sdk .max-w-full{max-width:100%}.extendify-sdk .max-w-screen-xl{max-width:1280px}.extendify-sdk .max-w-screen-4xl{max-width:1920px}.extendify-sdk .min-h-screen{min-height:100vh}.extendify-sdk .object-cover{-o-object-fit:cover;object-fit:cover}.extendify-sdk .opacity-0{opacity:0}.extendify-sdk .focus\:opacity-100:focus,.extendify-sdk .group:hover .group-hover\:opacity-100,.extendify-sdk .opacity-100{opacity:1}.extendify-sdk .outline-none{outline:2px solid transparent;outline-offset:2px}.extendify-sdk .overflow-hidden{overflow:hidden}.extendify-sdk .overflow-y-auto{overflow-y:auto}.extendify-sdk .p-0{padding:0}.extendify-sdk .p-1{padding:.25rem}.extendify-sdk .p-3{padding:.75rem}.extendify-sdk .p-4{padding:1rem}.extendify-sdk .p-6{padding:1.5rem}.extendify-sdk .p-1\.5{padding:.375rem}.extendify-sdk .p-3\.5{padding:.875rem}.extendify-sdk .py-0{padding-top:0;padding-bottom:0}.extendify-sdk .py-1{padding-top:.25rem;padding-bottom:.25rem}.extendify-sdk .py-2{padding-top:.5rem;padding-bottom:.5rem}.extendify-sdk .px-2{padding-left:.5rem;padding-right:.5rem}.extendify-sdk .px-3{padding-left:.75rem;padding-right:.75rem}.extendify-sdk .px-4{padding-left:1rem;padding-right:1rem}.extendify-sdk .py-6{padding-top:1.5rem;padding-bottom:1.5rem}.extendify-sdk .px-6{padding-left:1.5rem;padding-right:1.5rem}.extendify-sdk .py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.extendify-sdk .pt-1{padding-top:.25rem}.extendify-sdk .pr-2{padding-right:.5rem}.extendify-sdk .pt-4{padding-top:1rem}.extendify-sdk .pr-4{padding-right:1rem}.extendify-sdk .pb-4{padding-bottom:1rem}.extendify-sdk .pb-6{padding-bottom:1.5rem}.extendify-sdk .pl-6{padding-left:1.5rem}.extendify-sdk .pl-12{padding-left:3rem}.extendify-sdk .pt-20{padding-top:5rem}.extendify-sdk .pb-20{padding-bottom:5rem}.extendify-sdk .pb-32{padding-bottom:8rem}.extendify-sdk .static{position:static}.extendify-sdk .fixed{position:fixed}.extendify-sdk .absolute{position:absolute}.extendify-sdk .relative{position:relative}.extendify-sdk .sticky{position:sticky}.extendify-sdk .inset-0{top:0;right:0;bottom:0;left:0}.extendify-sdk .top-0{top:0}.extendify-sdk .right-0{right:0}.extendify-sdk .bottom-0{bottom:0}.extendify-sdk .left-0{left:0}.extendify-sdk .top-16{top:4rem}*{--tw-shadow:0 0 transparent}.extendify-sdk .shadow-xl{--tw-shadow:0 20px 25px -5px rgba(0,0,0,0.1),0 10px 10px -5px rgba(0,0,0,0.04);box-shadow:var(--tw-ring-offset-shadow,0 0 transparent),var(--tw-ring-shadow,0 0 transparent),var(--tw-shadow)}*{--tw-ring-inset:var(--tw-empty,/*!*/ /*!*/);--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,0.5);--tw-ring-offset-shadow:0 0 transparent;--tw-ring-shadow:0 0 transparent}.extendify-sdk .focus\:ring-2:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 transparent)}.extendify-sdk .ring-offset-1{--tw-ring-offset-width:1px}.extendify-sdk .focus\:ring-wp-theme-500:focus{--tw-ring-color:var(--wp-admin-theme-color)}.extendify-sdk .fill-current{fill:currentColor}.extendify-sdk .stroke-current{stroke:currentColor}.extendify-sdk .text-left{text-align:left}.extendify-sdk .text-center{text-align:center}.extendify-sdk .text-black{--tw-text-opacity:1;color:rgba(0,0,0,var(--tw-text-opacity))}.extendify-sdk .text-white{--tw-text-opacity:1;color:rgba(255,255,255,var(--tw-text-opacity))}.extendify-sdk .text-gray-900{--tw-text-opacity:1;color:rgba(30,30,30,var(--tw-text-opacity))}.extendify-sdk .text-extendify-main{--tw-text-opacity:1;color:rgba(0,129,96,var(--tw-text-opacity))}.extendify-sdk .text-wp-theme-500{color:var(--wp-admin-theme-color)}.extendify-sdk .text-wp-alert-red{--tw-text-opacity:1;color:rgba(204,24,24,var(--tw-text-opacity))}.extendify-sdk .hover\:text-white:hover{--tw-text-opacity:1;color:rgba(255,255,255,var(--tw-text-opacity))}.extendify-sdk .hover\:text-wp-theme-500:hover{color:var(--wp-admin-theme-color)}.extendify-sdk .focus\:text-blue-500:focus{--tw-text-opacity:1;color:rgba(59,130,246,var(--tw-text-opacity))}.extendify-sdk .active\:text-white:active{--tw-text-opacity:1;color:rgba(255,255,255,var(--tw-text-opacity))}.extendify-sdk .no-underline{text-decoration:none}.extendify-sdk .whitespace-nowrap{white-space:nowrap}.extendify-sdk .w-32{width:8rem}.extendify-sdk .w-72{width:18rem}.extendify-sdk .w-96{width:24rem}.extendify-sdk .w-full{width:100%}.extendify-sdk .w-screen{width:100vw}.extendify-sdk .z-0{z-index:0}.extendify-sdk .z-20{z-index:20}.extendify-sdk .z-30{z-index:30}.extendify-sdk .z-50{z-index:50}.extendify-sdk .z-high{z-index:1000000}.extendify-sdk .gap-6{gap:1.5rem}.extendify-sdk .transform{--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;transform:translateX(var(--tw-translate-x)) translateY(var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.extendify-sdk .rotate-180{--tw-rotate:180deg}.extendify-sdk .-translate-x-3{--tw-translate-x:-0.75rem}.extendify-sdk .translate-x-full{--tw-translate-x:100%}.extendify-sdk .-translate-x-full{--tw-translate-x:-100%}.extendify-sdk .translate-y-0{--tw-translate-y:0px}.extendify-sdk .translate-y-4{--tw-translate-y:1rem}.extendify-sdk .translate-y-0\.5{--tw-translate-y:0.125rem}.extendify-sdk .-translate-y-full{--tw-translate-y:-100%}.extendify-sdk .transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.extendify-sdk .transition{transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.extendify-sdk .transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.extendify-sdk .ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}.extendify-sdk .duration-150{transition-duration:.15s}.extendify-sdk .duration-200{transition-duration:.2s}.extendify-sdk .duration-300{transition-duration:.3s}@-webkit-keyframes spin{to{transform:rotate(1turn)}}@keyframes spin{to{transform:rotate(1turn)}}@-webkit-keyframes ping{75%,to{transform:scale(2);opacity:0}}@keyframes ping{75%,to{transform:scale(2);opacity:0}}@-webkit-keyframes pulse{50%{opacity:.5}}@keyframes pulse{50%{opacity:.5}}@-webkit-keyframes bounce{0%,to{transform:translateY(-25%);-webkit-animation-timing-function:cubic-bezier(.8,0,1,1);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;-webkit-animation-timing-function:cubic-bezier(0,0,.2,1);animation-timing-function:cubic-bezier(0,0,.2,1)}}@keyframes bounce{0%,to{transform:translateY(-25%);-webkit-animation-timing-function:cubic-bezier(.8,0,1,1);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;-webkit-animation-timing-function:cubic-bezier(0,0,.2,1);animation-timing-function:cubic-bezier(0,0,.2,1)}}.extendify-sdk .filter{--tw-blur:var(--tw-empty,/*!*/ /*!*/);--tw-brightness:var(--tw-empty,/*!*/ /*!*/);--tw-contrast:var(--tw-empty,/*!*/ /*!*/);--tw-grayscale:var(--tw-empty,/*!*/ /*!*/);--tw-hue-rotate:var(--tw-empty,/*!*/ /*!*/);--tw-invert:var(--tw-empty,/*!*/ /*!*/);--tw-saturate:var(--tw-empty,/*!*/ /*!*/);--tw-sepia:var(--tw-empty,/*!*/ /*!*/);--tw-drop-shadow:var(--tw-empty,/*!*/ /*!*/);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.extendify-sdk *,.extendify-sdk :after,.extendify-sdk :before{box-sizing:border-box;border:0 solid #e5e7eb}.extendify-sdk .button-focus{outline:2px solid transparent;outline-offset:2px}.extendify-sdk .button-focus:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 transparent)}.extendify-sdk .button-focus{--tw-ring-offset-width:1px}.extendify-sdk .button-focus:focus{--tw-ring-color:var(--wp-admin-theme-color)}.button-extendify-main{--tw-bg-opacity:1;background-color:rgba(0,129,96,var(--tw-bg-opacity))}.button-extendify-main:active,.button-extendify-main:hover{--tw-bg-opacity:1;background-color:rgba(30,30,30,var(--tw-bg-opacity))}.button-extendify-main{cursor:pointer;padding:.375rem .75rem}.button-extendify-main,.button-extendify-main:active,.button-extendify-main:focus,.button-extendify-main:hover{--tw-text-opacity:1;color:rgba(255,255,255,var(--tw-text-opacity))}.button-extendify-main{text-decoration:none;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s;transition-duration:.2s}.extendify-sdk .button-extendify-main{outline:2px solid transparent;outline-offset:2px}.extendify-sdk .button-extendify-main:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 transparent)}.extendify-sdk .button-extendify-main{--tw-ring-offset-width:1px}.extendify-sdk .button-extendify-main:focus{--tw-ring-color:var(--wp-admin-theme-color)}.extendify-sdk .components-panel__body>.components-panel__body-title{border-bottom:1px solid #e0e0e0!important}@media (min-width:600px){.extendify-sdk .sm\:space-x-12>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(3rem*var(--tw-space-x-reverse));margin-left:calc(3rem*(1 - var(--tw-space-x-reverse)))}.extendify-sdk .sm\:border-0{border-width:0}.extendify-sdk .sm\:block{display:block}.extendify-sdk .sm\:flex{display:flex}.extendify-sdk .sm\:hidden{display:none}.extendify-sdk .sm\:h-auto{height:auto}.extendify-sdk .sm\:text-2xl{font-size:1.5rem;line-height:2rem}.extendify-sdk .sm\:text-3xl{font-size:2rem;line-height:2.5rem}.extendify-sdk .sm\:m-0{margin:0}.extendify-sdk .sm\:my-6{margin-top:1.5rem;margin-bottom:1.5rem}.extendify-sdk .sm\:mr-1{margin-right:.25rem}.extendify-sdk .sm\:mb-6{margin-bottom:1.5rem}.extendify-sdk .sm\:mb-12{margin-bottom:3rem}.extendify-sdk .sm\:mt-64{margin-top:16rem}.extendify-sdk .sm\:ml-px{margin-left:1px}.extendify-sdk .sm\:min-h-0{min-height:0}.extendify-sdk .sm\:opacity-0{opacity:0}.extendify-sdk .sm\:p-0{padding:0}.extendify-sdk .sm\:px-0{padding-left:0;padding-right:0}.extendify-sdk .sm\:py-2{padding-top:.5rem;padding-bottom:.5rem}.extendify-sdk .sm\:px-5{padding-left:1.25rem;padding-right:1.25rem}.extendify-sdk .sm\:py-6{padding-top:1.5rem;padding-bottom:1.5rem}.extendify-sdk .sm\:px-12{padding-left:3rem;padding-right:3rem}.extendify-sdk .sm\:py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.extendify-sdk .sm\:pt-0{padding-top:0}.extendify-sdk .sm\:pl-0{padding-left:0}.extendify-sdk .sm\:pt-6{padding-top:1.5rem}.extendify-sdk .sm\:pb-6{padding-bottom:1.5rem}.extendify-sdk .sm\:pr-8{padding-right:2rem}.extendify-sdk .sm\:pl-12{padding-left:3rem}.extendify-sdk .sm\:static{position:static}.extendify-sdk .sm\:top-auto{top:auto}.extendify-sdk .sm\:w-56{width:14rem}.extendify-sdk .sm\:w-auto{width:auto}.extendify-sdk .sm\:w-full{width:100%}.extendify-sdk .sm\:translate-x-8{--tw-translate-x:2rem}.extendify-sdk .sm\:translate-y-5{--tw-translate-y:1.25rem}}@media (min-width:782px){.extendify-sdk .md\:flex{display:flex}.extendify-sdk .md\:-mt-32{margin-top:-8rem}}@media (min-width:1080px){.extendify-sdk .lg\:divide-x-2>:not([hidden])~:not([hidden]){--tw-divide-x-reverse:0;border-right-width:calc(2px*var(--tw-divide-x-reverse));border-left-width:calc(2px*(1 - var(--tw-divide-x-reverse)))}.extendify-sdk .lg\:block{display:block}.extendify-sdk .lg\:hidden{display:none}.extendify-sdk .lg\:flex-row{flex-direction:row}.extendify-sdk .lg\:items-center{align-items:center}.extendify-sdk .lg\:justify-between{justify-content:space-between}.extendify-sdk .lg\:h-full{height:100%}.extendify-sdk .lg\:leading-none{line-height:1}.extendify-sdk .lg\:-mx-2{margin-left:-.5rem;margin-right:-.5rem}.extendify-sdk .lg\:-ml-px{margin-left:-1px}.extendify-sdk .lg\:overflow-hidden{overflow:hidden}.extendify-sdk .lg\:p-10{padding:2.5rem}.extendify-sdk .lg\:px-2{padding-left:.5rem;padding-right:.5rem}.extendify-sdk .lg\:pt-5{padding-top:1.25rem}.extendify-sdk .lg\:pl-px{padding-left:1px}.extendify-sdk .lg\:static{position:static}.extendify-sdk .lg\:absolute{position:absolute}.extendify-sdk .lg\:w-72{width:18rem}}@media (min-width:1280px){.extendify-sdk .xl\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (min-width:1440px){.extendify-sdk .\32xl\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}
extendify-sdk/public/build/extendify-sdk.js CHANGED
@@ -1,2 +1,2 @@
1
  /*! For license information please see extendify-sdk.js.LICENSE.txt */
2
- (()=>{var e,t={135:(e,t,n)=>{e.exports=n(248)},206:(e,t,n)=>{e.exports=n(57)},387:(e,t,n)=>{"use strict";var r=n(485),o=n(570),i=n(940),a=n(581),u=n(574),s=n(845),c=n(338),l=n(524);e.exports=function(e){return new Promise((function(t,n){var f=e.data,d=e.headers;r.isFormData(f)&&delete d["Content-Type"];var p=new XMLHttpRequest;if(e.auth){var v=e.auth.username||"",m=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";d.Authorization="Basic "+btoa(v+":"+m)}var h=u(e.baseURL,e.url);if(p.open(e.method.toUpperCase(),a(h,e.params,e.paramsSerializer),!0),p.timeout=e.timeout,p.onreadystatechange=function(){if(p&&4===p.readyState&&(0!==p.status||p.responseURL&&0===p.responseURL.indexOf("file:"))){var r="getAllResponseHeaders"in p?s(p.getAllResponseHeaders()):null,i={data:e.responseType&&"text"!==e.responseType?p.response:p.responseText,status:p.status,statusText:p.statusText,headers:r,config:e,request:p};o(t,n,i),p=null}},p.onabort=function(){p&&(n(l("Request aborted",e,"ECONNABORTED",p)),p=null)},p.onerror=function(){n(l("Network Error",e,null,p)),p=null},p.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(l(t,e,"ECONNABORTED",p)),p=null},r.isStandardBrowserEnv()){var y=(e.withCredentials||c(h))&&e.xsrfCookieName?i.read(e.xsrfCookieName):void 0;y&&(d[e.xsrfHeaderName]=y)}if("setRequestHeader"in p&&r.forEach(d,(function(e,t){void 0===f&&"content-type"===t.toLowerCase()?delete d[t]:p.setRequestHeader(t,e)})),r.isUndefined(e.withCredentials)||(p.withCredentials=!!e.withCredentials),e.responseType)try{p.responseType=e.responseType}catch(t){if("json"!==e.responseType)throw t}"function"==typeof e.onDownloadProgress&&p.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&p.upload&&p.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then((function(e){p&&(p.abort(),n(e),p=null)})),f||(f=null),p.send(f)}))}},57:(e,t,n)=>{"use strict";var r=n(485),o=n(875),i=n(29),a=n(941);function u(e){var t=new i(e),n=o(i.prototype.request,t);return r.extend(n,i.prototype,t),r.extend(n,t),n}var s=u(n(141));s.Axios=i,s.create=function(e){return u(a(s.defaults,e))},s.Cancel=n(132),s.CancelToken=n(603),s.isCancel=n(475),s.all=function(e){return Promise.all(e)},s.spread=n(739),s.isAxiosError=n(835),e.exports=s,e.exports.default=s},132:e=>{"use strict";function t(e){this.message=e}t.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},t.prototype.__CANCEL__=!0,e.exports=t},603:(e,t,n)=>{"use strict";var r=n(132);function o(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var n=this;e((function(e){n.reason||(n.reason=new r(e),t(n.reason))}))}o.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},o.source=function(){var e;return{token:new o((function(t){e=t})),cancel:e}},e.exports=o},475:e=>{"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},29:(e,t,n)=>{"use strict";var r=n(485),o=n(581),i=n(96),a=n(9),u=n(941);function s(e){this.defaults=e,this.interceptors={request:new i,response:new i}}s.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=u(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=[a,void 0],n=Promise.resolve(e);for(this.interceptors.request.forEach((function(e){t.unshift(e.fulfilled,e.rejected)})),this.interceptors.response.forEach((function(e){t.push(e.fulfilled,e.rejected)}));t.length;)n=n.then(t.shift(),t.shift());return n},s.prototype.getUri=function(e){return e=u(this.defaults,e),o(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},r.forEach(["delete","get","head","options"],(function(e){s.prototype[e]=function(t,n){return this.request(u(n||{},{method:e,url:t,data:(n||{}).data}))}})),r.forEach(["post","put","patch"],(function(e){s.prototype[e]=function(t,n,r){return this.request(u(r||{},{method:e,url:t,data:n}))}})),e.exports=s},96:(e,t,n)=>{"use strict";var r=n(485);function o(){this.handlers=[]}o.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},o.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},o.prototype.forEach=function(e){r.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=o},574:(e,t,n)=>{"use strict";var r=n(642),o=n(288);e.exports=function(e,t){return e&&!r(t)?o(e,t):t}},524:(e,t,n)=>{"use strict";var r=n(953);e.exports=function(e,t,n,o,i){var a=new Error(e);return r(a,t,n,o,i)}},9:(e,t,n)=>{"use strict";var r=n(485),o=n(212),i=n(475),a=n(141);function u(e){e.cancelToken&&e.cancelToken.throwIfRequested()}e.exports=function(e){return u(e),e.headers=e.headers||{},e.data=o(e.data,e.headers,e.transformRequest),e.headers=r.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),r.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||a.adapter)(e).then((function(t){return u(e),t.data=o(t.data,t.headers,e.transformResponse),t}),(function(t){return i(t)||(u(e),t&&t.response&&(t.response.data=o(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},953:e=>{"use strict";e.exports=function(e,t,n,r,o){return e.config=t,n&&(e.code=n),e.request=r,e.response=o,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},e}},941:(e,t,n)=>{"use strict";var r=n(485);e.exports=function(e,t){t=t||{};var n={},o=["url","method","data"],i=["headers","auth","proxy","params"],a=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],u=["validateStatus"];function s(e,t){return r.isPlainObject(e)&&r.isPlainObject(t)?r.merge(e,t):r.isPlainObject(t)?r.merge({},t):r.isArray(t)?t.slice():t}function c(o){r.isUndefined(t[o])?r.isUndefined(e[o])||(n[o]=s(void 0,e[o])):n[o]=s(e[o],t[o])}r.forEach(o,(function(e){r.isUndefined(t[e])||(n[e]=s(void 0,t[e]))})),r.forEach(i,c),r.forEach(a,(function(o){r.isUndefined(t[o])?r.isUndefined(e[o])||(n[o]=s(void 0,e[o])):n[o]=s(void 0,t[o])})),r.forEach(u,(function(r){r in t?n[r]=s(e[r],t[r]):r in e&&(n[r]=s(void 0,e[r]))}));var l=o.concat(i).concat(a).concat(u),f=Object.keys(e).concat(Object.keys(t)).filter((function(e){return-1===l.indexOf(e)}));return r.forEach(f,c),n}},570:(e,t,n)=>{"use strict";var r=n(524);e.exports=function(e,t,n){var o=n.config.validateStatus;n.status&&o&&!o(n.status)?t(r("Request failed with status code "+n.status,n.config,null,n.request,n)):e(n)}},212:(e,t,n)=>{"use strict";var r=n(485);e.exports=function(e,t,n){return r.forEach(n,(function(n){e=n(e,t)})),e}},141:(e,t,n)=>{"use strict";var r=n(61),o=n(485),i=n(446),a={"Content-Type":"application/x-www-form-urlencoded"};function u(e,t){!o.isUndefined(e)&&o.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var s,c={adapter:(("undefined"!=typeof XMLHttpRequest||void 0!==r&&"[object process]"===Object.prototype.toString.call(r))&&(s=n(387)),s),transformRequest:[function(e,t){return i(t,"Accept"),i(t,"Content-Type"),o.isFormData(e)||o.isArrayBuffer(e)||o.isBuffer(e)||o.isStream(e)||o.isFile(e)||o.isBlob(e)?e:o.isArrayBufferView(e)?e.buffer:o.isURLSearchParams(e)?(u(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):o.isObject(e)?(u(t,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(e){}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300}};c.headers={common:{Accept:"application/json, text/plain, */*"}},o.forEach(["delete","get","head"],(function(e){c.headers[e]={}})),o.forEach(["post","put","patch"],(function(e){c.headers[e]=o.merge(a)})),e.exports=c},875:e=>{"use strict";e.exports=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];return e.apply(t,n)}}},581:(e,t,n)=>{"use strict";var r=n(485);function o(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,n){if(!t)return e;var i;if(n)i=n(t);else if(r.isURLSearchParams(t))i=t.toString();else{var a=[];r.forEach(t,(function(e,t){null!=e&&(r.isArray(e)?t+="[]":e=[e],r.forEach(e,(function(e){r.isDate(e)?e=e.toISOString():r.isObject(e)&&(e=JSON.stringify(e)),a.push(o(t)+"="+o(e))})))})),i=a.join("&")}if(i){var u=e.indexOf("#");-1!==u&&(e=e.slice(0,u)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}},288:e=>{"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},940:(e,t,n)=>{"use strict";var r=n(485);e.exports=r.isStandardBrowserEnv()?{write:function(e,t,n,o,i,a){var u=[];u.push(e+"="+encodeURIComponent(t)),r.isNumber(n)&&u.push("expires="+new Date(n).toGMTString()),r.isString(o)&&u.push("path="+o),r.isString(i)&&u.push("domain="+i),!0===a&&u.push("secure"),document.cookie=u.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},642:e=>{"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},835:e=>{"use strict";e.exports=function(e){return"object"==typeof e&&!0===e.isAxiosError}},338:(e,t,n)=>{"use strict";var r=n(485);e.exports=r.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function o(e){var r=e;return t&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return e=o(window.location.href),function(t){var n=r.isString(t)?o(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return!0}},446:(e,t,n)=>{"use strict";var r=n(485);e.exports=function(e,t){r.forEach(e,(function(n,r){r!==t&&r.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[r])}))}},845:(e,t,n)=>{"use strict";var r=n(485),o=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,n,i,a={};return e?(r.forEach(e.split("\n"),(function(e){if(i=e.indexOf(":"),t=r.trim(e.substr(0,i)).toLowerCase(),n=r.trim(e.substr(i+1)),t){if(a[t]&&o.indexOf(t)>=0)return;a[t]="set-cookie"===t?(a[t]?a[t]:[]).concat([n]):a[t]?a[t]+", "+n:n}})),a):a}},739:e=>{"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},485:(e,t,n)=>{"use strict";var r=n(875),o=Object.prototype.toString;function i(e){return"[object Array]"===o.call(e)}function a(e){return void 0===e}function u(e){return null!==e&&"object"==typeof e}function s(e){if("[object Object]"!==o.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function c(e){return"[object Function]"===o.call(e)}function l(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),i(e))for(var n=0,r=e.length;n<r;n++)t.call(null,e[n],n,e);else for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.call(null,e[o],o,e)}e.exports={isArray:i,isArrayBuffer:function(e){return"[object ArrayBuffer]"===o.call(e)},isBuffer:function(e){return null!==e&&!a(e)&&null!==e.constructor&&!a(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return"undefined"!=typeof FormData&&e instanceof FormData},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:u,isPlainObject:s,isUndefined:a,isDate:function(e){return"[object Date]"===o.call(e)},isFile:function(e){return"[object File]"===o.call(e)},isBlob:function(e){return"[object Blob]"===o.call(e)},isFunction:c,isStream:function(e){return u(e)&&c(e.pipe)},isURLSearchParams:function(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:l,merge:function e(){var t={};function n(n,r){s(t[r])&&s(n)?t[r]=e(t[r],n):s(n)?t[r]=e({},n):i(n)?t[r]=n.slice():t[r]=n}for(var r=0,o=arguments.length;r<o;r++)l(arguments[r],n);return t},extend:function(e,t,n){return l(t,(function(t,o){e[o]=n&&"function"==typeof t?r(t,n):t})),e},trim:function(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e}}},691:(e,t,n)=>{"use strict";const r=wp.element;var o=n(804),i=n.n(o);function a(e){let t;const n=new Set,r=(e,r)=>{const o="function"==typeof e?e(t):e;if(o!==t){const e=t;t=r?o:Object.assign({},t,o),n.forEach((n=>n(t,e)))}},o=()=>t,i={setState:r,getState:o,subscribe:(e,r,i)=>r||i?((e,r=o,i=Object.is)=>{let a=r(t);function u(){const n=r(t);if(!i(a,n)){const t=a;e(a=n,t)}}return n.add(u),()=>n.delete(u)})(e,r,i):(n.add(e),()=>n.delete(e)),destroy:()=>n.clear()};return t=e(r,o,i),i}const u="undefined"==typeof window||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent)?o.useEffect:o.useLayoutEffect;const s=function(e){const t="function"==typeof e?a(e):e,n=(e=t.getState,n=Object.is)=>{const[,r]=(0,o.useReducer)((e=>e+1),0),i=t.getState(),a=(0,o.useRef)(i),s=(0,o.useRef)(e),c=(0,o.useRef)(n),l=(0,o.useRef)(!1),f=(0,o.useRef)();let d;void 0===f.current&&(f.current=e(i));let p=!1;(a.current!==i||s.current!==e||c.current!==n||l.current)&&(d=e(i),p=!n(f.current,d)),u((()=>{p&&(f.current=d),a.current=i,s.current=e,c.current=n,l.current=!1}));const v=(0,o.useRef)(i);return u((()=>{const e=()=>{try{const e=t.getState(),n=s.current(e);c.current(f.current,n)||(a.current=e,f.current=n,r())}catch(e){l.current=!0,r()}},n=t.subscribe(e);return t.getState()!==v.current&&e(),n}),[]),p?d:f.current};return Object.assign(n,t),n[Symbol.iterator]=function*(){console.warn("[useStore, api] = create() is deprecated and will be removed in v4"),yield n,yield t},n};var c="pattern",l=12;function f(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null==n)return;var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return d(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 d(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 d(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 p(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=window.wp.blocks.createBlock;return e.map((function(e){var n=f(Array.isArray(e)?e:[e.name,e.attributes,e.innerBlocks],3),r=n[0],o=n[1],i=n[2];return t(r,o,p(void 0===i?[]:i))}))}function v(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 m(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?v(Object(n),!0).forEach((function(t){h(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):v(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function h(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function y(e){return function(e){if(Array.isArray(e))return b(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return b(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 b(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 b(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 g=function(e){return"pattern"===e?["Default"]:[]},x=s((function(e,t){return{templates:[],fetchToken:null,activeTemplate:{},activeTemplateBlocks:{},searchParams:{categories:g(c),type:c,search:""},nextPage:"",removeTemplates:function(){return e({nextPage:"",templates:[]})},appendTemplates:function(n){return e({templates:y(new Map([].concat(y(t().templates),y(n)).map((function(e){return[e.id,e]}))).values())})},setActive:function(t){var n;if(e({activeTemplate:t}),null!=t&&null!==(n=t.fields)&&void 0!==n&&n.code){var r=window.wp.blocks.parse;e({activeTemplateBlocks:p(r(t.fields.code))})}},updateSearchParams:function(n){var r;(null!=n&&n.categories&&!n.categories.length||!Object.prototype.hasOwnProperty.call(n,"categories"))&&(n.categories=g(null!==(r=null==n?void 0:n.type)&&void 0!==r?r:t().searchParams.type));e({templates:[],nextPage:"",searchParams:m({},Object.assign(t().searchParams,n))})}}})),w=s((function(e){return{open:!1,currentPage:"content",setOpen:function(t){e({open:t}),t&&x.getState().removeTemplates()}}})),S=n(135),k=n.n(S),j=Object.defineProperty,C=Object.prototype.hasOwnProperty,E=Object.getOwnPropertySymbols,O=Object.prototype.propertyIsEnumerable,I=(e,t,n)=>t in e?j(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,P=(e,t)=>{for(var n in t||(t={}))C.call(t,n)&&I(e,n,t[n]);if(E)for(var n of E(t))O.call(t,n)&&I(e,n,t[n]);return e};const T=(e,t)=>(n,r,o)=>{const{name:i,getStorage:a=(()=>localStorage),serialize:u=JSON.stringify,deserialize:s=JSON.parse,blacklist:c,whitelist:l,onRehydrateStorage:f,version:d=0,migrate:p}=t||{};let v;try{v=a()}catch(e){}if(!v)return e(((...e)=>{console.warn(`Persist middleware: unable to update ${i}, the given storage is currently unavailable.`),n(...e)}),r,o);const m=async()=>{const e=P({},r());return l&&Object.keys(e).forEach((t=>{!l.includes(t)&&delete e[t]})),c&&c.forEach((t=>delete e[t])),null==v?void 0:v.setItem(i,await u({state:e,version:d}))},h=o.setState;return o.setState=(e,t)=>{h(e,t),m()},(async()=>{const e=(null==f?void 0:f(r()))||void 0;try{const e=await v.getItem(i);if(e){const t=await s(e);if(t.version!==d){const e=await(null==p?void 0:p(t.state,t.version));e&&(n(e),await m())}else n(t.state)}}catch(t){return void(null==e||e(void 0,t))}null==e||e(r(),void 0)})(),e(((...e)=>{n(...e),m()}),r,o)};var N=n(206),R=n.n(N)().create({baseURL:window.extendifySdkData.root,headers:{"X-WP-Nonce":window.extendifySdkData.nonce,"X-Requested-With":"XMLHttpRequest","X-Extendify":!0}});function A(e){return Object.prototype.hasOwnProperty.call(e,"data")?e.data:e}R.interceptors.response.use((function(e){return function(e){return Object.prototype.hasOwnProperty.call(e,"soft_error")&&window.dispatchEvent(new CustomEvent("extendify-sdk::softerror-encountered",{detail:e.soft_error,bubbles:!0})),e}(A(e))}),(function(e){return function(e){if(e.response)return console.error(e.response),Promise.reject(A(e.response))}(e)})),R.interceptors.request.use((function(e){return function(e){return e.headers["X-Extendify-Dev-Mode"]=window.location.search.indexOf("DEVMODE")>-1,e}(function(e){return e.data&&(e.data.remaining_imports=H.getState().remainingImports(),e.data.entry_point=H.getState().entryPoint),e}(e))}),(function(e){return e}));var _=function(){return R.get("user")},L=function(e){return R.get("user-meta",{params:{key:e}})},D=function(e,t){var n=new FormData;return n.append("email",e),n.append("key",t),R.post("login",n,{headers:{"Content-Type":"multipart/form-data"}})},F=function(e){var t=new FormData;return t.append("data",JSON.stringify(e)),R.post("user",t,{headers:{"Content-Type":"multipart/form-data"}})};function M(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function B(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){M(i,r,o,a,u,"next",e)}function u(e){M(i,r,o,a,u,"throw",e)}a(void 0)}))}}var U,V,G={getItem:(V=B(k().mark((function e(){return k().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,_();case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)}))),function(){return V.apply(this,arguments)}),setItem:(U=B(k().mark((function e(t,n){return k().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",F(n));case 1:case"end":return e.stop()}}),e)}))),function(e,t){return U.apply(this,arguments)})},H=s(T((function(e,t){return{apiKey:"",imports:0,uuid:"",email:"",allowedImports:0,entryPoint:"not-set",incrementImports:function(){return e({imports:t().imports+1})},canImport:function(){return!!t().apiKey||Number(t().imports)<Number(t().allowedImports)},remainingImports:function(){if(t().apiKey)return"unlimited";var e=Number(t().allowedImports)-Number(t().imports);return e>0?e:0}}}),{name:"extendify-user",getStorage:function(){return G}}));const q=ReactDOM;function K(){return(K=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 W(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}function z(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 $(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return z(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)?z(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=e[Symbol.iterator]()).next.bind(n)}function Q(e,t){if(e in t){for(var n=t[e],r=arguments.length,o=new Array(r>2?r-2:0),i=2;i<r;i++)o[i-2]=arguments[i];return"function"==typeof n?n.apply(void 0,o):n}var a=new Error('Tried to handle "'+e+'" but there is no handler defined. Only defined handlers are: '+Object.keys(t).map((function(e){return'"'+e+'"'})).join(", ")+".");throw Error.captureStackTrace&&Error.captureStackTrace(a,Q),a}var Y,J,X;function Z(e){var t=e.props,n=e.slot,r=e.defaultTag,o=e.features,i=e.visible,a=void 0===i||i,u=e.name;if(a)return ee(t,n,r,u);var s=null!=o?o:Y.None;if(s&Y.Static){var c=t.static,l=void 0!==c&&c,f=W(t,["static"]);if(l)return ee(f,n,r,u)}if(s&Y.RenderStrategy){var d,p=t.unmount,v=void 0===p||p,m=W(t,["unmount"]);return Q(v?J.Unmount:J.Hidden,((d={})[J.Unmount]=function(){return null},d[J.Hidden]=function(){return ee(K({},m,{hidden:!0,style:{display:"none"}}),n,r,u)},d))}return ee(t,n,r,u)}function ee(e,t,n,r){var i;void 0===t&&(t={});var a=ne(e,["unmount","static"]),u=a.as,s=void 0===u?n:u,c=a.children,l=a.refName,f=void 0===l?"ref":l,d=W(a,["as","children","refName"]),p=void 0!==e.ref?((i={})[f]=e.ref,i):{},v="function"==typeof c?c(t):c;if(d.className&&"function"==typeof d.className&&(d.className=d.className(t)),s===o.Fragment&&Object.keys(d).length>0){if(!(0,o.isValidElement)(v)||Array.isArray(v)&&v.length>1)throw new Error(['Passing props on "Fragment"!',"","The current component <"+r+' /> is rendering a "Fragment".',"However we need to passthrough the following props:",Object.keys(d).map((function(e){return" - "+e})).join("\n"),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map((function(e){return" - "+e})).join("\n")].join("\n"));return(0,o.cloneElement)(v,Object.assign({},function(e,t,n){for(var r,o=Object.assign({},e),i=function(){var n,i=r.value;void 0!==e[i]&&void 0!==t[i]&&Object.assign(o,((n={})[i]=function(n){n.defaultPrevented||e[i](n),n.defaultPrevented||t[i](n)},n))},a=$(n);!(r=a()).done;)i();return o}(function(e){var t=Object.assign({},e);for(var n in t)void 0===t[n]&&delete t[n];return t}(ne(d,["ref"])),v.props,["onClick"]),p))}return(0,o.createElement)(s,Object.assign({},ne(d,["ref"]),s!==o.Fragment&&p),v)}function te(e){var t;return Object.assign((0,o.forwardRef)(e),{displayName:null!=(t=e.displayName)?t:e.name})}function ne(e,t){void 0===t&&(t=[]);for(var n,r=Object.assign({},e),o=$(t);!(n=o()).done;){var i=n.value;i in r&&delete r[i]}return r}function re(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=(0,o.useRef)(t);return(0,o.useEffect)((function(){r.current=t}),[t]),(0,o.useCallback)((function(e){for(var t,n=$(r.current);!(t=n()).done;){var o=t.value;null!=o&&("function"==typeof o?o(e):o.current=e)}}),[r])}function oe(e){for(var t,n,r=e.parentElement,o=null;r&&!(r instanceof HTMLFieldSetElement);)r instanceof HTMLLegendElement&&(o=r),r=r.parentElement;var i=null!=(t=""===(null==(n=r)?void 0:n.getAttribute("disabled")))&&t;return(!i||!function(e){if(!e)return!1;var t=e.previousElementSibling;for(;null!==t;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}(o))&&i}!function(e){e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static"}(Y||(Y={})),function(e){e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden"}(J||(J={})),function(e){e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab"}(X||(X={}));var ie="undefined"!=typeof window?o.useLayoutEffect:o.useEffect,ae={serverHandoffComplete:!1};function ue(){var e=(0,o.useState)(ae.serverHandoffComplete),t=e[0],n=e[1];return(0,o.useEffect)((function(){!0!==t&&n(!0)}),[t]),(0,o.useEffect)((function(){!1===ae.serverHandoffComplete&&(ae.serverHandoffComplete=!0)}),[]),t}var se=0;function ce(){return++se}function le(){var e=ue(),t=(0,o.useState)(e?ce:null),n=t[0],r=t[1];return ie((function(){null===n&&r(ce())}),[n]),null!=n?""+n:void 0}var fe,de,pe,ve,me,he=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map((function(e){return e+":not([tabindex='-1'])"})).join(",");function ye(e){return void 0===e&&(e=document.body),null==e?[]:Array.from(e.querySelectorAll(he))}function be(e,t){var n;return void 0===t&&(t=ve.Strict),e!==document.body&&Q(t,((n={})[ve.Strict]=function(){return e.matches(he)},n[ve.Loose]=function(){for(var t=e;null!==t;){if(t.matches(he))return!0;t=t.parentElement}return!1},n))}function ge(e){null==e||e.focus({preventScroll:!0})}function xe(e,t){var n=Array.isArray(e)?e:ye(e),r=document.activeElement,o=function(){if(t&(fe.First|fe.Next))return pe.Next;if(t&(fe.Previous|fe.Last))return pe.Previous;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")}(),i=function(){if(t&fe.First)return 0;if(t&fe.Previous)return Math.max(0,n.indexOf(r))-1;if(t&fe.Next)return Math.max(0,n.indexOf(r))+1;if(t&fe.Last)return n.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")}(),a=t&fe.NoScroll?{preventScroll:!0}:{},u=0,s=n.length,c=void 0;do{var l;if(u>=s||u+s<=0)return de.Error;var f=i+u;if(t&fe.WrapAround)f=(f+s)%s;else{if(f<0)return de.Underflow;if(f>=s)return de.Overflow}null==(l=c=n[f])||l.focus(a),u+=o}while(c!==document.activeElement);return c.hasAttribute("tabindex")||c.setAttribute("tabindex","0"),de.Success}function we(e,t,n){var r=(0,o.useRef)(t);r.current=t,(0,o.useEffect)((function(){function t(e){r.current.call(window,e)}return window.addEventListener(e,t,n),function(){return window.removeEventListener(e,t,n)}}),[e,n])}function Se(){var e=(0,o.useRef)(!1);return(0,o.useEffect)((function(){return e.current=!0,function(){e.current=!1}}),[]),e}function ke(e,t,n){void 0===t&&(t=me.All);var r=void 0===n?{}:n,i=r.initialFocus,a=r.containers,u=(0,o.useRef)("undefined"!=typeof window?document.activeElement:null),s=(0,o.useRef)(null),c=Se(),l=Boolean(t&me.RestoreFocus),f=Boolean(t&me.InitialFocus);(0,o.useEffect)((function(){l&&(u.current=document.activeElement)}),[l]),(0,o.useEffect)((function(){if(l)return function(){ge(u.current),u.current=null}}),[l]),(0,o.useEffect)((function(){if(f&&e.current){var t=document.activeElement;if(null==i?void 0:i.current){if((null==i?void 0:i.current)===t)return void(s.current=t)}else if(e.current.contains(t))return void(s.current=t);if(null==i?void 0:i.current)ge(i.current);else if(xe(e.current,fe.First)===de.Error)throw new Error("There are no focusable elements inside the <FocusTrap />");s.current=document.activeElement}}),[e,i,f]),we("keydown",(function(n){t&me.TabLock&&e.current&&n.key===X.Tab&&(n.preventDefault(),xe(e.current,(n.shiftKey?fe.Previous:fe.Next)|fe.WrapAround)===de.Success&&(s.current=document.activeElement))})),we("focus",(function(n){if(t&me.FocusLock){var r=new Set(null==a?void 0:a.current);if(r.add(e),r.size){var o=s.current;if(o&&c.current){var i=n.target;i&&i instanceof HTMLElement?!function(e,t){for(var n,r=$(e);!(n=r()).done;){var o;if(null==(o=n.value.current)?void 0:o.contains(t))return!0}return!1}(r,i)?(n.preventDefault(),n.stopPropagation(),ge(o)):(s.current=i,ge(i)):ge(s.current)}}}}),!0)}!function(e){e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll"}(fe||(fe={})),function(e){e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow"}(de||(de={})),function(e){e[e.Previous=-1]="Previous",e[e.Next=1]="Next"}(pe||(pe={})),function(e){e[e.Strict=0]="Strict",e[e.Loose=1]="Loose"}(ve||(ve={})),function(e){e[e.None=1]="None",e[e.InitialFocus=2]="InitialFocus",e[e.TabLock=4]="TabLock",e[e.FocusLock=8]="FocusLock",e[e.RestoreFocus=16]="RestoreFocus",e[e.All=30]="All"}(me||(me={}));var je=new Set,Ce=new Map;function Ee(e){e.setAttribute("aria-hidden","true"),e.inert=!0}function Oe(e){var t=Ce.get(e);t&&(null===t["aria-hidden"]?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",t["aria-hidden"]),e.inert=t.inert)}var Ie=(0,o.createContext)(!1);function Pe(e){return i().createElement(Ie.Provider,{value:e.force},e.children)}function Te(){var e=(0,o.useContext)(Ie),t=(0,o.useContext)(_e),n=(0,o.useState)((function(){if(!e&&null!==t)return null;if("undefined"==typeof window)return null;var n=document.getElementById("headlessui-portal-root");if(n)return n;var r=document.createElement("div");return r.setAttribute("id","headlessui-portal-root"),document.body.appendChild(r)})),r=n[0],i=n[1];return(0,o.useEffect)((function(){e||null!==t&&i(t.current)}),[t,i,e]),r}var Ne=o.Fragment;function Re(e){var t=e,n=Te(),r=(0,o.useState)((function(){return"undefined"==typeof window?null:document.createElement("div")}))[0],i=ue();return ie((function(){if(n&&r)return n.appendChild(r),function(){var e;n&&(r&&(n.removeChild(r),n.childNodes.length<=0&&(null==(e=n.parentElement)||e.removeChild(n))))}}),[n,r]),i&&n&&r?(0,q.createPortal)(Z({props:t,defaultTag:Ne,name:"Portal"}),r):null}var Ae=o.Fragment,_e=(0,o.createContext)(null);Re.Group=function(e){var t=e.target,n=W(e,["target"]);return i().createElement(_e.Provider,{value:t},Z({props:n,defaultTag:Ae,name:"Popover.Group"}))};var Le=(0,o.createContext)(null);function De(){var e=(0,o.useContext)(Le);if(null===e){var t=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,De),t}return e}function Fe(){var e=(0,o.useState)([]),t=e[0],n=e[1];return[t.length>0?t.join(" "):void 0,(0,o.useMemo)((function(){return function(e){var t=(0,o.useCallback)((function(e){return n((function(t){return[].concat(t,[e])})),function(){return n((function(t){var n=t.slice(),r=n.indexOf(e);return-1!==r&&n.splice(r,1),n}))}}),[]),r=(0,o.useMemo)((function(){return{register:t,slot:e.slot,name:e.name,props:e.props}}),[t,e.slot,e.name,e.props]);return i().createElement(Le.Provider,{value:r},e.children)}}),[n])]}function Me(e){var t=De(),n="headlessui-description-"+le();ie((function(){return t.register(n)}),[n,t.register]);var r=e,o=K({},t.props,{id:n});return Z({props:K({},r,o),slot:t.slot||{},defaultTag:"p",name:t.name||"Description"})}var Be,Ue=(0,o.createContext)(null);function Ve(){return(0,o.useContext)(Ue)}function Ge(e){var t=e.value,n=e.children;return i().createElement(Ue.Provider,{value:t},n)}Ue.displayName="OpenClosedContext",function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(Be||(Be={}));var He,qe,Ke,We,ze=(0,o.createContext)((function(){}));function $e(e){var t=e.children,n=e.onUpdate,r=e.type,a=e.element,u=(0,o.useContext)(ze),s=(0,o.useCallback)((function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];null==n||n.apply(void 0,t),u.apply(void 0,t)}),[u,n]);return ie((function(){return s(He.Add,r,a),function(){return s(He.Remove,r,a)}}),[s,r,a]),i().createElement(ze.Provider,{value:s},t)}ze.displayName="StackContext",function(e){e[e.Add=0]="Add",e[e.Remove=1]="Remove"}(He||(He={})),function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(Ke||(Ke={})),function(e){e[e.SetTitleId=0]="SetTitleId"}(We||(We={}));var Qe=((qe={})[We.SetTitleId]=function(e,t){return e.titleId===t.id?e:K({},e,{titleId:t.id})},qe),Ye=(0,o.createContext)(null);function Je(e){var t=(0,o.useContext)(Ye);if(null===t){var n=new Error("<"+e+" /> is missing a parent <"+it.displayName+" /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(n,Je),n}return t}function Xe(e,t){return Q(t.type,Qe,e,t)}Ye.displayName="DialogContext";var Ze=Y.RenderStrategy|Y.Static,et=te((function(e,t){var n,r=e.open,a=e.onClose,u=e.initialFocus,s=W(e,["open","onClose","initialFocus"]),c=(0,o.useState)(0),l=c[0],f=c[1],d=Ve();void 0===r&&null!==d&&(r=Q(d,((n={})[Be.Open]=!0,n[Be.Closed]=!1,n)));var p=(0,o.useRef)(new Set),v=(0,o.useRef)(null),m=re(v,t),h=e.hasOwnProperty("open")||null!==d,y=e.hasOwnProperty("onClose");if(!h&&!y)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!h)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!y)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if("boolean"!=typeof r)throw new Error("You provided an `open` prop to the `Dialog`, but the value is not a boolean. Received: "+r);if("function"!=typeof a)throw new Error("You provided an `onClose` prop to the `Dialog`, but the value is not a function. Received: "+a);var b=r?Ke.Open:Ke.Closed,g=null!==d?d===Be.Open:b===Ke.Open,x=(0,o.useReducer)(Xe,{titleId:null,descriptionId:null}),w=x[0],S=x[1],k=(0,o.useCallback)((function(){return a(!1)}),[a]),j=(0,o.useCallback)((function(e){return S({type:We.SetTitleId,id:e})}),[S]),C=ue()&&b===Ke.Open,E=l>1,O=null!==(0,o.useContext)(Ye);ke(v,C?Q(E?"parent":"leaf",{parent:me.RestoreFocus,leaf:me.All}):me.None,{initialFocus:u,containers:p}),function(e,t){void 0===t&&(t=!0),ie((function(){if(t&&e.current){var n=e.current;je.add(n);for(var r,o=$(Ce.keys());!(r=o()).done;){var i=r.value;i.contains(n)&&(Oe(i),Ce.delete(i))}return document.querySelectorAll("body > *").forEach((function(e){if(e instanceof HTMLElement){for(var t,n=$(je);!(t=n()).done;){var r=t.value;if(e.contains(r))return}1===je.size&&(Ce.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),Ee(e))}})),function(){if(je.delete(n),je.size>0)document.querySelectorAll("body > *").forEach((function(e){if(e instanceof HTMLElement&&!Ce.has(e)){for(var t,n=$(je);!(t=n()).done;){var r=t.value;if(e.contains(r))return}Ce.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),Ee(e)}}));else for(var e,t=$(Ce.keys());!(e=t()).done;){var r=e.value;Oe(r),Ce.delete(r)}}}}),[t])}(v,!!E&&C),we("mousedown",(function(e){var t,n=e.target;b===Ke.Open&&(E||(null==(t=v.current)?void 0:t.contains(n))||k())})),(0,o.useEffect)((function(){if(b===Ke.Open&&!O){var e=document.documentElement.style.overflow,t=document.documentElement.style.paddingRight,n=window.innerWidth-document.documentElement.clientWidth;return document.documentElement.style.overflow="hidden",document.documentElement.style.paddingRight=n+"px",function(){document.documentElement.style.overflow=e,document.documentElement.style.paddingRight=t}}}),[b,O]),(0,o.useEffect)((function(){if(b===Ke.Open&&v.current){var e=new IntersectionObserver((function(e){for(var t,n=$(e);!(t=n()).done;){var r=t.value;0===r.boundingClientRect.x&&0===r.boundingClientRect.y&&0===r.boundingClientRect.width&&0===r.boundingClientRect.height&&k()}}));return e.observe(v.current),function(){return e.disconnect()}}}),[b,v,k]);var I=Fe(),P=I[0],T=I[1],N="headlessui-dialog-"+le(),R=(0,o.useMemo)((function(){return[{dialogState:b,close:k,setTitleId:j},w]}),[b,w,k,j]),A=(0,o.useMemo)((function(){return{open:b===Ke.Open}}),[b]),_={ref:m,id:N,role:"dialog","aria-modal":b===Ke.Open||void 0,"aria-labelledby":w.titleId,"aria-describedby":P,onClick:function(e){e.stopPropagation()},onKeyDown:function(e){e.key===X.Escape&&b===Ke.Open&&(E||(e.preventDefault(),e.stopPropagation(),k()))}},L=s;return i().createElement($e,{type:"Dialog",element:v,onUpdate:(0,o.useCallback)((function(e,t,n){var r;"Dialog"===t&&Q(e,((r={})[He.Add]=function(){p.current.add(n),f((function(e){return e+1}))},r[He.Remove]=function(){p.current.add(n),f((function(e){return e-1}))},r))}),[])},i().createElement(Pe,{force:!0},i().createElement(Re,null,i().createElement(Ye.Provider,{value:R},i().createElement(Re.Group,{target:v},i().createElement(Pe,{force:!1},i().createElement(T,{slot:A,name:"Dialog.Description"},Z({props:K({},L,_),slot:A,defaultTag:"div",features:Ze,visible:g,name:"Dialog"}))))))))})),tt=te((function e(t,n){var r=Je([it.displayName,e.name].join("."))[0],i=r.dialogState,a=r.close,u=re(n),s="headlessui-dialog-overlay-"+le(),c=(0,o.useCallback)((function(e){if(oe(e.currentTarget))return e.preventDefault();e.preventDefault(),e.stopPropagation(),a()}),[a]),l=(0,o.useMemo)((function(){return{open:i===Ke.Open}}),[i]);return Z({props:K({},t,{ref:u,id:s,"aria-hidden":!0,onClick:c}),slot:l,defaultTag:"div",name:"Dialog.Overlay"})}));var nt,rt,ot,it=Object.assign(et,{Overlay:tt,Title:function e(t){var n=Je([it.displayName,e.name].join("."))[0],r=n.dialogState,i=n.setTitleId,a="headlessui-dialog-title-"+le();(0,o.useEffect)((function(){return i(a),function(){return i(null)}}),[a,i]);var u=(0,o.useMemo)((function(){return{open:r===Ke.Open}}),[r]);return Z({props:K({},t,{id:a}),slot:u,defaultTag:"h2",name:"Dialog.Title"})},Description:Me});!function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(rt||(rt={})),function(e){e[e.ToggleDisclosure=0]="ToggleDisclosure",e[e.SetButtonId=1]="SetButtonId",e[e.SetPanelId=2]="SetPanelId",e[e.LinkPanel=3]="LinkPanel",e[e.UnlinkPanel=4]="UnlinkPanel"}(ot||(ot={}));var at=((nt={})[ot.ToggleDisclosure]=function(e){var t;return K({},e,{disclosureState:Q(e.disclosureState,(t={},t[rt.Open]=rt.Closed,t[rt.Closed]=rt.Open,t))})},nt[ot.LinkPanel]=function(e){return!0===e.linkedPanel?e:K({},e,{linkedPanel:!0})},nt[ot.UnlinkPanel]=function(e){return!1===e.linkedPanel?e:K({},e,{linkedPanel:!1})},nt[ot.SetButtonId]=function(e,t){return e.buttonId===t.buttonId?e:K({},e,{buttonId:t.buttonId})},nt[ot.SetPanelId]=function(e,t){return e.panelId===t.panelId?e:K({},e,{panelId:t.panelId})},nt),ut=(0,o.createContext)(null);function st(e){var t=(0,o.useContext)(ut);if(null===t){var n=new Error("<"+e+" /> is missing a parent <"+ft.name+" /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(n,st),n}return t}function ct(e,t){return Q(t.type,at,e,t)}ut.displayName="DisclosureContext";var lt=o.Fragment;function ft(e){var t,n=e.defaultOpen,r=void 0!==n&&n,a=W(e,["defaultOpen"]),u="headlessui-disclosure-button-"+le(),s="headlessui-disclosure-panel-"+le(),c=(0,o.useReducer)(ct,{disclosureState:r?rt.Open:rt.Closed,linkedPanel:!1,buttonId:u,panelId:s}),l=c[0].disclosureState,f=c[1];(0,o.useEffect)((function(){return f({type:ot.SetButtonId,buttonId:u})}),[u,f]),(0,o.useEffect)((function(){return f({type:ot.SetPanelId,panelId:s})}),[s,f]);var d=(0,o.useMemo)((function(){return{open:l===rt.Open}}),[l]);return i().createElement(ut.Provider,{value:c},i().createElement(Ge,{value:Q(l,(t={},t[rt.Open]=Be.Open,t[rt.Closed]=Be.Closed,t))},Z({props:a,slot:d,defaultTag:lt,name:"Disclosure"})))}var dt=te((function e(t,n){var r=st([ft.name,e.name].join(".")),i=r[0],a=r[1],u=re(n),s=(0,o.useCallback)((function(e){switch(e.key){case X.Space:case X.Enter:e.preventDefault(),e.stopPropagation(),a({type:ot.ToggleDisclosure})}}),[a]),c=(0,o.useCallback)((function(e){switch(e.key){case X.Space:e.preventDefault()}}),[]),l=(0,o.useCallback)((function(e){oe(e.currentTarget)||t.disabled||a({type:ot.ToggleDisclosure})}),[a,t.disabled]),f=(0,o.useMemo)((function(){return{open:i.disclosureState===rt.Open}}),[i]);return Z({props:K({},t,{ref:u,id:i.buttonId,type:"button","aria-expanded":i.disclosureState===rt.Open||void 0,"aria-controls":i.linkedPanel?i.panelId:void 0,onKeyDown:s,onKeyUp:c,onClick:l}),slot:f,defaultTag:"button",name:"Disclosure.Button"})})),pt=Y.RenderStrategy|Y.Static,vt=te((function e(t,n){var r=st([ft.name,e.name].join(".")),i=r[0],a=r[1],u=re(n,(function(){i.linkedPanel||a({type:ot.LinkPanel})})),s=Ve(),c=null!==s?s===Be.Open:i.disclosureState===rt.Open;(0,o.useEffect)((function(){return function(){return a({type:ot.UnlinkPanel})}}),[a]),(0,o.useEffect)((function(){var e;i.disclosureState!==rt.Closed||null!=(e=t.unmount)&&!e||a({type:ot.UnlinkPanel})}),[i.disclosureState,t.unmount,a]);var l=(0,o.useMemo)((function(){return{open:i.disclosureState===rt.Open}}),[i]),f={ref:u,id:i.panelId};return Z({props:K({},t,f),slot:l,defaultTag:"div",features:pt,visible:c,name:"Disclosure.Panel"})}));ft.Button=dt,ft.Panel=vt;var mt,ht,yt,bt;function gt(){var e=[],t={requestAnimationFrame:function(e){function t(){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(){var e=requestAnimationFrame.apply(void 0,arguments);t.add((function(){return cancelAnimationFrame(e)}))})),nextFrame:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];t.requestAnimationFrame((function(){t.requestAnimationFrame.apply(t,n)}))},setTimeout:function(e){function t(){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(){var e=setTimeout.apply(void 0,arguments);t.add((function(){return clearTimeout(e)}))})),add:function(t){e.push(t)},dispose:function(){for(var t,n=$(e.splice(0));!(t=n()).done;){var r=t.value;r()}}};return t}function xt(){var e=(0,o.useState)(gt)[0];return(0,o.useEffect)((function(){return function(){return e.dispose()}}),[e]),e}function wt(e,t){var n=(0,o.useState)(e),r=n[0],i=n[1],a=(0,o.useRef)(e);return ie((function(){a.current=e}),[e]),ie((function(){return i(a.current)}),[a,i].concat(t)),r}function St(e,t){var n=t.resolveItems();if(n.length<=0)return null;var r=t.resolveActiveIndex(),o=null!=r?r:-1,i=function(){switch(e.focus){case mt.First:return n.findIndex((function(e){return!t.resolveDisabled(e)}));case mt.Previous:var r=n.slice().reverse().findIndex((function(e,n,r){return!(-1!==o&&r.length-n-1>=o)&&!t.resolveDisabled(e)}));return-1===r?r:n.length-1-r;case mt.Next:return n.findIndex((function(e,n){return!(n<=o)&&!t.resolveDisabled(e)}));case mt.Last:var i=n.slice().reverse().findIndex((function(e){return!t.resolveDisabled(e)}));return-1===i?i:n.length-1-i;case mt.Specific:return n.findIndex((function(n){return t.resolveId(n)===e.id}));case mt.Nothing:return null;default:!function(e){throw new Error("Unexpected object: "+e)}(e)}}();return-1===i?r:i}!function(e){e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing"}(mt||(mt={})),function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(yt||(yt={})),function(e){e[e.OpenListbox=0]="OpenListbox",e[e.CloseListbox=1]="CloseListbox",e[e.SetDisabled=2]="SetDisabled",e[e.GoToOption=3]="GoToOption",e[e.Search=4]="Search",e[e.ClearSearch=5]="ClearSearch",e[e.RegisterOption=6]="RegisterOption",e[e.UnregisterOption=7]="UnregisterOption"}(bt||(bt={}));var kt=((ht={})[bt.CloseListbox]=function(e){return e.disabled||e.listboxState===yt.Closed?e:K({},e,{activeOptionIndex:null,listboxState:yt.Closed})},ht[bt.OpenListbox]=function(e){return e.disabled||e.listboxState===yt.Open?e:K({},e,{listboxState:yt.Open})},ht[bt.SetDisabled]=function(e,t){return e.disabled===t.disabled?e:K({},e,{disabled:t.disabled})},ht[bt.GoToOption]=function(e,t){if(e.disabled)return e;if(e.listboxState===yt.Closed)return e;var n=St(t,{resolveItems:function(){return e.options},resolveActiveIndex:function(){return e.activeOptionIndex},resolveId:function(e){return e.id},resolveDisabled:function(e){return e.dataRef.current.disabled}});return""===e.searchQuery&&e.activeOptionIndex===n?e:K({},e,{searchQuery:"",activeOptionIndex:n})},ht[bt.Search]=function(e,t){if(e.disabled)return e;if(e.listboxState===yt.Closed)return e;var n=e.searchQuery+t.value.toLowerCase(),r=e.options.findIndex((function(e){var t;return!e.dataRef.current.disabled&&(null==(t=e.dataRef.current.textValue)?void 0:t.startsWith(n))}));return-1===r||r===e.activeOptionIndex?K({},e,{searchQuery:n}):K({},e,{searchQuery:n,activeOptionIndex:r})},ht[bt.ClearSearch]=function(e){return e.disabled||e.listboxState===yt.Closed||""===e.searchQuery?e:K({},e,{searchQuery:""})},ht[bt.RegisterOption]=function(e,t){return K({},e,{options:[].concat(e.options,[{id:t.id,dataRef:t.dataRef}])})},ht[bt.UnregisterOption]=function(e,t){var n=e.options.slice(),r=null!==e.activeOptionIndex?n[e.activeOptionIndex]:null,o=n.findIndex((function(e){return e.id===t.id}));return-1!==o&&n.splice(o,1),K({},e,{options:n,activeOptionIndex:o===e.activeOptionIndex||null===r?null:n.indexOf(r)})},ht),jt=(0,o.createContext)(null);function Ct(e){var t=(0,o.useContext)(jt);if(null===t){var n=new Error("<"+e+" /> is missing a parent <"+It.name+" /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(n,Ct),n}return t}function Et(e,t){return Q(t.type,kt,e,t)}jt.displayName="ListboxContext";var Ot=o.Fragment;function It(e){var t,n=e.value,r=e.onChange,a=e.disabled,u=void 0!==a&&a,s=W(e,["value","onChange","disabled"]),c=(0,o.useReducer)(Et,{listboxState:yt.Closed,propsRef:{current:{value:n,onChange:r}},labelRef:(0,o.createRef)(),buttonRef:(0,o.createRef)(),optionsRef:(0,o.createRef)(),disabled:u,options:[],searchQuery:"",activeOptionIndex:null}),l=c[0],f=l.listboxState,d=l.propsRef,p=l.optionsRef,v=l.buttonRef,m=c[1];ie((function(){d.current.value=n}),[n,d]),ie((function(){d.current.onChange=r}),[r,d]),ie((function(){return m({type:bt.SetDisabled,disabled:u})}),[u]),we("mousedown",(function(e){var t,n,r,o=e.target;f===yt.Open&&((null==(t=v.current)?void 0:t.contains(o))||(null==(n=p.current)?void 0:n.contains(o))||(m({type:bt.CloseListbox}),be(o,ve.Loose)||(e.preventDefault(),null==(r=v.current)||r.focus())))}));var h=(0,o.useMemo)((function(){return{open:f===yt.Open,disabled:u}}),[f,u]);return i().createElement(jt.Provider,{value:c},i().createElement(Ge,{value:Q(f,(t={},t[yt.Open]=Be.Open,t[yt.Closed]=Be.Closed,t))},Z({props:s,slot:h,defaultTag:Ot,name:"Listbox"})))}var Pt=te((function e(t,n){var r,i=Ct([It.name,e.name].join(".")),a=i[0],u=i[1],s=re(a.buttonRef,n),c="headlessui-listbox-button-"+le(),l=xt(),f=(0,o.useCallback)((function(e){switch(e.key){case X.Space:case X.Enter:case X.ArrowDown:e.preventDefault(),u({type:bt.OpenListbox}),l.nextFrame((function(){a.propsRef.current.value||u({type:bt.GoToOption,focus:mt.First})}));break;case X.ArrowUp:e.preventDefault(),u({type:bt.OpenListbox}),l.nextFrame((function(){a.propsRef.current.value||u({type:bt.GoToOption,focus:mt.Last})}))}}),[u,a,l]),d=(0,o.useCallback)((function(e){switch(e.key){case X.Space:e.preventDefault()}}),[]),p=(0,o.useCallback)((function(e){if(oe(e.currentTarget))return e.preventDefault();a.listboxState===yt.Open?(u({type:bt.CloseListbox}),l.nextFrame((function(){var e;return null==(e=a.buttonRef.current)?void 0:e.focus({preventScroll:!0})}))):(e.preventDefault(),u({type:bt.OpenListbox}))}),[u,l,a]),v=wt((function(){if(a.labelRef.current)return[a.labelRef.current.id,c].join(" ")}),[a.labelRef.current,c]),m=(0,o.useMemo)((function(){return{open:a.listboxState===yt.Open,disabled:a.disabled}}),[a]);return Z({props:K({},t,{ref:s,id:c,type:"button","aria-haspopup":!0,"aria-controls":null==(r=a.optionsRef.current)?void 0:r.id,"aria-expanded":a.listboxState===yt.Open||void 0,"aria-labelledby":v,disabled:a.disabled,onKeyDown:f,onKeyUp:d,onClick:p}),slot:m,defaultTag:"button",name:"Listbox.Button"})}));var Tt,Nt,Rt,At=Y.RenderStrategy|Y.Static,_t=te((function e(t,n){var r,i=Ct([It.name,e.name].join(".")),a=i[0],u=i[1],s=re(a.optionsRef,n),c="headlessui-listbox-options-"+le(),l=xt(),f=xt(),d=Ve(),p=null!==d?d===Be.Open:a.listboxState===yt.Open;ie((function(){var e=a.optionsRef.current;e&&a.listboxState===yt.Open&&e!==document.activeElement&&e.focus({preventScroll:!0})}),[a.listboxState,a.optionsRef]);var v=(0,o.useCallback)((function(e){switch(f.dispose(),e.key){case X.Space:if(""!==a.searchQuery)return e.preventDefault(),e.stopPropagation(),u({type:bt.Search,value:e.key});case X.Enter:if(e.preventDefault(),e.stopPropagation(),u({type:bt.CloseListbox}),null!==a.activeOptionIndex){var t=a.options[a.activeOptionIndex].dataRef;a.propsRef.current.onChange(t.current.value)}gt().nextFrame((function(){var e;return null==(e=a.buttonRef.current)?void 0:e.focus({preventScroll:!0})}));break;case X.ArrowDown:return e.preventDefault(),e.stopPropagation(),u({type:bt.GoToOption,focus:mt.Next});case X.ArrowUp:return e.preventDefault(),e.stopPropagation(),u({type:bt.GoToOption,focus:mt.Previous});case X.Home:case X.PageUp:return e.preventDefault(),e.stopPropagation(),u({type:bt.GoToOption,focus:mt.First});case X.End:case X.PageDown:return e.preventDefault(),e.stopPropagation(),u({type:bt.GoToOption,focus:mt.Last});case X.Escape:return e.preventDefault(),e.stopPropagation(),u({type:bt.CloseListbox}),l.nextFrame((function(){var e;return null==(e=a.buttonRef.current)?void 0:e.focus({preventScroll:!0})}));case X.Tab:e.preventDefault(),e.stopPropagation();break;default:1===e.key.length&&(u({type:bt.Search,value:e.key}),f.setTimeout((function(){return u({type:bt.ClearSearch})}),350))}}),[l,u,f,a]),m=wt((function(){var e,t,n;return null!=(e=null==(t=a.labelRef.current)?void 0:t.id)?e:null==(n=a.buttonRef.current)?void 0:n.id}),[a.labelRef.current,a.buttonRef.current]),h=(0,o.useMemo)((function(){return{open:a.listboxState===yt.Open}}),[a]);return Z({props:K({},t,{"aria-activedescendant":null===a.activeOptionIndex||null==(r=a.options[a.activeOptionIndex])?void 0:r.id,"aria-labelledby":m,id:c,onKeyDown:v,role:"listbox",tabIndex:0,ref:s}),slot:h,defaultTag:"ul",features:At,visible:p,name:"Listbox.Options"})}));function Lt(e){var t=e.container,n=e.accept,r=e.walk,i=e.enabled,a=void 0===i||i,u=(0,o.useRef)(n),s=(0,o.useRef)(r);(0,o.useEffect)((function(){u.current=n,s.current=r}),[n,r]),ie((function(){if(t&&a)for(var e=u.current,n=s.current,r=Object.assign((function(t){return e(t)}),{acceptNode:e}),o=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,r,!1);o.nextNode();)n(o.currentNode)}),[t,a,u,s])}It.Button=Pt,It.Label=function e(t){var n=Ct([It.name,e.name].join("."))[0],r="headlessui-listbox-label-"+le(),i=(0,o.useCallback)((function(){var e;return null==(e=n.buttonRef.current)?void 0:e.focus({preventScroll:!0})}),[n.buttonRef]),a=(0,o.useMemo)((function(){return{open:n.listboxState===yt.Open,disabled:n.disabled}}),[n]);return Z({props:K({},t,{ref:n.labelRef,id:r,onClick:i}),slot:a,defaultTag:"label",name:"Listbox.Label"})},It.Options=_t,It.Option=function e(t){var n=t.disabled,r=void 0!==n&&n,i=t.value,a=W(t,["disabled","value"]),u=Ct([It.name,e.name].join(".")),s=u[0],c=u[1],l="headlessui-listbox-option-"+le(),f=null!==s.activeOptionIndex&&s.options[s.activeOptionIndex].id===l,d=s.propsRef.current.value===i,p=(0,o.useRef)({disabled:r,value:i});ie((function(){p.current.disabled=r}),[p,r]),ie((function(){p.current.value=i}),[p,i]),ie((function(){var e,t;p.current.textValue=null==(e=document.getElementById(l))||null==(t=e.textContent)?void 0:t.toLowerCase()}),[p,l]);var v=(0,o.useCallback)((function(){return s.propsRef.current.onChange(i)}),[s.propsRef,i]);ie((function(){return c({type:bt.RegisterOption,id:l,dataRef:p}),function(){return c({type:bt.UnregisterOption,id:l})}}),[p,l]),ie((function(){var e;s.listboxState===yt.Open&&d&&(c({type:bt.GoToOption,focus:mt.Specific,id:l}),null==(e=document.getElementById(l))||null==e.focus||e.focus())}),[s.listboxState]),ie((function(){if(s.listboxState===yt.Open&&f){var e=gt();return e.nextFrame((function(){var e;return null==(e=document.getElementById(l))||null==e.scrollIntoView?void 0:e.scrollIntoView({block:"nearest"})})),e.dispose}}),[l,f,s.listboxState]);var m=(0,o.useCallback)((function(e){if(r)return e.preventDefault();v(),c({type:bt.CloseListbox}),gt().nextFrame((function(){var e;return null==(e=s.buttonRef.current)?void 0:e.focus({preventScroll:!0})}))}),[c,s.buttonRef,r,v]),h=(0,o.useCallback)((function(){if(r)return c({type:bt.GoToOption,focus:mt.Nothing});c({type:bt.GoToOption,focus:mt.Specific,id:l})}),[r,l,c]),y=(0,o.useCallback)((function(){r||f||c({type:bt.GoToOption,focus:mt.Specific,id:l})}),[r,f,l,c]),b=(0,o.useCallback)((function(){r||f&&c({type:bt.GoToOption,focus:mt.Nothing})}),[r,f,c]),g=(0,o.useMemo)((function(){return{active:f,selected:d,disabled:r}}),[f,d,r]);return Z({props:K({},a,{id:l,role:"option",tabIndex:-1,"aria-disabled":!0===r||void 0,"aria-selected":!0===d||void 0,onClick:m,onFocus:h,onPointerMove:y,onMouseMove:y,onPointerLeave:b,onMouseLeave:b}),slot:g,defaultTag:"li",name:"Listbox.Option"})},function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(Nt||(Nt={})),function(e){e[e.OpenMenu=0]="OpenMenu",e[e.CloseMenu=1]="CloseMenu",e[e.GoToItem=2]="GoToItem",e[e.Search=3]="Search",e[e.ClearSearch=4]="ClearSearch",e[e.RegisterItem=5]="RegisterItem",e[e.UnregisterItem=6]="UnregisterItem"}(Rt||(Rt={}));var Dt=((Tt={})[Rt.CloseMenu]=function(e){return e.menuState===Nt.Closed?e:K({},e,{activeItemIndex:null,menuState:Nt.Closed})},Tt[Rt.OpenMenu]=function(e){return e.menuState===Nt.Open?e:K({},e,{menuState:Nt.Open})},Tt[Rt.GoToItem]=function(e,t){var n=St(t,{resolveItems:function(){return e.items},resolveActiveIndex:function(){return e.activeItemIndex},resolveId:function(e){return e.id},resolveDisabled:function(e){return e.dataRef.current.disabled}});return""===e.searchQuery&&e.activeItemIndex===n?e:K({},e,{searchQuery:"",activeItemIndex:n})},Tt[Rt.Search]=function(e,t){var n=e.searchQuery+t.value.toLowerCase(),r=e.items.findIndex((function(e){var t;return(null==(t=e.dataRef.current.textValue)?void 0:t.startsWith(n))&&!e.dataRef.current.disabled}));return-1===r||r===e.activeItemIndex?K({},e,{searchQuery:n}):K({},e,{searchQuery:n,activeItemIndex:r})},Tt[Rt.ClearSearch]=function(e){return""===e.searchQuery?e:K({},e,{searchQuery:""})},Tt[Rt.RegisterItem]=function(e,t){return K({},e,{items:[].concat(e.items,[{id:t.id,dataRef:t.dataRef}])})},Tt[Rt.UnregisterItem]=function(e,t){var n=e.items.slice(),r=null!==e.activeItemIndex?n[e.activeItemIndex]:null,o=n.findIndex((function(e){return e.id===t.id}));return-1!==o&&n.splice(o,1),K({},e,{items:n,activeItemIndex:o===e.activeItemIndex||null===r?null:n.indexOf(r)})},Tt),Ft=(0,o.createContext)(null);function Mt(e){var t=(0,o.useContext)(Ft);if(null===t){var n=new Error("<"+e+" /> is missing a parent <"+Vt.name+" /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(n,Mt),n}return t}function Bt(e,t){return Q(t.type,Dt,e,t)}Ft.displayName="MenuContext";var Ut=o.Fragment;function Vt(e){var t,n=(0,o.useReducer)(Bt,{menuState:Nt.Closed,buttonRef:(0,o.createRef)(),itemsRef:(0,o.createRef)(),items:[],searchQuery:"",activeItemIndex:null}),r=n[0],a=r.menuState,u=r.itemsRef,s=r.buttonRef,c=n[1];we("mousedown",(function(e){var t,n,r,o=e.target;a===Nt.Open&&((null==(t=s.current)?void 0:t.contains(o))||(null==(n=u.current)?void 0:n.contains(o))||(c({type:Rt.CloseMenu}),be(o,ve.Loose)||(e.preventDefault(),null==(r=s.current)||r.focus())))}));var l=(0,o.useMemo)((function(){return{open:a===Nt.Open}}),[a]);return i().createElement(Ft.Provider,{value:n},i().createElement(Ge,{value:Q(a,(t={},t[Nt.Open]=Be.Open,t[Nt.Closed]=Be.Closed,t))},Z({props:e,slot:l,defaultTag:Ut,name:"Menu"})))}var Gt,Ht,qt,Kt=te((function e(t,n){var r,i=Mt([Vt.name,e.name].join(".")),a=i[0],u=i[1],s=re(a.buttonRef,n),c="headlessui-menu-button-"+le(),l=xt(),f=(0,o.useCallback)((function(e){switch(e.key){case X.Space:case X.Enter:case X.ArrowDown:e.preventDefault(),e.stopPropagation(),u({type:Rt.OpenMenu}),l.nextFrame((function(){return u({type:Rt.GoToItem,focus:mt.First})}));break;case X.ArrowUp:e.preventDefault(),e.stopPropagation(),u({type:Rt.OpenMenu}),l.nextFrame((function(){return u({type:Rt.GoToItem,focus:mt.Last})}))}}),[u,l]),d=(0,o.useCallback)((function(e){switch(e.key){case X.Space:e.preventDefault()}}),[]),p=(0,o.useCallback)((function(e){if(oe(e.currentTarget))return e.preventDefault();t.disabled||(a.menuState===Nt.Open?(u({type:Rt.CloseMenu}),l.nextFrame((function(){var e;return null==(e=a.buttonRef.current)?void 0:e.focus({preventScroll:!0})}))):(e.preventDefault(),e.stopPropagation(),u({type:Rt.OpenMenu})))}),[u,l,a,t.disabled]),v=(0,o.useMemo)((function(){return{open:a.menuState===Nt.Open}}),[a]);return Z({props:K({},t,{ref:s,id:c,type:"button","aria-haspopup":!0,"aria-controls":null==(r=a.itemsRef.current)?void 0:r.id,"aria-expanded":a.menuState===Nt.Open||void 0,onKeyDown:f,onKeyUp:d,onClick:p}),slot:v,defaultTag:"button",name:"Menu.Button"})})),Wt=Y.RenderStrategy|Y.Static,zt=te((function e(t,n){var r,i,a=Mt([Vt.name,e.name].join(".")),u=a[0],s=a[1],c=re(u.itemsRef,n),l="headlessui-menu-items-"+le(),f=xt(),d=Ve(),p=null!==d?d===Be.Open:u.menuState===Nt.Open;(0,o.useEffect)((function(){var e=u.itemsRef.current;e&&u.menuState===Nt.Open&&e!==document.activeElement&&e.focus({preventScroll:!0})}),[u.menuState,u.itemsRef]),Lt({container:u.itemsRef.current,enabled:u.menuState===Nt.Open,accept:function(e){return"menuitem"===e.getAttribute("role")?NodeFilter.FILTER_REJECT:e.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk:function(e){e.setAttribute("role","none")}});var v=(0,o.useCallback)((function(e){switch(f.dispose(),e.key){case X.Space:if(""!==u.searchQuery)return e.preventDefault(),e.stopPropagation(),s({type:Rt.Search,value:e.key});case X.Enter:if(e.preventDefault(),e.stopPropagation(),s({type:Rt.CloseMenu}),null!==u.activeItemIndex){var t,n=u.items[u.activeItemIndex].id;null==(t=document.getElementById(n))||t.click()}gt().nextFrame((function(){var e;return null==(e=u.buttonRef.current)?void 0:e.focus({preventScroll:!0})}));break;case X.ArrowDown:return e.preventDefault(),e.stopPropagation(),s({type:Rt.GoToItem,focus:mt.Next});case X.ArrowUp:return e.preventDefault(),e.stopPropagation(),s({type:Rt.GoToItem,focus:mt.Previous});case X.Home:case X.PageUp:return e.preventDefault(),e.stopPropagation(),s({type:Rt.GoToItem,focus:mt.First});case X.End:case X.PageDown:return e.preventDefault(),e.stopPropagation(),s({type:Rt.GoToItem,focus:mt.Last});case X.Escape:e.preventDefault(),e.stopPropagation(),s({type:Rt.CloseMenu}),gt().nextFrame((function(){var e;return null==(e=u.buttonRef.current)?void 0:e.focus({preventScroll:!0})}));break;case X.Tab:e.preventDefault(),e.stopPropagation();break;default:1===e.key.length&&(s({type:Rt.Search,value:e.key}),f.setTimeout((function(){return s({type:Rt.ClearSearch})}),350))}}),[s,f,u]),m=(0,o.useCallback)((function(e){switch(e.key){case X.Space:e.preventDefault()}}),[]),h=(0,o.useMemo)((function(){return{open:u.menuState===Nt.Open}}),[u]);return Z({props:K({},t,{"aria-activedescendant":null===u.activeItemIndex||null==(r=u.items[u.activeItemIndex])?void 0:r.id,"aria-labelledby":null==(i=u.buttonRef.current)?void 0:i.id,id:l,onKeyDown:v,onKeyUp:m,role:"menu",tabIndex:0,ref:c}),slot:h,defaultTag:"div",features:Wt,visible:p,name:"Menu.Items"})})),$t=o.Fragment;Vt.Button=Kt,Vt.Items=zt,Vt.Item=function e(t){var n=t.disabled,r=void 0!==n&&n,i=t.onClick,a=W(t,["disabled","onClick"]),u=Mt([Vt.name,e.name].join(".")),s=u[0],c=u[1],l="headlessui-menu-item-"+le(),f=null!==s.activeItemIndex&&s.items[s.activeItemIndex].id===l;ie((function(){if(s.menuState===Nt.Open&&f){var e=gt();return e.nextFrame((function(){var e;return null==(e=document.getElementById(l))||null==e.scrollIntoView?void 0:e.scrollIntoView({block:"nearest"})})),e.dispose}}),[l,f,s.menuState]);var d=(0,o.useRef)({disabled:r});ie((function(){d.current.disabled=r}),[d,r]),ie((function(){var e,t;d.current.textValue=null==(e=document.getElementById(l))||null==(t=e.textContent)?void 0:t.toLowerCase()}),[d,l]),ie((function(){return c({type:Rt.RegisterItem,id:l,dataRef:d}),function(){return c({type:Rt.UnregisterItem,id:l})}}),[d,l]);var p=(0,o.useCallback)((function(e){return r?e.preventDefault():(c({type:Rt.CloseMenu}),gt().nextFrame((function(){var e;return null==(e=s.buttonRef.current)?void 0:e.focus({preventScroll:!0})})),i?i(e):void 0)}),[c,s.buttonRef,r,i]),v=(0,o.useCallback)((function(){if(r)return c({type:Rt.GoToItem,focus:mt.Nothing});c({type:Rt.GoToItem,focus:mt.Specific,id:l})}),[r,l,c]),m=(0,o.useCallback)((function(){r||f||c({type:Rt.GoToItem,focus:mt.Specific,id:l})}),[r,f,l,c]),h=(0,o.useCallback)((function(){r||f&&c({type:Rt.GoToItem,focus:mt.Nothing})}),[r,f,c]),y=(0,o.useMemo)((function(){return{active:f,disabled:r}}),[f,r]);return Z({props:K({},a,{id:l,role:"menuitem",tabIndex:-1,"aria-disabled":!0===r||void 0,onClick:p,onFocus:v,onPointerMove:m,onMouseMove:m,onPointerLeave:h,onMouseLeave:h}),slot:y,defaultTag:$t,name:"Menu.Item"})},function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(Ht||(Ht={})),function(e){e[e.TogglePopover=0]="TogglePopover",e[e.ClosePopover=1]="ClosePopover",e[e.SetButton=2]="SetButton",e[e.SetButtonId=3]="SetButtonId",e[e.SetPanel=4]="SetPanel",e[e.SetPanelId=5]="SetPanelId"}(qt||(qt={}));var Qt=((Gt={})[qt.TogglePopover]=function(e){var t;return K({},e,{popoverState:Q(e.popoverState,(t={},t[Ht.Open]=Ht.Closed,t[Ht.Closed]=Ht.Open,t))})},Gt[qt.ClosePopover]=function(e){return e.popoverState===Ht.Closed?e:K({},e,{popoverState:Ht.Closed})},Gt[qt.SetButton]=function(e,t){return e.button===t.button?e:K({},e,{button:t.button})},Gt[qt.SetButtonId]=function(e,t){return e.buttonId===t.buttonId?e:K({},e,{buttonId:t.buttonId})},Gt[qt.SetPanel]=function(e,t){return e.panel===t.panel?e:K({},e,{panel:t.panel})},Gt[qt.SetPanelId]=function(e,t){return e.panelId===t.panelId?e:K({},e,{panelId:t.panelId})},Gt),Yt=(0,o.createContext)(null);function Jt(e){var t=(0,o.useContext)(Yt);if(null===t){var n=new Error("<"+e+" /> is missing a parent <"+nn.name+" /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(n,Jt),n}return t}Yt.displayName="PopoverContext";var Xt=(0,o.createContext)(null);function Zt(){return(0,o.useContext)(Xt)}Xt.displayName="PopoverGroupContext";var en=(0,o.createContext)(null);function tn(e,t){return Q(t.type,Qt,e,t)}en.displayName="PopoverPanelContext";function nn(e){var t,n="headlessui-popover-button-"+le(),r="headlessui-popover-panel-"+le(),a=(0,o.useReducer)(tn,{popoverState:Ht.Closed,button:null,buttonId:n,panel:null,panelId:r}),u=a[0],s=u.popoverState,c=u.button,l=u.panel,f=a[1];(0,o.useEffect)((function(){return f({type:qt.SetButtonId,buttonId:n})}),[n,f]),(0,o.useEffect)((function(){return f({type:qt.SetPanelId,panelId:r})}),[r,f]);var d=(0,o.useMemo)((function(){return{buttonId:n,panelId:r,close:function(){return f({type:qt.ClosePopover})}}}),[n,r,f]),p=Zt(),v=null==p?void 0:p.registerPopover,m=(0,o.useCallback)((function(){var e;return null!=(e=null==p?void 0:p.isFocusWithinPopoverGroup())?e:(null==c?void 0:c.contains(document.activeElement))||(null==l?void 0:l.contains(document.activeElement))}),[p,c,l]);(0,o.useEffect)((function(){return null==v?void 0:v(d)}),[v,d]),we("focus",(function(){s===Ht.Open&&(m()||c&&l&&f({type:qt.ClosePopover}))}),!0),we("mousedown",(function(e){var t=e.target;s===Ht.Open&&((null==c?void 0:c.contains(t))||(null==l?void 0:l.contains(t))||(f({type:qt.ClosePopover}),be(t,ve.Loose)||(e.preventDefault(),null==c||c.focus())))}));var h=(0,o.useMemo)((function(){return{open:s===Ht.Open}}),[s]);return i().createElement(Yt.Provider,{value:a},i().createElement(Ge,{value:Q(s,(t={},t[Ht.Open]=Be.Open,t[Ht.Closed]=Be.Closed,t))},Z({props:e,slot:h,defaultTag:"div",name:"Popover"})))}var rn=te((function e(t,n){var r=Jt([nn.name,e.name].join(".")),i=r[0],a=r[1],u=(0,o.useRef)(null),s=Zt(),c=null==s?void 0:s.closeOthers,l=(0,o.useContext)(en),f=null!==l&&l===i.panelId,d=re(u,n,f?null:function(e){return a({type:qt.SetButton,button:e})}),p=(0,o.useRef)(null),v=(0,o.useRef)("undefined"==typeof window?null:document.activeElement);we("focus",(function(){v.current=p.current,p.current=document.activeElement}),!0);var m=(0,o.useCallback)((function(e){var t;if(f){if(i.popoverState===Ht.Closed)return;switch(e.key){case X.Space:case X.Enter:e.preventDefault(),e.stopPropagation(),a({type:qt.ClosePopover}),null==(t=i.button)||t.focus()}}else switch(e.key){case X.Space:case X.Enter:e.preventDefault(),e.stopPropagation(),i.popoverState===Ht.Closed&&(null==c||c(i.buttonId)),a({type:qt.TogglePopover});break;case X.Escape:if(i.popoverState!==Ht.Open)return null==c?void 0:c(i.buttonId);if(!u.current)return;if(!u.current.contains(document.activeElement))return;a({type:qt.ClosePopover});break;case X.Tab:if(i.popoverState!==Ht.Open)return;if(!i.panel)return;if(!i.button)return;if(e.shiftKey){var n;if(!v.current)return;if(null==(n=i.button)?void 0:n.contains(v.current))return;if(i.panel.contains(v.current))return;var r=ye(),o=r.indexOf(v.current);if(r.indexOf(i.button)>o)return;e.preventDefault(),e.stopPropagation(),xe(i.panel,fe.Last)}else e.preventDefault(),e.stopPropagation(),xe(i.panel,fe.First)}}),[a,i.popoverState,i.buttonId,i.button,i.panel,u,c,f]),h=(0,o.useCallback)((function(e){var t;if(!f&&(e.key===X.Space&&e.preventDefault(),i.popoverState===Ht.Open&&i.panel&&i.button))switch(e.key){case X.Tab:if(!v.current)return;if(null==(t=i.button)?void 0:t.contains(v.current))return;if(i.panel.contains(v.current))return;var n=ye(),r=n.indexOf(v.current);if(n.indexOf(i.button)>r)return;e.preventDefault(),e.stopPropagation(),xe(i.panel,fe.Last)}}),[i.popoverState,i.panel,i.button,f]),y=(0,o.useCallback)((function(e){var n,r;oe(e.currentTarget)||(t.disabled||(f?(a({type:qt.ClosePopover}),null==(n=i.button)||n.focus()):(i.popoverState===Ht.Closed&&(null==c||c(i.buttonId)),null==(r=i.button)||r.focus(),a({type:qt.TogglePopover}))))}),[a,i.button,i.popoverState,i.buttonId,t.disabled,c,f]),b=(0,o.useMemo)((function(){return{open:i.popoverState===Ht.Open}}),[i]);return Z({props:K({},t,f?{type:"button",onKeyDown:m,onClick:y}:{ref:d,id:i.buttonId,type:"button","aria-expanded":i.popoverState===Ht.Open||void 0,"aria-controls":i.panel?i.panelId:void 0,onKeyDown:m,onKeyUp:h,onClick:y}),slot:b,defaultTag:"button",name:"Popover.Button"})})),on=Y.RenderStrategy|Y.Static,an=te((function e(t,n){var r=Jt([nn.name,e.name].join(".")),i=r[0].popoverState,a=r[1],u=re(n),s="headlessui-popover-overlay-"+le(),c=Ve(),l=null!==c?c===Be.Open:i===Ht.Open,f=(0,o.useCallback)((function(e){if(oe(e.currentTarget))return e.preventDefault();a({type:qt.ClosePopover})}),[a]),d=(0,o.useMemo)((function(){return{open:i===Ht.Open}}),[i]);return Z({props:K({},t,{ref:u,id:s,"aria-hidden":!0,onClick:f}),slot:d,defaultTag:"div",features:on,visible:l,name:"Popover.Overlay"})})),un=Y.RenderStrategy|Y.Static,sn=te((function e(t,n){var r=t.focus,a=void 0!==r&&r,u=W(t,["focus"]),s=Jt([nn.name,e.name].join(".")),c=s[0],l=s[1],f=(0,o.useRef)(null),d=re(f,n,(function(e){l({type:qt.SetPanel,panel:e})})),p=Ve(),v=null!==p?p===Be.Open:c.popoverState===Ht.Open,m=(0,o.useCallback)((function(e){var t;switch(e.key){case X.Escape:if(c.popoverState!==Ht.Open)return;if(!f.current)return;if(!f.current.contains(document.activeElement))return;e.preventDefault(),l({type:qt.ClosePopover}),null==(t=c.button)||t.focus()}}),[c,f,l]);(0,o.useEffect)((function(){return function(){return l({type:qt.SetPanel,panel:null})}}),[l]),(0,o.useEffect)((function(){var e;c.popoverState!==Ht.Closed||null!=(e=t.unmount)&&!e||l({type:qt.SetPanel,panel:null})}),[c.popoverState,t.unmount,l]),(0,o.useEffect)((function(){if(a&&c.popoverState===Ht.Open&&f.current){var e=document.activeElement;f.current.contains(e)||xe(f.current,fe.First)}}),[a,f,c.popoverState]),we("keydown",(function(e){if(c.popoverState===Ht.Open&&f.current&&e.key===X.Tab&&document.activeElement&&f.current&&f.current.contains(document.activeElement)){e.preventDefault();var t,n=xe(f.current,e.shiftKey?fe.Previous:fe.Next);if(n===de.Underflow)return null==(t=c.button)?void 0:t.focus();if(n===de.Overflow){if(!c.button)return;var r=ye(),o=r.indexOf(c.button);xe(r.splice(o+1).filter((function(e){var t;return!(null==(t=f.current)?void 0:t.contains(e))})),fe.First)===de.Error&&xe(document.body,fe.First)}}})),we("focus",(function(){var e;a&&c.popoverState===Ht.Open&&f.current&&((null==(e=f.current)?void 0:e.contains(document.activeElement))||l({type:qt.ClosePopover}))}),!0);var h=(0,o.useMemo)((function(){return{open:c.popoverState===Ht.Open}}),[c]),y={ref:d,id:c.panelId,onKeyDown:m};return i().createElement(en.Provider,{value:c.panelId},Z({props:K({},u,y),slot:h,defaultTag:"div",features:un,visible:v,name:"Popover.Panel"}))}));nn.Button=rn,nn.Overlay=an,nn.Panel=sn,nn.Group=function(e){var t=(0,o.useRef)(null),n=(0,o.useState)([]),r=n[0],a=n[1],u=(0,o.useCallback)((function(e){a((function(t){var n=t.indexOf(e);if(-1!==n){var r=t.slice();return r.splice(n,1),r}return t}))}),[a]),s=(0,o.useCallback)((function(e){return a((function(t){return[].concat(t,[e])})),function(){return u(e)}}),[a,u]),c=(0,o.useCallback)((function(){var e,n=document.activeElement;return!!(null==(e=t.current)?void 0:e.contains(n))||r.some((function(e){var t,r;return(null==(t=document.getElementById(e.buttonId))?void 0:t.contains(n))||(null==(r=document.getElementById(e.panelId))?void 0:r.contains(n))}))}),[t,r]),l=(0,o.useCallback)((function(e){for(var t,n=$(r);!(t=n()).done;){var o=t.value;o.buttonId!==e&&o.close()}}),[r]),f=(0,o.useMemo)((function(){return{registerPopover:s,unregisterPopover:u,isFocusWithinPopoverGroup:c,closeOthers:l}}),[s,u,c,l]),d=(0,o.useMemo)((function(){return{}}),[]),p={ref:t},v=e;return i().createElement(Xt.Provider,{value:f},Z({props:K({},v,p),slot:d,defaultTag:"div",name:"Popover.Group"}))};var cn=(0,o.createContext)(null);function ln(){var e=(0,o.useContext)(cn);if(null===e){var t=new Error("You used a <Label /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,ln),t}return e}function fn(){var e=(0,o.useState)([]),t=e[0],n=e[1];return[t.length>0?t.join(" "):void 0,(0,o.useMemo)((function(){return function(e){var t=(0,o.useCallback)((function(e){return n((function(t){return[].concat(t,[e])})),function(){return n((function(t){var n=t.slice(),r=n.indexOf(e);return-1!==r&&n.splice(r,1),n}))}}),[]),r=(0,o.useMemo)((function(){return{register:t,slot:e.slot,name:e.name,props:e.props}}),[t,e.slot,e.name,e.props]);return i().createElement(cn.Provider,{value:r},e.children)}}),[n])]}var dn,pn;function vn(e){var t=e.passive,n=void 0!==t&&t,r=W(e,["passive"]),o=ln(),i="headlessui-label-"+le();ie((function(){return o.register(i)}),[i,o.register]);var a=K({},o.props,{id:i}),u=K({},r,a);return n&&delete u.onClick,Z({props:u,slot:o.slot||{},defaultTag:"label",name:o.name||"Label"})}!function(e){e[e.RegisterOption=0]="RegisterOption",e[e.UnregisterOption=1]="UnregisterOption"}(pn||(pn={}));var mn=((dn={})[pn.RegisterOption]=function(e,t){return K({},e,{options:[].concat(e.options,[{id:t.id,element:t.element,propsRef:t.propsRef}])})},dn[pn.UnregisterOption]=function(e,t){var n=e.options.slice(),r=e.options.findIndex((function(e){return e.id===t.id}));return-1===r?e:(n.splice(r,1),K({},e,{options:n}))},dn),hn=(0,o.createContext)(null);function yn(e){var t=(0,o.useContext)(hn);if(null===t){var n=new Error("<"+e+" /> is missing a parent <"+xn.name+" /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(n,yn),n}return t}function bn(e,t){return Q(t.type,mn,e,t)}hn.displayName="RadioGroupContext";var gn;function xn(e){var t=e.value,n=e.onChange,r=e.disabled,a=void 0!==r&&r,u=W(e,["value","onChange","disabled"]),s=(0,o.useReducer)(bn,{options:[]}),c=s[0].options,l=s[1],f=fn(),d=f[0],p=f[1],v=Fe(),m=v[0],h=v[1],y="headlessui-radiogroup-"+le(),b=(0,o.useRef)(null),g=(0,o.useMemo)((function(){return c.find((function(e){return!e.propsRef.current.disabled}))}),[c]),x=(0,o.useMemo)((function(){return c.some((function(e){return e.propsRef.current.value===t}))}),[c,t]),w=(0,o.useCallback)((function(e){var r;if(a)return!1;if(e===t)return!1;var o=null==(r=c.find((function(t){return t.propsRef.current.value===e})))?void 0:r.propsRef.current;return!(null==o?void 0:o.disabled)&&(n(e),!0)}),[n,t,a,c]);Lt({container:b.current,accept:function(e){return"radio"===e.getAttribute("role")?NodeFilter.FILTER_REJECT:e.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk:function(e){e.setAttribute("role","none")}});var S=(0,o.useCallback)((function(e){if(b.current){var t=c.filter((function(e){return!1===e.propsRef.current.disabled})).map((function(e){return e.element.current}));switch(e.key){case X.ArrowLeft:case X.ArrowUp:if(e.preventDefault(),e.stopPropagation(),xe(t,fe.Previous|fe.WrapAround)===de.Success){var n=c.find((function(e){return e.element.current===document.activeElement}));n&&w(n.propsRef.current.value)}break;case X.ArrowRight:case X.ArrowDown:if(e.preventDefault(),e.stopPropagation(),xe(t,fe.Next|fe.WrapAround)===de.Success){var r=c.find((function(e){return e.element.current===document.activeElement}));r&&w(r.propsRef.current.value)}break;case X.Space:e.preventDefault(),e.stopPropagation();var o=c.find((function(e){return e.element.current===document.activeElement}));o&&w(o.propsRef.current.value)}}}),[b,c,w]),k=(0,o.useCallback)((function(e){return l(K({type:pn.RegisterOption},e)),function(){return l({type:pn.UnregisterOption,id:e.id})}}),[l]),j=(0,o.useMemo)((function(){return{registerOption:k,firstOption:g,containsCheckedOption:x,change:w,disabled:a,value:t}}),[k,g,x,w,a,t]),C={ref:b,id:y,role:"radiogroup","aria-labelledby":d,"aria-describedby":m,onKeyDown:S};return i().createElement(h,{name:"RadioGroup.Description"},i().createElement(p,{name:"RadioGroup.Label"},i().createElement(hn.Provider,{value:j},Z({props:K({},u,C),defaultTag:"div",name:"RadioGroup"}))))}!function(e){e[e.Empty=1]="Empty",e[e.Active=2]="Active"}(gn||(gn={}));xn.Option=function e(t){var n=(0,o.useRef)(null),r="headlessui-radiogroup-option-"+le(),a=fn(),u=a[0],s=a[1],c=Fe(),l=c[0],f=c[1],d=function(e){void 0===e&&(e=0);var t=(0,o.useState)(e),n=t[0],r=t[1];return{addFlag:(0,o.useCallback)((function(e){return r((function(t){return t|e}))}),[r]),hasFlag:(0,o.useCallback)((function(e){return Boolean(n&e)}),[n]),removeFlag:(0,o.useCallback)((function(e){return r((function(t){return t&~e}))}),[r]),toggleFlag:(0,o.useCallback)((function(e){return r((function(t){return t^e}))}),[r])}}(gn.Empty),p=d.addFlag,v=d.removeFlag,m=d.hasFlag,h=t.value,y=t.disabled,b=void 0!==y&&y,g=W(t,["value","disabled"]),x=(0,o.useRef)({value:h,disabled:b});ie((function(){x.current.value=h}),[h,x]),ie((function(){x.current.disabled=b}),[b,x]);var w=yn([xn.name,e.name].join(".")),S=w.registerOption,k=w.disabled,j=w.change,C=w.firstOption,E=w.containsCheckedOption,O=w.value;ie((function(){return S({id:r,element:n,propsRef:x})}),[r,S,n,t]);var I=(0,o.useCallback)((function(){var e;j(h)&&(p(gn.Active),null==(e=n.current)||e.focus())}),[p,j,h]),P=(0,o.useCallback)((function(){return p(gn.Active)}),[p]),T=(0,o.useCallback)((function(){return v(gn.Active)}),[v]),N=(null==C?void 0:C.id)===r,R=k||b,A=O===h,_={ref:n,id:r,role:"radio","aria-checked":A?"true":"false","aria-labelledby":u,"aria-describedby":l,tabIndex:R?-1:A||!E&&N?0:-1,onClick:R?void 0:I,onFocus:R?void 0:P,onBlur:R?void 0:T},L=(0,o.useMemo)((function(){return{checked:A,disabled:R,active:m(gn.Active)}}),[A,R,m]);return i().createElement(f,{name:"RadioGroup.Description"},i().createElement(s,{name:"RadioGroup.Label"},Z({props:K({},g,_),slot:L,defaultTag:"div",name:"RadioGroup.Option"})))},xn.Label=vn,xn.Description=Me;var wn=(0,o.createContext)(null);wn.displayName="GroupContext";var Sn=o.Fragment;var kn;function jn(e){var t=e.checked,n=e.onChange,r=W(e,["checked","onChange"]),i="headlessui-switch-"+le(),a=(0,o.useContext)(wn),u=(0,o.useCallback)((function(){return n(!t)}),[n,t]),s=(0,o.useCallback)((function(e){if(oe(e.currentTarget))return e.preventDefault();e.preventDefault(),u()}),[u]),c=(0,o.useCallback)((function(e){e.key!==X.Tab&&e.preventDefault(),e.key===X.Space&&u()}),[u]),l=(0,o.useCallback)((function(e){return e.preventDefault()}),[]),f=(0,o.useMemo)((function(){return{checked:t}}),[t]),d={id:i,ref:null===a?void 0:a.setSwitch,role:"switch",tabIndex:0,"aria-checked":t,"aria-labelledby":null==a?void 0:a.labelledby,"aria-describedby":null==a?void 0:a.describedby,onClick:s,onKeyUp:c,onKeyPress:l};return"button"===r.as&&Object.assign(d,{type:"button"}),Z({props:K({},r,d),slot:f,defaultTag:"button",name:"Switch"})}function Cn(){var e=(0,o.useRef)(!0);return(0,o.useEffect)((function(){e.current=!1}),[]),e.current}function En(e){for(var t,n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];e&&r.length>0&&(t=e.classList).add.apply(t,r)}function On(e){for(var t,n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];e&&r.length>0&&(t=e.classList).remove.apply(t,r)}function In(e,t,n,r,o){var i=gt(),a=void 0!==o?function(e){var t={called:!1};return function(){if(!t.called)return t.called=!0,e.apply(void 0,arguments)}}(o):function(){};return En.apply(void 0,[e].concat(t,n)),i.nextFrame((function(){On.apply(void 0,[e].concat(n)),En.apply(void 0,[e].concat(r)),i.add(function(e,t){var n=gt();if(!e)return n.dispose;var r=getComputedStyle(e),o=[r.transitionDuration,r.transitionDelay].map((function(e){var t=e.split(",").filter(Boolean).map((function(e){return e.includes("ms")?parseFloat(e):1e3*parseFloat(e)})).sort((function(e,t){return t-e}))[0];return void 0===t?0:t})),i=o[0],a=o[1];return 0!==i?n.setTimeout((function(){t(kn.Finished)}),i+a):t(kn.Finished),n.add((function(){return t(kn.Cancelled)})),n.dispose}(e,(function(n){return On.apply(void 0,[e].concat(r,t)),a(n)})))})),i.add((function(){return On.apply(void 0,[e].concat(t,n,r))})),i.add((function(){return a(kn.Cancelled)})),i.dispose}function Pn(e){return void 0===e&&(e=""),(0,o.useMemo)((function(){return e.split(" ").filter((function(e){return e.trim().length>1}))}),[e])}jn.Group=function(e){var t=(0,o.useState)(null),n=t[0],r=t[1],a=fn(),u=a[0],s=a[1],c=Fe(),l=c[0],f=c[1],d=(0,o.useMemo)((function(){return{switch:n,setSwitch:r,labelledby:u,describedby:l}}),[n,r,u,l]);return i().createElement(f,{name:"Switch.Description"},i().createElement(s,{name:"Switch.Label",props:{onClick:function(){n&&(n.click(),n.focus({preventScroll:!0}))}}},i().createElement(wn.Provider,{value:d},Z({props:e,defaultTag:Sn,name:"Switch.Group"}))))},jn.Label=vn,jn.Description=Me,function(e){e.Finished="finished",e.Cancelled="cancelled"}(kn||(kn={}));var Tn,Nn=(0,o.createContext)(null);Nn.displayName="TransitionContext",function(e){e.Visible="visible",e.Hidden="hidden"}(Tn||(Tn={}));var Rn=(0,o.createContext)(null);function An(e){return"children"in e?An(e.children):e.current.filter((function(e){return e.state===Tn.Visible})).length>0}function _n(e){var t=(0,o.useRef)(e),n=(0,o.useRef)([]),r=Se();(0,o.useEffect)((function(){t.current=e}),[e]);var i=(0,o.useCallback)((function(e,o){var i;void 0===o&&(o=J.Hidden);var a=n.current.findIndex((function(t){return t.id===e}));-1!==a&&(Q(o,((i={})[J.Unmount]=function(){n.current.splice(a,1)},i[J.Hidden]=function(){n.current[a].state=Tn.Hidden},i)),!An(n)&&r.current&&(null==t.current||t.current()))}),[t,r,n]),a=(0,o.useCallback)((function(e){var t=n.current.find((function(t){return t.id===e}));return t?t.state!==Tn.Visible&&(t.state=Tn.Visible):n.current.push({id:e,state:Tn.Visible}),function(){return i(e,J.Unmount)}}),[n,i]);return(0,o.useMemo)((function(){return{children:n,register:a,unregister:i}}),[a,i,n])}function Ln(){}Rn.displayName="NestingContext";var Dn=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function Fn(e){for(var t,n={},r=$(Dn);!(t=r()).done;){var o,i=t.value;n[i]=null!=(o=e[i])?o:Ln}return n}var Mn=Y.RenderStrategy;function Bn(e){var t,n=e.beforeEnter,r=e.afterEnter,a=e.beforeLeave,u=e.afterLeave,s=e.enter,c=e.enterFrom,l=e.enterTo,f=e.leave,d=e.leaveFrom,p=e.leaveTo,v=W(e,["beforeEnter","afterEnter","beforeLeave","afterLeave","enter","enterFrom","enterTo","leave","leaveFrom","leaveTo"]),m=(0,o.useRef)(null),h=(0,o.useState)(Tn.Visible),y=h[0],b=h[1],g=v.unmount?J.Unmount:J.Hidden,x=function(){var e=(0,o.useContext)(Nn);if(null===e)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}(),w=x.show,S=x.appear,k=function(){var e=(0,o.useContext)(Rn);if(null===e)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}(),j=k.register,C=k.unregister,E=Cn(),O=le(),I=(0,o.useRef)(!1),P=_n((function(){I.current||(b(Tn.Hidden),C(O),D.current.afterLeave())}));ie((function(){if(O)return j(O)}),[j,O]),ie((function(){var e;g===J.Hidden&&O&&(w&&y!==Tn.Visible?b(Tn.Visible):Q(y,((e={})[Tn.Hidden]=function(){return C(O)},e[Tn.Visible]=function(){return j(O)},e)))}),[y,O,j,C,w,g]);var T=Pn(s),N=Pn(c),R=Pn(l),A=Pn(f),_=Pn(d),L=Pn(p),D=function(e){var t=(0,o.useRef)(Fn(e));return(0,o.useEffect)((function(){t.current=Fn(e)}),[e]),t}({beforeEnter:n,afterEnter:r,beforeLeave:a,afterLeave:u}),F=ue();(0,o.useEffect)((function(){if(F&&y===Tn.Visible&&null===m.current)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")}),[m,y,F]);var M=E&&!S;ie((function(){var e=m.current;if(e&&!M)return I.current=!0,w&&D.current.beforeEnter(),w||D.current.beforeLeave(),w?In(e,T,N,R,(function(e){I.current=!1,e===kn.Finished&&D.current.afterEnter()})):In(e,A,_,L,(function(e){I.current=!1,e===kn.Finished&&(An(P)||(b(Tn.Hidden),C(O),D.current.afterLeave()))}))}),[D,O,I,C,P,m,M,w,T,N,R,A,_,L]);var B={ref:m},U=v;return i().createElement(Rn.Provider,{value:P},i().createElement(Ge,{value:Q(y,(t={},t[Tn.Visible]=Be.Open,t[Tn.Hidden]=Be.Closed,t))},Z({props:K({},U,B),defaultTag:"div",features:Mn,visible:y===Tn.Visible,name:"Transition.Child"})))}function Un(e){var t,n=e.show,r=e.appear,a=void 0!==r&&r,u=e.unmount,s=W(e,["show","appear","unmount"]),c=Ve();void 0===n&&null!==c&&(n=Q(c,((t={})[Be.Open]=!0,t[Be.Closed]=!1,t)));if(![!0,!1].includes(n))throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");var l=(0,o.useState)(n?Tn.Visible:Tn.Hidden),f=l[0],d=l[1],p=_n((function(){d(Tn.Hidden)})),v=Cn(),m=(0,o.useMemo)((function(){return{show:n,appear:a||!v}}),[n,a,v]);(0,o.useEffect)((function(){n?d(Tn.Visible):An(p)||d(Tn.Hidden)}),[n,p]);var h={unmount:u};return i().createElement(Rn.Provider,{value:p},i().createElement(Nn.Provider,{value:m},Z({props:K({},h,{as:o.Fragment,children:i().createElement(Bn,Object.assign({},h,s))}),defaultTag:o.Fragment,features:Mn,visible:f===Tn.Visible,name:"Transition"})))}Un.Child=Bn,Un.Root=Un;const Vn=wp.i18n;var Gn=n(246);function Hn(e){var t=e.className,n=e.hideLibrary,r=e.initialFocus,o=H((function(e){return e.remainingImports})),i=H((function(e){return e.apiKey})),a=H((function(e){return e.allowedImports}));return(0,Gn.jsx)("div",{className:t,children:(0,Gn.jsxs)("div",{className:"flex justify-between items-center px-6 sm:px-12 h-full",children:[(0,Gn.jsxs)("div",{className:"flex space-x-12 h-full",children:[(0,Gn.jsxs)("div",{className:"font-bold flex items-center space-x-1.5 lg:w-72",children:[(0,Gn.jsxs)("svg",{className:"",width:"30",height:"30",viewBox:"0 0 103 103",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,Gn.jsx)("rect",{y:"25.75",width:"70.8125",height:"77.25",fill:"#000000"}),(0,Gn.jsx)("rect",{x:"45.0625",width:"57.9375",height:"57.9375",fill:"#37C2A2"})]}),(0,Gn.jsx)("span",{className:"text-sm transform translate-y-0.5 whitespace-nowrap",children:(0,Vn.__)("Extendify Library","extendify-sdk")})]}),!i.length&&(0,Gn.jsx)(Gn.Fragment,{children:(0,Gn.jsxs)("div",{className:"items-center ml-8 h-full hidden md:flex",children:[(0,Gn.jsxs)("div",{className:"h-full flex items-center px-6 border-l border-r border-gray-300 bg-extendify-lightest",children:[(0,Gn.jsx)("a",{className:"button-extendify-main inline lg:hidden",target:"_blank",href:"https://extendify.com",rel:"noreferrer",children:(0,Vn.__)("Sign up","extendify-sdk")}),(0,Gn.jsx)("a",{className:"button-extendify-main hidden lg:block",target:"_blank",href:"https://extendify.com",rel:"noreferrer",children:(0,Vn.__)("Sign up today to get unlimited beta access","extendify-sdk")})]}),(0,Gn.jsx)("div",{className:"m-0 p-0 px-6 text-sm bg-gray-50 border-r border-gray-300 h-full flex items-center",children:(0,Vn.sprintf)((0,Vn.__)("Imports left: %s / %s"),o(),Number(a))})]})})]}),(0,Gn.jsx)("div",{className:"space-x-2 transform sm:translate-x-8",children:(0,Gn.jsxs)("button",{ref:r,type:"button",className:"components-button has-icon",onClick:function(){return n()},children:[(0,Gn.jsx)("svg",{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",size:"24",role:"img","aria-hidden":"true",focusable:"false",children:(0,Gn.jsx)("path",{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"})}),(0,Gn.jsx)("span",{className:"sr-only",children:(0,Vn.__)("Close library","extendify-sdk")})]})})]})})}const qn=wp.blockEditor,Kn=lodash;var Wn=function(){return R.get("categories")},zn=n(42),$n=n.n(zn);function Qn(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function Yn(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Qn(i,r,o,a,u,"next",e)}function u(e){Qn(i,r,o,a,u,"throw",e)}a(void 0)}))}}function Jn(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null==n)return;var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Xn(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 Xn(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 Xn(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 Zn(){var e,t=x((function(e){return e.updateSearchParams})),n=x((function(e){return e.searchParams})),o=(0,Kn.debounce)((function(e){return t({categories:[],search:e})}),500),i=Jn((0,r.useState)(null!==(e=null==n?void 0:n.search)&&void 0!==e?e:""),2),a=i[0],u=i[1],s=Jn((0,r.useState)([]),2),c=s[0],l=s[1],f=(0,r.useCallback)(Yn(k().mark((function e(){var t,n,r;return k().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Wn();case 2:t=e.sent,n=t.records,r=n.map((function(e){var t;return null==e||null===(t=e.fields)||void 0===t?void 0:t.title})).filter(Boolean).sort(),l(r);case 6:case"end":return e.stop()}}),e)}))),[]);return(0,r.useEffect)((function(){f()}),[f]),(0,Gn.jsxs)("div",{className:"flex-grow overflow-y-auto",children:[(0,Gn.jsx)(qn.__experimentalSearchForm,{placeholder:(0,Vn.__)("What are you looking for?","extendify-sdk"),onChange:function(e){x.setState({nextPage:""}),u(e),o(e)},value:a,className:"sm:ml-px sm:mt-1 sm:mr-1 sm:mb-6 px-6 sm:p-0 sm:px-0",autoComplete:"off"}),(0,Gn.jsxs)("div",{className:"hidden sm:block",children:[(0,Gn.jsx)("div",{className:"flex justify-between items-center mb-4 py-4 border-b border-gray-200",children:(0,Gn.jsx)("h3",{className:"font-medium mb-2 pl-4 text-sm m-0 p-0",children:(0,Vn.__)("Categories","extendify-sdk")})}),(0,Gn.jsx)("div",{className:"mt-6",children:(0,Gn.jsxs)("ul",{className:"m-0 pl-4 pb-24",children:[(0,Gn.jsx)("li",{className:"m-0",children:(0,Gn.jsx)("button",{type:"button",className:"cursor-pointer w-full flex justify-between items-center p-3 m-0 px-4 leading-none hover:text-wp-theme-500 bg-transparent transition duration-200",onClick:function(){t({categories:[]})},children:(0,Gn.jsx)("span",{className:$n()({"text-wp-theme-500 font-bold":!n.categories.length||(null==n?void 0:n.categories.includes("Default"))}),children:"pattern"===n.type?(0,Vn.__)("Default","extendify-sdk"):(0,Vn.__)("All","extendify-sdk")})})}),c.map((function(e){return(0,Gn.jsx)("li",{className:"m-0",children:(0,Gn.jsx)("button",{type:"button",className:"cursor-pointer w-full flex justify-between items-center p-3 m-0 px-4 leading-none bg-transparent hover:text-wp-theme-500 transition duration-200",onClick:function(){t({categories:[e]})},children:(0,Gn.jsx)("span",{className:$n()({"text-wp-theme-500 font-bold":n.categories.includes(e)}),children:e})})},e)}))]})})]})]})}function er(e){var t=(0,Kn.get)(e,"categories"),n=(0,Kn.get)(e,"search"),r=(0,Kn.get)(e,"type"),o=(0,Kn.isEmpty)(t)?"TRUE()":t.map((function(e){return'SEARCH("'.concat(e,'", {categories}) = 1')})).join(","),i=(0,Kn.isEmpty)(n)?"TRUE()":'OR(FIND(LOWER("'.concat(n,'"), LOWER(title)) != 0, FIND(LOWER("').concat(n,'"), LOWER({categories})) != 0)'),a=(0,Kn.isEmpty)(r)?"TRUE()":'{type}="'.concat(r,'"'),u="IF(AND(".concat(o,", ").concat(i,", ").concat(a,"), TRUE())");return(0,Kn.isEmpty)(i)&&(0,Kn.isEmpty)(a)&&(0,Kn.isEmpty)(o)&&(u=""),u.replace(/\r?\n|\r/g,"")}function tr(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}var nr=0,rr=function(e,t){return(n=k().mark((function n(){var r,o,i;return k().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return nr++,o=N.CancelToken.source(),null!==(r=x.getState().fetchToken)&&void 0!==r&&r.cancel&&x.getState().fetchToken.cancel(),x.setState({fetchToken:o}),n.next=6,R.post("templates",{filterByFormula:er(e),pageSize:l,categories:e.categories,search:e.search,type:e.type,offset:t,initial:1===nr,requestNumber:nr},{cancelToken:o.token});case 6:return i=n.sent,x.setState({fetchToken:null}),n.abrupt("return",i);case 9:case"end":return n.stop()}}),n)})),function(){var e=this,t=arguments;return new Promise((function(r,o){var i=n.apply(e,t);function a(e){tr(i,r,o,a,u,"next",e)}function u(e){tr(i,r,o,a,u,"throw",e)}a(void 0)}))})();var n},or=function(e){var t;return R.post("templates/".concat(e.id),{template_id:e.id,pageSize:l,template_name:null===(t=e.fields)||void 0===t?void 0:t.title})};function ir(){return(ir=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 ar=new Map,ur=new WeakMap,sr=0;function cr(e){return Object.keys(e).sort().filter((function(t){return void 0!==e[t]})).map((function(t){return t+"_"+("root"===t?(n=e.root)?(ur.has(n)||(sr+=1,ur.set(n,sr.toString())),ur.get(n)):"0":e[t]);var n})).toString()}function lr(e,t,n){if(void 0===n&&(n={}),!e)return function(){};var r=function(e){var t=cr(e),n=ar.get(t);if(!n){var r,o=new Map,i=new IntersectionObserver((function(t){t.forEach((function(t){var n,i=t.isIntersecting&&r.some((function(e){return t.intersectionRatio>=e}));e.trackVisibility&&void 0===t.isVisible&&(t.isVisible=i),null==(n=o.get(t.target))||n.forEach((function(e){e(i,t)}))}))}),e);r=i.thresholds||(Array.isArray(e.threshold)?e.threshold:[e.threshold||0]),n={id:t,observer:i,elements:o},ar.set(t,n)}return n}(n),o=r.id,i=r.observer,a=r.elements,u=a.get(e)||[];return a.has(e)||a.set(e,u),u.push(t),i.observe(e),function(){u.splice(u.indexOf(t),1),0===u.length&&(a.delete(e),i.unobserve(e)),0===a.size&&(i.disconnect(),ar.delete(o))}}function fr(e){return"function"!=typeof e.children}var dr=function(e){var t,n;function r(t){var n;return(n=e.call(this,t)||this).node=null,n._unobserveCb=null,n.handleNode=function(e){n.node&&(n.unobserve(),e||n.props.triggerOnce||n.props.skip||n.setState({inView:!!n.props.initialInView,entry:void 0})),n.node=e||null,n.observeNode()},n.handleChange=function(e,t){e&&n.props.triggerOnce&&n.unobserve(),fr(n.props)||n.setState({inView:e,entry:t}),n.props.onChange&&n.props.onChange(e,t)},n.state={inView:!!t.initialInView,entry:void 0},n}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n;var i=r.prototype;return i.componentDidUpdate=function(e){e.rootMargin===this.props.rootMargin&&e.root===this.props.root&&e.threshold===this.props.threshold&&e.skip===this.props.skip&&e.trackVisibility===this.props.trackVisibility&&e.delay===this.props.delay||(this.unobserve(),this.observeNode())},i.componentWillUnmount=function(){this.unobserve(),this.node=null},i.observeNode=function(){if(this.node&&!this.props.skip){var e=this.props,t=e.threshold,n=e.root,r=e.rootMargin,o=e.trackVisibility,i=e.delay;this._unobserveCb=lr(this.node,this.handleChange,{threshold:t,root:n,rootMargin:r,trackVisibility:o,delay:i})}},i.unobserve=function(){this._unobserveCb&&(this._unobserveCb(),this._unobserveCb=null)},i.render=function(){if(!fr(this.props)){var e=this.state,t=e.inView,n=e.entry;return this.props.children({inView:t,entry:n,ref:this.handleNode})}var r=this.props,i=r.children,a=r.as,u=r.tag,s=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(r,["children","as","tag","triggerOnce","threshold","root","rootMargin","onChange","skip","trackVisibility","delay","initialInView"]);return(0,o.createElement)(a||u||"div",ir({ref:this.handleNode},s),i)},r}(o.Component);dr.displayName="InView",dr.defaultProps={threshold:0,triggerOnce:!1,initialInView:!1};const pr=wp.components;function vr(e){return function(e){if(Array.isArray(e))return gr(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||br(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 mr(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function hr(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){mr(i,r,o,a,u,"next",e)}function u(e){mr(i,r,o,a,u,"throw",e)}a(void 0)}))}}function yr(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null==n)return;var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}(e,t)||br(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 br(e,t){if(e){if("string"==typeof e)return gr(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)?gr(e,t):void 0}}function gr(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 xr(e){var t=e.templates,n=x((function(e){return e.setActive})),i=x((function(e){return e.activeTemplate})),a=x((function(e){return e.appendTemplates})),u=yr((0,r.useState)(""),2),s=u[0],c=u[1],l=yr((0,r.useState)(!1),2),f=l[0],d=l[1],p=yr((0,r.useState)([]),2),v=p[0],m=p[1],h=yr(function(e){var t=void 0===e?{}:e,n=t.threshold,r=t.delay,i=t.trackVisibility,a=t.rootMargin,u=t.root,s=t.triggerOnce,c=t.skip,l=t.initialInView,f=(0,o.useRef)(),d=(0,o.useState)({inView:!!l}),p=d[0],v=d[1],m=(0,o.useCallback)((function(e){void 0!==f.current&&(f.current(),f.current=void 0),c||e&&(f.current=lr(e,(function(e,t){v({inView:e,entry:t}),t.isIntersecting&&s&&f.current&&(f.current(),f.current=void 0)}),{root:u,rootMargin:a,threshold:n,trackVisibility:i,delay:r}))}),[Array.isArray(n)?n.toString():n,u,a,s,c,i,r]);(0,o.useEffect)((function(){f.current||!p.entry||s||c||v({inView:!!l})}));var h=[m,p.inView,p.entry];return h.ref=h[0],h.inView=h[1],h.entry=h[2],h}(),2),y=h[0],b=h[1],g=x((function(e){return e.updateSearchParams})),w=x((function(e){return e.searchParams})),S=(0,r.useRef)(x.getState().nextPage),j=(0,r.useRef)(x.getState().searchParams);(0,r.useEffect)((function(){return x.subscribe((function(e){return S.current=e}),(function(e){return e.nextPage}))}),[]),(0,r.useEffect)((function(){return x.subscribe((function(e){return j.current=e}),(function(e){return e.searchParams}))}),[]);var C=(0,r.useCallback)(hr(k().mark((function e(){var t,n;return k().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return c(""),d(!1),e.next=4,rr(j.current,S.current).catch((function(e){c(e&&e.message?e.message:(0,Vn.__)("Unknown error occured. Check browser console or contact support.","extendify-sdk"))}));case 4:null!=(n=e.sent)&&null!==(t=n.error)&&void 0!==t&&t.length&&c(null==n?void 0:n.error),null!=n&&n.records&&w===j.current&&(a(n.records),d(n.records.length<=0),x.setState({nextPage:n.offset}));case 7:case"end":return e.stop()}}),e)}))),[w,a]);return(0,r.useEffect)((function(){m([]),C()}),[C,j]),(0,r.useEffect)((function(){b&&C()}),[b,C]),s.length?(0,Gn.jsxs)("div",{className:"text-left",children:[(0,Gn.jsx)("h2",{className:"text-left",children:(0,Vn.__)("Server error","extendify-sdk")}),(0,Gn.jsx)("code",{className:"block max-w-xl p-4 mb-4",style:{minHeight:"10rem"},children:s}),(0,Gn.jsx)(pr.Button,{isTertiary:!0,onClick:function(){m([]),g({categories:[],search:""}),C()},children:(0,Vn.__)("Press here to reload experience")})]}):f?null!=w&&w.search.length?(0,Gn.jsx)("h2",{className:"text-left",children:(0,Vn.sprintf)((0,Vn.__)("No results for %s.","extendify-sdk"),null==w?void 0:w.search)}):(0,Gn.jsx)("h2",{className:"text-left",children:(0,Vn.__)("No results found.","extendify-sdk")}):t.length?(0,Gn.jsxs)(Gn.Fragment,{children:[(0,Gn.jsx)("ul",{className:"flex-grow gap-6 grid xl:grid-cols-2 2xl:grid-cols-3 pb-32 m-0",children:t.map((function(e,t){var r,o,a,u,s,c,l;return(0,Gn.jsxs)("li",{className:"flex flex-col justify-between group overflow-hidden max-w-lg",children:[(0,Gn.jsx)("div",{className:"flex justify-items-center flex-grow h-80 border-gray-200 bg-white border border-b-0 group-hover:border-wp-theme-500 transition duration-150 cursor-pointer",onClick:function(){return n(e)},children:(0,Gn.jsx)("img",{role:"button",className:"max-w-full block m-auto object-cover",onLoad:function(){return m([].concat(vr(v),[t]))},src:null!==(r=null==e||null===(o=e.fields)||void 0===o||null===(a=o.screenshot[0])||void 0===a||null===(u=a.thumbnails)||void 0===u||null===(s=u.large)||void 0===s?void 0:s.url)&&void 0!==r?r:null==e||null===(c=e.fields)||void 0===c||null===(l=c.screenshot[0])||void 0===l?void 0:l.url})}),(0,Gn.jsx)("span",{role:"img","aria-hidden":"true",className:"h-px w-full bg-gray-200 border group-hover:bg-transparent border-t-0 border-b-0 border-gray-200 group-hover:border-wp-theme-500 transition duration-150"}),(0,Gn.jsxs)("div",{className:"bg-transparent text-left bg-white flex items-center justify-between p-4 border border-t-0 border-transparent group-hover:border-wp-theme-500 transition duration-150 cursor-pointer",role:"button",onClick:function(){return n(e)},children:[(0,Gn.jsxs)("div",{children:[(0,Gn.jsx)("h4",{className:"m-0 font-bold",children:e.fields.title}),(0,Gn.jsx)("p",{className:"m-0",children:e.fields.categories.filter((function(e){return"default"!==e.toLowerCase()})).join(", ")})]}),(0,Gn.jsx)(pr.Button,{isSecondary:!0,tabIndex:Object.keys(i).length?"-1":"0",className:"sm:opacity-0 group-hover:opacity-100 transition duration-150 focus:opacity-100",onClick:function(t){t.stopPropagation(),n(e)},children:(0,Vn.__)("View","extendify-sdk")})]})]},e.id)}))}),x.getState().nextPage&&!!v.length&&v.length===t.length&&(0,Gn.jsxs)(Gn.Fragment,{children:[(0,Gn.jsx)("div",{className:"-translate-y-full flex flex-col h-80 items-end justify-end my-2 relative transform z-0 text",ref:y,style:{zIndex:-1}}),(0,Gn.jsx)("div",{className:"my-4",children:(0,Gn.jsx)(pr.Spinner,{})})]})]}):(0,Gn.jsx)("div",{className:"flex items-center justify-center w-full sm:mt-64",children:(0,Gn.jsx)(pr.Spinner,{})})}var wr=function(){return R.get("plugins")},Sr=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=new FormData;return t.append("plugins",JSON.stringify(e)),R.post("plugins",t,{headers:{"Content-Type":"multipart/form-data"}})},kr=function(){return R.get("active-plugins")};function jr(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function Cr(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){jr(i,r,o,a,u,"next",e)}function u(e){jr(i,r,o,a,u,"throw",e)}a(void 0)}))}}function Er(e){return Or.apply(this,arguments)}function Or(){return(Or=Cr(k().mark((function e(t){var n,r,o,i;return k().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((r=null!==(n=(0,Kn.get)(t,"fields.required_plugins"))&&void 0!==n?n:[]).length){e.next=3;break}return e.abrupt("return",!1);case 3:return e.t0=Object,e.next=6,wr();case 6:return e.t1=e.sent,o=e.t0.keys.call(e.t0,e.t1),i=!!r.length&&r.filter((function(e){return!o.some((function(t){return t.includes(e)}))})),e.abrupt("return",i.length);case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ir(e){return Pr.apply(this,arguments)}function Pr(){return(Pr=Cr(k().mark((function e(t){var n,r,o,i;return k().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((r=null!==(n=(0,Kn.get)(t,"fields.required_plugins"))&&void 0!==n?n:[]).length){e.next=3;break}return e.abrupt("return",!1);case 3:return e.t0=Object,e.next=6,kr();case 6:if(e.t1=e.sent,o=e.t0.values.call(e.t0,e.t1),!(i=!!r.length&&r.filter((function(e){return!o.some((function(t){return t.includes(e)}))})))){e.next=14;break}return e.next=12,Er(t);case 12:if(!e.sent){e.next=14;break}return e.abrupt("return",!1);case 14:return e.abrupt("return",i.length);case 15:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Tr=s(T((function(e){return{wantedTemplate:{},importOnLoad:!1,setWanted:function(t){return e({wantedTemplate:t})},removeWanted:function(){return e({wantedTemplate:{}})}}}),{name:"extendify-wanted-template"}));function Nr(e){var t=e.msg;return(0,Gn.jsxs)(pr.Modal,{style:{maxWidth:"500px"},title:(0,Vn.__)("Error installing plugins","extendify-sdk"),isDismissible:!1,children:[(0,Vn.__)("You have encountered an error that we cannot recover from. Please try again.","extendify-sdk"),(0,Gn.jsx)("br",{}),(0,Gn.jsx)(pr.Notice,{isDismissible:!1,status:"error",children:t}),(0,Gn.jsx)(pr.Button,{isPrimary:!0,onClick:function(){return(0,r.render)((0,Gn.jsx)(Vr,{}),document.getElementById("extendify-root"))},children:(0,Vn.__)("Go back","extendify-sdk")})]})}const Rr=wp.data;function Ar(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null==n)return;var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return _r(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 _r(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 _r(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 Lr(){var e=Ar((0,r.useState)(!1),2),t=e[0],n=e[1],o=function(){location.reload()};return(0,(0,Rr.select)("core/editor").isEditedPostDirty)()?(0,Gn.jsxs)(pr.Modal,{title:(0,Vn.__)("Reload required","extendify-sdk"),isDismissible:!1,children:[(0,Gn.jsx)("p",{style:{maxWidth:"400px"},children:(0,Vn.__)("Just one more thing! We need to reload the page to continue.","extendify-sdk")}),(0,Gn.jsxs)(pr.ButtonGroup,{children:[(0,Gn.jsx)(pr.Button,{isPrimary:!0,onClick:o,disabled:t,children:(0,Vn.__)("Reload page","extendify-sdk")}),(0,Gn.jsx)(pr.Button,{isSecondary:!0,onClick:function(){n(!0),(0,Rr.dispatch)("core/editor").savePost(),n(!1)},isBusy:t,style:{margin:"0 4px"},children:(0,Vn.__)("Save changes","extendify-sdk")})]})]}):(o(),null)}function Dr(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null==n)return;var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Fr(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 Fr(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 Fr(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 Mr(){var e,t=Dr((0,r.useState)(""),2),n=t[0],o=t[1],i=Tr((function(e){return e.wantedTemplate}));return Sr(null==i||null===(e=i.fields)||void 0===e?void 0:e.required_plugins).then((function(){Tr.setState({importOnLoad:!0}),(0,r.render)((0,Gn.jsx)(Lr,{}),document.getElementById("extendify-root"))})).catch((function(e){var t=e.message;o(t)})),n?(0,Gn.jsx)(Nr,{msg:n}):(0,Gn.jsx)(pr.Modal,{title:(0,Vn.__)("Installing plugins","extendify-sdk"),isDismissible:!1,children:(0,Gn.jsx)(pr.Button,{style:{width:"100%"},disabled:!0,isPrimary:!0,isBusy:!0,onClick:function(){},children:(0,Vn.__)("Installing...","extendify-sdk")})})}var Br=function(e){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"broken-event",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"open";window.dispatchEvent(new CustomEvent("extendify-sdk::".concat(t,"-library"),{detail:e,bubbles:!0})),H.setState({entryPoint:e})}(e,"open")};function Ur(e){switch(e){case"editorplus":return"Editor Plus";case"ml-slider":return"MetaSlider"}return e}function Vr(e){var t,n,o,i,a,u,s,c=Tr((function(e){return e.wantedTemplate})),l=function(){e.forceOpen||(0,r.render)((0,Gn.jsx)(No,{show:!0}),document.getElementById("extendify-root"))},f=(null==c||null===(t=c.fields)||void 0===t?void 0:t.required_plugins)||[];return(0,Gn.jsxs)(pr.Modal,{title:null!==(n=e.title)&&void 0!==n?n:(0,Vn.__)("Install required plugins","extendify-sdk"),closeButtonLabel:(0,Vn.__)("No thanks, take me back","extendify-sdk"),onRequestClose:l,children:[(0,Gn.jsx)("p",{style:{maxWidth:"400px"},children:null!==(o=e.message)&&void 0!==o?o:(0,Vn.__)((0,Vn.sprintf)("There is just one more step. This %s requires the following to be automatically installed and activated:",null!==(i=null==c||null===(a=c.fields)||void 0===a?void 0:a.type)&&void 0!==i?i:"template"),"extendify-sdk")}),(null===(u=e.message)||void 0===u?void 0:u.length)>0||(0,Gn.jsx)("ul",{children:f.map((function(e){return(0,Gn.jsx)("li",{children:Ur(e)},e)}))}),(0,Gn.jsxs)(pr.ButtonGroup,{children:[(0,Gn.jsx)(pr.Button,{isPrimary:!0,onClick:function(){return(0,r.render)((0,Gn.jsx)(Mr,{}),document.getElementById("extendify-root"))},children:null!==(s=e.buttonLabel)&&void 0!==s?s:(0,Vn.__)("Install Plugins","extendify-sdk")}),e.forceOpen||(0,Gn.jsx)(pr.Button,{isTertiary:!0,onClick:l,style:{boxShadow:"none",margin:"0 4px"},children:(0,Vn.__)("No thanks, take me back","extendify-sdk")})]})]})}function Gr(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function Hr(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Gr(i,r,o,a,u,"next",e)}function u(e){Gr(i,r,o,a,u,"throw",e)}a(void 0)}))}}var qr=function(){var e=Hr(k().mark((function e(t){return k().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Er(t);case 2:return e.t0=!e.sent,e.t1=function(){return Hr(k().mark((function e(){return k().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})))()},e.t2=function(){return Hr(k().mark((function e(){return k().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(){(0,r.render)((0,Gn.jsx)(Vr,{}),document.getElementById("extendify-root"))})));case 1:case"end":return e.stop()}}),e)})))()},e.abrupt("return",{id:"hasRequiredPlugins",pass:e.t0,allow:e.t1,deny:e.t2});case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();function Kr(e){var t=e.msg;return(0,Gn.jsxs)(pr.Modal,{style:{maxWidth:"500px"},title:(0,Vn.__)("Error Activating plugins","extendify-sdk"),isDismissible:!1,children:[(0,Vn.__)("You have encountered an error that we cannot recover from. Please try again.","extendify-sdk"),(0,Gn.jsx)("br",{}),(0,Gn.jsx)(pr.Notice,{isDismissible:!1,status:"error",children:t}),(0,Gn.jsx)(pr.Button,{isPrimary:!0,onClick:function(){(0,r.render)((0,Gn.jsx)(Jr,{}),document.getElementById("extendify-root"))},children:(0,Vn.__)("Go back","extendify-sdk")})]})}function Wr(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function zr(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Wr(i,r,o,a,u,"next",e)}function u(e){Wr(i,r,o,a,u,"throw",e)}a(void 0)}))}}function $r(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null==n)return;var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Qr(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 Qr(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 Qr(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 Yr(){var e,t=$r((0,r.useState)(""),2),n=t[0],o=t[1],i=Tr((function(e){return e.wantedTemplate}));return Sr(null==i||null===(e=i.fields)||void 0===e?void 0:e.required_plugins).then((function(){Tr.setState({importOnLoad:!0})})).then(zr(k().mark((function e(){return k().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,new Promise((function(e){return setTimeout(e,1e3)}));case 2:(0,r.render)((0,Gn.jsx)(Lr,{}),document.getElementById("extendify-root"));case 3:case"end":return e.stop()}}),e)})))).catch((function(e){var t=e.response;o(t.data.message)})),n?(0,Gn.jsx)(Kr,{msg:n}):(0,Gn.jsx)(pr.Modal,{title:(0,Vn.__)("Activating plugins","extendify-sdk"),isDismissible:!1,children:(0,Gn.jsx)(pr.Button,{style:{width:"100%"},disabled:!0,isPrimary:!0,isBusy:!0,onClick:function(){},children:(0,Vn.__)("Activating...","extendify-sdk")})})}function Jr(e){var t,n,o,i,a=Tr((function(e){return e.wantedTemplate})),u=function(){return(0,r.render)((0,Gn.jsx)(No,{show:!0}),document.getElementById("extendify-root"))},s=(null==a||null===(t=a.fields)||void 0===t?void 0:t.required_plugins)||[];return(0,Gn.jsxs)(pr.Modal,{title:(0,Vn.__)("Activate required plugins","extendify-sdk"),closeButtonLabel:(0,Vn.__)("No thanks, return to library","extendify-sdk"),onRequestClose:u,children:[(0,Gn.jsx)("p",{style:{maxWidth:"400px"},children:null!==(n=e.message)&&void 0!==n?n:(0,Vn.__)((0,Vn.sprintf)("There is just one more step. This %s requires the following plugins to be installed and activated:",null!==(o=null==a||null===(i=a.fields)||void 0===i?void 0:i.type)&&void 0!==o?o:"template"),"extendify-sdk")}),(0,Gn.jsx)("ul",{children:s.map((function(e){return(0,Gn.jsx)("li",{children:Ur(e)},e)}))}),(0,Gn.jsxs)(pr.ButtonGroup,{children:[(0,Gn.jsx)(pr.Button,{isPrimary:!0,onClick:function(){return(0,r.render)((0,Gn.jsx)(Yr,{}),document.getElementById("extendify-root"))},children:(0,Vn.__)("Activate Plugins","extendify-sdk")}),e.showClose&&(0,Gn.jsx)(pr.Button,{isTertiary:!0,onClick:u,style:{boxShadow:"none",margin:"0 4px"},children:(0,Vn.__)("No thanks, return to library","extendify-sdk")})]})]})}function Xr(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function Zr(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Xr(i,r,o,a,u,"next",e)}function u(e){Xr(i,r,o,a,u,"throw",e)}a(void 0)}))}}var eo=function(){var e=Zr(k().mark((function e(t){return k().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ir(t);case 2:return e.t0=!e.sent,e.t1=function(){return Zr(k().mark((function e(){return k().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})))()},e.t2=function(){return Zr(k().mark((function e(){return k().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(){(0,r.render)((0,Gn.jsx)(Jr,{showClose:!0}),document.getElementById("extendify-root"))})));case 1:case"end":return e.stop()}}),e)})))()},e.abrupt("return",{id:"hasPluginsActivated",pass:e.t0,allow:e.t1,deny:e.t2});case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();function to(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return no(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 no(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}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 i,a=!0,u=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function no(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 ro(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function oo(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){ro(i,r,o,a,u,"next",e)}function u(e){ro(i,r,o,a,u,"throw",e)}a(void 0)}))}}function io(e){return function(){return new ao(e.apply(this,arguments))}}function ao(e){var t,n;function r(t,n){try{var i=e[t](n),a=i.value,u=a instanceof uo;Promise.resolve(u?a.wrapped:a).then((function(e){u?r("return"===t?"return":"next",e):o(i.done?"return":"normal",e)}),(function(e){r("throw",e)}))}catch(e){o("throw",e)}}function o(e,o){switch(e){case"return":t.resolve({value:o,done:!0});break;case"throw":t.reject(o);break;default:t.resolve({value:o,done:!1})}(t=t.next)?r(t.key,t.arg):n=null}this._invoke=function(e,o){return new Promise((function(i,a){var u={key:e,arg:o,resolve:i,reject:a,next:null};n?n=n.next=u:(t=n=u,r(e,o))}))},"function"!=typeof e.return&&(this.return=void 0)}function uo(e){this.wrapped=e}ao.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},ao.prototype.next=function(e){return this._invoke("next",e)},ao.prototype.throw=function(e){return this._invoke("throw",e)},ao.prototype.return=function(e){return this._invoke("return",e)};function so(){return(so=oo(k().mark((function e(t){var n;return k().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=co(t);case 1:return e.next=4,n.next();case 4:if(!e.sent.done){e.next=7;break}return e.abrupt("break",9);case 7:e.next=1;break;case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function co(e){return lo.apply(this,arguments)}function lo(){return(lo=io(k().mark((function e(t){var n,r,o;return k().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=to(t),e.prev=1,n.s();case 3:if((r=n.n()).done){e.next=9;break}return o=r.value,e.next=7,o();case 7:e.next=3;break;case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(1),n.e(e.t0);case 14:return e.prev=14,n.f(),e.finish(14);case 17:case"end":return e.stop()}}),e,null,[[1,11,14,17]])})))).apply(this,arguments)}function fo(e,t){return(0,(0,Rr.dispatch)("core/block-editor").insertBlocks)(e).then((function(){window.dispatchEvent(new CustomEvent("extendify-sdk::template-inserted",{detail:{template:t},bubbles:!0}))}))}function po(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null==n)return;var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}(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 mo=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return{hasRequiredPlugins:qr,hasPluginsActivated:eo,stack:[],check:function(t){var n=this;return oo(k().mark((function r(){var o,i,a;return k().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:o=to(e),r.prev=1,a=k().mark((function e(){var r,o;return k().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=i.value,e.next=3,n["".concat(r)](t);case 3:o=e.sent,setTimeout((function(){n.stack.push(o.pass?o.allow:o.deny)}),0);case 5:case"end":return e.stop()}}),e)})),o.s();case 4:if((i=o.n()).done){r.next=8;break}return r.delegateYield(a(),"t0",6);case 6:r.next=4;break;case 8:r.next=13;break;case 10:r.prev=10,r.t1=r.catch(1),o.e(r.t1);case 13:return r.prev=13,o.f(),r.finish(13);case 16:case"end":return r.stop()}}),r,null,[[1,10,13,16]])})))()},reset:function(){this.stack=[]}}}(["hasRequiredPlugins","hasPluginsActivated"]);function ho(e){var t=e.template,n=x((function(e){return e.activeTemplateBlocks})),o=H((function(e){return e.canImport})),i=H((function(e){return e.apiKey})),a=w((function(e){return e.setOpen})),u=po((0,r.useState)(!1),2),s=u[0],c=u[1],l=po((0,r.useState)(!1),2),f=l[0],d=l[1],p=Tr((function(e){return e.setWanted})),v=function(){(function(e){return so.apply(this,arguments)})(mo.stack).then((function(){setTimeout((function(){fo(n,t).then((function(){return a(!1)}))}),100)}))};(0,r.useEffect)((function(){return mo.check(t).then((function(){return d(!0)})),function(){return mo.reset()&&d(!1)}}),[t]);return f&&Object.keys(n).length?i||o()?s?(0,Gn.jsx)("button",{type:"button",disabled:!0,className:"components-button is-secondary text-lg sm:text-2xl h-auto py-1.5 px-3 sm:py-2.5 sm:px-5",onClick:function(){},children:(0,Vn.__)("Importing...","extendify-sdk")}):(0,Gn.jsx)("button",{type:"button",className:"components-button is-primary text-lg sm:text-2xl h-auto py-1.5 px-3 sm:py-2.5 sm:px-5",onClick:function(){return c(!0),p(t),void v()},children:(0,Vn.sprintf)((0,Vn.__)("Add %s","extendify-sdk"),t.fields.type)}):(0,Gn.jsx)("a",{className:"button-extendify-main text-lg sm:text-2xl py-1.5 px-3 sm:py-2.5 sm:px-5",target:"_blank",href:"https://extendify.com",rel:"noreferrer",children:(0,Vn.__)("Sign up now","extendify-sdk")}):""}function yo(e){var t,n,r,o,i,a,u,s=e.template,c=s.fields.categories,l=H((function(e){return e.apiKey}));return(0,Gn.jsxs)("div",{className:"flex flex-col min-h-screen bg-white sm:min-h-0 items-start overflow-y-auto h-full sm:pr-8 lg:pl-px lg:-ml-px",children:[(0,Gn.jsxs)("div",{className:"flex flex-col lg:flex-row items-start justify-start lg:items-center lg:justify-between w-full max-w-screen-xl",children:[(0,Gn.jsxs)("div",{className:"text-left m-0 sm:mb-6 p-6 sm:p-0",children:[(0,Gn.jsx)("h1",{className:"leading-tight text-left mb-2.5 sm:text-3xl font-normal",children:s.fields.title}),(0,Gn.jsx)(pr.ExternalLink,{href:s.fields.url,children:(0,Vn.__)("Demo","extendify-sdk")})]}),(0,Gn.jsx)("div",{className:$n()({"inline-flex absolute sm:static sm:top-auto right-0 m-6 sm:m-0 sm:my-6 space-x-3":!0,"top-16 mt-5":!l.length,"top-0":l.length>0}),children:(0,Gn.jsx)(ho,{template:s})})]}),(0,Gn.jsx)("div",{className:"max-w-screen-xl sm:w-full sm:m-0 sm:mb-12 m-6 border border-gray-300 m-46",children:(0,Gn.jsx)("img",{className:"max-w-full w-full",src:null!==(t=null==s||null===(n=s.fields)||void 0===n||null===(r=n.screenshot[0])||void 0===r||null===(o=r.thumbnails)||void 0===o||null===(i=o.full)||void 0===i?void 0:i.url)&&void 0!==t?t:null==s||null===(a=s.fields)||void 0===a||null===(u=a.screenshot[0])||void 0===u?void 0:u.url})}),(0,Gn.jsxs)("div",{className:"text-xs text-left p-6 w-full block sm:hidden",children:[(0,Gn.jsx)("h3",{className:"m-0 mb-6",children:(0,Vn.__)("Categories","extendify-sdk")}),(0,Gn.jsx)("ul",{className:"text-sm",children:c.map((function(e){return(0,Gn.jsx)("li",{className:"inline-block mr-2 px-4 py-2 bg-gray-100",children:e},e)}))})]})]})}function bo(){return 0===H((function(e){return e.apiKey})).length?(0,Gn.jsx)("button",{className:"components-button",onClick:function(){return w.setState({currentPage:"login"})},children:(0,Vn.__)("Log into account","extendify-sdk")}):(0,Gn.jsx)("button",{className:"components-button",onClick:function(){return H.setState({apiKey:""})},children:(0,Vn.__)("Log out","extendify-sdk")})}function go(e){var t=e.children;return(0,Gn.jsxs)(Gn.Fragment,{children:[(0,Gn.jsxs)("aside",{className:"flex-shrink-0 sm:pl-12 py-0 sm:py-6 relative",children:[(0,Gn.jsx)("div",{className:"lg:w-72 sticky flex flex-col h-full",children:t[0]}),(0,Gn.jsxs)("div",{className:"hidden sm:flex flex-col absolute bottom-0 bg-white p-4 w-72 text-left space-y-4",children:[(0,Gn.jsx)("div",{children:(0,Gn.jsx)(pr.Button,{isSecondary:!0,target:"_blank",href:"https://extendify.com/feedback",children:(0,Vn.__)("Send us your feedback","extendify-sdk")})}),(0,Gn.jsx)("div",{className:"border-t border-gray-300",children:(0,Gn.jsx)(bo,{})})]})]}),(0,Gn.jsx)("main",{id:"extendify-templates",tabIndex:"0",className:"w-full smpl-12 sm:pt-6 h-full",children:t[1]})]})}function xo(){var e=x((function(e){return e.updateSearchParams})),t=x((function(e){return e.searchParams})),n=function(t){return e({type:t})};return(0,Gn.jsxs)("div",{className:"text-left w-full bg-white px-6 sm:px-0 pb-4 sm:pb-6 mt-px border-b sm:border-0",children:[(0,Gn.jsx)("h4",{className:"sr-only",children:(0,Vn.__)("Type select","extendify-sdk")}),(0,Gn.jsxs)("button",{type:"button",className:$n()({"cursor-pointer p-3.5 space-x-2 inline-flex items-center border border-black button-focus":!0,"bg-gray-900 text-white":"pattern"===t.type,"bg-transparent text-black":"pattern"!==t.type}),onClick:function(){return n("pattern")},children:[(0,Gn.jsx)("svg",{width:"17",height:"13",viewBox:"0 0 17 13",className:"fill-current",xmlns:"http://www.w3.org/2000/svg",children:(0,Gn.jsx)("path",{d:"M1 13H16C16.55 13 17 12.55 17 12V8C17 7.45 16.55 7 16 7H1C0.45 7 0 7.45 0 8V12C0 12.55 0.45 13 1 13ZM0 1V5C0 5.55 0.45 6 1 6H16C16.55 6 17 5.55 17 5V1C17 0.45 16.55 0 16 0H1C0.45 0 0 0.45 0 1Z"})}),(0,Gn.jsx)("span",{className:"",children:(0,Vn.__)("Patterns","extendify-sdk")})]}),(0,Gn.jsxs)("button",{type:"button",className:$n()({"cursor-pointer p-3.5 px-4 space-x-2 inline-flex items-center border border-black focus:ring-2 focus:ring-wp-theme-500 ring-offset-1 outline-none -ml-px":!0,"bg-gray-900 text-white":"template"===t.type,"bg-transparent text-black":"template"!==t.type}),onClick:function(){return n("template")},children:[(0,Gn.jsx)("svg",{width:"17",height:"13",viewBox:"0 0 17 13",className:"fill-current",xmlns:"http://www.w3.org/2000/svg",children:(0,Gn.jsx)("path",{d:"M7 13H10C10.55 13 11 12.55 11 12V8C11 7.45 10.55 7 10 7H7C6.45 7 6 7.45 6 8V12C6 12.55 6.45 13 7 13ZM1 13H4C4.55 13 5 12.55 5 12V1C5 0.45 4.55 0 4 0H1C0.45 0 0 0.45 0 1V12C0 12.55 0.45 13 1 13ZM13 13H16C16.55 13 17 12.55 17 12V8C17 7.45 16.55 7 16 7H13C12.45 7 12 7.45 12 8V12C12 12.55 12.45 13 13 13ZM6 1V5C6 5.55 6.45 6 7 6H16C16.55 6 17 5.55 17 5V1C17 0.45 16.55 0 16 0H7C6.45 0 6 0.45 6 1Z"})}),(0,Gn.jsx)("span",{className:"",children:(0,Vn.__)("Page templates","extendify-sdk")})]})]})}function wo(e){var t=e.template,n=x((function(e){return e.setActive})),o=(0,r.useRef)(null),i=t.fields,a=i.categories,u=i.required_plugins,s=H((function(e){return e.apiKey}));return(0,r.useEffect)((function(){o.current.focus()}),[]),(0,Gn.jsxs)("div",{className:"flex flex-col items-start justify-start",children:[!s.length&&(0,Gn.jsxs)("div",{className:"h-full flex sm:hidden w-full p-4 justify-between border items-center border-gray-300 bg-extendify-lightest",children:[(0,Gn.jsx)("a",{className:"button-extendify-main",target:"_blank",href:"https://extendify.com",rel:"noreferrer",children:(0,Vn.__)("Sign up today to get unlimited beta access","extendify-sdk")}),(0,Gn.jsx)("button",{className:"components-button",onClick:function(){return w.setState({currentPage:"login"})},children:(0,Vn.__)("Log in","extendify-sdk")})]}),(0,Gn.jsx)("div",{className:"p-6 sm:p-0",children:(0,Gn.jsxs)("button",{ref:o,type:"button",className:"cursor-pointer text-black bg-transparent font-medium flex items-center p-3 transform -translate-x-3 button-focus",onClick:function(){return n({})},children:[(0,Gn.jsx)("svg",{className:"fill-current",width:"8",height:"12",viewBox:"0 0 8 12",xmlns:"http://www.w3.org/2000/svg",children:(0,Gn.jsx)("path",{d:"M6.70998 9.88047L2.82998 6.00047L6.70998 2.12047C7.09998 1.73047 7.09998 1.10047 6.70998 0.710469C6.31998 0.320469 5.68998 0.320469 5.29998 0.710469L0.70998 5.30047C0.31998 5.69047 0.31998 6.32047 0.70998 6.71047L5.29998 11.3005C5.68998 11.6905 6.31998 11.6905 6.70998 11.3005C7.08998 10.9105 7.09998 10.2705 6.70998 9.88047Z"})}),(0,Gn.jsx)("span",{className:"ml-4",children:(0,Vn.__)("Go back","extendify-sdk")})]})}),(0,Gn.jsxs)("div",{className:"text-xs text-left pt-20 divide-y w-full hidden sm:block",children:[(0,Gn.jsxs)("div",{className:"w-full",children:[(0,Gn.jsx)("h3",{className:"m-0 mb-6",children:(0,Vn.__)("Categories","extendify-sdk")}),(0,Gn.jsx)("ul",{className:"text-sm",children:a.map((function(e){return(0,Gn.jsx)("li",{className:"inline-block mr-2 px-4 py-2 bg-gray-100",children:e},e)}))})]}),(0,Gn.jsxs)("div",{className:"pt-4 w-full",children:[(0,Gn.jsx)("h3",{className:"m-0 mb-6",children:(0,Vn.__)("Required Plugins","extendify-sdk")}),(0,Gn.jsx)("ul",{className:"text-sm",children:u.map((function(e){return(0,Gn.jsx)("li",{className:"inline-block mr-2 px-4 py-2 bg-extendify-light",children:Ur(e)},e)}))})]})]})]})}function So(e){var t=e.className,n=e.initialFocus,r=x((function(e){return e.templates})),o=x((function(e){return e.activeTemplate}));return(0,Gn.jsxs)("div",{className:t,children:[(0,Gn.jsx)("a",{href:"#extendify-templates",className:"sr-only focus:not-sr-only focus:text-blue-500",children:(0,Vn.__)("Skip to content","extendify-sdk")}),(0,Gn.jsxs)("div",{className:"sm:flex sm:space-x-12 relative bg-white mx-auto max-w-screen-4xl h-full",children:[!!Object.keys(o).length&&(0,Gn.jsx)("div",{className:"absolute bg-white sm:flex inset-0 z-50 sm:space-x-12",children:(0,Gn.jsxs)(go,{children:[(0,Gn.jsx)(wo,{template:o}),(0,Gn.jsx)(yo,{template:o})]})}),(0,Gn.jsxs)(go,{children:[(0,Gn.jsx)(Zn,{initialFocus:n}),(0,Gn.jsxs)(Gn.Fragment,{children:[(0,Gn.jsx)(xo,{}),(0,Gn.jsx)("div",{className:"relative h-full z-30 bg-white",children:(0,Gn.jsx)("div",{className:"absolute z-20 inset-0 lg:static h-screen lg:h-full overflow-y-auto pt-4 sm:pt-0 px-6 sm:pl-0 sm:pr-8",children:(0,Gn.jsx)(xr,{templates:r})})})]})]})]})]})}function ko(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function jo(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null==n)return;var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Co(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 Co(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 Co(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 Eo(){var e=jo((0,r.useState)(H.getState().apiKey),2),t=e[0],n=e[1],o=jo((0,r.useState)(H.getState().email),2),i=o[0],a=o[1],u=jo((0,r.useState)(""),2),s=u[0],c=u[1],l=jo((0,r.useState)("info"),2),f=l[0],d=l[1],p=jo((0,r.useState)(""),2),v=p[0],m=p[1];(0,r.useEffect)((function(){return function(){return d("info")}}),[]);var h=function(){var e,n=(e=k().mark((function e(n){var r,o,a,u,s,l;return k().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n.preventDefault(),c(""),r=i.length?i:v,e.next=5,D(r,t);case 5:if(o=e.sent,a=o.token,u=o.error,s=o.exception,void 0===(l=o.message)){e.next=13;break}return d("error"),e.abrupt("return",c(l.length?l:"Error: Are you interacting with the wrong server?"));case 13:if(!u&&!s){e.next=16;break}return d("error"),e.abrupt("return",c(u.length?u:s));case 16:if(a&&"string"==typeof a){e.next=19;break}return d("error"),e.abrupt("return",c((0,Vn.__)("Something went wrong","extendify-sdk")));case 19:return d("success"),c("Success!"),e.next=23,new Promise((function(e){return setTimeout(e,1500)}));case 23:H.setState({apiKey:a}),w.setState({currentPage:"content"});case 25:case"end":return e.stop()}}),e)})),function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){ko(i,r,o,a,u,"next",e)}function u(e){ko(i,r,o,a,u,"throw",e)}a(void 0)}))});return function(e){return n.apply(this,arguments)}}();return(0,r.useEffect)((function(){i||L("user_email").then((function(e){return m(e)}))}),[i]),(0,Gn.jsxs)("section",{className:"w-96 text-left md:-mt-32",children:[(0,Gn.jsx)("h1",{className:"border-b border-gray-900 mb-12 pb-4",children:(0,Vn.__)("Welcome","extendify-sdk")}),s&&(0,Gn.jsx)("div",{className:$n()({"border-b pb-6 mb-6 -mt-6":!0,"border-gray-900 text-gray-900":"info"===f,"border-wp-alert-red text-wp-alert-red":"error"===f,"border-extendify-main text-extendify-main":"success"===f}),children:s}),(0,Gn.jsxs)("form",{onSubmit:h,className:" space-y-6",children:[(0,Gn.jsxs)("div",{className:"flex items-center",children:[(0,Gn.jsx)("label",{htmlFor:"extendifysdk-login-email",className:"w-32 font-bold",children:(0,Vn.__)("Email:","extendify-sdk")}),(0,Gn.jsx)("input",{id:"extendifysdk-login-email",name:"extendifysdk-login-email",type:"email",className:"border px-2 w-full",placeholder:"Email",value:i.length?i:v,onChange:function(e){return a(e.target.value)}})]}),(0,Gn.jsxs)("div",{className:"flex items-center",children:[(0,Gn.jsx)("label",{htmlFor:"extendifysdk-login-license",className:"w-32 font-bold",children:(0,Vn.__)("License:","extendify-sdk")}),(0,Gn.jsx)("input",{id:"extendifysdk-login-license",name:"extendifysdk-login-email",type:"text",className:"border px-2 w-full",placeholder:"License key",value:t,onChange:function(e){return n(e.target.value)}})]}),(0,Gn.jsx)("div",{className:"flex justify-end",children:(0,Gn.jsx)("button",{type:"submit",className:"button-extendify-main p-3 px-4",children:(0,Vn.__)("Sign in","extendify-sdk")})})]})]})}function Oo(e){var t=e.className;return(0,Gn.jsxs)("div",{className:t,children:[(0,Gn.jsx)("a",{href:"#extendify-templates",className:"sr-only focus:not-sr-only focus:text-blue-500",children:(0,Vn.__)("Skip to content","extendify-sdk")}),(0,Gn.jsx)("div",{className:"flex sm:space-x-12 relative mx-auto max-w-screen-4xl h-full",children:(0,Gn.jsxs)("div",{className:"absolute flex inset-0 items-center justify-center z-20 sm:space-x-12",children:[(0,Gn.jsx)("div",{className:"pl-12 py-6 absolute top-0 left-0",children:(0,Gn.jsxs)("button",{type:"button",className:"cursor-pointer text-black bg-transparent font-medium flex items-center p-3 transform -translate-x-3 button-focus",onClick:function(){return w.setState({currentPage:"content"})},children:[(0,Gn.jsx)("svg",{className:"fill-current",width:"8",height:"12",viewBox:"0 0 8 12",xmlns:"http://www.w3.org/2000/svg",children:(0,Gn.jsx)("path",{d:"M6.70998 9.88047L2.82998 6.00047L6.70998 2.12047C7.09998 1.73047 7.09998 1.10047 6.70998 0.710469C6.31998 0.320469 5.68998 0.320469 5.29998 0.710469L0.70998 5.30047C0.31998 5.69047 0.31998 6.32047 0.70998 6.71047L5.29998 11.3005C5.68998 11.6905 6.31998 11.6905 6.70998 11.3005C7.08998 10.9105 7.09998 10.2705 6.70998 9.88047Z"})}),(0,Gn.jsx)("span",{className:"ml-4",children:(0,Vn.__)("Go back","extendify-sdk")})]})}),(0,Gn.jsx)("div",{className:"flex justify-center",children:(0,Gn.jsx)(Eo,{})})]})})]})}function Io(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null==n)return;var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Po(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 Po(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 Po(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 To(){var e=Io((0,r.useState)(!1),2),t=e[0],n=e[1],o=(0,r.useRef)(null),i=w((function(e){return e.open})),a=w((function(e){return e.setOpen})),u=w((function(e){return e.currentPage}));return(0,Gn.jsx)(Un.Root,{show:i,as:r.Fragment,children:(0,Gn.jsx)(it,{as:"div",static:!0,className:"extendify-sdk",initialFocus:o,onClose:function(){},children:(0,Gn.jsx)("div",{className:"h-screen w-screen sm:h-auto sm:w-auto fixed z-high inset-0 overflow-y-auto",children:(0,Gn.jsxs)("div",{className:"flex items-end justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0",children:[(0,Gn.jsx)(Un.Child,{as:r.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",children:(0,Gn.jsx)(it.Overlay,{className:"fixed inset-0 bg-black bg-opacity-30 transition-opacity"})}),(0,Gn.jsx)(Un.Child,{as:r.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0 translate-y-4 sm:translate-y-5",enterTo:"opacity-100 translate-y-0",children:(0,Gn.jsx)("div",{className:$n()({"fixed lg:absolute inset-0 lg:overflow-hidden transform transition-all":!0,"lg:pt-5 lg:p-10":!t}),children:(0,Gn.jsxs)("div",{className:$n()({"bg-white h-full flex flex-col items-center relative shadow-xl":!0,"max-w-screen-4xl mx-auto":!t}),children:[(0,Gn.jsx)(Hn,{className:"w-full h-16 border-solid border-0 border-b border-gray-300 flex-shrink-0",toggleFullScreen:function(){return n(!t)},initialFocus:o,hideLibrary:function(){return a(!1)}}),"content"===u&&(0,Gn.jsx)(So,{className:"w-full flex-grow overflow-hidden"}),"login"===u&&(0,Gn.jsx)(Oo,{className:"w-full flex-grow overflow-hidden bg-extendify-light"})]})})})]})})})})}function No(e){var t=e.show,n=void 0!==t&&t,o=w((function(e){return e.setOpen})),i=(0,r.useCallback)((function(){return o(!0)}),[o]),a=(0,r.useCallback)((function(){o(!1)}),[o]);return(0,r.useEffect)((function(){n&&o(!0)}),[n,o]),(0,r.useEffect)((function(){return window.localStorage.getItem("etfy_library__key")&&H.setState({apiKey:"any-key-will-work-during-beta"}),function(){return window.localStorage.removeItem("etfy_library__key")}}),[]),(0,r.useEffect)((function(){return window.addEventListener("extendify-sdk::open-library",i),window.addEventListener("extendify-sdk::close-library",a),function(){window.removeEventListener("extendify-sdk::open-library",i),window.removeEventListener("extendify-sdk::close-library",a)}}),[a,i]),(0,Gn.jsx)(To,{})}const Ro=wp.plugins,Ao=wp.editPost;var _o=function(e){var t,n;Br(null===(t=e.target.closest("[data-extendify-identifier]"))||void 0===t||null===(n=t.dataset)||void 0===n?void 0:n.extendifyIdentifier)},Lo=(0,Gn.jsx)("div",{id:"extendify-templates-inserter",children:(0,Gn.jsxs)("button",{style:"background:#D9F1EE;color:#1e1e1e;border:1px solid #949494;font-weight:bold;font-size:14px;padding:8px;margin-right:8px",type:"button","data-extendify-identifier":"main-button",id:"extendify-templates-inserter-btn",className:"components-button",children:[(0,Gn.jsxs)("svg",{style:"margin-right:0.5rem",width:"20",height:"20",viewBox:"0 0 103 103",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,Gn.jsx)("rect",{y:"25.75",width:"70.8125",height:"77.25",fill:"#000000"}),(0,Gn.jsx)("rect",{x:"45.0625",width:"57.9375",height:"57.9375",fill:"#37C2A2"})]}),(0,Vn.__)("Library","extendify-sdk")]})});window._wpLoadBlockEditor&&window.wp.data.subscribe((function(){setTimeout((function(){document.getElementById("extendify-templates-inserter-btn")||document.querySelector(".edit-post-header-toolbar")&&(document.querySelector(".edit-post-header-toolbar").insertAdjacentHTML("beforeend",(0,r.renderToString)(Lo)),document.getElementById("extendify-templates-inserter-btn").addEventListener("click",_o))}),0)})),window._wpLoadBlockEditor&&window.wp.data.subscribe((function(){setTimeout((function(){if(document.querySelector("[id$=patterns-view]")&&!document.getElementById("extendify-cta-button")){var e=(0,Gn.jsx)("div",{children:(0,Gn.jsx)("button",{id:"extendify-cta-button",style:"margin:1rem 1rem 0","data-extendify-identifier":"patterns-cta",className:"components-button is-secondary",children:(0,Vn.__)("Discover more patterns in Extendify Library","extendify-sdk")})});document.querySelector("[id$=patterns-view]").insertAdjacentHTML("afterbegin",(0,r.renderToString)(e)),document.getElementById("extendify-cta-button").addEventListener("click",_o)}}),0)}));window._wpLoadBlockEditor&&(0,Ro.registerPlugin)("extendify-temps-more-menu-trigger",{render:function(){return(0,Gn.jsx)(Ao.PluginSidebarMoreMenuItem,{"data-extendify-identifier":"sidebar-button",onClick:_o,icon:(0,Gn.jsx)("span",{className:"components-menu-items__item-icon",children:(0,Gn.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 103 103",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,Gn.jsx)("rect",{y:"25.75",width:"70.8125",height:"77.25",fill:"#000000"}),(0,Gn.jsx)("rect",{x:"45.0625",width:"57.9375",height:"57.9375",fill:"#37C2A2"})]})}),children:(0,Vn.__)("Library","extendify-sdk")})}});var Do={register:function(){var e=this;window.addEventListener("extendify-sdk::softerror-encountered",(function(t){e[(0,Kn.camelCase)(t.detail.type)](t.detail)}))},versionOutdated:function(e){(0,r.render)((0,Gn.jsx)(Vr,{title:e.data.title,message:e.data.message,buttonLabel:e.data.buttonLabel,forceOpen:!0}),document.getElementById("extendify-root"))}};(function(){var e=(0,Rr.dispatch)("core/notices").createNotice,t=H.getState().incrementImports;window.addEventListener("extendify-sdk::template-inserted",(function(n){var r;e("info",(0,Vn.__)("Template Added"),{isDismissible:!0,type:"snackbar"}),t(),or(null===(r=n.detail)||void 0===r?void 0:r.template)}))})(),Do.register(),window._wpLoadBlockEditor&&window.wp.domReady((function(){if(Tr.getState().importOnLoad){var e=Tr.getState().wantedTemplate;setTimeout((function(){!function(e){if(!e)throw Error("Template not found");fo(p((0,window.wp.blocks.parse)((0,Kn.get)(e,"fields.code"))),e)}(e)}),0)}Tr.setState({importOnLoad:!1,wantedTemplate:{}});var t=document.createElement("div");t.id="extendify-root",document.body.append(t),(0,r.render)((0,Gn.jsx)(No,{}),t)}))},42:(e,t)=>{var n;!function(){"use strict";var r={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var i=typeof n;if("string"===i||"number"===i)e.push(n);else if(Array.isArray(n)){if(n.length){var a=o.apply(null,n);a&&e.push(a)}}else if("object"===i)if(n.toString===Object.prototype.toString)for(var u in n)r.call(n,u)&&n[u]&&e.push(u);else e.push(n.toString())}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(n=function(){return o}.apply(t,[]))||(e.exports=n)}()},602:()=>{},525:e=>{"use strict";var t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;function o(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,i){for(var a,u,s=o(e),c=1;c<arguments.length;c++){for(var l in a=Object(arguments[c]))n.call(a,l)&&(s[l]=a[l]);if(t){u=t(a);for(var f=0;f<u.length;f++)r.call(a,u[f])&&(s[u[f]]=a[u[f]])}}return s}},61:e=>{var t,n,r=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function a(e){if(t===setTimeout)return setTimeout(e,0);if((t===o||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:o}catch(e){t=o}try{n="function"==typeof clearTimeout?clearTimeout:i}catch(e){n=i}}();var u,s=[],c=!1,l=-1;function f(){c&&u&&(c=!1,u.length?s=u.concat(s):l=-1,s.length&&d())}function d(){if(!c){var e=a(f);c=!0;for(var t=s.length;t;){for(u=s,s=[];++l<t;)u&&u[l].run();l=-1,t=s.length}u=null,c=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===i||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function v(){}r.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];s.push(new p(e,t)),1!==s.length||c||a(d)},p.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=v,r.addListener=v,r.once=v,r.off=v,r.removeListener=v,r.removeAllListeners=v,r.emit=v,r.prependListener=v,r.prependOnceListener=v,r.listeners=function(e){return[]},r.binding=function(e){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(e){throw new Error("process.chdir is not supported")},r.umask=function(){return 0}},426:(e,t,n)=>{"use strict";n(525);var r=n(804),o=60103;if(t.Fragment=60107,"function"==typeof Symbol&&Symbol.for){var i=Symbol.for;o=i("react.element"),t.Fragment=i("react.fragment")}var a=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,u=Object.prototype.hasOwnProperty,s={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,n){var r,i={},c=null,l=null;for(r in void 0!==n&&(c=""+n),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(l=t.ref),t)u.call(t,r)&&!s.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===i[r]&&(i[r]=t[r]);return{$$typeof:o,type:e,key:c,ref:l,props:i,_owner:a.current}}t.jsx=c,t.jsxs=c},246:(e,t,n)=>{"use strict";e.exports=n(426)},248:e=>{var t=function(e){"use strict";var t,n=Object.prototype,r=n.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function s(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,n){return e[t]=n}}function c(e,t,n,r){var o=t&&t.prototype instanceof h?t:h,i=Object.create(o.prototype),a=new I(r||[]);return i._invoke=function(e,t,n){var r=f;return function(o,i){if(r===p)throw new Error("Generator is already running");if(r===v){if("throw"===o)throw i;return T()}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var u=C(a,n);if(u){if(u===m)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===f)throw r=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=p;var s=l(e,t,n);if("normal"===s.type){if(r=n.done?v:d,s.arg===m)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(r=v,n.method="throw",n.arg=s.arg)}}}(e,n,a),i}function l(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var f="suspendedStart",d="suspendedYield",p="executing",v="completed",m={};function h(){}function y(){}function b(){}var g={};g[i]=function(){return this};var x=Object.getPrototypeOf,w=x&&x(x(P([])));w&&w!==n&&r.call(w,i)&&(g=w);var S=b.prototype=h.prototype=Object.create(g);function k(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function j(e,t){function n(o,i,a,u){var s=l(e[o],e,i);if("throw"!==s.type){var c=s.arg,f=c.value;return f&&"object"==typeof f&&r.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,a,u)}),(function(e){n("throw",e,a,u)})):t.resolve(f).then((function(e){c.value=e,a(c)}),(function(e){return n("throw",e,a,u)}))}u(s.arg)}var o;this._invoke=function(e,r){function i(){return new t((function(t,o){n(e,r,t,o)}))}return o=o?o.then(i,i):i()}}function C(e,n){var r=e.iterator[n.method];if(r===t){if(n.delegate=null,"throw"===n.method){if(e.iterator.return&&(n.method="return",n.arg=t,C(e,n),"throw"===n.method))return m;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return m}var o=l(r,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,m;var i=o.arg;return i?i.done?(n[e.resultName]=i.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,m):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function P(e){if(e){var n=e[i];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return a.next=a}}return{next:T}}function T(){return{value:t,done:!0}}return y.prototype=S.constructor=b,b.constructor=y,y.displayName=s(b,u,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===y||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,s(e,u,"GeneratorFunction")),e.prototype=Object.create(S),e},e.awrap=function(e){return{__await:e}},k(j.prototype),j.prototype[a]=function(){return this},e.AsyncIterator=j,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new j(c(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},k(S),s(S,u,"Generator"),S[i]=function(){return this},S.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=P,I.prototype={constructor:I,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(O),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return u.type="throw",u.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var s=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(s&&c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),m},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),O(n),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;O(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:P(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),m}},e}(e.exports);try{regeneratorRuntime=t}catch(e){Function("r","regeneratorRuntime = r")(t)}},804:e=>{"use strict";e.exports=React}},n={};function r(e){var o=n[e];if(void 0!==o)return o.exports;var i=n[e]={exports:{}};return t[e](i,i.exports,r),i.exports}r.m=t,e=[],r.O=(t,n,o,i)=>{if(!n){var a=1/0;for(c=0;c<e.length;c++){for(var[n,o,i]=e[c],u=!0,s=0;s<n.length;s++)(!1&i||a>=i)&&Object.keys(r.O).every((e=>r.O[e](n[s])))?n.splice(s--,1):(u=!1,i<a&&(a=i));u&&(e.splice(c--,1),t=o())}return t}i=i||0;for(var c=e.length;c>0&&e[c-1][2]>i;c--)e[c]=e[c-1];e[c]=[n,o,i]},r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={172:0,106:0};r.O.j=t=>0===e[t];var t=(t,n)=>{var o,i,[a,u,s]=n,c=0;for(o in u)r.o(u,o)&&(r.m[o]=u[o]);if(s)var l=s(r);for(t&&t(n);c<a.length;c++)i=a[c],r.o(e,i)&&e[i]&&e[i][0](),e[a[c]]=0;return r.O(l)},n=self.webpackChunk=self.webpackChunk||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})(),r.O(void 0,[106],(()=>r(691)));var o=r.O(void 0,[106],(()=>r(602)));o=r.O(o)})();
1
  /*! For license information please see extendify-sdk.js.LICENSE.txt */
2
+ (()=>{var e,t={135:(e,t,n)=>{e.exports=n(248)},206:(e,t,n)=>{e.exports=n(57)},387:(e,t,n)=>{"use strict";var r=n(485),o=n(570),i=n(940),a=n(581),u=n(574),s=n(845),c=n(338),l=n(524);e.exports=function(e){return new Promise((function(t,n){var f=e.data,d=e.headers;r.isFormData(f)&&delete d["Content-Type"];var p=new XMLHttpRequest;if(e.auth){var m=e.auth.username||"",v=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";d.Authorization="Basic "+btoa(m+":"+v)}var h=u(e.baseURL,e.url);if(p.open(e.method.toUpperCase(),a(h,e.params,e.paramsSerializer),!0),p.timeout=e.timeout,p.onreadystatechange=function(){if(p&&4===p.readyState&&(0!==p.status||p.responseURL&&0===p.responseURL.indexOf("file:"))){var r="getAllResponseHeaders"in p?s(p.getAllResponseHeaders()):null,i={data:e.responseType&&"text"!==e.responseType?p.response:p.responseText,status:p.status,statusText:p.statusText,headers:r,config:e,request:p};o(t,n,i),p=null}},p.onabort=function(){p&&(n(l("Request aborted",e,"ECONNABORTED",p)),p=null)},p.onerror=function(){n(l("Network Error",e,null,p)),p=null},p.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(l(t,e,"ECONNABORTED",p)),p=null},r.isStandardBrowserEnv()){var y=(e.withCredentials||c(h))&&e.xsrfCookieName?i.read(e.xsrfCookieName):void 0;y&&(d[e.xsrfHeaderName]=y)}if("setRequestHeader"in p&&r.forEach(d,(function(e,t){void 0===f&&"content-type"===t.toLowerCase()?delete d[t]:p.setRequestHeader(t,e)})),r.isUndefined(e.withCredentials)||(p.withCredentials=!!e.withCredentials),e.responseType)try{p.responseType=e.responseType}catch(t){if("json"!==e.responseType)throw t}"function"==typeof e.onDownloadProgress&&p.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&p.upload&&p.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then((function(e){p&&(p.abort(),n(e),p=null)})),f||(f=null),p.send(f)}))}},57:(e,t,n)=>{"use strict";var r=n(485),o=n(875),i=n(29),a=n(941);function u(e){var t=new i(e),n=o(i.prototype.request,t);return r.extend(n,i.prototype,t),r.extend(n,t),n}var s=u(n(141));s.Axios=i,s.create=function(e){return u(a(s.defaults,e))},s.Cancel=n(132),s.CancelToken=n(603),s.isCancel=n(475),s.all=function(e){return Promise.all(e)},s.spread=n(739),s.isAxiosError=n(835),e.exports=s,e.exports.default=s},132:e=>{"use strict";function t(e){this.message=e}t.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},t.prototype.__CANCEL__=!0,e.exports=t},603:(e,t,n)=>{"use strict";var r=n(132);function o(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var n=this;e((function(e){n.reason||(n.reason=new r(e),t(n.reason))}))}o.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},o.source=function(){var e;return{token:new o((function(t){e=t})),cancel:e}},e.exports=o},475:e=>{"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},29:(e,t,n)=>{"use strict";var r=n(485),o=n(581),i=n(96),a=n(9),u=n(941);function s(e){this.defaults=e,this.interceptors={request:new i,response:new i}}s.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=u(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=[a,void 0],n=Promise.resolve(e);for(this.interceptors.request.forEach((function(e){t.unshift(e.fulfilled,e.rejected)})),this.interceptors.response.forEach((function(e){t.push(e.fulfilled,e.rejected)}));t.length;)n=n.then(t.shift(),t.shift());return n},s.prototype.getUri=function(e){return e=u(this.defaults,e),o(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},r.forEach(["delete","get","head","options"],(function(e){s.prototype[e]=function(t,n){return this.request(u(n||{},{method:e,url:t,data:(n||{}).data}))}})),r.forEach(["post","put","patch"],(function(e){s.prototype[e]=function(t,n,r){return this.request(u(r||{},{method:e,url:t,data:n}))}})),e.exports=s},96:(e,t,n)=>{"use strict";var r=n(485);function o(){this.handlers=[]}o.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},o.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},o.prototype.forEach=function(e){r.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=o},574:(e,t,n)=>{"use strict";var r=n(642),o=n(288);e.exports=function(e,t){return e&&!r(t)?o(e,t):t}},524:(e,t,n)=>{"use strict";var r=n(953);e.exports=function(e,t,n,o,i){var a=new Error(e);return r(a,t,n,o,i)}},9:(e,t,n)=>{"use strict";var r=n(485),o=n(212),i=n(475),a=n(141);function u(e){e.cancelToken&&e.cancelToken.throwIfRequested()}e.exports=function(e){return u(e),e.headers=e.headers||{},e.data=o(e.data,e.headers,e.transformRequest),e.headers=r.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),r.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||a.adapter)(e).then((function(t){return u(e),t.data=o(t.data,t.headers,e.transformResponse),t}),(function(t){return i(t)||(u(e),t&&t.response&&(t.response.data=o(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},953:e=>{"use strict";e.exports=function(e,t,n,r,o){return e.config=t,n&&(e.code=n),e.request=r,e.response=o,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},e}},941:(e,t,n)=>{"use strict";var r=n(485);e.exports=function(e,t){t=t||{};var n={},o=["url","method","data"],i=["headers","auth","proxy","params"],a=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],u=["validateStatus"];function s(e,t){return r.isPlainObject(e)&&r.isPlainObject(t)?r.merge(e,t):r.isPlainObject(t)?r.merge({},t):r.isArray(t)?t.slice():t}function c(o){r.isUndefined(t[o])?r.isUndefined(e[o])||(n[o]=s(void 0,e[o])):n[o]=s(e[o],t[o])}r.forEach(o,(function(e){r.isUndefined(t[e])||(n[e]=s(void 0,t[e]))})),r.forEach(i,c),r.forEach(a,(function(o){r.isUndefined(t[o])?r.isUndefined(e[o])||(n[o]=s(void 0,e[o])):n[o]=s(void 0,t[o])})),r.forEach(u,(function(r){r in t?n[r]=s(e[r],t[r]):r in e&&(n[r]=s(void 0,e[r]))}));var l=o.concat(i).concat(a).concat(u),f=Object.keys(e).concat(Object.keys(t)).filter((function(e){return-1===l.indexOf(e)}));return r.forEach(f,c),n}},570:(e,t,n)=>{"use strict";var r=n(524);e.exports=function(e,t,n){var o=n.config.validateStatus;n.status&&o&&!o(n.status)?t(r("Request failed with status code "+n.status,n.config,null,n.request,n)):e(n)}},212:(e,t,n)=>{"use strict";var r=n(485);e.exports=function(e,t,n){return r.forEach(n,(function(n){e=n(e,t)})),e}},141:(e,t,n)=>{"use strict";var r=n(61),o=n(485),i=n(446),a={"Content-Type":"application/x-www-form-urlencoded"};function u(e,t){!o.isUndefined(e)&&o.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var s,c={adapter:(("undefined"!=typeof XMLHttpRequest||void 0!==r&&"[object process]"===Object.prototype.toString.call(r))&&(s=n(387)),s),transformRequest:[function(e,t){return i(t,"Accept"),i(t,"Content-Type"),o.isFormData(e)||o.isArrayBuffer(e)||o.isBuffer(e)||o.isStream(e)||o.isFile(e)||o.isBlob(e)?e:o.isArrayBufferView(e)?e.buffer:o.isURLSearchParams(e)?(u(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):o.isObject(e)?(u(t,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(e){}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300}};c.headers={common:{Accept:"application/json, text/plain, */*"}},o.forEach(["delete","get","head"],(function(e){c.headers[e]={}})),o.forEach(["post","put","patch"],(function(e){c.headers[e]=o.merge(a)})),e.exports=c},875:e=>{"use strict";e.exports=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];return e.apply(t,n)}}},581:(e,t,n)=>{"use strict";var r=n(485);function o(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,n){if(!t)return e;var i;if(n)i=n(t);else if(r.isURLSearchParams(t))i=t.toString();else{var a=[];r.forEach(t,(function(e,t){null!=e&&(r.isArray(e)?t+="[]":e=[e],r.forEach(e,(function(e){r.isDate(e)?e=e.toISOString():r.isObject(e)&&(e=JSON.stringify(e)),a.push(o(t)+"="+o(e))})))})),i=a.join("&")}if(i){var u=e.indexOf("#");-1!==u&&(e=e.slice(0,u)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}},288:e=>{"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},940:(e,t,n)=>{"use strict";var r=n(485);e.exports=r.isStandardBrowserEnv()?{write:function(e,t,n,o,i,a){var u=[];u.push(e+"="+encodeURIComponent(t)),r.isNumber(n)&&u.push("expires="+new Date(n).toGMTString()),r.isString(o)&&u.push("path="+o),r.isString(i)&&u.push("domain="+i),!0===a&&u.push("secure"),document.cookie=u.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},642:e=>{"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},835:e=>{"use strict";e.exports=function(e){return"object"==typeof e&&!0===e.isAxiosError}},338:(e,t,n)=>{"use strict";var r=n(485);e.exports=r.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function o(e){var r=e;return t&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return e=o(window.location.href),function(t){var n=r.isString(t)?o(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return!0}},446:(e,t,n)=>{"use strict";var r=n(485);e.exports=function(e,t){r.forEach(e,(function(n,r){r!==t&&r.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[r])}))}},845:(e,t,n)=>{"use strict";var r=n(485),o=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,n,i,a={};return e?(r.forEach(e.split("\n"),(function(e){if(i=e.indexOf(":"),t=r.trim(e.substr(0,i)).toLowerCase(),n=r.trim(e.substr(i+1)),t){if(a[t]&&o.indexOf(t)>=0)return;a[t]="set-cookie"===t?(a[t]?a[t]:[]).concat([n]):a[t]?a[t]+", "+n:n}})),a):a}},739:e=>{"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},485:(e,t,n)=>{"use strict";var r=n(875),o=Object.prototype.toString;function i(e){return"[object Array]"===o.call(e)}function a(e){return void 0===e}function u(e){return null!==e&&"object"==typeof e}function s(e){if("[object Object]"!==o.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function c(e){return"[object Function]"===o.call(e)}function l(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),i(e))for(var n=0,r=e.length;n<r;n++)t.call(null,e[n],n,e);else for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.call(null,e[o],o,e)}e.exports={isArray:i,isArrayBuffer:function(e){return"[object ArrayBuffer]"===o.call(e)},isBuffer:function(e){return null!==e&&!a(e)&&null!==e.constructor&&!a(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return"undefined"!=typeof FormData&&e instanceof FormData},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:u,isPlainObject:s,isUndefined:a,isDate:function(e){return"[object Date]"===o.call(e)},isFile:function(e){return"[object File]"===o.call(e)},isBlob:function(e){return"[object Blob]"===o.call(e)},isFunction:c,isStream:function(e){return u(e)&&c(e.pipe)},isURLSearchParams:function(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:l,merge:function e(){var t={};function n(n,r){s(t[r])&&s(n)?t[r]=e(t[r],n):s(n)?t[r]=e({},n):i(n)?t[r]=n.slice():t[r]=n}for(var r=0,o=arguments.length;r<o;r++)l(arguments[r],n);return t},extend:function(e,t,n){return l(t,(function(t,o){e[o]=n&&"function"==typeof t?r(t,n):t})),e},trim:function(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e}}},501:(e,t,n)=>{"use strict";const r=wp.element;var o=n(804),i=n.n(o);function a(e){let t;const n=new Set,r=(e,r)=>{const o="function"==typeof e?e(t):e;if(o!==t){const e=t;t=r?o:Object.assign({},t,o),n.forEach((n=>n(t,e)))}},o=()=>t,i={setState:r,getState:o,subscribe:(e,r,i)=>r||i?((e,r=o,i=Object.is)=>{let a=r(t);function u(){const n=r(t);if(!i(a,n)){const t=a;e(a=n,t)}}return n.add(u),()=>n.delete(u)})(e,r,i):(n.add(e),()=>n.delete(e)),destroy:()=>n.clear()};return t=e(r,o,i),i}const u="undefined"==typeof window||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent)?o.useEffect:o.useLayoutEffect;const s=function(e){const t="function"==typeof e?a(e):e,n=(e=t.getState,n=Object.is)=>{const[,r]=(0,o.useReducer)((e=>e+1),0),i=t.getState(),a=(0,o.useRef)(i),s=(0,o.useRef)(e),c=(0,o.useRef)(n),l=(0,o.useRef)(!1),f=(0,o.useRef)();let d;void 0===f.current&&(f.current=e(i));let p=!1;(a.current!==i||s.current!==e||c.current!==n||l.current)&&(d=e(i),p=!n(f.current,d)),u((()=>{p&&(f.current=d),a.current=i,s.current=e,c.current=n,l.current=!1}));const m=(0,o.useRef)(i);return u((()=>{const e=()=>{try{const e=t.getState(),n=s.current(e);c.current(f.current,n)||(a.current=e,f.current=n,r())}catch(e){l.current=!0,r()}},n=t.subscribe(e);return t.getState()!==m.current&&e(),n}),[]),p?d:f.current};return Object.assign(n,t),n[Symbol.iterator]=function*(){console.warn("[useStore, api] = create() is deprecated and will be removed in v4"),yield n,yield t},n};var c="pattern",l=12;function f(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null==n)return;var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return d(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 d(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 d(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 p(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=window.wp.blocks.createBlock;return e.map((function(e){var n=f(Array.isArray(e)?e:[e.name,e.attributes,e.innerBlocks],3),r=n[0],o=n[1],i=n[2];return t(r,o,p(void 0===i?[]:i))}))}function m(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 v(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?m(Object(n),!0).forEach((function(t){h(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function h(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function y(e){return function(e){if(Array.isArray(e))return b(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return b(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 b(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 b(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 g=s((function(e,t){return{templates:[],fetchToken:null,activeTemplate:{},activeTemplateBlocks:{},taxonomyDefaultState:{},searchParams:{taxonomies:{},type:c,search:""},nextPage:"",removeTemplates:function(){return e({nextPage:"",templates:[]})},appendTemplates:function(n){return e({templates:y(new Map([].concat(y(t().templates),y(n)).map((function(e){return[e.id,e]}))).values())})},setupDefaultTaxonomies:function(n){var r=Object.keys(n).reduce((function(e,n){return e[n]=function(e){return function(e,t){return"pattern"===e&&"tax_categories"===t?"Default":""}(t().searchParams.type,e)}(n),e}),{}),o={};o.taxonomies=r,e({taxonomyDefaultState:r,searchParams:v({},Object.assign(t().searchParams,o))})},setActive:function(t){var n;if(e({activeTemplate:t}),null!=t&&null!==(n=t.fields)&&void 0!==n&&n.code){var r=window.wp.blocks.parse;e({activeTemplateBlocks:p(r(t.fields.code))})}},resetTaxonomies:function(){var e={tax_categories:"pattern"===t().searchParams.type?"Default":""};t().updateSearchParams({taxonomies:Object.assign(t().taxonomyDefaultState,e)})},updateTaxonomies:function(e){var n={};n.taxonomies=Object.assign({},t().searchParams.taxonomies,e),t().updateSearchParams(n)},updateSearchParams:function(n){null!=n&&n.taxonomies&&!Object.keys(n.taxonomies).length&&(n.taxonomies=t().taxonomyDefaultState),e({templates:[],nextPage:"",searchParams:v({},Object.assign(t().searchParams,n))})}}})),x=s((function(e){return{open:!1,currentPage:"content",setOpen:function(t){e({open:t}),t&&g.getState().removeTemplates()}}})),w=n(135),S=n.n(w),k=Object.defineProperty,j=Object.prototype.hasOwnProperty,O=Object.getOwnPropertySymbols,C=Object.prototype.propertyIsEnumerable,E=(e,t,n)=>t in e?k(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,P=(e,t)=>{for(var n in t||(t={}))j.call(t,n)&&E(e,n,t[n]);if(O)for(var n of O(t))C.call(t,n)&&E(e,n,t[n]);return e};const I=(e,t)=>(n,r,o)=>{const{name:i,getStorage:a=(()=>localStorage),serialize:u=JSON.stringify,deserialize:s=JSON.parse,blacklist:c,whitelist:l,onRehydrateStorage:f,version:d=0,migrate:p}=t||{};let m;try{m=a()}catch(e){}if(!m)return e(((...e)=>{console.warn(`Persist middleware: unable to update ${i}, the given storage is currently unavailable.`),n(...e)}),r,o);const v=async()=>{const e=P({},r());return l&&Object.keys(e).forEach((t=>{!l.includes(t)&&delete e[t]})),c&&c.forEach((t=>delete e[t])),null==m?void 0:m.setItem(i,await u({state:e,version:d}))},h=o.setState;return o.setState=(e,t)=>{h(e,t),v()},(async()=>{const e=(null==f?void 0:f(r()))||void 0;try{const e=await m.getItem(i);if(e){const t=await s(e);if(t.version!==d){const e=await(null==p?void 0:p(t.state,t.version));e&&(n(e),await v())}else n(t.state)}}catch(t){return void(null==e||e(void 0,t))}null==e||e(r(),void 0)})(),e(((...e)=>{n(...e),v()}),r,o)};var N=n(206),T=n.n(N)().create({baseURL:window.extendifySdkData.root,headers:{"X-WP-Nonce":window.extendifySdkData.nonce,"X-Requested-With":"XMLHttpRequest","X-Extendify":!0}});function R(e){return Object.prototype.hasOwnProperty.call(e,"data")?e.data:e}T.interceptors.response.use((function(e){return function(e){return Object.prototype.hasOwnProperty.call(e,"soft_error")&&window.dispatchEvent(new CustomEvent("extendify-sdk::softerror-encountered",{detail:e.soft_error,bubbles:!0})),e}(R(e))}),(function(e){return function(e){if(e.response)return console.error(e.response),Promise.reject(R(e.response))}(e)})),T.interceptors.request.use((function(e){return function(e){return e.headers["X-Extendify-Dev-Mode"]=window.location.search.indexOf("DEVMODE")>-1,e.headers["X-Extendify-Local-Mode"]=window.location.search.indexOf("LOCALMODE")>-1,e}(function(e){return e.data&&(e.data.remaining_imports=G.getState().remainingImports(),e.data.entry_point=G.getState().entryPoint,e.data.total_imports=G.getState().imports),e}(e))}),(function(e){return e}));var _=function(){return T.get("user")},A=function(e){return T.get("user-meta",{params:{key:e}})},L=function(e,t){var n=new FormData;return n.append("email",e),n.append("key",t),T.post("login",n,{headers:{"Content-Type":"multipart/form-data"}})},D=function(e){var t=new FormData;return t.append("data",JSON.stringify(e)),T.post("user",t,{headers:{"Content-Type":"multipart/form-data"}})};function F(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function M(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){F(i,r,o,a,u,"next",e)}function u(e){F(i,r,o,a,u,"throw",e)}a(void 0)}))}}var B,U,V={getItem:(U=M(S().mark((function e(){return S().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,_();case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)}))),function(){return U.apply(this,arguments)}),setItem:(B=M(S().mark((function e(t,n){return S().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",D(n));case 1:case"end":return e.stop()}}),e)}))),function(e,t){return B.apply(this,arguments)})},G=s(I((function(e,t){return{apiKey:"",imports:0,uuid:"",email:"",allowedImports:0,entryPoint:"not-set",enabled:!0,incrementImports:function(){return e({imports:t().imports+1})},canImport:function(){return!!t().apiKey||Number(t().imports)<Number(t().allowedImports)},remainingImports:function(){if(t().apiKey)return"unlimited";var e=Number(t().allowedImports)-Number(t().imports);return e>0?e:0}}}),{name:"extendify-user",getStorage:function(){return V}}));const H=ReactDOM;function q(){return(q=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 K(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}function W(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 z(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return W(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)?W(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=e[Symbol.iterator]()).next.bind(n)}function $(e,t){if(e in t){for(var n=t[e],r=arguments.length,o=new Array(r>2?r-2:0),i=2;i<r;i++)o[i-2]=arguments[i];return"function"==typeof n?n.apply(void 0,o):n}var a=new Error('Tried to handle "'+e+'" but there is no handler defined. Only defined handlers are: '+Object.keys(t).map((function(e){return'"'+e+'"'})).join(", ")+".");throw Error.captureStackTrace&&Error.captureStackTrace(a,$),a}var Q,Y,J;function X(e){var t=e.props,n=e.slot,r=e.defaultTag,o=e.features,i=e.visible,a=void 0===i||i,u=e.name;if(a)return Z(t,n,r,u);var s=null!=o?o:Q.None;if(s&Q.Static){var c=t.static,l=void 0!==c&&c,f=K(t,["static"]);if(l)return Z(f,n,r,u)}if(s&Q.RenderStrategy){var d,p=t.unmount,m=void 0===p||p,v=K(t,["unmount"]);return $(m?Y.Unmount:Y.Hidden,((d={})[Y.Unmount]=function(){return null},d[Y.Hidden]=function(){return Z(q({},v,{hidden:!0,style:{display:"none"}}),n,r,u)},d))}return Z(t,n,r,u)}function Z(e,t,n,r){var i;void 0===t&&(t={});var a=te(e,["unmount","static"]),u=a.as,s=void 0===u?n:u,c=a.children,l=a.refName,f=void 0===l?"ref":l,d=K(a,["as","children","refName"]),p=void 0!==e.ref?((i={})[f]=e.ref,i):{},m="function"==typeof c?c(t):c;if(d.className&&"function"==typeof d.className&&(d.className=d.className(t)),s===o.Fragment&&Object.keys(d).length>0){if(!(0,o.isValidElement)(m)||Array.isArray(m)&&m.length>1)throw new Error(['Passing props on "Fragment"!',"","The current component <"+r+' /> is rendering a "Fragment".',"However we need to passthrough the following props:",Object.keys(d).map((function(e){return" - "+e})).join("\n"),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map((function(e){return" - "+e})).join("\n")].join("\n"));return(0,o.cloneElement)(m,Object.assign({},function(e,t,n){for(var r,o=Object.assign({},e),i=function(){var n,i=r.value;void 0!==e[i]&&void 0!==t[i]&&Object.assign(o,((n={})[i]=function(n){n.defaultPrevented||e[i](n),n.defaultPrevented||t[i](n)},n))},a=z(n);!(r=a()).done;)i();return o}(function(e){var t=Object.assign({},e);for(var n in t)void 0===t[n]&&delete t[n];return t}(te(d,["ref"])),m.props,["onClick"]),p))}return(0,o.createElement)(s,Object.assign({},te(d,["ref"]),s!==o.Fragment&&p),m)}function ee(e){var t;return Object.assign((0,o.forwardRef)(e),{displayName:null!=(t=e.displayName)?t:e.name})}function te(e,t){void 0===t&&(t=[]);for(var n,r=Object.assign({},e),o=z(t);!(n=o()).done;){var i=n.value;i in r&&delete r[i]}return r}function ne(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=(0,o.useRef)(t);return(0,o.useEffect)((function(){r.current=t}),[t]),(0,o.useCallback)((function(e){for(var t,n=z(r.current);!(t=n()).done;){var o=t.value;null!=o&&("function"==typeof o?o(e):o.current=e)}}),[r])}function re(e){for(var t,n,r=e.parentElement,o=null;r&&!(r instanceof HTMLFieldSetElement);)r instanceof HTMLLegendElement&&(o=r),r=r.parentElement;var i=null!=(t=""===(null==(n=r)?void 0:n.getAttribute("disabled")))&&t;return(!i||!function(e){if(!e)return!1;var t=e.previousElementSibling;for(;null!==t;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}(o))&&i}!function(e){e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static"}(Q||(Q={})),function(e){e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden"}(Y||(Y={})),function(e){e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab"}(J||(J={}));var oe="undefined"!=typeof window?o.useLayoutEffect:o.useEffect,ie={serverHandoffComplete:!1};function ae(){var e=(0,o.useState)(ie.serverHandoffComplete),t=e[0],n=e[1];return(0,o.useEffect)((function(){!0!==t&&n(!0)}),[t]),(0,o.useEffect)((function(){!1===ie.serverHandoffComplete&&(ie.serverHandoffComplete=!0)}),[]),t}var ue=0;function se(){return++ue}function ce(){var e=ae(),t=(0,o.useState)(e?se:null),n=t[0],r=t[1];return oe((function(){null===n&&r(se())}),[n]),null!=n?""+n:void 0}var le,fe,de,pe,me,ve=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map((function(e){return e+":not([tabindex='-1'])"})).join(",");function he(e){return void 0===e&&(e=document.body),null==e?[]:Array.from(e.querySelectorAll(ve))}function ye(e,t){var n;return void 0===t&&(t=pe.Strict),e!==document.body&&$(t,((n={})[pe.Strict]=function(){return e.matches(ve)},n[pe.Loose]=function(){for(var t=e;null!==t;){if(t.matches(ve))return!0;t=t.parentElement}return!1},n))}function be(e){null==e||e.focus({preventScroll:!0})}function ge(e,t){var n=Array.isArray(e)?e:he(e),r=document.activeElement,o=function(){if(t&(le.First|le.Next))return de.Next;if(t&(le.Previous|le.Last))return de.Previous;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")}(),i=function(){if(t&le.First)return 0;if(t&le.Previous)return Math.max(0,n.indexOf(r))-1;if(t&le.Next)return Math.max(0,n.indexOf(r))+1;if(t&le.Last)return n.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")}(),a=t&le.NoScroll?{preventScroll:!0}:{},u=0,s=n.length,c=void 0;do{var l;if(u>=s||u+s<=0)return fe.Error;var f=i+u;if(t&le.WrapAround)f=(f+s)%s;else{if(f<0)return fe.Underflow;if(f>=s)return fe.Overflow}null==(l=c=n[f])||l.focus(a),u+=o}while(c!==document.activeElement);return c.hasAttribute("tabindex")||c.setAttribute("tabindex","0"),fe.Success}function xe(e,t,n){var r=(0,o.useRef)(t);r.current=t,(0,o.useEffect)((function(){function t(e){r.current.call(window,e)}return window.addEventListener(e,t,n),function(){return window.removeEventListener(e,t,n)}}),[e,n])}function we(){var e=(0,o.useRef)(!1);return(0,o.useEffect)((function(){return e.current=!0,function(){e.current=!1}}),[]),e}function Se(e,t,n){void 0===t&&(t=me.All);var r=void 0===n?{}:n,i=r.initialFocus,a=r.containers,u=(0,o.useRef)("undefined"!=typeof window?document.activeElement:null),s=(0,o.useRef)(null),c=we(),l=Boolean(t&me.RestoreFocus),f=Boolean(t&me.InitialFocus);(0,o.useEffect)((function(){l&&(u.current=document.activeElement)}),[l]),(0,o.useEffect)((function(){if(l)return function(){be(u.current),u.current=null}}),[l]),(0,o.useEffect)((function(){if(f&&e.current){var t=document.activeElement;if(null==i?void 0:i.current){if((null==i?void 0:i.current)===t)return void(s.current=t)}else if(e.current.contains(t))return void(s.current=t);if(null==i?void 0:i.current)be(i.current);else if(ge(e.current,le.First)===fe.Error)throw new Error("There are no focusable elements inside the <FocusTrap />");s.current=document.activeElement}}),[e,i,f]),xe("keydown",(function(n){t&me.TabLock&&e.current&&n.key===J.Tab&&(n.preventDefault(),ge(e.current,(n.shiftKey?le.Previous:le.Next)|le.WrapAround)===fe.Success&&(s.current=document.activeElement))})),xe("focus",(function(n){if(t&me.FocusLock){var r=new Set(null==a?void 0:a.current);if(r.add(e),r.size){var o=s.current;if(o&&c.current){var i=n.target;i&&i instanceof HTMLElement?!function(e,t){for(var n,r=z(e);!(n=r()).done;){var o;if(null==(o=n.value.current)?void 0:o.contains(t))return!0}return!1}(r,i)?(n.preventDefault(),n.stopPropagation(),be(o)):(s.current=i,be(i)):be(s.current)}}}}),!0)}!function(e){e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll"}(le||(le={})),function(e){e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow"}(fe||(fe={})),function(e){e[e.Previous=-1]="Previous",e[e.Next=1]="Next"}(de||(de={})),function(e){e[e.Strict=0]="Strict",e[e.Loose=1]="Loose"}(pe||(pe={})),function(e){e[e.None=1]="None",e[e.InitialFocus=2]="InitialFocus",e[e.TabLock=4]="TabLock",e[e.FocusLock=8]="FocusLock",e[e.RestoreFocus=16]="RestoreFocus",e[e.All=30]="All"}(me||(me={}));var ke=new Set,je=new Map;function Oe(e){e.setAttribute("aria-hidden","true"),e.inert=!0}function Ce(e){var t=je.get(e);t&&(null===t["aria-hidden"]?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",t["aria-hidden"]),e.inert=t.inert)}var Ee=(0,o.createContext)(!1);function Pe(e){return i().createElement(Ee.Provider,{value:e.force},e.children)}function Ie(){var e=(0,o.useContext)(Ee),t=(0,o.useContext)(_e),n=(0,o.useState)((function(){if(!e&&null!==t)return null;if("undefined"==typeof window)return null;var n=document.getElementById("headlessui-portal-root");if(n)return n;var r=document.createElement("div");return r.setAttribute("id","headlessui-portal-root"),document.body.appendChild(r)})),r=n[0],i=n[1];return(0,o.useEffect)((function(){e||null!==t&&i(t.current)}),[t,i,e]),r}var Ne=o.Fragment;function Te(e){var t=e,n=Ie(),r=(0,o.useState)((function(){return"undefined"==typeof window?null:document.createElement("div")}))[0],i=ae();return oe((function(){if(n&&r)return n.appendChild(r),function(){var e;n&&(r&&(n.removeChild(r),n.childNodes.length<=0&&(null==(e=n.parentElement)||e.removeChild(n))))}}),[n,r]),i&&n&&r?(0,H.createPortal)(X({props:t,defaultTag:Ne,name:"Portal"}),r):null}var Re=o.Fragment,_e=(0,o.createContext)(null);Te.Group=function(e){var t=e.target,n=K(e,["target"]);return i().createElement(_e.Provider,{value:t},X({props:n,defaultTag:Re,name:"Popover.Group"}))};var Ae=(0,o.createContext)(null);function Le(){var e=(0,o.useContext)(Ae);if(null===e){var t=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,Le),t}return e}function De(){var e=(0,o.useState)([]),t=e[0],n=e[1];return[t.length>0?t.join(" "):void 0,(0,o.useMemo)((function(){return function(e){var t=(0,o.useCallback)((function(e){return n((function(t){return[].concat(t,[e])})),function(){return n((function(t){var n=t.slice(),r=n.indexOf(e);return-1!==r&&n.splice(r,1),n}))}}),[]),r=(0,o.useMemo)((function(){return{register:t,slot:e.slot,name:e.name,props:e.props}}),[t,e.slot,e.name,e.props]);return i().createElement(Ae.Provider,{value:r},e.children)}}),[n])]}function Fe(e){var t=Le(),n="headlessui-description-"+ce();oe((function(){return t.register(n)}),[n,t.register]);var r=e,o=q({},t.props,{id:n});return X({props:q({},r,o),slot:t.slot||{},defaultTag:"p",name:t.name||"Description"})}var Me,Be=(0,o.createContext)(null);function Ue(){return(0,o.useContext)(Be)}function Ve(e){var t=e.value,n=e.children;return i().createElement(Be.Provider,{value:t},n)}Be.displayName="OpenClosedContext",function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(Me||(Me={}));var Ge,He,qe,Ke,We=(0,o.createContext)((function(){}));function ze(e){var t=e.children,n=e.onUpdate,r=e.type,a=e.element,u=(0,o.useContext)(We),s=(0,o.useCallback)((function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];null==n||n.apply(void 0,t),u.apply(void 0,t)}),[u,n]);return oe((function(){return s(Ge.Add,r,a),function(){return s(Ge.Remove,r,a)}}),[s,r,a]),i().createElement(We.Provider,{value:s},t)}We.displayName="StackContext",function(e){e[e.Add=0]="Add",e[e.Remove=1]="Remove"}(Ge||(Ge={})),function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(qe||(qe={})),function(e){e[e.SetTitleId=0]="SetTitleId"}(Ke||(Ke={}));var $e=((He={})[Ke.SetTitleId]=function(e,t){return e.titleId===t.id?e:q({},e,{titleId:t.id})},He),Qe=(0,o.createContext)(null);function Ye(e){var t=(0,o.useContext)(Qe);if(null===t){var n=new Error("<"+e+" /> is missing a parent <"+ot.displayName+" /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(n,Ye),n}return t}function Je(e,t){return $(t.type,$e,e,t)}Qe.displayName="DialogContext";var Xe=Q.RenderStrategy|Q.Static,Ze=ee((function(e,t){var n,r=e.open,a=e.onClose,u=e.initialFocus,s=K(e,["open","onClose","initialFocus"]),c=(0,o.useState)(0),l=c[0],f=c[1],d=Ue();void 0===r&&null!==d&&(r=$(d,((n={})[Me.Open]=!0,n[Me.Closed]=!1,n)));var p=(0,o.useRef)(new Set),m=(0,o.useRef)(null),v=ne(m,t),h=e.hasOwnProperty("open")||null!==d,y=e.hasOwnProperty("onClose");if(!h&&!y)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!h)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!y)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if("boolean"!=typeof r)throw new Error("You provided an `open` prop to the `Dialog`, but the value is not a boolean. Received: "+r);if("function"!=typeof a)throw new Error("You provided an `onClose` prop to the `Dialog`, but the value is not a function. Received: "+a);var b=r?qe.Open:qe.Closed,g=null!==d?d===Me.Open:b===qe.Open,x=(0,o.useReducer)(Je,{titleId:null,descriptionId:null}),w=x[0],S=x[1],k=(0,o.useCallback)((function(){return a(!1)}),[a]),j=(0,o.useCallback)((function(e){return S({type:Ke.SetTitleId,id:e})}),[S]),O=ae()&&b===qe.Open,C=l>1,E=null!==(0,o.useContext)(Qe);Se(m,O?$(C?"parent":"leaf",{parent:me.RestoreFocus,leaf:me.All}):me.None,{initialFocus:u,containers:p}),function(e,t){void 0===t&&(t=!0),oe((function(){if(t&&e.current){var n=e.current;ke.add(n);for(var r,o=z(je.keys());!(r=o()).done;){var i=r.value;i.contains(n)&&(Ce(i),je.delete(i))}return document.querySelectorAll("body > *").forEach((function(e){if(e instanceof HTMLElement){for(var t,n=z(ke);!(t=n()).done;){var r=t.value;if(e.contains(r))return}1===ke.size&&(je.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),Oe(e))}})),function(){if(ke.delete(n),ke.size>0)document.querySelectorAll("body > *").forEach((function(e){if(e instanceof HTMLElement&&!je.has(e)){for(var t,n=z(ke);!(t=n()).done;){var r=t.value;if(e.contains(r))return}je.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),Oe(e)}}));else for(var e,t=z(je.keys());!(e=t()).done;){var r=e.value;Ce(r),je.delete(r)}}}}),[t])}(m,!!C&&O),xe("mousedown",(function(e){var t,n=e.target;b===qe.Open&&(C||(null==(t=m.current)?void 0:t.contains(n))||k())})),(0,o.useEffect)((function(){if(b===qe.Open&&!E){var e=document.documentElement.style.overflow,t=document.documentElement.style.paddingRight,n=window.innerWidth-document.documentElement.clientWidth;return document.documentElement.style.overflow="hidden",document.documentElement.style.paddingRight=n+"px",function(){document.documentElement.style.overflow=e,document.documentElement.style.paddingRight=t}}}),[b,E]),(0,o.useEffect)((function(){if(b===qe.Open&&m.current){var e=new IntersectionObserver((function(e){for(var t,n=z(e);!(t=n()).done;){var r=t.value;0===r.boundingClientRect.x&&0===r.boundingClientRect.y&&0===r.boundingClientRect.width&&0===r.boundingClientRect.height&&k()}}));return e.observe(m.current),function(){return e.disconnect()}}}),[b,m,k]);var P=De(),I=P[0],N=P[1],T="headlessui-dialog-"+ce(),R=(0,o.useMemo)((function(){return[{dialogState:b,close:k,setTitleId:j},w]}),[b,w,k,j]),_=(0,o.useMemo)((function(){return{open:b===qe.Open}}),[b]),A={ref:v,id:T,role:"dialog","aria-modal":b===qe.Open||void 0,"aria-labelledby":w.titleId,"aria-describedby":I,onClick:function(e){e.stopPropagation()},onKeyDown:function(e){e.key===J.Escape&&b===qe.Open&&(C||(e.preventDefault(),e.stopPropagation(),k()))}},L=s;return i().createElement(ze,{type:"Dialog",element:m,onUpdate:(0,o.useCallback)((function(e,t,n){var r;"Dialog"===t&&$(e,((r={})[Ge.Add]=function(){p.current.add(n),f((function(e){return e+1}))},r[Ge.Remove]=function(){p.current.add(n),f((function(e){return e-1}))},r))}),[])},i().createElement(Pe,{force:!0},i().createElement(Te,null,i().createElement(Qe.Provider,{value:R},i().createElement(Te.Group,{target:m},i().createElement(Pe,{force:!1},i().createElement(N,{slot:_,name:"Dialog.Description"},X({props:q({},L,A),slot:_,defaultTag:"div",features:Xe,visible:g,name:"Dialog"}))))))))})),et=ee((function e(t,n){var r=Ye([ot.displayName,e.name].join("."))[0],i=r.dialogState,a=r.close,u=ne(n),s="headlessui-dialog-overlay-"+ce(),c=(0,o.useCallback)((function(e){if(re(e.currentTarget))return e.preventDefault();e.preventDefault(),e.stopPropagation(),a()}),[a]),l=(0,o.useMemo)((function(){return{open:i===qe.Open}}),[i]);return X({props:q({},t,{ref:u,id:s,"aria-hidden":!0,onClick:c}),slot:l,defaultTag:"div",name:"Dialog.Overlay"})}));var tt,nt,rt,ot=Object.assign(Ze,{Overlay:et,Title:function e(t){var n=Ye([ot.displayName,e.name].join("."))[0],r=n.dialogState,i=n.setTitleId,a="headlessui-dialog-title-"+ce();(0,o.useEffect)((function(){return i(a),function(){return i(null)}}),[a,i]);var u=(0,o.useMemo)((function(){return{open:r===qe.Open}}),[r]);return X({props:q({},t,{id:a}),slot:u,defaultTag:"h2",name:"Dialog.Title"})},Description:Fe});!function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(nt||(nt={})),function(e){e[e.ToggleDisclosure=0]="ToggleDisclosure",e[e.SetButtonId=1]="SetButtonId",e[e.SetPanelId=2]="SetPanelId",e[e.LinkPanel=3]="LinkPanel",e[e.UnlinkPanel=4]="UnlinkPanel"}(rt||(rt={}));var it=((tt={})[rt.ToggleDisclosure]=function(e){var t;return q({},e,{disclosureState:$(e.disclosureState,(t={},t[nt.Open]=nt.Closed,t[nt.Closed]=nt.Open,t))})},tt[rt.LinkPanel]=function(e){return!0===e.linkedPanel?e:q({},e,{linkedPanel:!0})},tt[rt.UnlinkPanel]=function(e){return!1===e.linkedPanel?e:q({},e,{linkedPanel:!1})},tt[rt.SetButtonId]=function(e,t){return e.buttonId===t.buttonId?e:q({},e,{buttonId:t.buttonId})},tt[rt.SetPanelId]=function(e,t){return e.panelId===t.panelId?e:q({},e,{panelId:t.panelId})},tt),at=(0,o.createContext)(null);function ut(e){var t=(0,o.useContext)(at);if(null===t){var n=new Error("<"+e+" /> is missing a parent <"+lt.name+" /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(n,ut),n}return t}function st(e,t){return $(t.type,it,e,t)}at.displayName="DisclosureContext";var ct=o.Fragment;function lt(e){var t,n=e.defaultOpen,r=void 0!==n&&n,a=K(e,["defaultOpen"]),u="headlessui-disclosure-button-"+ce(),s="headlessui-disclosure-panel-"+ce(),c=(0,o.useReducer)(st,{disclosureState:r?nt.Open:nt.Closed,linkedPanel:!1,buttonId:u,panelId:s}),l=c[0].disclosureState,f=c[1];(0,o.useEffect)((function(){return f({type:rt.SetButtonId,buttonId:u})}),[u,f]),(0,o.useEffect)((function(){return f({type:rt.SetPanelId,panelId:s})}),[s,f]);var d=(0,o.useMemo)((function(){return{open:l===nt.Open}}),[l]);return i().createElement(at.Provider,{value:c},i().createElement(Ve,{value:$(l,(t={},t[nt.Open]=Me.Open,t[nt.Closed]=Me.Closed,t))},X({props:a,slot:d,defaultTag:ct,name:"Disclosure"})))}var ft=ee((function e(t,n){var r=ut([lt.name,e.name].join(".")),i=r[0],a=r[1],u=ne(n),s=(0,o.useCallback)((function(e){switch(e.key){case J.Space:case J.Enter:e.preventDefault(),e.stopPropagation(),a({type:rt.ToggleDisclosure})}}),[a]),c=(0,o.useCallback)((function(e){switch(e.key){case J.Space:e.preventDefault()}}),[]),l=(0,o.useCallback)((function(e){re(e.currentTarget)||t.disabled||a({type:rt.ToggleDisclosure})}),[a,t.disabled]),f=(0,o.useMemo)((function(){return{open:i.disclosureState===nt.Open}}),[i]);return X({props:q({},t,{ref:u,id:i.buttonId,type:"button","aria-expanded":i.disclosureState===nt.Open||void 0,"aria-controls":i.linkedPanel?i.panelId:void 0,onKeyDown:s,onKeyUp:c,onClick:l}),slot:f,defaultTag:"button",name:"Disclosure.Button"})})),dt=Q.RenderStrategy|Q.Static,pt=ee((function e(t,n){var r=ut([lt.name,e.name].join(".")),i=r[0],a=r[1],u=ne(n,(function(){i.linkedPanel||a({type:rt.LinkPanel})})),s=Ue(),c=null!==s?s===Me.Open:i.disclosureState===nt.Open;(0,o.useEffect)((function(){return function(){return a({type:rt.UnlinkPanel})}}),[a]),(0,o.useEffect)((function(){var e;i.disclosureState!==nt.Closed||null!=(e=t.unmount)&&!e||a({type:rt.UnlinkPanel})}),[i.disclosureState,t.unmount,a]);var l=(0,o.useMemo)((function(){return{open:i.disclosureState===nt.Open}}),[i]),f={ref:u,id:i.panelId};return X({props:q({},t,f),slot:l,defaultTag:"div",features:dt,visible:c,name:"Disclosure.Panel"})}));lt.Button=ft,lt.Panel=pt;var mt,vt,ht,yt;function bt(){var e=[],t={requestAnimationFrame:function(e){function t(){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(){var e=requestAnimationFrame.apply(void 0,arguments);t.add((function(){return cancelAnimationFrame(e)}))})),nextFrame:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];t.requestAnimationFrame((function(){t.requestAnimationFrame.apply(t,n)}))},setTimeout:function(e){function t(){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(){var e=setTimeout.apply(void 0,arguments);t.add((function(){return clearTimeout(e)}))})),add:function(t){e.push(t)},dispose:function(){for(var t,n=z(e.splice(0));!(t=n()).done;){var r=t.value;r()}}};return t}function gt(){var e=(0,o.useState)(bt)[0];return(0,o.useEffect)((function(){return function(){return e.dispose()}}),[e]),e}function xt(e,t){var n=(0,o.useState)(e),r=n[0],i=n[1],a=(0,o.useRef)(e);return oe((function(){a.current=e}),[e]),oe((function(){return i(a.current)}),[a,i].concat(t)),r}function wt(e,t){var n=t.resolveItems();if(n.length<=0)return null;var r=t.resolveActiveIndex(),o=null!=r?r:-1,i=function(){switch(e.focus){case mt.First:return n.findIndex((function(e){return!t.resolveDisabled(e)}));case mt.Previous:var r=n.slice().reverse().findIndex((function(e,n,r){return!(-1!==o&&r.length-n-1>=o)&&!t.resolveDisabled(e)}));return-1===r?r:n.length-1-r;case mt.Next:return n.findIndex((function(e,n){return!(n<=o)&&!t.resolveDisabled(e)}));case mt.Last:var i=n.slice().reverse().findIndex((function(e){return!t.resolveDisabled(e)}));return-1===i?i:n.length-1-i;case mt.Specific:return n.findIndex((function(n){return t.resolveId(n)===e.id}));case mt.Nothing:return null;default:!function(e){throw new Error("Unexpected object: "+e)}(e)}}();return-1===i?r:i}!function(e){e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing"}(mt||(mt={})),function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(ht||(ht={})),function(e){e[e.OpenListbox=0]="OpenListbox",e[e.CloseListbox=1]="CloseListbox",e[e.SetDisabled=2]="SetDisabled",e[e.GoToOption=3]="GoToOption",e[e.Search=4]="Search",e[e.ClearSearch=5]="ClearSearch",e[e.RegisterOption=6]="RegisterOption",e[e.UnregisterOption=7]="UnregisterOption"}(yt||(yt={}));var St=((vt={})[yt.CloseListbox]=function(e){return e.disabled||e.listboxState===ht.Closed?e:q({},e,{activeOptionIndex:null,listboxState:ht.Closed})},vt[yt.OpenListbox]=function(e){return e.disabled||e.listboxState===ht.Open?e:q({},e,{listboxState:ht.Open})},vt[yt.SetDisabled]=function(e,t){return e.disabled===t.disabled?e:q({},e,{disabled:t.disabled})},vt[yt.GoToOption]=function(e,t){if(e.disabled)return e;if(e.listboxState===ht.Closed)return e;var n=wt(t,{resolveItems:function(){return e.options},resolveActiveIndex:function(){return e.activeOptionIndex},resolveId:function(e){return e.id},resolveDisabled:function(e){return e.dataRef.current.disabled}});return""===e.searchQuery&&e.activeOptionIndex===n?e:q({},e,{searchQuery:"",activeOptionIndex:n})},vt[yt.Search]=function(e,t){if(e.disabled)return e;if(e.listboxState===ht.Closed)return e;var n=e.searchQuery+t.value.toLowerCase(),r=e.options.findIndex((function(e){var t;return!e.dataRef.current.disabled&&(null==(t=e.dataRef.current.textValue)?void 0:t.startsWith(n))}));return-1===r||r===e.activeOptionIndex?q({},e,{searchQuery:n}):q({},e,{searchQuery:n,activeOptionIndex:r})},vt[yt.ClearSearch]=function(e){return e.disabled||e.listboxState===ht.Closed||""===e.searchQuery?e:q({},e,{searchQuery:""})},vt[yt.RegisterOption]=function(e,t){return q({},e,{options:[].concat(e.options,[{id:t.id,dataRef:t.dataRef}])})},vt[yt.UnregisterOption]=function(e,t){var n=e.options.slice(),r=null!==e.activeOptionIndex?n[e.activeOptionIndex]:null,o=n.findIndex((function(e){return e.id===t.id}));return-1!==o&&n.splice(o,1),q({},e,{options:n,activeOptionIndex:o===e.activeOptionIndex||null===r?null:n.indexOf(r)})},vt),kt=(0,o.createContext)(null);function jt(e){var t=(0,o.useContext)(kt);if(null===t){var n=new Error("<"+e+" /> is missing a parent <"+Et.name+" /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(n,jt),n}return t}function Ot(e,t){return $(t.type,St,e,t)}kt.displayName="ListboxContext";var Ct=o.Fragment;function Et(e){var t,n=e.value,r=e.onChange,a=e.disabled,u=void 0!==a&&a,s=K(e,["value","onChange","disabled"]),c=(0,o.useReducer)(Ot,{listboxState:ht.Closed,propsRef:{current:{value:n,onChange:r}},labelRef:(0,o.createRef)(),buttonRef:(0,o.createRef)(),optionsRef:(0,o.createRef)(),disabled:u,options:[],searchQuery:"",activeOptionIndex:null}),l=c[0],f=l.listboxState,d=l.propsRef,p=l.optionsRef,m=l.buttonRef,v=c[1];oe((function(){d.current.value=n}),[n,d]),oe((function(){d.current.onChange=r}),[r,d]),oe((function(){return v({type:yt.SetDisabled,disabled:u})}),[u]),xe("mousedown",(function(e){var t,n,r,o=e.target;f===ht.Open&&((null==(t=m.current)?void 0:t.contains(o))||(null==(n=p.current)?void 0:n.contains(o))||(v({type:yt.CloseListbox}),ye(o,pe.Loose)||(e.preventDefault(),null==(r=m.current)||r.focus())))}));var h=(0,o.useMemo)((function(){return{open:f===ht.Open,disabled:u}}),[f,u]);return i().createElement(kt.Provider,{value:c},i().createElement(Ve,{value:$(f,(t={},t[ht.Open]=Me.Open,t[ht.Closed]=Me.Closed,t))},X({props:s,slot:h,defaultTag:Ct,name:"Listbox"})))}var Pt=ee((function e(t,n){var r,i=jt([Et.name,e.name].join(".")),a=i[0],u=i[1],s=ne(a.buttonRef,n),c="headlessui-listbox-button-"+ce(),l=gt(),f=(0,o.useCallback)((function(e){switch(e.key){case J.Space:case J.Enter:case J.ArrowDown:e.preventDefault(),u({type:yt.OpenListbox}),l.nextFrame((function(){a.propsRef.current.value||u({type:yt.GoToOption,focus:mt.First})}));break;case J.ArrowUp:e.preventDefault(),u({type:yt.OpenListbox}),l.nextFrame((function(){a.propsRef.current.value||u({type:yt.GoToOption,focus:mt.Last})}))}}),[u,a,l]),d=(0,o.useCallback)((function(e){switch(e.key){case J.Space:e.preventDefault()}}),[]),p=(0,o.useCallback)((function(e){if(re(e.currentTarget))return e.preventDefault();a.listboxState===ht.Open?(u({type:yt.CloseListbox}),l.nextFrame((function(){var e;return null==(e=a.buttonRef.current)?void 0:e.focus({preventScroll:!0})}))):(e.preventDefault(),u({type:yt.OpenListbox}))}),[u,l,a]),m=xt((function(){if(a.labelRef.current)return[a.labelRef.current.id,c].join(" ")}),[a.labelRef.current,c]),v=(0,o.useMemo)((function(){return{open:a.listboxState===ht.Open,disabled:a.disabled}}),[a]);return X({props:q({},t,{ref:s,id:c,type:"button","aria-haspopup":!0,"aria-controls":null==(r=a.optionsRef.current)?void 0:r.id,"aria-expanded":a.listboxState===ht.Open||void 0,"aria-labelledby":m,disabled:a.disabled,onKeyDown:f,onKeyUp:d,onClick:p}),slot:v,defaultTag:"button",name:"Listbox.Button"})}));var It,Nt,Tt,Rt=Q.RenderStrategy|Q.Static,_t=ee((function e(t,n){var r,i=jt([Et.name,e.name].join(".")),a=i[0],u=i[1],s=ne(a.optionsRef,n),c="headlessui-listbox-options-"+ce(),l=gt(),f=gt(),d=Ue(),p=null!==d?d===Me.Open:a.listboxState===ht.Open;oe((function(){var e=a.optionsRef.current;e&&a.listboxState===ht.Open&&e!==document.activeElement&&e.focus({preventScroll:!0})}),[a.listboxState,a.optionsRef]);var m=(0,o.useCallback)((function(e){switch(f.dispose(),e.key){case J.Space:if(""!==a.searchQuery)return e.preventDefault(),e.stopPropagation(),u({type:yt.Search,value:e.key});case J.Enter:if(e.preventDefault(),e.stopPropagation(),u({type:yt.CloseListbox}),null!==a.activeOptionIndex){var t=a.options[a.activeOptionIndex].dataRef;a.propsRef.current.onChange(t.current.value)}bt().nextFrame((function(){var e;return null==(e=a.buttonRef.current)?void 0:e.focus({preventScroll:!0})}));break;case J.ArrowDown:return e.preventDefault(),e.stopPropagation(),u({type:yt.GoToOption,focus:mt.Next});case J.ArrowUp:return e.preventDefault(),e.stopPropagation(),u({type:yt.GoToOption,focus:mt.Previous});case J.Home:case J.PageUp:return e.preventDefault(),e.stopPropagation(),u({type:yt.GoToOption,focus:mt.First});case J.End:case J.PageDown:return e.preventDefault(),e.stopPropagation(),u({type:yt.GoToOption,focus:mt.Last});case J.Escape:return e.preventDefault(),e.stopPropagation(),u({type:yt.CloseListbox}),l.nextFrame((function(){var e;return null==(e=a.buttonRef.current)?void 0:e.focus({preventScroll:!0})}));case J.Tab:e.preventDefault(),e.stopPropagation();break;default:1===e.key.length&&(u({type:yt.Search,value:e.key}),f.setTimeout((function(){return u({type:yt.ClearSearch})}),350))}}),[l,u,f,a]),v=xt((function(){var e,t,n;return null!=(e=null==(t=a.labelRef.current)?void 0:t.id)?e:null==(n=a.buttonRef.current)?void 0:n.id}),[a.labelRef.current,a.buttonRef.current]),h=(0,o.useMemo)((function(){return{open:a.listboxState===ht.Open}}),[a]);return X({props:q({},t,{"aria-activedescendant":null===a.activeOptionIndex||null==(r=a.options[a.activeOptionIndex])?void 0:r.id,"aria-labelledby":v,id:c,onKeyDown:m,role:"listbox",tabIndex:0,ref:s}),slot:h,defaultTag:"ul",features:Rt,visible:p,name:"Listbox.Options"})}));function At(e){var t=e.container,n=e.accept,r=e.walk,i=e.enabled,a=void 0===i||i,u=(0,o.useRef)(n),s=(0,o.useRef)(r);(0,o.useEffect)((function(){u.current=n,s.current=r}),[n,r]),oe((function(){if(t&&a)for(var e=u.current,n=s.current,r=Object.assign((function(t){return e(t)}),{acceptNode:e}),o=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,r,!1);o.nextNode();)n(o.currentNode)}),[t,a,u,s])}Et.Button=Pt,Et.Label=function e(t){var n=jt([Et.name,e.name].join("."))[0],r="headlessui-listbox-label-"+ce(),i=(0,o.useCallback)((function(){var e;return null==(e=n.buttonRef.current)?void 0:e.focus({preventScroll:!0})}),[n.buttonRef]),a=(0,o.useMemo)((function(){return{open:n.listboxState===ht.Open,disabled:n.disabled}}),[n]);return X({props:q({},t,{ref:n.labelRef,id:r,onClick:i}),slot:a,defaultTag:"label",name:"Listbox.Label"})},Et.Options=_t,Et.Option=function e(t){var n=t.disabled,r=void 0!==n&&n,i=t.value,a=K(t,["disabled","value"]),u=jt([Et.name,e.name].join(".")),s=u[0],c=u[1],l="headlessui-listbox-option-"+ce(),f=null!==s.activeOptionIndex&&s.options[s.activeOptionIndex].id===l,d=s.propsRef.current.value===i,p=(0,o.useRef)({disabled:r,value:i});oe((function(){p.current.disabled=r}),[p,r]),oe((function(){p.current.value=i}),[p,i]),oe((function(){var e,t;p.current.textValue=null==(e=document.getElementById(l))||null==(t=e.textContent)?void 0:t.toLowerCase()}),[p,l]);var m=(0,o.useCallback)((function(){return s.propsRef.current.onChange(i)}),[s.propsRef,i]);oe((function(){return c({type:yt.RegisterOption,id:l,dataRef:p}),function(){return c({type:yt.UnregisterOption,id:l})}}),[p,l]),oe((function(){var e;s.listboxState===ht.Open&&d&&(c({type:yt.GoToOption,focus:mt.Specific,id:l}),null==(e=document.getElementById(l))||null==e.focus||e.focus())}),[s.listboxState]),oe((function(){if(s.listboxState===ht.Open&&f){var e=bt();return e.nextFrame((function(){var e;return null==(e=document.getElementById(l))||null==e.scrollIntoView?void 0:e.scrollIntoView({block:"nearest"})})),e.dispose}}),[l,f,s.listboxState]);var v=(0,o.useCallback)((function(e){if(r)return e.preventDefault();m(),c({type:yt.CloseListbox}),bt().nextFrame((function(){var e;return null==(e=s.buttonRef.current)?void 0:e.focus({preventScroll:!0})}))}),[c,s.buttonRef,r,m]),h=(0,o.useCallback)((function(){if(r)return c({type:yt.GoToOption,focus:mt.Nothing});c({type:yt.GoToOption,focus:mt.Specific,id:l})}),[r,l,c]),y=(0,o.useCallback)((function(){r||f||c({type:yt.GoToOption,focus:mt.Specific,id:l})}),[r,f,l,c]),b=(0,o.useCallback)((function(){r||f&&c({type:yt.GoToOption,focus:mt.Nothing})}),[r,f,c]),g=(0,o.useMemo)((function(){return{active:f,selected:d,disabled:r}}),[f,d,r]);return X({props:q({},a,{id:l,role:"option",tabIndex:-1,"aria-disabled":!0===r||void 0,"aria-selected":!0===d||void 0,onClick:v,onFocus:h,onPointerMove:y,onMouseMove:y,onPointerLeave:b,onMouseLeave:b}),slot:g,defaultTag:"li",name:"Listbox.Option"})},function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(Nt||(Nt={})),function(e){e[e.OpenMenu=0]="OpenMenu",e[e.CloseMenu=1]="CloseMenu",e[e.GoToItem=2]="GoToItem",e[e.Search=3]="Search",e[e.ClearSearch=4]="ClearSearch",e[e.RegisterItem=5]="RegisterItem",e[e.UnregisterItem=6]="UnregisterItem"}(Tt||(Tt={}));var Lt=((It={})[Tt.CloseMenu]=function(e){return e.menuState===Nt.Closed?e:q({},e,{activeItemIndex:null,menuState:Nt.Closed})},It[Tt.OpenMenu]=function(e){return e.menuState===Nt.Open?e:q({},e,{menuState:Nt.Open})},It[Tt.GoToItem]=function(e,t){var n=wt(t,{resolveItems:function(){return e.items},resolveActiveIndex:function(){return e.activeItemIndex},resolveId:function(e){return e.id},resolveDisabled:function(e){return e.dataRef.current.disabled}});return""===e.searchQuery&&e.activeItemIndex===n?e:q({},e,{searchQuery:"",activeItemIndex:n})},It[Tt.Search]=function(e,t){var n=e.searchQuery+t.value.toLowerCase(),r=e.items.findIndex((function(e){var t;return(null==(t=e.dataRef.current.textValue)?void 0:t.startsWith(n))&&!e.dataRef.current.disabled}));return-1===r||r===e.activeItemIndex?q({},e,{searchQuery:n}):q({},e,{searchQuery:n,activeItemIndex:r})},It[Tt.ClearSearch]=function(e){return""===e.searchQuery?e:q({},e,{searchQuery:""})},It[Tt.RegisterItem]=function(e,t){return q({},e,{items:[].concat(e.items,[{id:t.id,dataRef:t.dataRef}])})},It[Tt.UnregisterItem]=function(e,t){var n=e.items.slice(),r=null!==e.activeItemIndex?n[e.activeItemIndex]:null,o=n.findIndex((function(e){return e.id===t.id}));return-1!==o&&n.splice(o,1),q({},e,{items:n,activeItemIndex:o===e.activeItemIndex||null===r?null:n.indexOf(r)})},It),Dt=(0,o.createContext)(null);function Ft(e){var t=(0,o.useContext)(Dt);if(null===t){var n=new Error("<"+e+" /> is missing a parent <"+Ut.name+" /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(n,Ft),n}return t}function Mt(e,t){return $(t.type,Lt,e,t)}Dt.displayName="MenuContext";var Bt=o.Fragment;function Ut(e){var t,n=(0,o.useReducer)(Mt,{menuState:Nt.Closed,buttonRef:(0,o.createRef)(),itemsRef:(0,o.createRef)(),items:[],searchQuery:"",activeItemIndex:null}),r=n[0],a=r.menuState,u=r.itemsRef,s=r.buttonRef,c=n[1];xe("mousedown",(function(e){var t,n,r,o=e.target;a===Nt.Open&&((null==(t=s.current)?void 0:t.contains(o))||(null==(n=u.current)?void 0:n.contains(o))||(c({type:Tt.CloseMenu}),ye(o,pe.Loose)||(e.preventDefault(),null==(r=s.current)||r.focus())))}));var l=(0,o.useMemo)((function(){return{open:a===Nt.Open}}),[a]);return i().createElement(Dt.Provider,{value:n},i().createElement(Ve,{value:$(a,(t={},t[Nt.Open]=Me.Open,t[Nt.Closed]=Me.Closed,t))},X({props:e,slot:l,defaultTag:Bt,name:"Menu"})))}var Vt,Gt,Ht,qt=ee((function e(t,n){var r,i=Ft([Ut.name,e.name].join(".")),a=i[0],u=i[1],s=ne(a.buttonRef,n),c="headlessui-menu-button-"+ce(),l=gt(),f=(0,o.useCallback)((function(e){switch(e.key){case J.Space:case J.Enter:case J.ArrowDown:e.preventDefault(),e.stopPropagation(),u({type:Tt.OpenMenu}),l.nextFrame((function(){return u({type:Tt.GoToItem,focus:mt.First})}));break;case J.ArrowUp:e.preventDefault(),e.stopPropagation(),u({type:Tt.OpenMenu}),l.nextFrame((function(){return u({type:Tt.GoToItem,focus:mt.Last})}))}}),[u,l]),d=(0,o.useCallback)((function(e){switch(e.key){case J.Space:e.preventDefault()}}),[]),p=(0,o.useCallback)((function(e){if(re(e.currentTarget))return e.preventDefault();t.disabled||(a.menuState===Nt.Open?(u({type:Tt.CloseMenu}),l.nextFrame((function(){var e;return null==(e=a.buttonRef.current)?void 0:e.focus({preventScroll:!0})}))):(e.preventDefault(),e.stopPropagation(),u({type:Tt.OpenMenu})))}),[u,l,a,t.disabled]),m=(0,o.useMemo)((function(){return{open:a.menuState===Nt.Open}}),[a]);return X({props:q({},t,{ref:s,id:c,type:"button","aria-haspopup":!0,"aria-controls":null==(r=a.itemsRef.current)?void 0:r.id,"aria-expanded":a.menuState===Nt.Open||void 0,onKeyDown:f,onKeyUp:d,onClick:p}),slot:m,defaultTag:"button",name:"Menu.Button"})})),Kt=Q.RenderStrategy|Q.Static,Wt=ee((function e(t,n){var r,i,a=Ft([Ut.name,e.name].join(".")),u=a[0],s=a[1],c=ne(u.itemsRef,n),l="headlessui-menu-items-"+ce(),f=gt(),d=Ue(),p=null!==d?d===Me.Open:u.menuState===Nt.Open;(0,o.useEffect)((function(){var e=u.itemsRef.current;e&&u.menuState===Nt.Open&&e!==document.activeElement&&e.focus({preventScroll:!0})}),[u.menuState,u.itemsRef]),At({container:u.itemsRef.current,enabled:u.menuState===Nt.Open,accept:function(e){return"menuitem"===e.getAttribute("role")?NodeFilter.FILTER_REJECT:e.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk:function(e){e.setAttribute("role","none")}});var m=(0,o.useCallback)((function(e){switch(f.dispose(),e.key){case J.Space:if(""!==u.searchQuery)return e.preventDefault(),e.stopPropagation(),s({type:Tt.Search,value:e.key});case J.Enter:if(e.preventDefault(),e.stopPropagation(),s({type:Tt.CloseMenu}),null!==u.activeItemIndex){var t,n=u.items[u.activeItemIndex].id;null==(t=document.getElementById(n))||t.click()}bt().nextFrame((function(){var e;return null==(e=u.buttonRef.current)?void 0:e.focus({preventScroll:!0})}));break;case J.ArrowDown:return e.preventDefault(),e.stopPropagation(),s({type:Tt.GoToItem,focus:mt.Next});case J.ArrowUp:return e.preventDefault(),e.stopPropagation(),s({type:Tt.GoToItem,focus:mt.Previous});case J.Home:case J.PageUp:return e.preventDefault(),e.stopPropagation(),s({type:Tt.GoToItem,focus:mt.First});case J.End:case J.PageDown:return e.preventDefault(),e.stopPropagation(),s({type:Tt.GoToItem,focus:mt.Last});case J.Escape:e.preventDefault(),e.stopPropagation(),s({type:Tt.CloseMenu}),bt().nextFrame((function(){var e;return null==(e=u.buttonRef.current)?void 0:e.focus({preventScroll:!0})}));break;case J.Tab:e.preventDefault(),e.stopPropagation();break;default:1===e.key.length&&(s({type:Tt.Search,value:e.key}),f.setTimeout((function(){return s({type:Tt.ClearSearch})}),350))}}),[s,f,u]),v=(0,o.useCallback)((function(e){switch(e.key){case J.Space:e.preventDefault()}}),[]),h=(0,o.useMemo)((function(){return{open:u.menuState===Nt.Open}}),[u]);return X({props:q({},t,{"aria-activedescendant":null===u.activeItemIndex||null==(r=u.items[u.activeItemIndex])?void 0:r.id,"aria-labelledby":null==(i=u.buttonRef.current)?void 0:i.id,id:l,onKeyDown:m,onKeyUp:v,role:"menu",tabIndex:0,ref:c}),slot:h,defaultTag:"div",features:Kt,visible:p,name:"Menu.Items"})})),zt=o.Fragment;Ut.Button=qt,Ut.Items=Wt,Ut.Item=function e(t){var n=t.disabled,r=void 0!==n&&n,i=t.onClick,a=K(t,["disabled","onClick"]),u=Ft([Ut.name,e.name].join(".")),s=u[0],c=u[1],l="headlessui-menu-item-"+ce(),f=null!==s.activeItemIndex&&s.items[s.activeItemIndex].id===l;oe((function(){if(s.menuState===Nt.Open&&f){var e=bt();return e.nextFrame((function(){var e;return null==(e=document.getElementById(l))||null==e.scrollIntoView?void 0:e.scrollIntoView({block:"nearest"})})),e.dispose}}),[l,f,s.menuState]);var d=(0,o.useRef)({disabled:r});oe((function(){d.current.disabled=r}),[d,r]),oe((function(){var e,t;d.current.textValue=null==(e=document.getElementById(l))||null==(t=e.textContent)?void 0:t.toLowerCase()}),[d,l]),oe((function(){return c({type:Tt.RegisterItem,id:l,dataRef:d}),function(){return c({type:Tt.UnregisterItem,id:l})}}),[d,l]);var p=(0,o.useCallback)((function(e){return r?e.preventDefault():(c({type:Tt.CloseMenu}),bt().nextFrame((function(){var e;return null==(e=s.buttonRef.current)?void 0:e.focus({preventScroll:!0})})),i?i(e):void 0)}),[c,s.buttonRef,r,i]),m=(0,o.useCallback)((function(){if(r)return c({type:Tt.GoToItem,focus:mt.Nothing});c({type:Tt.GoToItem,focus:mt.Specific,id:l})}),[r,l,c]),v=(0,o.useCallback)((function(){r||f||c({type:Tt.GoToItem,focus:mt.Specific,id:l})}),[r,f,l,c]),h=(0,o.useCallback)((function(){r||f&&c({type:Tt.GoToItem,focus:mt.Nothing})}),[r,f,c]),y=(0,o.useMemo)((function(){return{active:f,disabled:r}}),[f,r]);return X({props:q({},a,{id:l,role:"menuitem",tabIndex:-1,"aria-disabled":!0===r||void 0,onClick:p,onFocus:m,onPointerMove:v,onMouseMove:v,onPointerLeave:h,onMouseLeave:h}),slot:y,defaultTag:zt,name:"Menu.Item"})},function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(Gt||(Gt={})),function(e){e[e.TogglePopover=0]="TogglePopover",e[e.ClosePopover=1]="ClosePopover",e[e.SetButton=2]="SetButton",e[e.SetButtonId=3]="SetButtonId",e[e.SetPanel=4]="SetPanel",e[e.SetPanelId=5]="SetPanelId"}(Ht||(Ht={}));var $t=((Vt={})[Ht.TogglePopover]=function(e){var t;return q({},e,{popoverState:$(e.popoverState,(t={},t[Gt.Open]=Gt.Closed,t[Gt.Closed]=Gt.Open,t))})},Vt[Ht.ClosePopover]=function(e){return e.popoverState===Gt.Closed?e:q({},e,{popoverState:Gt.Closed})},Vt[Ht.SetButton]=function(e,t){return e.button===t.button?e:q({},e,{button:t.button})},Vt[Ht.SetButtonId]=function(e,t){return e.buttonId===t.buttonId?e:q({},e,{buttonId:t.buttonId})},Vt[Ht.SetPanel]=function(e,t){return e.panel===t.panel?e:q({},e,{panel:t.panel})},Vt[Ht.SetPanelId]=function(e,t){return e.panelId===t.panelId?e:q({},e,{panelId:t.panelId})},Vt),Qt=(0,o.createContext)(null);function Yt(e){var t=(0,o.useContext)(Qt);if(null===t){var n=new Error("<"+e+" /> is missing a parent <"+tn.name+" /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(n,Yt),n}return t}Qt.displayName="PopoverContext";var Jt=(0,o.createContext)(null);function Xt(){return(0,o.useContext)(Jt)}Jt.displayName="PopoverGroupContext";var Zt=(0,o.createContext)(null);function en(e,t){return $(t.type,$t,e,t)}Zt.displayName="PopoverPanelContext";function tn(e){var t,n="headlessui-popover-button-"+ce(),r="headlessui-popover-panel-"+ce(),a=(0,o.useReducer)(en,{popoverState:Gt.Closed,button:null,buttonId:n,panel:null,panelId:r}),u=a[0],s=u.popoverState,c=u.button,l=u.panel,f=a[1];(0,o.useEffect)((function(){return f({type:Ht.SetButtonId,buttonId:n})}),[n,f]),(0,o.useEffect)((function(){return f({type:Ht.SetPanelId,panelId:r})}),[r,f]);var d=(0,o.useMemo)((function(){return{buttonId:n,panelId:r,close:function(){return f({type:Ht.ClosePopover})}}}),[n,r,f]),p=Xt(),m=null==p?void 0:p.registerPopover,v=(0,o.useCallback)((function(){var e;return null!=(e=null==p?void 0:p.isFocusWithinPopoverGroup())?e:(null==c?void 0:c.contains(document.activeElement))||(null==l?void 0:l.contains(document.activeElement))}),[p,c,l]);(0,o.useEffect)((function(){return null==m?void 0:m(d)}),[m,d]),xe("focus",(function(){s===Gt.Open&&(v()||c&&l&&f({type:Ht.ClosePopover}))}),!0),xe("mousedown",(function(e){var t=e.target;s===Gt.Open&&((null==c?void 0:c.contains(t))||(null==l?void 0:l.contains(t))||(f({type:Ht.ClosePopover}),ye(t,pe.Loose)||(e.preventDefault(),null==c||c.focus())))}));var h=(0,o.useMemo)((function(){return{open:s===Gt.Open}}),[s]);return i().createElement(Qt.Provider,{value:a},i().createElement(Ve,{value:$(s,(t={},t[Gt.Open]=Me.Open,t[Gt.Closed]=Me.Closed,t))},X({props:e,slot:h,defaultTag:"div",name:"Popover"})))}var nn=ee((function e(t,n){var r=Yt([tn.name,e.name].join(".")),i=r[0],a=r[1],u=(0,o.useRef)(null),s=Xt(),c=null==s?void 0:s.closeOthers,l=(0,o.useContext)(Zt),f=null!==l&&l===i.panelId,d=ne(u,n,f?null:function(e){return a({type:Ht.SetButton,button:e})}),p=(0,o.useRef)(null),m=(0,o.useRef)("undefined"==typeof window?null:document.activeElement);xe("focus",(function(){m.current=p.current,p.current=document.activeElement}),!0);var v=(0,o.useCallback)((function(e){var t;if(f){if(i.popoverState===Gt.Closed)return;switch(e.key){case J.Space:case J.Enter:e.preventDefault(),e.stopPropagation(),a({type:Ht.ClosePopover}),null==(t=i.button)||t.focus()}}else switch(e.key){case J.Space:case J.Enter:e.preventDefault(),e.stopPropagation(),i.popoverState===Gt.Closed&&(null==c||c(i.buttonId)),a({type:Ht.TogglePopover});break;case J.Escape:if(i.popoverState!==Gt.Open)return null==c?void 0:c(i.buttonId);if(!u.current)return;if(!u.current.contains(document.activeElement))return;a({type:Ht.ClosePopover});break;case J.Tab:if(i.popoverState!==Gt.Open)return;if(!i.panel)return;if(!i.button)return;if(e.shiftKey){var n;if(!m.current)return;if(null==(n=i.button)?void 0:n.contains(m.current))return;if(i.panel.contains(m.current))return;var r=he(),o=r.indexOf(m.current);if(r.indexOf(i.button)>o)return;e.preventDefault(),e.stopPropagation(),ge(i.panel,le.Last)}else e.preventDefault(),e.stopPropagation(),ge(i.panel,le.First)}}),[a,i.popoverState,i.buttonId,i.button,i.panel,u,c,f]),h=(0,o.useCallback)((function(e){var t;if(!f&&(e.key===J.Space&&e.preventDefault(),i.popoverState===Gt.Open&&i.panel&&i.button))switch(e.key){case J.Tab:if(!m.current)return;if(null==(t=i.button)?void 0:t.contains(m.current))return;if(i.panel.contains(m.current))return;var n=he(),r=n.indexOf(m.current);if(n.indexOf(i.button)>r)return;e.preventDefault(),e.stopPropagation(),ge(i.panel,le.Last)}}),[i.popoverState,i.panel,i.button,f]),y=(0,o.useCallback)((function(e){var n,r;re(e.currentTarget)||(t.disabled||(f?(a({type:Ht.ClosePopover}),null==(n=i.button)||n.focus()):(i.popoverState===Gt.Closed&&(null==c||c(i.buttonId)),null==(r=i.button)||r.focus(),a({type:Ht.TogglePopover}))))}),[a,i.button,i.popoverState,i.buttonId,t.disabled,c,f]),b=(0,o.useMemo)((function(){return{open:i.popoverState===Gt.Open}}),[i]);return X({props:q({},t,f?{type:"button",onKeyDown:v,onClick:y}:{ref:d,id:i.buttonId,type:"button","aria-expanded":i.popoverState===Gt.Open||void 0,"aria-controls":i.panel?i.panelId:void 0,onKeyDown:v,onKeyUp:h,onClick:y}),slot:b,defaultTag:"button",name:"Popover.Button"})})),rn=Q.RenderStrategy|Q.Static,on=ee((function e(t,n){var r=Yt([tn.name,e.name].join(".")),i=r[0].popoverState,a=r[1],u=ne(n),s="headlessui-popover-overlay-"+ce(),c=Ue(),l=null!==c?c===Me.Open:i===Gt.Open,f=(0,o.useCallback)((function(e){if(re(e.currentTarget))return e.preventDefault();a({type:Ht.ClosePopover})}),[a]),d=(0,o.useMemo)((function(){return{open:i===Gt.Open}}),[i]);return X({props:q({},t,{ref:u,id:s,"aria-hidden":!0,onClick:f}),slot:d,defaultTag:"div",features:rn,visible:l,name:"Popover.Overlay"})})),an=Q.RenderStrategy|Q.Static,un=ee((function e(t,n){var r=t.focus,a=void 0!==r&&r,u=K(t,["focus"]),s=Yt([tn.name,e.name].join(".")),c=s[0],l=s[1],f=(0,o.useRef)(null),d=ne(f,n,(function(e){l({type:Ht.SetPanel,panel:e})})),p=Ue(),m=null!==p?p===Me.Open:c.popoverState===Gt.Open,v=(0,o.useCallback)((function(e){var t;switch(e.key){case J.Escape:if(c.popoverState!==Gt.Open)return;if(!f.current)return;if(!f.current.contains(document.activeElement))return;e.preventDefault(),l({type:Ht.ClosePopover}),null==(t=c.button)||t.focus()}}),[c,f,l]);(0,o.useEffect)((function(){return function(){return l({type:Ht.SetPanel,panel:null})}}),[l]),(0,o.useEffect)((function(){var e;c.popoverState!==Gt.Closed||null!=(e=t.unmount)&&!e||l({type:Ht.SetPanel,panel:null})}),[c.popoverState,t.unmount,l]),(0,o.useEffect)((function(){if(a&&c.popoverState===Gt.Open&&f.current){var e=document.activeElement;f.current.contains(e)||ge(f.current,le.First)}}),[a,f,c.popoverState]),xe("keydown",(function(e){if(c.popoverState===Gt.Open&&f.current&&e.key===J.Tab&&document.activeElement&&f.current&&f.current.contains(document.activeElement)){e.preventDefault();var t,n=ge(f.current,e.shiftKey?le.Previous:le.Next);if(n===fe.Underflow)return null==(t=c.button)?void 0:t.focus();if(n===fe.Overflow){if(!c.button)return;var r=he(),o=r.indexOf(c.button);ge(r.splice(o+1).filter((function(e){var t;return!(null==(t=f.current)?void 0:t.contains(e))})),le.First)===fe.Error&&ge(document.body,le.First)}}})),xe("focus",(function(){var e;a&&c.popoverState===Gt.Open&&f.current&&((null==(e=f.current)?void 0:e.contains(document.activeElement))||l({type:Ht.ClosePopover}))}),!0);var h=(0,o.useMemo)((function(){return{open:c.popoverState===Gt.Open}}),[c]),y={ref:d,id:c.panelId,onKeyDown:v};return i().createElement(Zt.Provider,{value:c.panelId},X({props:q({},u,y),slot:h,defaultTag:"div",features:an,visible:m,name:"Popover.Panel"}))}));tn.Button=nn,tn.Overlay=on,tn.Panel=un,tn.Group=function(e){var t=(0,o.useRef)(null),n=(0,o.useState)([]),r=n[0],a=n[1],u=(0,o.useCallback)((function(e){a((function(t){var n=t.indexOf(e);if(-1!==n){var r=t.slice();return r.splice(n,1),r}return t}))}),[a]),s=(0,o.useCallback)((function(e){return a((function(t){return[].concat(t,[e])})),function(){return u(e)}}),[a,u]),c=(0,o.useCallback)((function(){var e,n=document.activeElement;return!!(null==(e=t.current)?void 0:e.contains(n))||r.some((function(e){var t,r;return(null==(t=document.getElementById(e.buttonId))?void 0:t.contains(n))||(null==(r=document.getElementById(e.panelId))?void 0:r.contains(n))}))}),[t,r]),l=(0,o.useCallback)((function(e){for(var t,n=z(r);!(t=n()).done;){var o=t.value;o.buttonId!==e&&o.close()}}),[r]),f=(0,o.useMemo)((function(){return{registerPopover:s,unregisterPopover:u,isFocusWithinPopoverGroup:c,closeOthers:l}}),[s,u,c,l]),d=(0,o.useMemo)((function(){return{}}),[]),p={ref:t},m=e;return i().createElement(Jt.Provider,{value:f},X({props:q({},m,p),slot:d,defaultTag:"div",name:"Popover.Group"}))};var sn=(0,o.createContext)(null);function cn(){var e=(0,o.useContext)(sn);if(null===e){var t=new Error("You used a <Label /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,cn),t}return e}function ln(){var e=(0,o.useState)([]),t=e[0],n=e[1];return[t.length>0?t.join(" "):void 0,(0,o.useMemo)((function(){return function(e){var t=(0,o.useCallback)((function(e){return n((function(t){return[].concat(t,[e])})),function(){return n((function(t){var n=t.slice(),r=n.indexOf(e);return-1!==r&&n.splice(r,1),n}))}}),[]),r=(0,o.useMemo)((function(){return{register:t,slot:e.slot,name:e.name,props:e.props}}),[t,e.slot,e.name,e.props]);return i().createElement(sn.Provider,{value:r},e.children)}}),[n])]}var fn,dn;function pn(e){var t=e.passive,n=void 0!==t&&t,r=K(e,["passive"]),o=cn(),i="headlessui-label-"+ce();oe((function(){return o.register(i)}),[i,o.register]);var a=q({},o.props,{id:i}),u=q({},r,a);return n&&delete u.onClick,X({props:u,slot:o.slot||{},defaultTag:"label",name:o.name||"Label"})}!function(e){e[e.RegisterOption=0]="RegisterOption",e[e.UnregisterOption=1]="UnregisterOption"}(dn||(dn={}));var mn=((fn={})[dn.RegisterOption]=function(e,t){return q({},e,{options:[].concat(e.options,[{id:t.id,element:t.element,propsRef:t.propsRef}])})},fn[dn.UnregisterOption]=function(e,t){var n=e.options.slice(),r=e.options.findIndex((function(e){return e.id===t.id}));return-1===r?e:(n.splice(r,1),q({},e,{options:n}))},fn),vn=(0,o.createContext)(null);function hn(e){var t=(0,o.useContext)(vn);if(null===t){var n=new Error("<"+e+" /> is missing a parent <"+gn.name+" /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(n,hn),n}return t}function yn(e,t){return $(t.type,mn,e,t)}vn.displayName="RadioGroupContext";var bn;function gn(e){var t=e.value,n=e.onChange,r=e.disabled,a=void 0!==r&&r,u=K(e,["value","onChange","disabled"]),s=(0,o.useReducer)(yn,{options:[]}),c=s[0].options,l=s[1],f=ln(),d=f[0],p=f[1],m=De(),v=m[0],h=m[1],y="headlessui-radiogroup-"+ce(),b=(0,o.useRef)(null),g=(0,o.useMemo)((function(){return c.find((function(e){return!e.propsRef.current.disabled}))}),[c]),x=(0,o.useMemo)((function(){return c.some((function(e){return e.propsRef.current.value===t}))}),[c,t]),w=(0,o.useCallback)((function(e){var r;if(a)return!1;if(e===t)return!1;var o=null==(r=c.find((function(t){return t.propsRef.current.value===e})))?void 0:r.propsRef.current;return!(null==o?void 0:o.disabled)&&(n(e),!0)}),[n,t,a,c]);At({container:b.current,accept:function(e){return"radio"===e.getAttribute("role")?NodeFilter.FILTER_REJECT:e.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk:function(e){e.setAttribute("role","none")}});var S=(0,o.useCallback)((function(e){if(b.current){var t=c.filter((function(e){return!1===e.propsRef.current.disabled})).map((function(e){return e.element.current}));switch(e.key){case J.ArrowLeft:case J.ArrowUp:if(e.preventDefault(),e.stopPropagation(),ge(t,le.Previous|le.WrapAround)===fe.Success){var n=c.find((function(e){return e.element.current===document.activeElement}));n&&w(n.propsRef.current.value)}break;case J.ArrowRight:case J.ArrowDown:if(e.preventDefault(),e.stopPropagation(),ge(t,le.Next|le.WrapAround)===fe.Success){var r=c.find((function(e){return e.element.current===document.activeElement}));r&&w(r.propsRef.current.value)}break;case J.Space:e.preventDefault(),e.stopPropagation();var o=c.find((function(e){return e.element.current===document.activeElement}));o&&w(o.propsRef.current.value)}}}),[b,c,w]),k=(0,o.useCallback)((function(e){return l(q({type:dn.RegisterOption},e)),function(){return l({type:dn.UnregisterOption,id:e.id})}}),[l]),j=(0,o.useMemo)((function(){return{registerOption:k,firstOption:g,containsCheckedOption:x,change:w,disabled:a,value:t}}),[k,g,x,w,a,t]),O={ref:b,id:y,role:"radiogroup","aria-labelledby":d,"aria-describedby":v,onKeyDown:S};return i().createElement(h,{name:"RadioGroup.Description"},i().createElement(p,{name:"RadioGroup.Label"},i().createElement(vn.Provider,{value:j},X({props:q({},u,O),defaultTag:"div",name:"RadioGroup"}))))}!function(e){e[e.Empty=1]="Empty",e[e.Active=2]="Active"}(bn||(bn={}));gn.Option=function e(t){var n=(0,o.useRef)(null),r="headlessui-radiogroup-option-"+ce(),a=ln(),u=a[0],s=a[1],c=De(),l=c[0],f=c[1],d=function(e){void 0===e&&(e=0);var t=(0,o.useState)(e),n=t[0],r=t[1];return{addFlag:(0,o.useCallback)((function(e){return r((function(t){return t|e}))}),[r]),hasFlag:(0,o.useCallback)((function(e){return Boolean(n&e)}),[n]),removeFlag:(0,o.useCallback)((function(e){return r((function(t){return t&~e}))}),[r]),toggleFlag:(0,o.useCallback)((function(e){return r((function(t){return t^e}))}),[r])}}(bn.Empty),p=d.addFlag,m=d.removeFlag,v=d.hasFlag,h=t.value,y=t.disabled,b=void 0!==y&&y,g=K(t,["value","disabled"]),x=(0,o.useRef)({value:h,disabled:b});oe((function(){x.current.value=h}),[h,x]),oe((function(){x.current.disabled=b}),[b,x]);var w=hn([gn.name,e.name].join(".")),S=w.registerOption,k=w.disabled,j=w.change,O=w.firstOption,C=w.containsCheckedOption,E=w.value;oe((function(){return S({id:r,element:n,propsRef:x})}),[r,S,n,t]);var P=(0,o.useCallback)((function(){var e;j(h)&&(p(bn.Active),null==(e=n.current)||e.focus())}),[p,j,h]),I=(0,o.useCallback)((function(){return p(bn.Active)}),[p]),N=(0,o.useCallback)((function(){return m(bn.Active)}),[m]),T=(null==O?void 0:O.id)===r,R=k||b,_=E===h,A={ref:n,id:r,role:"radio","aria-checked":_?"true":"false","aria-labelledby":u,"aria-describedby":l,tabIndex:R?-1:_||!C&&T?0:-1,onClick:R?void 0:P,onFocus:R?void 0:I,onBlur:R?void 0:N},L=(0,o.useMemo)((function(){return{checked:_,disabled:R,active:v(bn.Active)}}),[_,R,v]);return i().createElement(f,{name:"RadioGroup.Description"},i().createElement(s,{name:"RadioGroup.Label"},X({props:q({},g,A),slot:L,defaultTag:"div",name:"RadioGroup.Option"})))},gn.Label=pn,gn.Description=Fe;var xn=(0,o.createContext)(null);xn.displayName="GroupContext";var wn=o.Fragment;var Sn;function kn(e){var t=e.checked,n=e.onChange,r=K(e,["checked","onChange"]),i="headlessui-switch-"+ce(),a=(0,o.useContext)(xn),u=(0,o.useCallback)((function(){return n(!t)}),[n,t]),s=(0,o.useCallback)((function(e){if(re(e.currentTarget))return e.preventDefault();e.preventDefault(),u()}),[u]),c=(0,o.useCallback)((function(e){e.key!==J.Tab&&e.preventDefault(),e.key===J.Space&&u()}),[u]),l=(0,o.useCallback)((function(e){return e.preventDefault()}),[]),f=(0,o.useMemo)((function(){return{checked:t}}),[t]),d={id:i,ref:null===a?void 0:a.setSwitch,role:"switch",tabIndex:0,"aria-checked":t,"aria-labelledby":null==a?void 0:a.labelledby,"aria-describedby":null==a?void 0:a.describedby,onClick:s,onKeyUp:c,onKeyPress:l};return"button"===r.as&&Object.assign(d,{type:"button"}),X({props:q({},r,d),slot:f,defaultTag:"button",name:"Switch"})}function jn(){var e=(0,o.useRef)(!0);return(0,o.useEffect)((function(){e.current=!1}),[]),e.current}function On(e){for(var t,n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];e&&r.length>0&&(t=e.classList).add.apply(t,r)}function Cn(e){for(var t,n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];e&&r.length>0&&(t=e.classList).remove.apply(t,r)}function En(e,t,n,r,o){var i=bt(),a=void 0!==o?function(e){var t={called:!1};return function(){if(!t.called)return t.called=!0,e.apply(void 0,arguments)}}(o):function(){};return On.apply(void 0,[e].concat(t,n)),i.nextFrame((function(){Cn.apply(void 0,[e].concat(n)),On.apply(void 0,[e].concat(r)),i.add(function(e,t){var n=bt();if(!e)return n.dispose;var r=getComputedStyle(e),o=[r.transitionDuration,r.transitionDelay].map((function(e){var t=e.split(",").filter(Boolean).map((function(e){return e.includes("ms")?parseFloat(e):1e3*parseFloat(e)})).sort((function(e,t){return t-e}))[0];return void 0===t?0:t})),i=o[0],a=o[1];return 0!==i?n.setTimeout((function(){t(Sn.Finished)}),i+a):t(Sn.Finished),n.add((function(){return t(Sn.Cancelled)})),n.dispose}(e,(function(n){return Cn.apply(void 0,[e].concat(r,t)),a(n)})))})),i.add((function(){return Cn.apply(void 0,[e].concat(t,n,r))})),i.add((function(){return a(Sn.Cancelled)})),i.dispose}function Pn(e){return void 0===e&&(e=""),(0,o.useMemo)((function(){return e.split(" ").filter((function(e){return e.trim().length>1}))}),[e])}kn.Group=function(e){var t=(0,o.useState)(null),n=t[0],r=t[1],a=ln(),u=a[0],s=a[1],c=De(),l=c[0],f=c[1],d=(0,o.useMemo)((function(){return{switch:n,setSwitch:r,labelledby:u,describedby:l}}),[n,r,u,l]);return i().createElement(f,{name:"Switch.Description"},i().createElement(s,{name:"Switch.Label",props:{onClick:function(){n&&(n.click(),n.focus({preventScroll:!0}))}}},i().createElement(xn.Provider,{value:d},X({props:e,defaultTag:wn,name:"Switch.Group"}))))},kn.Label=pn,kn.Description=Fe,function(e){e.Finished="finished",e.Cancelled="cancelled"}(Sn||(Sn={}));var In,Nn=(0,o.createContext)(null);Nn.displayName="TransitionContext",function(e){e.Visible="visible",e.Hidden="hidden"}(In||(In={}));var Tn=(0,o.createContext)(null);function Rn(e){return"children"in e?Rn(e.children):e.current.filter((function(e){return e.state===In.Visible})).length>0}function _n(e){var t=(0,o.useRef)(e),n=(0,o.useRef)([]),r=we();(0,o.useEffect)((function(){t.current=e}),[e]);var i=(0,o.useCallback)((function(e,o){var i;void 0===o&&(o=Y.Hidden);var a=n.current.findIndex((function(t){return t.id===e}));-1!==a&&($(o,((i={})[Y.Unmount]=function(){n.current.splice(a,1)},i[Y.Hidden]=function(){n.current[a].state=In.Hidden},i)),!Rn(n)&&r.current&&(null==t.current||t.current()))}),[t,r,n]),a=(0,o.useCallback)((function(e){var t=n.current.find((function(t){return t.id===e}));return t?t.state!==In.Visible&&(t.state=In.Visible):n.current.push({id:e,state:In.Visible}),function(){return i(e,Y.Unmount)}}),[n,i]);return(0,o.useMemo)((function(){return{children:n,register:a,unregister:i}}),[a,i,n])}function An(){}Tn.displayName="NestingContext";var Ln=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function Dn(e){for(var t,n={},r=z(Ln);!(t=r()).done;){var o,i=t.value;n[i]=null!=(o=e[i])?o:An}return n}var Fn=Q.RenderStrategy;function Mn(e){var t,n=e.beforeEnter,r=e.afterEnter,a=e.beforeLeave,u=e.afterLeave,s=e.enter,c=e.enterFrom,l=e.enterTo,f=e.leave,d=e.leaveFrom,p=e.leaveTo,m=K(e,["beforeEnter","afterEnter","beforeLeave","afterLeave","enter","enterFrom","enterTo","leave","leaveFrom","leaveTo"]),v=(0,o.useRef)(null),h=(0,o.useState)(In.Visible),y=h[0],b=h[1],g=m.unmount?Y.Unmount:Y.Hidden,x=function(){var e=(0,o.useContext)(Nn);if(null===e)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}(),w=x.show,S=x.appear,k=function(){var e=(0,o.useContext)(Tn);if(null===e)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}(),j=k.register,O=k.unregister,C=jn(),E=ce(),P=(0,o.useRef)(!1),I=_n((function(){P.current||(b(In.Hidden),O(E),D.current.afterLeave())}));oe((function(){if(E)return j(E)}),[j,E]),oe((function(){var e;g===Y.Hidden&&E&&(w&&y!==In.Visible?b(In.Visible):$(y,((e={})[In.Hidden]=function(){return O(E)},e[In.Visible]=function(){return j(E)},e)))}),[y,E,j,O,w,g]);var N=Pn(s),T=Pn(c),R=Pn(l),_=Pn(f),A=Pn(d),L=Pn(p),D=function(e){var t=(0,o.useRef)(Dn(e));return(0,o.useEffect)((function(){t.current=Dn(e)}),[e]),t}({beforeEnter:n,afterEnter:r,beforeLeave:a,afterLeave:u}),F=ae();(0,o.useEffect)((function(){if(F&&y===In.Visible&&null===v.current)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")}),[v,y,F]);var M=C&&!S;oe((function(){var e=v.current;if(e&&!M)return P.current=!0,w&&D.current.beforeEnter(),w||D.current.beforeLeave(),w?En(e,N,T,R,(function(e){P.current=!1,e===Sn.Finished&&D.current.afterEnter()})):En(e,_,A,L,(function(e){P.current=!1,e===Sn.Finished&&(Rn(I)||(b(In.Hidden),O(E),D.current.afterLeave()))}))}),[D,E,P,O,I,v,M,w,N,T,R,_,A,L]);var B={ref:v},U=m;return i().createElement(Tn.Provider,{value:I},i().createElement(Ve,{value:$(y,(t={},t[In.Visible]=Me.Open,t[In.Hidden]=Me.Closed,t))},X({props:q({},U,B),defaultTag:"div",features:Fn,visible:y===In.Visible,name:"Transition.Child"})))}function Bn(e){var t,n=e.show,r=e.appear,a=void 0!==r&&r,u=e.unmount,s=K(e,["show","appear","unmount"]),c=Ue();void 0===n&&null!==c&&(n=$(c,((t={})[Me.Open]=!0,t[Me.Closed]=!1,t)));if(![!0,!1].includes(n))throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");var l=(0,o.useState)(n?In.Visible:In.Hidden),f=l[0],d=l[1],p=_n((function(){d(In.Hidden)})),m=jn(),v=(0,o.useMemo)((function(){return{show:n,appear:a||!m}}),[n,a,m]);(0,o.useEffect)((function(){n?d(In.Visible):Rn(p)||d(In.Hidden)}),[n,p]);var h={unmount:u};return i().createElement(Tn.Provider,{value:p},i().createElement(Nn.Provider,{value:v},X({props:q({},h,{as:o.Fragment,children:i().createElement(Mn,Object.assign({},h,s))}),defaultTag:o.Fragment,features:Fn,visible:f===In.Visible,name:"Transition"})))}Bn.Child=Mn,Bn.Root=Bn;const Un=wp.i18n;var Vn=n(246);function Gn(e){var t=e.className,n=e.hideLibrary,r=e.initialFocus,o=G((function(e){return e.remainingImports})),i=G((function(e){return e.apiKey})),a=G((function(e){return e.allowedImports}));return(0,Vn.jsx)("div",{className:t,children:(0,Vn.jsxs)("div",{className:"flex justify-between items-center px-6 sm:px-12 h-full",children:[(0,Vn.jsxs)("div",{className:"flex space-x-12 h-full",children:[(0,Vn.jsxs)("div",{className:"font-bold flex items-center space-x-1.5 lg:w-72",children:[(0,Vn.jsxs)("svg",{className:"",width:"30",height:"30",viewBox:"0 0 103 103",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,Vn.jsx)("rect",{y:"25.75",width:"70.8125",height:"77.25",fill:"#000000"}),(0,Vn.jsx)("rect",{x:"45.0625",width:"57.9375",height:"57.9375",fill:"#37C2A2"})]}),(0,Vn.jsx)("span",{className:"text-sm transform translate-y-0.5 whitespace-nowrap",children:(0,Un.__)("Extendify Library","extendify-sdk")})]}),!i.length&&(0,Vn.jsx)(Vn.Fragment,{children:(0,Vn.jsxs)("div",{className:"items-center ml-8 h-full hidden md:flex",children:[(0,Vn.jsxs)("div",{className:"h-full flex items-center px-6 border-l border-r border-gray-300 bg-extendify-lightest",children:[(0,Vn.jsx)("a",{className:"button-extendify-main inline lg:hidden",target:"_blank",href:"https://extendify.com",rel:"noreferrer",children:(0,Un.__)("Sign up","extendify-sdk")}),(0,Vn.jsx)("a",{className:"button-extendify-main hidden lg:block",target:"_blank",href:"https://extendify.com",rel:"noreferrer",children:(0,Un.__)("Sign up today to get unlimited beta access","extendify-sdk")})]}),(0,Vn.jsx)("div",{className:"m-0 p-0 px-6 text-sm bg-gray-50 border-r border-gray-300 h-full flex items-center",children:(0,Un.sprintf)((0,Un.__)("Imports left: %s / %s"),o(),Number(a))})]})})]}),(0,Vn.jsx)("div",{className:"space-x-2 transform sm:translate-x-8",children:(0,Vn.jsxs)("button",{ref:r,type:"button",className:"components-button has-icon",onClick:function(){return n()},children:[(0,Vn.jsx)("svg",{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",size:"24",role:"img","aria-hidden":"true",focusable:"false",children:(0,Vn.jsx)("path",{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"})}),(0,Vn.jsx)("span",{className:"sr-only",children:(0,Un.__)("Close library","extendify-sdk")})]})})]})})}const Hn=wp.blockEditor,qn=lodash;var Kn=function(){return T.get("taxonomies")};const Wn=wp.components;var zn=n(42),$n=n.n(zn);function Qn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Yn(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null==n)return;var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Jn(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 Jn(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 Jn(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 Xn(e){var t=Yn(e.taxonomy,2),n=t[0],o=t[1],i=e.open,a=g((function(e){return e.updateTaxonomies})),u=g((function(e){return e.resetTaxonomies})),s=g((function(e){return e.searchParams})),c=Yn((0,r.useState)({}),2),l=c[0],f=c[1],d=Yn((0,r.useState)({}),2),p=d[0],m=d[1],v=(0,r.useRef)(),h=(0,r.useRef)(),y=(0,r.useRef)(),b=(0,r.useRef)(!0),x=function(e){var t;return(null==s?void 0:s.taxonomies[n])===e.term||(null===(t=e.children)||void 0===t?void 0:t.filter((function(e){return e.term===(null==s?void 0:s.taxonomies[n])})).length)>0},w=function(e){var t;return Object.prototype.hasOwnProperty.call(e,"children")?e.children.filter((function(e){return null==e?void 0:e.type.includes(s.type)})).length:null==e||null===(t=e.type)||void 0===t?void 0:t.includes(s.type)};if((0,r.useEffect)((function(){b.current?b.current=!1:(f({}),u())}),[s.type,u]),(0,r.useEffect)((function(){Object.keys(l).length?setTimeout((function(){requestAnimationFrame((function(){m(v.current.clientHeight),y.current.focus()}))}),200):m("auto")}),[l]),!Object.keys(o).length||!Object.values(o).filter((function(e){return w(e)})).length)return"";var S=n.replace("tax_","").replace("_"," ").replace(/\b\w/g,(function(e){return e.toUpperCase()}));return(0,Vn.jsx)(Wn.PanelBody,{title:S,initialOpen:i,children:(0,Vn.jsx)(Wn.PanelRow,{children:(0,Vn.jsxs)("div",{className:"overflow-hidden w-full relative",style:{height:p},children:[(0,Vn.jsxs)("ul",{className:$n()("p-1 m-0 w-full transform transition duration-200",{"-translate-x-full":Object.keys(l).length}),children:[(0,Vn.jsx)("li",{className:"m-0",children:(0,Vn.jsx)("button",{type:"button",className:"text-left cursor-pointer w-full flex justify-between items-center py-1.5 m-0 leading-none hover:text-wp-theme-500 bg-transparent transition duration-200 button-focus",ref:h,onClick:function(){a(Qn({},n,"pattern"===s.type&&"tax_categories"===n?"Default":""))},children:(0,Vn.jsx)("span",{className:$n()({"text-wp-theme-500":!s.taxonomies[n].length||"Default"===(null==s?void 0:s.taxonomies[n])}),children:"pattern"===s.type&&"tax_categories"===n?(0,Un.__)("Default","extendify-sdk"):(0,Un.__)("All","extendify-sdk")})})}),Object.values(o).filter((function(e){return w(e)})).sort((function(e,t){return e.term.localeCompare(t.term)})).map((function(e){return(0,Vn.jsx)("li",{className:"m-0 w-full",children:(0,Vn.jsxs)("button",{type:"button",className:"text-left cursor-pointer w-full flex justify-between items-center py-1.5 m-0 leading-none bg-transparent hover:text-wp-theme-500 transition duration-200 button-focus",onClick:function(){Object.prototype.hasOwnProperty.call(e,"children")?f(e):a(Qn({},n,e.term))},children:[(0,Vn.jsx)("span",{className:$n()({"text-wp-theme-500":x(e)}),children:e.term}),Object.prototype.hasOwnProperty.call(e,"children")&&(0,Vn.jsx)("span",{className:"text-black",children:(0,Vn.jsx)("svg",{width:"8",height:"14",viewBox:"0 0 8 14",className:"stroke-current",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,Vn.jsx)("path",{d:"M1 12.5L6 6.99998L1 1.5",strokeWidth:"1.5"})})})]})},e.term)}))]}),(0,Vn.jsxs)("ul",{ref:v,className:$n()("p-1 m-0 w-full transform transition duration-200 absolute top-0 right-0",{"translate-x-full":!Object.keys(l).length}),children:[Object.values(l).length>0&&(0,Vn.jsx)("li",{className:"m-0",children:(0,Vn.jsxs)("button",{type:"button",className:"text-left cursor-pointer font-bold flex space-x-4 items-center py-2 pr-4 m-0leading-none hover:text-wp-theme-500 bg-transparent transition duration-200 button-focus",ref:y,onClick:function(){f({}),h.current.focus()},children:[(0,Vn.jsx)("svg",{className:"stroke-current transform rotate-180",width:"8",height:"14",viewBox:"0 0 8 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,Vn.jsx)("path",{d:"M1 12.5L6 6.99998L1 1.5",strokeWidth:"1.5"})}),(0,Vn.jsx)("span",{children:l.term})]})}),Object.values(l).length&&Object.values(l.children).filter((function(e){return w(e)})).sort((function(e,t){return e.term.localeCompare(t.term)})).map((function(e){return(0,Vn.jsx)("li",{className:"m-0 pl-6 w-full flex justify-between items-center",children:(0,Vn.jsx)("button",{type:"button",className:"text-left cursor-pointer w-full flex justify-between items-center py-1.5 m-0 leading-none bg-transparent hover:text-wp-theme-500 transition duration-200 button-focus",onClick:function(){a(Qn({},n,e.term))},children:(0,Vn.jsx)("span",{className:$n()({"text-wp-theme-500":x(e)}),children:e.term})})},e.term)}))]})]})})})}function Zn(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function er(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Zn(i,r,o,a,u,"next",e)}function u(e){Zn(i,r,o,a,u,"throw",e)}a(void 0)}))}}function tr(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null==n)return;var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return nr(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 nr(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 nr(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 rr(){var e,t=g((function(e){return e.updateSearchParams})),n=g((function(e){return e.setupDefaultTaxonomies})),o=g((function(e){return e.searchParams})),i=(0,qn.debounce)((function(e){return t({taxonomies:{},search:e})}),500),a=tr((0,r.useState)(null!==(e=null==o?void 0:o.search)&&void 0!==e?e:""),2),u=a[0],s=a[1],c=tr((0,r.useState)({}),2),l=c[0],f=c[1],d=(0,r.useCallback)(er(S().mark((function e(){var t;return S().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Kn();case 2:t=e.sent,n(t),f(t);case 5:case"end":return e.stop()}}),e)}))),[n]);return(0,r.useEffect)((function(){d()}),[d]),(0,Vn.jsxs)(Vn.Fragment,{children:[(0,Vn.jsx)("div",{className:"pt-1 -mt-1 mb-1 bg-white",children:(0,Vn.jsx)(Hn.__experimentalSearchForm,{placeholder:(0,Un.__)("What are you looking for?","extendify-sdk"),onChange:function(e){g.setState({nextPage:""}),s(e),i(e)},value:u,className:"sm:ml-px sm:mr-1 sm:mb-6 px-6 sm:p-0 sm:px-0",autoComplete:"off"})}),(0,Vn.jsx)("div",{className:"flex-grow hidden overflow-y-auto pb-32 pr-2 sm:block",children:(0,Vn.jsx)(Wn.Panel,{children:Object.entries(l).map((function(e,t){return(0,Vn.jsx)(Xn,{open:!1,taxonomy:e},t)}))})})]})}function or(e){var t=e.taxonomies,n=e.search,r=e.type,o=[],i=Object.entries(t).filter((function(e){return Boolean(e[1].length)})).map((function(e){return"".concat(e[0],' = "').concat(e[1],'"')})).join(", ");return i.length&&o.push(i),n.length&&o.push('OR(FIND(LOWER("'.concat(n,'"), LOWER(title))!= 0, FIND(LOWER("').concat(n,'"), LOWER({tax_categories})) != 0)')),r.length&&o.push('{type}="'.concat(r,'"')),o.length?"AND(".concat(o.join(", "),")").replace(/\r?\n|\r/g,""):""}function ir(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}var ar=0,ur=function(e,t){return(n=S().mark((function n(){var r,o,i;return S().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return ar++,o=N.CancelToken.source(),null!==(r=g.getState().fetchToken)&&void 0!==r&&r.cancel&&g.getState().fetchToken.cancel(),g.setState({fetchToken:o}),n.next=6,T.post("templates",{filterByFormula:or(e),pageSize:l,categories:e.taxonomies,search:e.search,type:e.type,offset:t,initial:1===ar,request_count:ar},{cancelToken:o.token});case 6:return i=n.sent,g.setState({fetchToken:null}),n.abrupt("return",i);case 9:case"end":return n.stop()}}),n)})),function(){var e=this,t=arguments;return new Promise((function(r,o){var i=n.apply(e,t);function a(e){ir(i,r,o,a,u,"next",e)}function u(e){ir(i,r,o,a,u,"throw",e)}a(void 0)}))})();var n},sr=function(e){var t;return T.post("templates/".concat(e.id),{template_id:e.id,maybe_import:!0,pageSize:l,template_name:null===(t=e.fields)||void 0===t?void 0:t.title})},cr=function(e){var t;return T.post("templates/".concat(e.id),{template_id:e.id,single:!0,pageSize:l,template_name:null===(t=e.fields)||void 0===t?void 0:t.title})},lr=function(e){var t;return T.post("templates/".concat(e.id),{template_id:e.id,imported:!0,pageSize:l,template_name:null===(t=e.fields)||void 0===t?void 0:t.title})};function fr(){return(fr=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 dr=new Map,pr=new WeakMap,mr=0;function vr(e){return Object.keys(e).sort().filter((function(t){return void 0!==e[t]})).map((function(t){return t+"_"+("root"===t?(n=e.root)?(pr.has(n)||(mr+=1,pr.set(n,mr.toString())),pr.get(n)):"0":e[t]);var n})).toString()}function hr(e,t,n){if(void 0===n&&(n={}),!e)return function(){};var r=function(e){var t=vr(e),n=dr.get(t);if(!n){var r,o=new Map,i=new IntersectionObserver((function(t){t.forEach((function(t){var n,i=t.isIntersecting&&r.some((function(e){return t.intersectionRatio>=e}));e.trackVisibility&&void 0===t.isVisible&&(t.isVisible=i),null==(n=o.get(t.target))||n.forEach((function(e){e(i,t)}))}))}),e);r=i.thresholds||(Array.isArray(e.threshold)?e.threshold:[e.threshold||0]),n={id:t,observer:i,elements:o},dr.set(t,n)}return n}(n),o=r.id,i=r.observer,a=r.elements,u=a.get(e)||[];return a.has(e)||a.set(e,u),u.push(t),i.observe(e),function(){u.splice(u.indexOf(t),1),0===u.length&&(a.delete(e),i.unobserve(e)),0===a.size&&(i.disconnect(),dr.delete(o))}}function yr(e){return"function"!=typeof e.children}var br=function(e){var t,n;function r(t){var n;return(n=e.call(this,t)||this).node=null,n._unobserveCb=null,n.handleNode=function(e){n.node&&(n.unobserve(),e||n.props.triggerOnce||n.props.skip||n.setState({inView:!!n.props.initialInView,entry:void 0})),n.node=e||null,n.observeNode()},n.handleChange=function(e,t){e&&n.props.triggerOnce&&n.unobserve(),yr(n.props)||n.setState({inView:e,entry:t}),n.props.onChange&&n.props.onChange(e,t)},n.state={inView:!!t.initialInView,entry:void 0},n}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n;var i=r.prototype;return i.componentDidUpdate=function(e){e.rootMargin===this.props.rootMargin&&e.root===this.props.root&&e.threshold===this.props.threshold&&e.skip===this.props.skip&&e.trackVisibility===this.props.trackVisibility&&e.delay===this.props.delay||(this.unobserve(),this.observeNode())},i.componentWillUnmount=function(){this.unobserve(),this.node=null},i.observeNode=function(){if(this.node&&!this.props.skip){var e=this.props,t=e.threshold,n=e.root,r=e.rootMargin,o=e.trackVisibility,i=e.delay;this._unobserveCb=hr(this.node,this.handleChange,{threshold:t,root:n,rootMargin:r,trackVisibility:o,delay:i})}},i.unobserve=function(){this._unobserveCb&&(this._unobserveCb(),this._unobserveCb=null)},i.render=function(){if(!yr(this.props)){var e=this.state,t=e.inView,n=e.entry;return this.props.children({inView:t,entry:n,ref:this.handleNode})}var r=this.props,i=r.children,a=r.as,u=r.tag,s=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(r,["children","as","tag","triggerOnce","threshold","root","rootMargin","onChange","skip","trackVisibility","delay","initialInView"]);return(0,o.createElement)(a||u||"div",fr({ref:this.handleNode},s),i)},r}(o.Component);br.displayName="InView",br.defaultProps={threshold:0,triggerOnce:!1,initialInView:!1};function gr(e){return function(e){if(Array.isArray(e))return jr(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||kr(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 xr(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function wr(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){xr(i,r,o,a,u,"next",e)}function u(e){xr(i,r,o,a,u,"throw",e)}a(void 0)}))}}function Sr(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null==n)return;var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}(e,t)||kr(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 kr(e,t){if(e){if("string"==typeof e)return jr(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)?jr(e,t):void 0}}function jr(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 Or(e){var t=e.templates,n=g((function(e){return e.setActive})),i=g((function(e){return e.activeTemplate})),a=g((function(e){return e.appendTemplates})),u=Sr((0,r.useState)(""),2),s=u[0],c=u[1],l=Sr((0,r.useState)(!1),2),f=l[0],d=l[1],p=Sr((0,r.useState)([]),2),m=p[0],v=p[1],h=Sr(function(e){var t=void 0===e?{}:e,n=t.threshold,r=t.delay,i=t.trackVisibility,a=t.rootMargin,u=t.root,s=t.triggerOnce,c=t.skip,l=t.initialInView,f=(0,o.useRef)(),d=(0,o.useState)({inView:!!l}),p=d[0],m=d[1],v=(0,o.useCallback)((function(e){void 0!==f.current&&(f.current(),f.current=void 0),c||e&&(f.current=hr(e,(function(e,t){m({inView:e,entry:t}),t.isIntersecting&&s&&f.current&&(f.current(),f.current=void 0)}),{root:u,rootMargin:a,threshold:n,trackVisibility:i,delay:r}))}),[Array.isArray(n)?n.toString():n,u,a,s,c,i,r]);(0,o.useEffect)((function(){f.current||!p.entry||s||c||m({inView:!!l})}));var h=[v,p.inView,p.entry];return h.ref=h[0],h.inView=h[1],h.entry=h[2],h}(),2),y=h[0],b=h[1],x=g((function(e){return e.updateSearchParams})),w=g((function(e){return e.searchParams})),k=(0,r.useRef)(g.getState().nextPage),j=(0,r.useRef)(g.getState().searchParams);(0,r.useEffect)((function(){return g.subscribe((function(e){return k.current=e}),(function(e){return e.nextPage}))}),[]),(0,r.useEffect)((function(){return g.subscribe((function(e){return j.current=e}),(function(e){return e.searchParams}))}),[]);var O=(0,r.useCallback)(wr(S().mark((function e(){var t,n;return S().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return c(""),d(!1),e.next=4,ur(j.current,k.current).catch((function(e){console.error(e),c(e&&e.message?e.message:(0,Un.__)("Unknown error occured. Check browser console or contact support.","extendify-sdk"))}));case 4:null!=(n=e.sent)&&null!==(t=n.error)&&void 0!==t&&t.length&&c(null==n?void 0:n.error),null!=n&&n.records&&w===j.current&&(a(n.records),d(n.records.length<=0),g.setState({nextPage:n.offset}));case 7:case"end":return e.stop()}}),e)}))),[w,a]);return(0,r.useEffect)((function(){Object.keys(j.current.taxonomies).length&&(v([]),O())}),[O,j]),(0,r.useEffect)((function(){b&&O()}),[b,O]),s.length?(0,Vn.jsxs)("div",{className:"text-left",children:[(0,Vn.jsx)("h2",{className:"text-left",children:(0,Un.__)("Server error","extendify-sdk")}),(0,Vn.jsx)("code",{className:"block max-w-xl p-4 mb-4",style:{minHeight:"10rem"},children:s}),(0,Vn.jsx)(Wn.Button,{isTertiary:!0,onClick:function(){v([]),x({taxonomies:{},search:""}),O()},children:(0,Un.__)("Press here to reload experience")})]}):f?null!=w&&w.search.length?(0,Vn.jsx)("h2",{className:"text-left",children:(0,Un.sprintf)((0,Un.__)("No results for %s.","extendify-sdk"),null==w?void 0:w.search)}):(0,Vn.jsx)("h2",{className:"text-left",children:(0,Un.__)("No results found.","extendify-sdk")}):t.length?(0,Vn.jsxs)(Vn.Fragment,{children:[(0,Vn.jsx)("ul",{className:"flex-grow gap-6 grid xl:grid-cols-2 2xl:grid-cols-3 pb-32 m-0",children:t.map((function(e,t){var r,o,a,u,s,c,l,f,d;return(0,Vn.jsxs)("li",{className:"flex flex-col justify-between group overflow-hidden max-w-lg",children:[(0,Vn.jsx)("div",{className:"flex justify-items-center flex-grow h-80 border-gray-200 bg-white border border-b-0 group-hover:border-wp-theme-500 transition duration-150 cursor-pointer",onClick:function(){return n(e)},children:(0,Vn.jsx)("img",{role:"button",className:"max-w-full block m-auto object-cover",onLoad:function(){return v([].concat(gr(m),[t]))},src:null!==(r=null==e||null===(o=e.fields)||void 0===o||null===(a=o.screenshot[0])||void 0===a||null===(u=a.thumbnails)||void 0===u||null===(s=u.large)||void 0===s?void 0:s.url)&&void 0!==r?r:null==e||null===(c=e.fields)||void 0===c||null===(l=c.screenshot[0])||void 0===l?void 0:l.url})}),(0,Vn.jsx)("span",{role:"img","aria-hidden":"true",className:"h-px w-full bg-gray-200 border group-hover:bg-transparent border-t-0 border-b-0 border-gray-200 group-hover:border-wp-theme-500 transition duration-150"}),(0,Vn.jsxs)("div",{className:"bg-transparent text-left bg-white flex items-center justify-between p-4 border border-t-0 border-transparent group-hover:border-wp-theme-500 transition duration-150 cursor-pointer",role:"button",onClick:function(){return n(e)},children:[(0,Vn.jsxs)("div",{children:[(0,Vn.jsx)("h4",{className:"m-0 font-bold",children:e.fields.title}),(0,Vn.jsx)("p",{className:"m-0",children:null==e||null===(f=e.fields)||void 0===f||null===(d=f.tax_categories)||void 0===d?void 0:d.filter((function(e){return"default"!==e.toLowerCase()})).join(", ")})]}),(0,Vn.jsx)(Wn.Button,{isSecondary:!0,tabIndex:Object.keys(i).length?"-1":"0",className:"sm:opacity-0 group-hover:opacity-100 transition duration-150 focus:opacity-100",onClick:function(t){t.stopPropagation(),n(e)},children:(0,Un.__)("View","extendify-sdk")})]})]},e.id)}))}),g.getState().nextPage&&!!m.length&&m.length===t.length&&(0,Vn.jsxs)(Vn.Fragment,{children:[(0,Vn.jsx)("div",{className:"-translate-y-full flex flex-col h-80 items-end justify-end my-2 relative transform z-0 text",ref:y,style:{zIndex:-1}}),(0,Vn.jsx)("div",{className:"my-4",children:(0,Vn.jsx)(Wn.Spinner,{})})]})]}):(0,Vn.jsx)("div",{className:"flex items-center justify-center w-full sm:mt-64",children:(0,Vn.jsx)(Wn.Spinner,{})})}var Cr=function(){return T.get("plugins")},Er=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=new FormData;return t.append("plugins",JSON.stringify(e)),T.post("plugins",t,{headers:{"Content-Type":"multipart/form-data"}})},Pr=function(){return T.get("active-plugins")};function Ir(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function Nr(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Ir(i,r,o,a,u,"next",e)}function u(e){Ir(i,r,o,a,u,"throw",e)}a(void 0)}))}}function Tr(e){return Rr.apply(this,arguments)}function Rr(){return(Rr=Nr(S().mark((function e(t){var n,r,o,i;return S().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((r=null!==(n=(0,qn.get)(t,"fields.required_plugins"))&&void 0!==n?n:[]).length){e.next=3;break}return e.abrupt("return",!1);case 3:return e.t0=Object,e.next=6,Cr();case 6:return e.t1=e.sent,o=e.t0.keys.call(e.t0,e.t1),i=!!r.length&&r.filter((function(e){return!o.some((function(t){return t.includes(e)}))})),e.abrupt("return",i.length);case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function _r(e){return Ar.apply(this,arguments)}function Ar(){return(Ar=Nr(S().mark((function e(t){var n,r,o,i;return S().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((r=null!==(n=(0,qn.get)(t,"fields.required_plugins"))&&void 0!==n?n:[]).length){e.next=3;break}return e.abrupt("return",!1);case 3:return e.t0=Object,e.next=6,Pr();case 6:if(e.t1=e.sent,o=e.t0.values.call(e.t0,e.t1),!(i=!!r.length&&r.filter((function(e){return!o.some((function(t){return t.includes(e)}))})))){e.next=14;break}return e.next=12,Tr(t);case 12:if(!e.sent){e.next=14;break}return e.abrupt("return",!1);case 14:return e.abrupt("return",i.length);case 15:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Lr=s(I((function(e){return{wantedTemplate:{},importOnLoad:!1,setWanted:function(t){return e({wantedTemplate:t})},removeWanted:function(){return e({wantedTemplate:{}})}}}),{name:"extendify-wanted-template"}));function Dr(e){var t=e.msg;return(0,Vn.jsxs)(Wn.Modal,{style:{maxWidth:"500px"},title:(0,Un.__)("Error installing plugins","extendify-sdk"),isDismissible:!1,children:[(0,Un.__)("You have encountered an error that we cannot recover from. Please try again.","extendify-sdk"),(0,Vn.jsx)("br",{}),(0,Vn.jsx)(Wn.Notice,{isDismissible:!1,status:"error",children:t}),(0,Vn.jsx)(Wn.Button,{isPrimary:!0,onClick:function(){return(0,r.render)((0,Vn.jsx)(Wr,{}),document.getElementById("extendify-root"))},children:(0,Un.__)("Go back","extendify-sdk")})]})}const Fr=wp.data;function Mr(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null==n)return;var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Br(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 Br(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 Br(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 Ur(){var e=Mr((0,r.useState)(!1),2),t=e[0],n=e[1],o=function(){location.reload()};return(0,(0,Fr.select)("core/editor").isEditedPostDirty)()?(0,Vn.jsxs)(Wn.Modal,{title:(0,Un.__)("Reload required","extendify-sdk"),isDismissible:!1,children:[(0,Vn.jsx)("p",{style:{maxWidth:"400px"},children:(0,Un.__)("Just one more thing! We need to reload the page to continue.","extendify-sdk")}),(0,Vn.jsxs)(Wn.ButtonGroup,{children:[(0,Vn.jsx)(Wn.Button,{isPrimary:!0,onClick:o,disabled:t,children:(0,Un.__)("Reload page","extendify-sdk")}),(0,Vn.jsx)(Wn.Button,{isSecondary:!0,onClick:function(){n(!0),(0,Fr.dispatch)("core/editor").savePost(),n(!1)},isBusy:t,style:{margin:"0 4px"},children:(0,Un.__)("Save changes","extendify-sdk")})]})]}):(o(),null)}function Vr(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null==n)return;var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Gr(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 Gr(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 Gr(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 Hr(){var e,t=Vr((0,r.useState)(""),2),n=t[0],o=t[1],i=Lr((function(e){return e.wantedTemplate}));return Er(null==i||null===(e=i.fields)||void 0===e?void 0:e.required_plugins).then((function(){Lr.setState({importOnLoad:!0}),(0,r.render)((0,Vn.jsx)(Ur,{}),document.getElementById("extendify-root"))})).catch((function(e){var t=e.message;o(t)})),n?(0,Vn.jsx)(Dr,{msg:n}):(0,Vn.jsx)(Wn.Modal,{title:(0,Un.__)("Installing plugins","extendify-sdk"),isDismissible:!1,children:(0,Vn.jsx)(Wn.Button,{style:{width:"100%"},disabled:!0,isPrimary:!0,isBusy:!0,onClick:function(){},children:(0,Un.__)("Installing...","extendify-sdk")})})}var qr=function(e){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"broken-event",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"open";G.setState({entryPoint:e}),window.dispatchEvent(new CustomEvent("extendify-sdk::".concat(t,"-library"),{detail:e,bubbles:!0}))}(e,"open")};function Kr(e){switch(e){case"editorplus":return"Editor Plus";case"ml-slider":return"MetaSlider"}return e}function Wr(e){var t,n,o,i,a,u,s,c=Lr((function(e){return e.wantedTemplate})),l=function(){e.forceOpen||(0,r.render)((0,Vn.jsx)(Fo,{show:!0}),document.getElementById("extendify-root"))},f=(null==c||null===(t=c.fields)||void 0===t?void 0:t.required_plugins)||[];return(0,Vn.jsxs)(Wn.Modal,{title:null!==(n=e.title)&&void 0!==n?n:(0,Un.__)("Install required plugins","extendify-sdk"),closeButtonLabel:(0,Un.__)("No thanks, take me back","extendify-sdk"),onRequestClose:l,children:[(0,Vn.jsx)("p",{style:{maxWidth:"400px"},children:null!==(o=e.message)&&void 0!==o?o:(0,Un.__)((0,Un.sprintf)("There is just one more step. This %s requires the following to be automatically installed and activated:",null!==(i=null==c||null===(a=c.fields)||void 0===a?void 0:a.type)&&void 0!==i?i:"template"),"extendify-sdk")}),(null===(u=e.message)||void 0===u?void 0:u.length)>0||(0,Vn.jsx)("ul",{children:f.map((function(e){return(0,Vn.jsx)("li",{children:Kr(e)},e)}))}),(0,Vn.jsxs)(Wn.ButtonGroup,{children:[(0,Vn.jsx)(Wn.Button,{isPrimary:!0,onClick:function(){return(0,r.render)((0,Vn.jsx)(Hr,{}),document.getElementById("extendify-root"))},children:null!==(s=e.buttonLabel)&&void 0!==s?s:(0,Un.__)("Install Plugins","extendify-sdk")}),e.forceOpen||(0,Vn.jsx)(Wn.Button,{isTertiary:!0,onClick:l,style:{boxShadow:"none",margin:"0 4px"},children:(0,Un.__)("No thanks, take me back","extendify-sdk")})]})]})}function zr(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function $r(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){zr(i,r,o,a,u,"next",e)}function u(e){zr(i,r,o,a,u,"throw",e)}a(void 0)}))}}var Qr=function(){var e=$r(S().mark((function e(t){return S().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Tr(t);case 2:return e.t0=!e.sent,e.t1=function(){return $r(S().mark((function e(){return S().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})))()},e.t2=function(){return $r(S().mark((function e(){return S().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(){(0,r.render)((0,Vn.jsx)(Wr,{}),document.getElementById("extendify-root"))})));case 1:case"end":return e.stop()}}),e)})))()},e.abrupt("return",{id:"hasRequiredPlugins",pass:e.t0,allow:e.t1,deny:e.t2});case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();function Yr(e){var t=e.msg;return(0,Vn.jsxs)(Wn.Modal,{style:{maxWidth:"500px"},title:(0,Un.__)("Error Activating plugins","extendify-sdk"),isDismissible:!1,children:[(0,Un.__)("You have encountered an error that we cannot recover from. Please try again.","extendify-sdk"),(0,Vn.jsx)("br",{}),(0,Vn.jsx)(Wn.Notice,{isDismissible:!1,status:"error",children:t}),(0,Vn.jsx)(Wn.Button,{isPrimary:!0,onClick:function(){(0,r.render)((0,Vn.jsx)(no,{}),document.getElementById("extendify-root"))},children:(0,Un.__)("Go back","extendify-sdk")})]})}function Jr(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function Xr(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Jr(i,r,o,a,u,"next",e)}function u(e){Jr(i,r,o,a,u,"throw",e)}a(void 0)}))}}function Zr(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null==n)return;var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return eo(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 eo(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 eo(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 to(){var e,t=Zr((0,r.useState)(""),2),n=t[0],o=t[1],i=Lr((function(e){return e.wantedTemplate}));return Er(null==i||null===(e=i.fields)||void 0===e?void 0:e.required_plugins).then((function(){Lr.setState({importOnLoad:!0})})).then(Xr(S().mark((function e(){return S().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,new Promise((function(e){return setTimeout(e,1e3)}));case 2:(0,r.render)((0,Vn.jsx)(Ur,{}),document.getElementById("extendify-root"));case 3:case"end":return e.stop()}}),e)})))).catch((function(e){var t=e.response;o(t.data.message)})),n?(0,Vn.jsx)(Yr,{msg:n}):(0,Vn.jsx)(Wn.Modal,{title:(0,Un.__)("Activating plugins","extendify-sdk"),isDismissible:!1,children:(0,Vn.jsx)(Wn.Button,{style:{width:"100%"},disabled:!0,isPrimary:!0,isBusy:!0,onClick:function(){},children:(0,Un.__)("Activating...","extendify-sdk")})})}function no(e){var t,n,o,i,a=Lr((function(e){return e.wantedTemplate})),u=function(){return(0,r.render)((0,Vn.jsx)(Fo,{show:!0}),document.getElementById("extendify-root"))},s=(null==a||null===(t=a.fields)||void 0===t?void 0:t.required_plugins)||[];return(0,Vn.jsxs)(Wn.Modal,{title:(0,Un.__)("Activate required plugins","extendify-sdk"),closeButtonLabel:(0,Un.__)("No thanks, return to library","extendify-sdk"),onRequestClose:u,children:[(0,Vn.jsx)("p",{style:{maxWidth:"400px"},children:null!==(n=e.message)&&void 0!==n?n:(0,Un.__)((0,Un.sprintf)("There is just one more step. This %s requires the following plugins to be installed and activated:",null!==(o=null==a||null===(i=a.fields)||void 0===i?void 0:i.type)&&void 0!==o?o:"template"),"extendify-sdk")}),(0,Vn.jsx)("ul",{children:s.map((function(e){return(0,Vn.jsx)("li",{children:Kr(e)},e)}))}),(0,Vn.jsxs)(Wn.ButtonGroup,{children:[(0,Vn.jsx)(Wn.Button,{isPrimary:!0,onClick:function(){return(0,r.render)((0,Vn.jsx)(to,{}),document.getElementById("extendify-root"))},children:(0,Un.__)("Activate Plugins","extendify-sdk")}),e.showClose&&(0,Vn.jsx)(Wn.Button,{isTertiary:!0,onClick:u,style:{boxShadow:"none",margin:"0 4px"},children:(0,Un.__)("No thanks, return to library","extendify-sdk")})]})]})}function ro(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function oo(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){ro(i,r,o,a,u,"next",e)}function u(e){ro(i,r,o,a,u,"throw",e)}a(void 0)}))}}var io=function(){var e=oo(S().mark((function e(t){return S().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,_r(t);case 2:return e.t0=!e.sent,e.t1=function(){return oo(S().mark((function e(){return S().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})))()},e.t2=function(){return oo(S().mark((function e(){return S().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(){(0,r.render)((0,Vn.jsx)(no,{showClose:!0}),document.getElementById("extendify-root"))})));case 1:case"end":return e.stop()}}),e)})))()},e.abrupt("return",{id:"hasPluginsActivated",pass:e.t0,allow:e.t1,deny:e.t2});case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();function ao(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return uo(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 uo(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}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 i,a=!0,u=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function uo(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 so(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function co(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){so(i,r,o,a,u,"next",e)}function u(e){so(i,r,o,a,u,"throw",e)}a(void 0)}))}}function lo(e){return function(){return new fo(e.apply(this,arguments))}}function fo(e){var t,n;function r(t,n){try{var i=e[t](n),a=i.value,u=a instanceof po;Promise.resolve(u?a.wrapped:a).then((function(e){u?r("return"===t?"return":"next",e):o(i.done?"return":"normal",e)}),(function(e){r("throw",e)}))}catch(e){o("throw",e)}}function o(e,o){switch(e){case"return":t.resolve({value:o,done:!0});break;case"throw":t.reject(o);break;default:t.resolve({value:o,done:!1})}(t=t.next)?r(t.key,t.arg):n=null}this._invoke=function(e,o){return new Promise((function(i,a){var u={key:e,arg:o,resolve:i,reject:a,next:null};n?n=n.next=u:(t=n=u,r(e,o))}))},"function"!=typeof e.return&&(this.return=void 0)}function po(e){this.wrapped=e}fo.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},fo.prototype.next=function(e){return this._invoke("next",e)},fo.prototype.throw=function(e){return this._invoke("throw",e)},fo.prototype.return=function(e){return this._invoke("return",e)};function mo(){return(mo=co(S().mark((function e(t){var n;return S().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=vo(t);case 1:return e.next=4,n.next();case 4:if(!e.sent.done){e.next=7;break}return e.abrupt("break",9);case 7:e.next=1;break;case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function vo(e){return ho.apply(this,arguments)}function ho(){return(ho=lo(S().mark((function e(t){var n,r,o;return S().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=ao(t),e.prev=1,n.s();case 3:if((r=n.n()).done){e.next=9;break}return o=r.value,e.next=7,o();case 7:e.next=3;break;case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(1),n.e(e.t0);case 14:return e.prev=14,n.f(),e.finish(14);case 17:case"end":return e.stop()}}),e,null,[[1,11,14,17]])})))).apply(this,arguments)}function yo(e,t){return(0,(0,Fr.dispatch)("core/block-editor").insertBlocks)(e).then((function(){window.dispatchEvent(new CustomEvent("extendify-sdk::template-inserted",{detail:{template:t},bubbles:!0}))}))}function bo(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null==n)return;var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return go(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 go(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 go(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 xo=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return{hasRequiredPlugins:Qr,hasPluginsActivated:io,stack:[],check:function(t){var n=this;return co(S().mark((function r(){var o,i,a;return S().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:o=ao(e),r.prev=1,a=S().mark((function e(){var r,o;return S().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=i.value,e.next=3,n["".concat(r)](t);case 3:o=e.sent,setTimeout((function(){n.stack.push(o.pass?o.allow:o.deny)}),0);case 5:case"end":return e.stop()}}),e)})),o.s();case 4:if((i=o.n()).done){r.next=8;break}return r.delegateYield(a(),"t0",6);case 6:r.next=4;break;case 8:r.next=13;break;case 10:r.prev=10,r.t1=r.catch(1),o.e(r.t1);case 13:return r.prev=13,o.f(),r.finish(13);case 16:case"end":return r.stop()}}),r,null,[[1,10,13,16]])})))()},reset:function(){this.stack=[]}}}(["hasRequiredPlugins","hasPluginsActivated"]);function wo(e){var t=e.template,n=g((function(e){return e.activeTemplateBlocks})),o=G((function(e){return e.canImport})),i=G((function(e){return e.apiKey})),a=x((function(e){return e.setOpen})),u=bo((0,r.useState)(!1),2),s=u[0],c=u[1],l=bo((0,r.useState)(!1),2),f=l[0],d=l[1],p=Lr((function(e){return e.setWanted})),m=function(){(function(e){return mo.apply(this,arguments)})(xo.stack).then((function(){setTimeout((function(){yo(n,t).then((function(){return a(!1)}))}),100)}))};(0,r.useEffect)((function(){return xo.check(t).then((function(){return d(!0)})),function(){return xo.reset()&&d(!1)}}),[t]),(0,r.useEffect)((function(){s&&sr(t)}),[s,t]);return f&&Object.keys(n).length?i||o()?s?(0,Vn.jsx)("button",{type:"button",disabled:!0,className:"components-button is-secondary text-lg sm:text-2xl h-auto py-1.5 px-3 sm:py-2.5 sm:px-5",onClick:function(){},children:(0,Un.__)("Importing...","extendify-sdk")}):(0,Vn.jsx)("button",{type:"button",className:"components-button is-primary text-lg sm:text-2xl h-auto py-1.5 px-3 sm:py-2.5 sm:px-5",onClick:function(){return c(!0),p(t),void m()},children:(0,Un.sprintf)((0,Un.__)("Add %s","extendify-sdk"),t.fields.type)}):(0,Vn.jsx)("a",{className:"button-extendify-main text-lg sm:text-2xl py-1.5 px-3 sm:py-2.5 sm:px-5",target:"_blank",href:"https://extendify.com",rel:"noreferrer",children:(0,Un.__)("Sign up now","extendify-sdk")}):""}function So(e){var t,n,o,i,a,u,s,c=e.template,l=c.fields.tax_categories,f=G((function(e){return e.apiKey}));return(0,r.useEffect)((function(){cr(c)}),[c]),(0,Vn.jsxs)("div",{className:"flex flex-col min-h-screen bg-white sm:min-h-0 items-start overflow-y-auto h-full sm:pr-8 lg:pl-px lg:-ml-px",children:[(0,Vn.jsxs)("div",{className:"flex flex-col lg:flex-row items-start justify-start lg:items-center lg:justify-between w-full max-w-screen-xl",children:[(0,Vn.jsxs)("div",{className:"text-left m-0 sm:mb-6 p-6 sm:p-0",children:[(0,Vn.jsx)("h1",{className:"leading-tight text-left mb-2.5 sm:text-3xl font-normal",children:c.fields.title}),(0,Vn.jsx)(Wn.ExternalLink,{href:c.fields.url,children:(0,Un.__)("Demo","extendify-sdk")})]}),(0,Vn.jsx)("div",{className:$n()({"inline-flex absolute sm:static sm:top-auto right-0 m-6 sm:m-0 sm:my-6 space-x-3":!0,"top-16 mt-5":!f.length,"top-0":f.length>0}),children:(0,Vn.jsx)(wo,{template:c})})]}),(0,Vn.jsx)("div",{className:"max-w-screen-xl sm:w-full sm:m-0 sm:mb-12 m-6 border border-gray-300 m-46",children:(0,Vn.jsx)("img",{className:"max-w-full w-full",src:null!==(t=null==c||null===(n=c.fields)||void 0===n||null===(o=n.screenshot[0])||void 0===o||null===(i=o.thumbnails)||void 0===i||null===(a=i.full)||void 0===a?void 0:a.url)&&void 0!==t?t:null==c||null===(u=c.fields)||void 0===u||null===(s=u.screenshot[0])||void 0===s?void 0:s.url})}),(0,Vn.jsxs)("div",{className:"text-xs text-left p-6 w-full block sm:hidden",children:[(0,Vn.jsx)("h3",{className:"m-0 mb-6",children:(0,Un.__)("Categories","extendify-sdk")}),(0,Vn.jsx)("ul",{className:"text-sm",children:l.map((function(e){return(0,Vn.jsx)("li",{className:"inline-block mr-2 px-4 py-2 bg-gray-100",children:e},e)}))})]})]})}function ko(){return 0===G((function(e){return e.apiKey})).length?(0,Vn.jsx)("button",{className:"components-button",onClick:function(){return x.setState({currentPage:"login"})},children:(0,Un.__)("Log into account","extendify-sdk")}):(0,Vn.jsx)("button",{className:"components-button",onClick:function(){return G.setState({apiKey:""})},children:(0,Un.__)("Log out","extendify-sdk")})}function jo(e){var t=e.children;return(0,Vn.jsxs)(Vn.Fragment,{children:[(0,Vn.jsxs)("aside",{className:"flex-shrink-0 sm:pl-12 py-0 sm:py-6 relative",children:[(0,Vn.jsx)("div",{className:"sm:w-56 lg:w-72 sticky flex flex-col h-full",children:t[0]}),(0,Vn.jsxs)("div",{className:"hidden sm:flex flex-col absolute bottom-0 bg-white p-4 w-72 text-left space-y-4",children:[(0,Vn.jsx)("div",{children:(0,Vn.jsx)(Wn.Button,{isSecondary:!0,target:"_blank",href:"https://extendify.com/feedback",children:(0,Un.__)("Send us your feedback","extendify-sdk")})}),(0,Vn.jsx)("div",{className:"border-t border-gray-300",children:(0,Vn.jsx)(ko,{})})]})]}),(0,Vn.jsx)("main",{id:"extendify-templates",tabIndex:"0",className:"w-full smp:l-12 sm:pt-6 h-full",children:t[1]})]})}function Oo(){var e=g((function(e){return e.updateSearchParams})),t=g((function(e){return e.searchParams})),n=function(t){return e({type:t})};return(0,Vn.jsxs)("div",{className:"text-left w-full bg-white px-6 sm:px-0 pb-4 sm:pb-6 mt-px border-b sm:border-0",children:[(0,Vn.jsx)("h4",{className:"sr-only",children:(0,Un.__)("Type select","extendify-sdk")}),(0,Vn.jsxs)("button",{type:"button",className:$n()({"cursor-pointer p-3.5 space-x-2 inline-flex items-center border border-black button-focus":!0,"bg-gray-900 text-white":"pattern"===t.type,"bg-transparent text-black":"pattern"!==t.type}),onClick:function(){return n("pattern")},children:[(0,Vn.jsx)("svg",{width:"17",height:"13",viewBox:"0 0 17 13",className:"fill-current",xmlns:"http://www.w3.org/2000/svg",children:(0,Vn.jsx)("path",{d:"M1 13H16C16.55 13 17 12.55 17 12V8C17 7.45 16.55 7 16 7H1C0.45 7 0 7.45 0 8V12C0 12.55 0.45 13 1 13ZM0 1V5C0 5.55 0.45 6 1 6H16C16.55 6 17 5.55 17 5V1C17 0.45 16.55 0 16 0H1C0.45 0 0 0.45 0 1Z"})}),(0,Vn.jsx)("span",{className:"",children:(0,Un.__)("Patterns","extendify-sdk")})]}),(0,Vn.jsxs)("button",{type:"button",className:$n()({"cursor-pointer p-3.5 px-4 space-x-2 inline-flex items-center border border-black focus:ring-2 focus:ring-wp-theme-500 ring-offset-1 outline-none -ml-px":!0,"bg-gray-900 text-white":"template"===t.type,"bg-transparent text-black":"template"!==t.type}),onClick:function(){return n("template")},children:[(0,Vn.jsx)("svg",{width:"17",height:"13",viewBox:"0 0 17 13",className:"fill-current",xmlns:"http://www.w3.org/2000/svg",children:(0,Vn.jsx)("path",{d:"M7 13H10C10.55 13 11 12.55 11 12V8C11 7.45 10.55 7 10 7H7C6.45 7 6 7.45 6 8V12C6 12.55 6.45 13 7 13ZM1 13H4C4.55 13 5 12.55 5 12V1C5 0.45 4.55 0 4 0H1C0.45 0 0 0.45 0 1V12C0 12.55 0.45 13 1 13ZM13 13H16C16.55 13 17 12.55 17 12V8C17 7.45 16.55 7 16 7H13C12.45 7 12 7.45 12 8V12C12 12.55 12.45 13 13 13ZM6 1V5C6 5.55 6.45 6 7 6H16C16.55 6 17 5.55 17 5V1C17 0.45 16.55 0 16 0H7C6.45 0 6 0.45 6 1Z"})}),(0,Vn.jsx)("span",{className:"",children:(0,Un.__)("Page templates","extendify-sdk")})]})]})}function Co(e){var t=e.template,n=g((function(e){return e.setActive})),o=(0,r.useRef)(null),i=t.fields,a=i.tax_categories,u=i.required_plugins,s=G((function(e){return e.apiKey}));return(0,r.useEffect)((function(){o.current.focus()}),[]),(0,Vn.jsxs)("div",{className:"flex flex-col items-start justify-start",children:[!s.length&&(0,Vn.jsxs)("div",{className:"h-full flex sm:hidden w-full p-4 justify-between border items-center border-gray-300 bg-extendify-lightest",children:[(0,Vn.jsx)("a",{className:"button-extendify-main",target:"_blank",href:"https://extendify.com",rel:"noreferrer",children:(0,Un.__)("Sign up today to get unlimited beta access","extendify-sdk")}),(0,Vn.jsx)("button",{className:"components-button",onClick:function(){return x.setState({currentPage:"login"})},children:(0,Un.__)("Log in","extendify-sdk")})]}),(0,Vn.jsx)("div",{className:"p-6 sm:p-0",children:(0,Vn.jsxs)("button",{ref:o,type:"button",className:"cursor-pointer text-black bg-transparent font-medium flex items-center p-3 transform -translate-x-3 button-focus",onClick:function(){return n({})},children:[(0,Vn.jsx)("svg",{className:"fill-current",width:"8",height:"12",viewBox:"0 0 8 12",xmlns:"http://www.w3.org/2000/svg",children:(0,Vn.jsx)("path",{d:"M6.70998 9.88047L2.82998 6.00047L6.70998 2.12047C7.09998 1.73047 7.09998 1.10047 6.70998 0.710469C6.31998 0.320469 5.68998 0.320469 5.29998 0.710469L0.70998 5.30047C0.31998 5.69047 0.31998 6.32047 0.70998 6.71047L5.29998 11.3005C5.68998 11.6905 6.31998 11.6905 6.70998 11.3005C7.08998 10.9105 7.09998 10.2705 6.70998 9.88047Z"})}),(0,Vn.jsx)("span",{className:"ml-4",children:(0,Un.__)("Go back","extendify-sdk")})]})}),(0,Vn.jsxs)("div",{className:"text-xs text-left pt-20 divide-y w-full hidden sm:block",children:[(0,Vn.jsxs)("div",{className:"w-full",children:[(0,Vn.jsx)("h3",{className:"m-0 mb-6",children:(0,Un.__)("Categories","extendify-sdk")}),(0,Vn.jsx)("ul",{className:"text-sm",children:a.map((function(e){return(0,Vn.jsx)("li",{className:"inline-block mr-2 px-4 py-2 bg-gray-100",children:e},e)}))})]}),(0,Vn.jsxs)("div",{className:"pt-4 w-full",children:[(0,Vn.jsx)("h3",{className:"m-0 mb-6",children:(0,Un.__)("Required Plugins","extendify-sdk")}),(0,Vn.jsx)("ul",{className:"text-sm",children:u.map((function(e){return(0,Vn.jsx)("li",{className:"inline-block mr-2 px-4 py-2 bg-extendify-light",children:Kr(e)},e)}))})]})]})]})}function Eo(){var e=g((function(e){return e.searchParams}));return(0,Vn.jsx)("div",{className:"hidden sm:flex items-start flex-col lg:flex-row -mt-2 lg:-mx-2 mb-4 lg:divide-x-2 lg:leading-none",children:Object.entries(e.taxonomies).map((function(t){return"template"===e.type&&"tax_pattern_types"===t[0]||"pattern"===e.type&&"tax_page_types"===t[0]?"":(0,Vn.jsxs)("div",{className:"lg:px-2 text-left",children:[(0,Vn.jsx)("span",{className:"font-bold",children:(n=t[0],n.replace("tax_","").replace("_"," ").replace(/\b\w/g,(function(e){return e.toUpperCase()})))}),": ",(0,Vn.jsx)("span",{children:t[1]?t[1]:"All"})]},t[0]);var n}))})}function Po(e){var t=e.className,n=e.initialFocus,r=g((function(e){return e.templates})),o=g((function(e){return e.activeTemplate}));return(0,Vn.jsxs)("div",{className:t,children:[(0,Vn.jsx)("a",{href:"#extendify-templates",className:"sr-only focus:not-sr-only focus:text-blue-500",children:(0,Un.__)("Skip to content","extendify-sdk")}),(0,Vn.jsxs)("div",{className:"sm:flex sm:space-x-12 relative bg-white mx-auto max-w-screen-4xl h-full",children:[!!Object.keys(o).length&&(0,Vn.jsx)("div",{className:"absolute bg-white sm:flex inset-0 z-50 sm:space-x-12",children:(0,Vn.jsxs)(jo,{children:[(0,Vn.jsx)(Co,{template:o}),(0,Vn.jsx)(So,{template:o})]})}),(0,Vn.jsxs)(jo,{children:[(0,Vn.jsx)(rr,{initialFocus:n}),(0,Vn.jsxs)(Vn.Fragment,{children:[(0,Vn.jsx)(Oo,{}),(0,Vn.jsx)(Eo,{}),(0,Vn.jsx)("div",{className:"relative h-full z-30 bg-white",children:(0,Vn.jsx)("div",{className:"absolute z-20 inset-0 lg:static h-screen lg:h-full overflow-y-auto pt-4 sm:pt-0 px-6 sm:pl-0 sm:pr-8",children:(0,Vn.jsx)(Or,{templates:r})})})]})]})]})]})}function Io(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function No(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null==n)return;var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return To(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 To(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 To(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 Ro(){var e=No((0,r.useState)(G.getState().apiKey),2),t=e[0],n=e[1],o=No((0,r.useState)(G.getState().email),2),i=o[0],a=o[1],u=No((0,r.useState)(""),2),s=u[0],c=u[1],l=No((0,r.useState)("info"),2),f=l[0],d=l[1],p=No((0,r.useState)(""),2),m=p[0],v=p[1];(0,r.useEffect)((function(){return function(){return d("info")}}),[]);var h=function(){var e,n=(e=S().mark((function e(n){var r,o,a,u,s,l;return S().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n.preventDefault(),c(""),r=i.length?i:m,e.next=5,L(r,t);case 5:if(o=e.sent,a=o.token,u=o.error,s=o.exception,void 0===(l=o.message)){e.next=13;break}return d("error"),e.abrupt("return",c(l.length?l:"Error: Are you interacting with the wrong server?"));case 13:if(!u&&!s){e.next=16;break}return d("error"),e.abrupt("return",c(u.length?u:s));case 16:if(a&&"string"==typeof a){e.next=19;break}return d("error"),e.abrupt("return",c((0,Un.__)("Something went wrong","extendify-sdk")));case 19:return d("success"),c("Success!"),e.next=23,new Promise((function(e){return setTimeout(e,1500)}));case 23:G.setState({apiKey:a}),x.setState({currentPage:"content"});case 25:case"end":return e.stop()}}),e)})),function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Io(i,r,o,a,u,"next",e)}function u(e){Io(i,r,o,a,u,"throw",e)}a(void 0)}))});return function(e){return n.apply(this,arguments)}}();return(0,r.useEffect)((function(){i||A("user_email").then((function(e){return v(e)}))}),[i]),(0,Vn.jsxs)("section",{className:"w-96 text-left md:-mt-32",children:[(0,Vn.jsx)("h1",{className:"border-b border-gray-900 mb-12 pb-4",children:(0,Un.__)("Welcome","extendify-sdk")}),s&&(0,Vn.jsx)("div",{className:$n()({"border-b pb-6 mb-6 -mt-6":!0,"border-gray-900 text-gray-900":"info"===f,"border-wp-alert-red text-wp-alert-red":"error"===f,"border-extendify-main text-extendify-main":"success"===f}),children:s}),(0,Vn.jsxs)("form",{onSubmit:h,className:" space-y-6",children:[(0,Vn.jsxs)("div",{className:"flex items-center",children:[(0,Vn.jsx)("label",{htmlFor:"extendifysdk-login-email",className:"w-32 font-bold",children:(0,Un.__)("Email:","extendify-sdk")}),(0,Vn.jsx)("input",{id:"extendifysdk-login-email",name:"extendifysdk-login-email",type:"email",className:"border px-2 w-full",placeholder:"Email",value:i.length?i:m,onChange:function(e){return a(e.target.value)}})]}),(0,Vn.jsxs)("div",{className:"flex items-center",children:[(0,Vn.jsx)("label",{htmlFor:"extendifysdk-login-license",className:"w-32 font-bold",children:(0,Un.__)("License:","extendify-sdk")}),(0,Vn.jsx)("input",{id:"extendifysdk-login-license",name:"extendifysdk-login-email",type:"text",className:"border px-2 w-full",placeholder:"License key",value:t,onChange:function(e){return n(e.target.value)}})]}),(0,Vn.jsx)("div",{className:"flex justify-end",children:(0,Vn.jsx)("button",{type:"submit",className:"button-extendify-main p-3 px-4",children:(0,Un.__)("Sign in","extendify-sdk")})})]})]})}function _o(e){var t=e.className;return(0,Vn.jsxs)("div",{className:t,children:[(0,Vn.jsx)("a",{href:"#extendify-templates",className:"sr-only focus:not-sr-only focus:text-blue-500",children:(0,Un.__)("Skip to content","extendify-sdk")}),(0,Vn.jsx)("div",{className:"flex sm:space-x-12 relative mx-auto max-w-screen-4xl h-full",children:(0,Vn.jsxs)("div",{className:"absolute flex inset-0 items-center justify-center z-20 sm:space-x-12",children:[(0,Vn.jsx)("div",{className:"pl-12 py-6 absolute top-0 left-0",children:(0,Vn.jsxs)("button",{type:"button",className:"cursor-pointer text-black bg-transparent font-medium flex items-center p-3 transform -translate-x-3 button-focus",onClick:function(){return x.setState({currentPage:"content"})},children:[(0,Vn.jsx)("svg",{className:"fill-current",width:"8",height:"12",viewBox:"0 0 8 12",xmlns:"http://www.w3.org/2000/svg",children:(0,Vn.jsx)("path",{d:"M6.70998 9.88047L2.82998 6.00047L6.70998 2.12047C7.09998 1.73047 7.09998 1.10047 6.70998 0.710469C6.31998 0.320469 5.68998 0.320469 5.29998 0.710469L0.70998 5.30047C0.31998 5.69047 0.31998 6.32047 0.70998 6.71047L5.29998 11.3005C5.68998 11.6905 6.31998 11.6905 6.70998 11.3005C7.08998 10.9105 7.09998 10.2705 6.70998 9.88047Z"})}),(0,Vn.jsx)("span",{className:"ml-4",children:(0,Un.__)("Go back","extendify-sdk")})]})}),(0,Vn.jsx)("div",{className:"flex justify-center",children:(0,Vn.jsx)(Ro,{})})]})})]})}function Ao(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null==n)return;var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Lo(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 Lo(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 Lo(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 Do(){var e=Ao((0,r.useState)(!1),2),t=e[0],n=e[1],o=(0,r.useRef)(null),i=x((function(e){return e.open})),a=x((function(e){return e.setOpen})),u=x((function(e){return e.currentPage}));return(0,Vn.jsx)(Bn.Root,{show:i,as:r.Fragment,children:(0,Vn.jsx)(ot,{as:"div",static:!0,className:"extendify-sdk",initialFocus:o,onClose:function(){},children:(0,Vn.jsx)("div",{className:"h-screen w-screen sm:h-auto sm:w-auto fixed z-high inset-0 overflow-y-auto",children:(0,Vn.jsxs)("div",{className:"flex items-end justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0",children:[(0,Vn.jsx)(Bn.Child,{as:r.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",children:(0,Vn.jsx)(ot.Overlay,{className:"fixed inset-0 bg-black bg-opacity-30 transition-opacity"})}),(0,Vn.jsx)(Bn.Child,{as:r.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0 translate-y-4 sm:translate-y-5",enterTo:"opacity-100 translate-y-0",children:(0,Vn.jsx)("div",{className:$n()({"fixed lg:absolute inset-0 lg:overflow-hidden transform transition-all":!0,"lg:pt-5 lg:p-10":!t}),children:(0,Vn.jsxs)("div",{className:$n()({"bg-white h-full flex flex-col items-center relative shadow-xl":!0,"max-w-screen-4xl mx-auto":!t}),children:[(0,Vn.jsx)(Gn,{className:"w-full h-16 border-solid border-0 border-b border-gray-300 flex-shrink-0",toggleFullScreen:function(){return n(!t)},initialFocus:o,hideLibrary:function(){return a(!1)}}),"content"===u&&(0,Vn.jsx)(Po,{className:"w-full flex-grow overflow-hidden"}),"login"===u&&(0,Vn.jsx)(_o,{className:"w-full flex-grow overflow-hidden bg-extendify-light"})]})})})]})})})})}function Fo(e){var t=e.show,n=void 0!==t&&t,o=x((function(e){return e.setOpen})),i=(0,r.useCallback)((function(){return o(!0)}),[o]),a=(0,r.useCallback)((function(){o(!1)}),[o]);return(0,r.useEffect)((function(){n&&o(!0)}),[n,o]),(0,r.useEffect)((function(){return window.localStorage.getItem("etfy_library__key")&&G.setState({apiKey:"any-key-will-work-during-beta"}),function(){return window.localStorage.removeItem("etfy_library__key")}}),[]),(0,r.useEffect)((function(){return window.addEventListener("extendify-sdk::open-library",i),window.addEventListener("extendify-sdk::close-library",a),function(){window.removeEventListener("extendify-sdk::open-library",i),window.removeEventListener("extendify-sdk::close-library",a)}}),[a,i]),(0,Vn.jsx)(Do,{})}const Mo=wp.plugins,Bo=wp.editPost;var Uo=function(e){var t,n;qr(null===(t=e.target.closest("[data-extendify-identifier]"))||void 0===t||null===(n=t.dataset)||void 0===n?void 0:n.extendifyIdentifier)},Vo=(0,Vn.jsx)("div",{id:"extendify-templates-inserter",children:(0,Vn.jsxs)("button",{style:"background:#D9F1EE;color:#1e1e1e;border:1px solid #949494;font-weight:bold;font-size:14px;padding:8px;margin-right:8px",type:"button","data-extendify-identifier":"main-button",id:"extendify-templates-inserter-btn",className:"components-button",children:[(0,Vn.jsxs)("svg",{style:"margin-right:0.5rem",width:"20",height:"20",viewBox:"0 0 103 103",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,Vn.jsx)("rect",{y:"25.75",width:"70.8125",height:"77.25",fill:"#000000"}),(0,Vn.jsx)("rect",{x:"45.0625",width:"57.9375",height:"57.9375",fill:"#37C2A2"})]}),(0,Un.__)("Library","extendify-sdk")]})});window._wpLoadBlockEditor&&window.wp.data.subscribe((function(){setTimeout((function(){G.getState().enabled&&(document.getElementById("extendify-templates-inserter-btn")||document.querySelector(".edit-post-header-toolbar")&&(document.querySelector(".edit-post-header-toolbar").insertAdjacentHTML("beforeend",(0,r.renderToString)(Vo)),document.getElementById("extendify-templates-inserter-btn").addEventListener("click",Uo)))}),0)})),window._wpLoadBlockEditor&&window.wp.data.subscribe((function(){setTimeout((function(){if(G.getState().enabled&&document.querySelector("[id$=patterns-view]")&&!document.getElementById("extendify-cta-button")){var e=(0,Vn.jsx)("div",{children:(0,Vn.jsx)("button",{id:"extendify-cta-button",style:"margin:1rem 1rem 0","data-extendify-identifier":"patterns-cta",className:"components-button is-secondary",children:(0,Un.__)("Discover more patterns in Extendify Library","extendify-sdk")})});document.querySelector("[id$=patterns-view]").insertAdjacentHTML("afterbegin",(0,r.renderToString)(e)),document.getElementById("extendify-cta-button").addEventListener("click",Uo)}}),0)}));window._wpLoadBlockEditor&&(0,Mo.registerPlugin)("extendify-temps-more-menu-trigger",{render:function(){return G.getState().enabled&&(0,Vn.jsx)(Bo.PluginSidebarMoreMenuItem,{"data-extendify-identifier":"sidebar-button",onClick:Uo,icon:(0,Vn.jsx)("span",{className:"components-menu-items__item-icon",children:(0,Vn.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 103 103",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,Vn.jsx)("rect",{y:"25.75",width:"70.8125",height:"77.25",fill:"#000000"}),(0,Vn.jsx)("rect",{x:"45.0625",width:"57.9375",height:"57.9375",fill:"#37C2A2"})]})}),children:(0,Un.__)("Library","extendify-sdk")})}});window._wpLoadBlockEditor&&(0,Mo.registerPlugin)("extendify-settings-enable-disable",{render:function(){return(0,Vn.jsx)(Bo.PluginSidebarMoreMenuItem,{onClick:function(){G.setState({enabled:!G.getState().enabled}),requestAnimationFrame((function(){return location.reload()}))},icon:(0,Vn.jsx)(Vn.Fragment,{}),children:G.getState().enabled?(0,Un.__)("Disable Extendify","extendify-sdk"):(0,Un.__)("Enable Extendify","extendify-sdk")})}});var Go={register:function(){var e=this;window.addEventListener("extendify-sdk::softerror-encountered",(function(t){e[(0,qn.camelCase)(t.detail.type)](t.detail)}))},versionOutdated:function(e){(0,r.render)((0,Vn.jsx)(Wr,{title:e.data.title,message:e.data.message,buttonLabel:e.data.buttonLabel,forceOpen:!0}),document.getElementById("extendify-root"))}};(function(){var e=(0,Fr.dispatch)("core/notices").createNotice,t=G.getState().incrementImports;window.addEventListener("extendify-sdk::template-inserted",(function(n){e("info",(0,Un.__)("Template Added"),{isDismissible:!0,type:"snackbar"}),setTimeout((function(){var e;t(),lr(null===(e=n.detail)||void 0===e?void 0:e.template)}),0)}))})(),Go.register(),window._wpLoadBlockEditor&&window.wp.domReady((function(){var e=document.createElement("div");if(e.id="extendify-root",document.body.append(e),(0,r.render)((0,Vn.jsx)(Fo,{}),e),Lr.getState().importOnLoad){var t=Lr.getState().wantedTemplate;setTimeout((function(){!function(e){if(!e)throw Error("Template not found");yo(p((0,window.wp.blocks.parse)((0,qn.get)(e,"fields.code"))),e)}(t)}),0)}Lr.setState({importOnLoad:!1,wantedTemplate:{}})}))},42:(e,t)=>{var n;!function(){"use strict";var r={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var i=typeof n;if("string"===i||"number"===i)e.push(n);else if(Array.isArray(n)){if(n.length){var a=o.apply(null,n);a&&e.push(a)}}else if("object"===i)if(n.toString===Object.prototype.toString)for(var u in n)r.call(n,u)&&n[u]&&e.push(u);else e.push(n.toString())}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(n=function(){return o}.apply(t,[]))||(e.exports=n)}()},602:()=>{},525:e=>{"use strict";var t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;function o(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,i){for(var a,u,s=o(e),c=1;c<arguments.length;c++){for(var l in a=Object(arguments[c]))n.call(a,l)&&(s[l]=a[l]);if(t){u=t(a);for(var f=0;f<u.length;f++)r.call(a,u[f])&&(s[u[f]]=a[u[f]])}}return s}},61:e=>{var t,n,r=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function a(e){if(t===setTimeout)return setTimeout(e,0);if((t===o||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:o}catch(e){t=o}try{n="function"==typeof clearTimeout?clearTimeout:i}catch(e){n=i}}();var u,s=[],c=!1,l=-1;function f(){c&&u&&(c=!1,u.length?s=u.concat(s):l=-1,s.length&&d())}function d(){if(!c){var e=a(f);c=!0;for(var t=s.length;t;){for(u=s,s=[];++l<t;)u&&u[l].run();l=-1,t=s.length}u=null,c=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===i||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function m(){}r.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];s.push(new p(e,t)),1!==s.length||c||a(d)},p.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=m,r.addListener=m,r.once=m,r.off=m,r.removeListener=m,r.removeAllListeners=m,r.emit=m,r.prependListener=m,r.prependOnceListener=m,r.listeners=function(e){return[]},r.binding=function(e){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(e){throw new Error("process.chdir is not supported")},r.umask=function(){return 0}},426:(e,t,n)=>{"use strict";n(525);var r=n(804),o=60103;if(t.Fragment=60107,"function"==typeof Symbol&&Symbol.for){var i=Symbol.for;o=i("react.element"),t.Fragment=i("react.fragment")}var a=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,u=Object.prototype.hasOwnProperty,s={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,n){var r,i={},c=null,l=null;for(r in void 0!==n&&(c=""+n),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(l=t.ref),t)u.call(t,r)&&!s.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===i[r]&&(i[r]=t[r]);return{$$typeof:o,type:e,key:c,ref:l,props:i,_owner:a.current}}t.jsx=c,t.jsxs=c},246:(e,t,n)=>{"use strict";e.exports=n(426)},248:e=>{var t=function(e){"use strict";var t,n=Object.prototype,r=n.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function s(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,n){return e[t]=n}}function c(e,t,n,r){var o=t&&t.prototype instanceof h?t:h,i=Object.create(o.prototype),a=new P(r||[]);return i._invoke=function(e,t,n){var r=f;return function(o,i){if(r===p)throw new Error("Generator is already running");if(r===m){if("throw"===o)throw i;return N()}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var u=O(a,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===f)throw r=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=p;var s=l(e,t,n);if("normal"===s.type){if(r=n.done?m:d,s.arg===v)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(r=m,n.method="throw",n.arg=s.arg)}}}(e,n,a),i}function l(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var f="suspendedStart",d="suspendedYield",p="executing",m="completed",v={};function h(){}function y(){}function b(){}var g={};g[i]=function(){return this};var x=Object.getPrototypeOf,w=x&&x(x(I([])));w&&w!==n&&r.call(w,i)&&(g=w);var S=b.prototype=h.prototype=Object.create(g);function k(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function j(e,t){function n(o,i,a,u){var s=l(e[o],e,i);if("throw"!==s.type){var c=s.arg,f=c.value;return f&&"object"==typeof f&&r.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,a,u)}),(function(e){n("throw",e,a,u)})):t.resolve(f).then((function(e){c.value=e,a(c)}),(function(e){return n("throw",e,a,u)}))}u(s.arg)}var o;this._invoke=function(e,r){function i(){return new t((function(t,o){n(e,r,t,o)}))}return o=o?o.then(i,i):i()}}function O(e,n){var r=e.iterator[n.method];if(r===t){if(n.delegate=null,"throw"===n.method){if(e.iterator.return&&(n.method="return",n.arg=t,O(e,n),"throw"===n.method))return v;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var o=l(r,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,v;var i=o.arg;return i?i.done?(n[e.resultName]=i.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function P(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function I(e){if(e){var n=e[i];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return a.next=a}}return{next:N}}function N(){return{value:t,done:!0}}return y.prototype=S.constructor=b,b.constructor=y,y.displayName=s(b,u,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===y||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,s(e,u,"GeneratorFunction")),e.prototype=Object.create(S),e},e.awrap=function(e){return{__await:e}},k(j.prototype),j.prototype[a]=function(){return this},e.AsyncIterator=j,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new j(c(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},k(S),s(S,u,"Generator"),S[i]=function(){return this},S.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=I,P.prototype={constructor:P,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(E),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return u.type="throw",u.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var s=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(s&&c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),v},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),E(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;E(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:I(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}(e.exports);try{regeneratorRuntime=t}catch(e){Function("r","regeneratorRuntime = r")(t)}},804:e=>{"use strict";e.exports=React}},n={};function r(e){var o=n[e];if(void 0!==o)return o.exports;var i=n[e]={exports:{}};return t[e](i,i.exports,r),i.exports}r.m=t,e=[],r.O=(t,n,o,i)=>{if(!n){var a=1/0;for(c=0;c<e.length;c++){for(var[n,o,i]=e[c],u=!0,s=0;s<n.length;s++)(!1&i||a>=i)&&Object.keys(r.O).every((e=>r.O[e](n[s])))?n.splice(s--,1):(u=!1,i<a&&(a=i));u&&(e.splice(c--,1),t=o())}return t}i=i||0;for(var c=e.length;c>0&&e[c-1][2]>i;c--)e[c]=e[c-1];e[c]=[n,o,i]},r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={172:0,106:0};r.O.j=t=>0===e[t];var t=(t,n)=>{var o,i,[a,u,s]=n,c=0;for(o in u)r.o(u,o)&&(r.m[o]=u[o]);if(s)var l=s(r);for(t&&t(n);c<a.length;c++)i=a[c],r.o(e,i)&&e[i]&&e[i][0](),e[a[c]]=0;return r.O(l)},n=self.webpackChunk=self.webpackChunk||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})(),r.O(void 0,[106],(()=>r(501)));var o=r.O(void 0,[106],(()=>r(602)));o=r.O(o)})();
extendify-sdk/readme.txt CHANGED
@@ -1,5 +1,5 @@
1
  === Extendify Sdk ===
2
  Requires at least: 5.4
3
- Stable tag: 3.1
4
  Requires PHP: 5.6
5
  Tested up to: 5.7.0
1
  === Extendify Sdk ===
2
  Requires at least: 5.4
3
+ Stable tag: 3.5
4
  Requires PHP: 5.6
5
  Tested up to: 5.7.0
extendify-sdk/routes/api.php CHANGED
@@ -11,7 +11,7 @@ use Extendify\ExtendifySdk\ApiRouter;
11
  use Extendify\ExtendifySdk\Controllers\AuthController;
12
  use Extendify\ExtendifySdk\Controllers\UserController;
13
  use Extendify\ExtendifySdk\Controllers\PluginController;
14
- use Extendify\ExtendifySdk\Controllers\CategoryController;
15
  use Extendify\ExtendifySdk\Controllers\TemplateController;
16
 
17
  \add_action(
@@ -21,9 +21,10 @@ use Extendify\ExtendifySdk\Controllers\TemplateController;
21
  ApiRouter::get('/plugins', [PluginController::class, 'index']);
22
  ApiRouter::post('/plugins', [PluginController::class, 'install']);
23
 
24
- ApiRouter::get('/categories', [CategoryController::class, 'index']);
 
25
  ApiRouter::post('/templates', [TemplateController::class, 'index']);
26
- ApiRouter::post('/templates/(?P<template_id>[a-zA-Z0-9-]+)', [TemplateController::class, 'single']);
27
 
28
  ApiRouter::get('/user', [UserController::class, 'show']);
29
  ApiRouter::post('/user', [UserController::class, 'store']);
11
  use Extendify\ExtendifySdk\Controllers\AuthController;
12
  use Extendify\ExtendifySdk\Controllers\UserController;
13
  use Extendify\ExtendifySdk\Controllers\PluginController;
14
+ use Extendify\ExtendifySdk\Controllers\TaxonomyController;
15
  use Extendify\ExtendifySdk\Controllers\TemplateController;
16
 
17
  \add_action(
21
  ApiRouter::get('/plugins', [PluginController::class, 'index']);
22
  ApiRouter::post('/plugins', [PluginController::class, 'install']);
23
 
24
+ ApiRouter::get('/taxonomies', [TaxonomyController::class, 'index']);
25
+
26
  ApiRouter::post('/templates', [TemplateController::class, 'index']);
27
+ ApiRouter::post('/templates/(?P<template_id>[a-zA-Z0-9-]+)', [TemplateController::class, 'ping']);
28
 
29
  ApiRouter::get('/user', [UserController::class, 'show']);
30
  ApiRouter::post('/user', [UserController::class, 'store']);
extendify-sdk/src/api/Categories.js DELETED
@@ -1,7 +0,0 @@
1
- import { Axios as api } from './axios'
2
-
3
- export const Categories = {
4
- get() {
5
- return api.get('categories')
6
- },
7
- }
 
 
 
 
 
 
 
extendify-sdk/src/api/Taxonomies.js ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ import { Axios as api } from './axios'
2
+
3
+ export const Taxonomies = {
4
+ get() {
5
+ return api.get('taxonomies')
6
+ },
7
+ }
extendify-sdk/src/api/Templates.js CHANGED
@@ -22,12 +22,12 @@ export const Templates = {
22
  'templates', {
23
  filterByFormula: createTemplatesFilterFormula(searchParams),
24
  pageSize: config.templatesPerRequest,
25
- categories: searchParams.categories,
26
  search: searchParams.search,
27
  type: searchParams.type,
28
  offset: offset,
29
  initial: count === 1,
30
- requestNumber: count,
31
  }, {
32
  cancelToken: fetchToken.token,
33
  },
@@ -37,9 +37,27 @@ export const Templates = {
37
  })
38
  return templates
39
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
40
  import(template) {
41
  return api.post(`templates/${template.id}`, {
42
  template_id: template.id,
 
43
  pageSize: config.templatesPerRequest,
44
  template_name: template.fields?.title,
45
  })
22
  'templates', {
23
  filterByFormula: createTemplatesFilterFormula(searchParams),
24
  pageSize: config.templatesPerRequest,
25
+ categories: searchParams.taxonomies,
26
  search: searchParams.search,
27
  type: searchParams.type,
28
  offset: offset,
29
  initial: count === 1,
30
+ request_count: count,
31
  }, {
32
  cancelToken: fetchToken.token,
33
  },
37
  })
38
  return templates
39
  },
40
+ // TODO: Refactor this later to combine the following three
41
+ maybeImport(template) {
42
+ return api.post(`templates/${template.id}`, {
43
+ template_id: template.id,
44
+ maybe_import: true,
45
+ pageSize: config.templatesPerRequest,
46
+ template_name: template.fields?.title,
47
+ })
48
+ },
49
+ single(template) {
50
+ return api.post(`templates/${template.id}`, {
51
+ template_id: template.id,
52
+ single: true,
53
+ pageSize: config.templatesPerRequest,
54
+ template_name: template.fields?.title,
55
+ })
56
+ },
57
  import(template) {
58
  return api.post(`templates/${template.id}`, {
59
  template_id: template.id,
60
+ imported: true,
61
  pageSize: config.templatesPerRequest,
62
  template_name: template.fields?.title,
63
  })
extendify-sdk/src/api/axios.js CHANGED
@@ -29,12 +29,14 @@ function addDefaults(request) {
29
  if (request.data) {
30
  request.data.remaining_imports = useUserStore.getState().remainingImports()
31
  request.data.entry_point = useUserStore.getState().entryPoint
 
32
  }
33
  return request
34
  }
35
 
36
  function checkDevMode(request) {
37
  request.headers['X-Extendify-Dev-Mode'] = window.location.search.indexOf('DEVMODE') > -1
 
38
  return request
39
  }
40
 
29
  if (request.data) {
30
  request.data.remaining_imports = useUserStore.getState().remainingImports()
31
  request.data.entry_point = useUserStore.getState().entryPoint
32
+ request.data.total_imports = useUserStore.getState().imports
33
  }
34
  return request
35
  }
36
 
37
  function checkDevMode(request) {
38
  request.headers['X-Extendify-Dev-Mode'] = window.location.search.indexOf('DEVMODE') > -1
39
+ request.headers['X-Extendify-Local-Mode'] = window.location.search.indexOf('LOCALMODE') > -1
40
  return request
41
  }
42
 
extendify-sdk/src/app.css CHANGED
@@ -14,3 +14,9 @@
14
  .button-extendify-main {
15
  @apply bg-extendify-main cursor-pointer transition duration-200 p-1.5 px-3 text-white hover:text-white no-underline hover:bg-gray-900 button-focus active:bg-gray-900 active:text-white focus:text-white;
16
  }
 
 
 
 
 
 
14
  .button-extendify-main {
15
  @apply bg-extendify-main cursor-pointer transition duration-200 p-1.5 px-3 text-white hover:text-white no-underline hover:bg-gray-900 button-focus active:bg-gray-900 active:text-white focus:text-white;
16
  }
17
+
18
+ /* WP tweaks and overrides */
19
+ .extendify-sdk .components-panel__body > .components-panel__body-title {
20
+ /* Override WP aggressive boder:none and border:0 */
21
+ border-bottom: 1px solid #e0e0e0 !important;
22
+ }
extendify-sdk/src/app.js CHANGED
@@ -6,13 +6,18 @@ import './buttons'
6
  import './listeners'
7
 
8
  window._wpLoadBlockEditor && window.wp.domReady(() => {
 
 
 
 
 
9
 
10
  // Insert a template on page load if it exists in localstorage
 
 
11
  if (useWantedTemplateStore.getState().importOnLoad) {
12
  const template = useWantedTemplateStore.getState().wantedTemplate
13
- setTimeout(() => {
14
- injectTemplate(template)
15
- }, 0)
16
  }
17
 
18
  // Reset template state after checking if we need an import
@@ -20,10 +25,4 @@ window._wpLoadBlockEditor && window.wp.domReady(() => {
20
  importOnLoad: false,
21
  wantedTemplate: {},
22
  })
23
-
24
- // Insert into the editor (note: Modal opens in a portal)
25
- const extendify = document.createElement('div')
26
- extendify.id = 'extendify-root'
27
- document.body.append(extendify)
28
- render(<ExtendifyLibrary/>, extendify)
29
  })
6
  import './listeners'
7
 
8
  window._wpLoadBlockEditor && window.wp.domReady(() => {
9
+ // Insert into the editor (note: Modal opens in a portal)
10
+ const extendify = document.createElement('div')
11
+ extendify.id = 'extendify-root'
12
+ document.body.append(extendify)
13
+ render(<ExtendifyLibrary/>, extendify)
14
 
15
  // Insert a template on page load if it exists in localstorage
16
+ // Note 6/28/21 - this was moved to after the render to possibly
17
+ // fix a bug where imports would go from 3->0.
18
  if (useWantedTemplateStore.getState().importOnLoad) {
19
  const template = useWantedTemplateStore.getState().wantedTemplate
20
+ setTimeout(() => { injectTemplate(template) }, 0)
 
 
21
  }
22
 
23
  // Reset template state after checking if we need an import
25
  importOnLoad: false,
26
  wantedTemplate: {},
27
  })
 
 
 
 
 
 
28
  })
extendify-sdk/src/buttons.js CHANGED
@@ -1,8 +1,9 @@
1
  import { __ } from '@wordpress/i18n'
2
  import { renderToString } from '@wordpress/element'
3
  import { registerPlugin } from '@wordpress/plugins'
4
- import { PluginSidebarMoreMenuItem } from '@wordpress/edit-post'
5
  import { openModal } from './util/general'
 
 
6
 
7
  const openLibrary = (event) => {
8
  openModal(event.target.closest('[data-extendify-identifier]')?.dataset?.extendifyIdentifier)
@@ -26,6 +27,9 @@ const mainButton = <div id="extendify-templates-inserter">
26
  // Add the MAIN button when Gutenberg is available and ready
27
  window._wpLoadBlockEditor && window.wp.data.subscribe(() => {
28
  setTimeout(() => {
 
 
 
29
  if (document.getElementById('extendify-templates-inserter-btn')) {
30
  return
31
  }
@@ -40,6 +44,9 @@ window._wpLoadBlockEditor && window.wp.data.subscribe(() => {
40
  // The CTA button inside patterns
41
  window._wpLoadBlockEditor && window.wp.data.subscribe(() => {
42
  setTimeout(() => {
 
 
 
43
  if (!document.querySelector('[id$=patterns-view]')) {
44
  return
45
  }
@@ -61,7 +68,7 @@ window._wpLoadBlockEditor && window.wp.data.subscribe(() => {
61
  })
62
 
63
  // The right dropdown side menu
64
- const SideMenuButton = () => (<PluginSidebarMoreMenuItem
65
  data-extendify-identifier="sidebar-button"
66
  onClick={openLibrary}
67
  icon={
@@ -74,7 +81,27 @@ const SideMenuButton = () => (<PluginSidebarMoreMenuItem
74
  }
75
  >
76
  {__('Library', 'extendify-sdk')}
77
- </PluginSidebarMoreMenuItem>)
78
  window._wpLoadBlockEditor && registerPlugin('extendify-temps-more-menu-trigger', {
79
  render: SideMenuButton,
80
  })
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  import { __ } from '@wordpress/i18n'
2
  import { renderToString } from '@wordpress/element'
3
  import { registerPlugin } from '@wordpress/plugins'
 
4
  import { openModal } from './util/general'
5
+ import { useUserStore } from './state/User'
6
+ import { PluginSidebarMoreMenuItem } from '@wordpress/edit-post'
7
 
8
  const openLibrary = (event) => {
9
  openModal(event.target.closest('[data-extendify-identifier]')?.dataset?.extendifyIdentifier)
27
  // Add the MAIN button when Gutenberg is available and ready
28
  window._wpLoadBlockEditor && window.wp.data.subscribe(() => {
29
  setTimeout(() => {
30
+ if (!useUserStore.getState().enabled) {
31
+ return
32
+ }
33
  if (document.getElementById('extendify-templates-inserter-btn')) {
34
  return
35
  }
44
  // The CTA button inside patterns
45
  window._wpLoadBlockEditor && window.wp.data.subscribe(() => {
46
  setTimeout(() => {
47
+ if (!useUserStore.getState().enabled) {
48
+ return
49
+ }
50
  if (!document.querySelector('[id$=patterns-view]')) {
51
  return
52
  }
68
  })
69
 
70
  // The right dropdown side menu
71
+ const SideMenuButton = () => useUserStore.getState().enabled && <PluginSidebarMoreMenuItem
72
  data-extendify-identifier="sidebar-button"
73
  onClick={openLibrary}
74
  icon={
81
  }
82
  >
83
  {__('Library', 'extendify-sdk')}
84
+ </PluginSidebarMoreMenuItem>
85
  window._wpLoadBlockEditor && registerPlugin('extendify-temps-more-menu-trigger', {
86
  render: SideMenuButton,
87
  })
88
+
89
+ // Everything above this line will be enabled or disabled based on the
90
+ // users "enabled" state, which is controlled by another button here
91
+ const LibraryEnableDisable = () => <PluginSidebarMoreMenuItem
92
+ onClick={() => {
93
+ useUserStore.setState({
94
+ enabled: !useUserStore.getState().enabled,
95
+ })
96
+ requestAnimationFrame(() => location.reload())
97
+ }}
98
+ icon={<></>}
99
+ >
100
+ {useUserStore.getState().enabled
101
+ ? __('Disable Extendify', 'extendify-sdk')
102
+ : __('Enable Extendify', 'extendify-sdk')}
103
+ </PluginSidebarMoreMenuItem>
104
+
105
+ window._wpLoadBlockEditor && registerPlugin('extendify-settings-enable-disable', {
106
+ render: LibraryEnableDisable,
107
+ })
extendify-sdk/src/components/Filtering.js CHANGED
@@ -6,123 +6,54 @@ import { debounce } from 'lodash'
6
  import {
7
  useEffect, useState, useCallback,
8
  } from '@wordpress/element'
9
- import { Categories as CategoriesApi } from '../api/Categories'
10
- import classNames from 'classnames'
 
11
 
12
  export default function Filtering() {
13
  const updateSearchParams = useTemplatesStore(state => state.updateSearchParams)
 
14
  const searchParams = useTemplatesStore(state => state.searchParams)
15
- // const [categoriesOpen, setCategoriesOpen] = useState(true)
16
  const searchInputUpdate = debounce((value) => updateSearchParams({
17
- categories: [],
18
  search: value,
19
  }), 500)
20
  const [searchValue, setSearchValue] = useState(searchParams?.search ?? '')
21
- const [categories, setCategories] = useState([])
22
- const fetchCategories = useCallback(async () => {
23
- const { records } = await CategoriesApi.get()
24
- const cats = records.map(cat => cat?.fields?.title).filter(Boolean).sort()
25
- setCategories(cats)
26
- }, [])
27
 
28
  useEffect(() => {
29
- fetchCategories()
30
- }, [fetchCategories])
31
 
32
- return <div className="flex-grow overflow-y-auto">
33
- <SearchForm
34
- placeholder={__('What are you looking for?', 'extendify-sdk')}
35
- onChange={(value) => {
36
- useTemplatesStore.setState({
37
- nextPage: '',
38
- })
39
- setSearchValue(value)
40
- searchInputUpdate(value)
41
- }}
42
- value={searchValue}
43
- className="sm:ml-px sm:mt-1 sm:mr-1 sm:mb-6 px-6 sm:p-0 sm:px-0"
44
- autoComplete="off" />
45
- {/* <div className="sm:hidden pb-2 px-6" style={{
46
- maxWidth: '400px',
47
- }}>
48
- <label htmlFor="category-search-mobile" className="sr-only">
49
- {__('Select a category', 'extendify-sdk')}
50
- </label>
51
- <SelectControl
52
- id="category-search-mobile"
53
- className="pt-0"
54
- onChange={(cat) => updateSearchParams({
55
- categories: [cat],
56
  })}
57
- options={
58
- [{
59
- value: '',
60
- label: __('Select a category...', 'extendify-sdk'),
61
- }, ...categories.map(cat => ({
62
- value: cat, label: cat,
63
- }))]
64
- }/>
65
- </div> */}
66
- <div className="hidden sm:block">
67
- <div
68
- className="flex justify-between items-center mb-4 py-4 border-b border-gray-200">
69
- <h3 className="font-medium mb-2 pl-4 text-sm m-0 p-0">{ __('Categories', 'extendify-sdk') }</h3>
70
- {/* <span>
71
- {categoriesOpen ?
72
- <svg width="14" height="8" className="stroke-current" viewBox="0 0 14 2" fill="none" xmlns="http://www.w3.org/2000/svg">
73
- <path d="M8.00018 1L6.00018 1M14.0002 1L12.0002 1M2.00018 1L0.000183105 1" strokeWidth="2"/>
74
- </svg> :
75
- <svg width="14" height="8" className="stroke-current" viewBox="0 0 14 8" fill="none" xmlns="http://www.w3.org/2000/svg">
76
- <path d="M1.49999 1L6.99999 6L12.5 1" strokeWidth="1.5"/>
77
- </svg>
78
- }
79
- </span> */}
80
- </div>
81
- {<div className="mt-6">
82
- <ul className="m-0 pl-4 pb-24">
83
- <li className="m-0">
84
- <button
85
- type="button"
86
- className="cursor-pointer w-full flex justify-between items-center p-3 m-0 px-4 leading-none hover:text-wp-theme-500 bg-transparent transition duration-200"
87
- onClick={() => {
88
- updateSearchParams({
89
- categories: [],
90
- })
91
- }}>
92
- <span className={classNames({
93
- 'text-wp-theme-500 font-bold': (!searchParams.categories.length || searchParams?.categories.includes('Default')),
94
- })}>
95
- {searchParams.type === 'pattern'
96
- ? __('Default', 'extendify-sdk')
97
- : __('All', 'extendify-sdk')}
98
- </span>
99
- </button>
100
- </li>
101
- {categories.map((category) =>
102
- <li className="m-0" key={category}>
103
- <button
104
- type="button"
105
- className="cursor-pointer w-full flex justify-between items-center p-3 m-0 px-4 leading-none bg-transparent hover:text-wp-theme-500 transition duration-200"
106
- onClick={() => {
107
- updateSearchParams({
108
- categories: [category],
109
- })
110
- }}>
111
- <span className={classNames({
112
- 'text-wp-theme-500 font-bold': searchParams.categories.includes(category),
113
- })}>
114
- {category}
115
- </span>
116
- {/* <span className="text-black">
117
- <svg width="8" height="14" viewBox="0 0 8 14" className="stroke-current" fill="none" xmlns="http://www.w3.org/2000/svg">
118
- <path d="M1 12.5L6 6.99998L1 1.5" strokeWidth="1.5"/>
119
- </svg>
120
- </span> */}
121
- </button>
122
- </li>)
123
- }
124
- </ul>
125
- </div>}
126
  </div>
127
- </div>
128
  }
6
  import {
7
  useEffect, useState, useCallback,
8
  } from '@wordpress/element'
9
+ import { Taxonomies as TaxonomiesApi } from '../api/Taxonomies'
10
+ import { Panel } from '@wordpress/components'
11
+ import TaxonomySection from './TaxonomySection'
12
 
13
  export default function Filtering() {
14
  const updateSearchParams = useTemplatesStore(state => state.updateSearchParams)
15
+ const setupDefaultTaxonomies = useTemplatesStore(state => state.setupDefaultTaxonomies)
16
  const searchParams = useTemplatesStore(state => state.searchParams)
 
17
  const searchInputUpdate = debounce((value) => updateSearchParams({
18
+ taxonomies: {},
19
  search: value,
20
  }), 500)
21
  const [searchValue, setSearchValue] = useState(searchParams?.search ?? '')
22
+ const [taxonomies, setTaxonomies] = useState({})
23
+ const fetchTaxonomies = useCallback(async () => {
24
+ const tax = await TaxonomiesApi.get()
25
+ setupDefaultTaxonomies(tax)
26
+ setTaxonomies(tax)
27
+ }, [setupDefaultTaxonomies])
28
 
29
  useEffect(() => {
30
+ fetchTaxonomies()
31
+ }, [fetchTaxonomies])
32
 
33
+ return <>
34
+ <div className="pt-1 -mt-1 mb-1 bg-white">
35
+ <SearchForm
36
+ placeholder={__('What are you looking for?', 'extendify-sdk')}
37
+ onChange={(value) => {
38
+ useTemplatesStore.setState({
39
+ nextPage: '',
40
+ })
41
+ setSearchValue(value)
42
+ searchInputUpdate(value)
43
+ }}
44
+ value={searchValue}
45
+ className="sm:ml-px sm:mr-1 sm:mb-6 px-6 sm:p-0 sm:px-0"
46
+ autoComplete="off" />
47
+ </div>
48
+ <div className="flex-grow hidden overflow-y-auto pb-32 pr-2 sm:block">
49
+ <Panel>
50
+ {Object.entries(taxonomies).map((taxonomy, index) => {
51
+ return <TaxonomySection
52
+ key={index}
53
+ open={false}
54
+ taxonomy={taxonomy} />
 
 
55
  })}
56
+ </Panel>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
57
  </div>
58
+ </>
59
  }
extendify-sdk/src/components/ImportButton.js CHANGED
@@ -6,6 +6,7 @@ import { useWantedTemplateStore } from '../state/Importing'
6
  import { useUserStore } from '../state/User'
7
  import { useGlobalStore } from '../state/GlobalState'
8
  import { __, sprintf } from '@wordpress/i18n'
 
9
 
10
  const canImportMiddleware = Middleware(['hasRequiredPlugins', 'hasPluginsActivated'])
11
  export function ImportButton({ template }) {
@@ -30,6 +31,13 @@ export function ImportButton({ template }) {
30
  return () => canImportMiddleware.reset() && setMiddlewareChecked(false)
31
  }, [template])
32
 
 
 
 
 
 
 
 
33
  const importTemplate = () => {
34
  setImporting(true)
35
  setWanted(template)
6
  import { useUserStore } from '../state/User'
7
  import { useGlobalStore } from '../state/GlobalState'
8
  import { __, sprintf } from '@wordpress/i18n'
9
+ import { Templates as TemplatesApi } from '../api/Templates'
10
 
11
  const canImportMiddleware = Middleware(['hasRequiredPlugins', 'hasPluginsActivated'])
12
  export function ImportButton({ template }) {
31
  return () => canImportMiddleware.reset() && setMiddlewareChecked(false)
32
  }, [template])
33
 
34
+ useEffect(() => {
35
+ if (!importing) {
36
+ return
37
+ }
38
+ TemplatesApi.maybeImport(template)
39
+ }, [importing, template])
40
+
41
  const importTemplate = () => {
42
  setImporting(true)
43
  setWanted(template)
extendify-sdk/src/components/SidebarSingle.js CHANGED
@@ -8,7 +8,7 @@ import { getPluginDescription } from '../util/general'
8
  export default function SidebarSingle({ template }) {
9
  const setActiveTemplate = useTemplatesStore(state => state.setActive)
10
  const goBackRef = useRef(null)
11
- const { categories, required_plugins: requiredPlugins } = template.fields
12
  const apiKey = useUserStore(state => state.apiKey)
13
 
14
  useEffect(() => {
8
  export default function SidebarSingle({ template }) {
9
  const setActiveTemplate = useTemplatesStore(state => state.setActive)
10
  const goBackRef = useRef(null)
11
+ const { tax_categories: categories, required_plugins: requiredPlugins } = template.fields
12
  const apiKey = useUserStore(state => state.apiKey)
13
 
14
  useEffect(() => {
extendify-sdk/src/components/TaxonomyBreadcrumbs.js ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { useTemplatesStore } from '../state/Templates'
2
+
3
+ export default function TaxonomyBreadcrumbs() {
4
+ const searchParams = useTemplatesStore(state => state.searchParams)
5
+ const formatTitle = (title) => title.replace('tax_', '').replace('_' , ' ').replace(/\b\w/g, l => l.toUpperCase())
6
+ return <div className="hidden sm:flex items-start flex-col lg:flex-row -mt-2 lg:-mx-2 mb-4 lg:divide-x-2 lg:leading-none">{Object.entries(searchParams.taxonomies).map((tax) => {
7
+ // Special exception for page templates
8
+ if (searchParams.type === 'template' && tax[0] === 'tax_pattern_types') {
9
+ return ''
10
+ }
11
+ // Special exception for page types
12
+ if (searchParams.type === 'pattern' && tax[0] === 'tax_page_types') {
13
+ return ''
14
+ }
15
+ return <div key={tax[0]} className="lg:px-2 text-left">
16
+ <span className="font-bold">{formatTitle(tax[0])}</span>: <span>{tax[1]
17
+ ? tax[1]
18
+ : 'All'}</span>
19
+ </div>
20
+ })}</div>
21
+ }
extendify-sdk/src/components/TaxonomySection.js ADDED
@@ -0,0 +1,168 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { PanelBody, PanelRow } from '@wordpress/components'
2
+ import classNames from 'classnames'
3
+ import { useTemplatesStore } from '../state/Templates'
4
+ import { __ } from '@wordpress/i18n'
5
+ import {
6
+ useState, useEffect, useRef,
7
+ } from '@wordpress/element'
8
+
9
+ // import { useState } from '@wordpress/element'
10
+ export default function TaxonomySection({ taxonomy: [title, data], open }) {
11
+ const updateTaxonomies = useTemplatesStore(state => state.updateTaxonomies)
12
+ const resetTaxonomies = useTemplatesStore(state => state.resetTaxonomies)
13
+ const searchParams = useTemplatesStore(state => state.searchParams)
14
+ const [pageTwoTerms, setPageTwoTerms] = useState({})
15
+ const [taxListHeight, setTaxListHeight] = useState({})
16
+ const pageTwo = useRef()
17
+ const pageOneFocus = useRef()
18
+ const pageTwoFocus = useRef()
19
+ const firstUpdate = useRef(true)
20
+
21
+ // This will check whether the term is current (either child or top level/has no child)
22
+ // And then it will search children so the parent is also marked as selected
23
+ const isCurrentTax = (tax) => searchParams?.taxonomies[title] === tax.term
24
+ || tax.children?.filter((t) => {
25
+ return t.term === searchParams?.taxonomies[title]
26
+ }).length > 0
27
+
28
+ // Todo: memo this
29
+ const isAvailableOnCurrentType = (tax) => {
30
+ if (Object.prototype.hasOwnProperty.call(tax, 'children')) {
31
+ return tax.children.filter((t) => t?.type.includes(searchParams.type)).length
32
+ }
33
+ return tax?.type?.includes(searchParams.type)
34
+ }
35
+
36
+ useEffect(() => {
37
+ if (firstUpdate.current) {
38
+ firstUpdate.current = false
39
+ return
40
+ }
41
+ setPageTwoTerms({})
42
+ resetTaxonomies()
43
+ }, [searchParams.type, resetTaxonomies])
44
+
45
+ useEffect(() => {
46
+ if (Object.keys(pageTwoTerms).length) {
47
+ setTimeout(() => {
48
+ requestAnimationFrame(() => {
49
+ setTaxListHeight(pageTwo.current.clientHeight)
50
+ pageTwoFocus.current.focus()
51
+ })
52
+ }, 200)
53
+ return
54
+ }
55
+ setTaxListHeight('auto')
56
+ }, [pageTwoTerms])
57
+
58
+ // Return early if 1. No data or 2. Children don't match this type
59
+ if (!Object.keys(data).length || !Object.values(data).filter((tax) => isAvailableOnCurrentType(tax)).length) {
60
+ return ''
61
+ }
62
+
63
+ const theTitle = title.replace('tax_', '').replace('_' , ' ').replace(/\b\w/g, l => l.toUpperCase())
64
+ return <PanelBody title={theTitle} initialOpen={open}>
65
+ <PanelRow>
66
+ <div className="overflow-hidden w-full relative" style={{
67
+ height: taxListHeight,
68
+ }}>
69
+ <ul className={classNames('p-1 m-0 w-full transform transition duration-200', {
70
+ '-translate-x-full': Object.keys(pageTwoTerms).length,
71
+ })}>
72
+ <li className="m-0">
73
+ <button
74
+ type="button"
75
+ className="text-left cursor-pointer w-full flex justify-between items-center py-1.5 m-0 leading-none hover:text-wp-theme-500 bg-transparent transition duration-200 button-focus"
76
+ ref={pageOneFocus}
77
+ onClick={() => {
78
+ updateTaxonomies({
79
+ [title]: searchParams.type === 'pattern' && title === 'tax_categories'
80
+ ? 'Default'
81
+ : '',
82
+ })
83
+ }}>
84
+ <span className={classNames({
85
+ 'text-wp-theme-500': (!searchParams.taxonomies[title].length || searchParams?.taxonomies[title] === 'Default'),
86
+ })}>
87
+ {searchParams.type === 'pattern' && title === 'tax_categories'
88
+ ? __('Default', 'extendify-sdk')
89
+ : __('All', 'extendify-sdk')}
90
+ </span>
91
+ </button>
92
+ </li>
93
+ {Object.values(data)
94
+ .filter((tax) => isAvailableOnCurrentType(tax))
95
+ .sort((prev, next) => prev.term.localeCompare(next.term))
96
+ .map((tax) =>
97
+ <li className="m-0 w-full" key={tax.term}>
98
+ <button
99
+ type="button"
100
+ className="text-left cursor-pointer w-full flex justify-between items-center py-1.5 m-0 leading-none bg-transparent hover:text-wp-theme-500 transition duration-200 button-focus"
101
+ onClick={() => {
102
+ if (Object.prototype.hasOwnProperty.call(tax, 'children')) {
103
+ setPageTwoTerms(tax)
104
+ return
105
+ }
106
+ updateTaxonomies({
107
+ [title]: tax.term,
108
+ })
109
+ }}>
110
+ <span className={classNames({
111
+ 'text-wp-theme-500': isCurrentTax(tax),
112
+ })}>
113
+ {tax.term}
114
+ </span>
115
+ {Object.prototype.hasOwnProperty.call(tax, 'children') && <span className="text-black">
116
+ <svg width="8" height="14" viewBox="0 0 8 14" className="stroke-current" fill="none" xmlns="http://www.w3.org/2000/svg">
117
+ <path d="M1 12.5L6 6.99998L1 1.5" strokeWidth="1.5"/>
118
+ </svg>
119
+ </span>}
120
+ </button>
121
+ </li>)
122
+ }
123
+ </ul>
124
+ <ul ref={pageTwo} className={classNames('p-1 m-0 w-full transform transition duration-200 absolute top-0 right-0', {
125
+ 'translate-x-full': !Object.keys(pageTwoTerms).length,
126
+ })}>
127
+ {Object.values(pageTwoTerms).length > 0 && <li className="m-0">
128
+ <button
129
+ type="button"
130
+ className="text-left cursor-pointer font-bold flex space-x-4 items-center py-2 pr-4 m-0leading-none hover:text-wp-theme-500 bg-transparent transition duration-200 button-focus"
131
+ ref={pageTwoFocus}
132
+ onClick={() => {
133
+ setPageTwoTerms({})
134
+ pageOneFocus.current.focus()
135
+ }}>
136
+ <svg className="stroke-current transform rotate-180" width="8" height="14" viewBox="0 0 8 14" fill="none" xmlns="http://www.w3.org/2000/svg">
137
+ <path d="M1 12.5L6 6.99998L1 1.5" strokeWidth="1.5"/>
138
+ </svg>
139
+ <span>{pageTwoTerms.term}</span>
140
+ </button>
141
+ </li> }
142
+ {Object.values(pageTwoTerms).length
143
+ && Object.values(pageTwoTerms.children)
144
+ .filter((tax) => isAvailableOnCurrentType(tax))
145
+ .sort((prev, next) => prev.term.localeCompare(next.term))
146
+ .map((childTax) =>
147
+ <li className="m-0 pl-6 w-full flex justify-between items-center" key={childTax.term}>
148
+ <button
149
+ type="button"
150
+ className="text-left cursor-pointer w-full flex justify-between items-center py-1.5 m-0 leading-none bg-transparent hover:text-wp-theme-500 transition duration-200 button-focus"
151
+ onClick={() => {
152
+ updateTaxonomies({
153
+ [title]: childTax.term,
154
+ })
155
+ }}>
156
+ <span className={classNames({
157
+ 'text-wp-theme-500': isCurrentTax(childTax),
158
+ })}>
159
+ {childTax.term}
160
+ </span>
161
+ </button>
162
+ </li>)
163
+ }
164
+ </ul>
165
+ </div>
166
+ </PanelRow>
167
+ </PanelBody>
168
+ }
extendify-sdk/src/components/TemplatesList.js CHANGED
@@ -29,11 +29,14 @@ export default function TemplatesList({ templates }) {
29
  state => state.searchParams), [])
30
 
31
  // Fetch the templates then add them to the current state
 
 
32
  const fetchTemplates = useCallback(async () => {
33
  setServerError('')
34
  setNothingFound(false)
35
  const response = await TemplatesApi.get(searchParams.current, nextPage.current)
36
  .catch((error) => {
 
37
  setServerError(error && error.message
38
  ? error.message
39
  : __('Unknown error occured. Check browser console or contact support.', 'extendify-sdk'))
@@ -52,6 +55,9 @@ export default function TemplatesList({ templates }) {
52
 
53
  // This loads the initial batch of templates
54
  useEffect(() => {
 
 
 
55
  setImagesLoaded([])
56
  fetchTemplates()
57
  }, [fetchTemplates, searchParams])
@@ -70,7 +76,7 @@ export default function TemplatesList({ templates }) {
70
  <Button isTertiary onClick={() => {
71
  setImagesLoaded([])
72
  updateSearchParams({
73
- categories: [],
74
  search: '',
75
  })
76
  fetchTemplates()
@@ -117,7 +123,7 @@ export default function TemplatesList({ templates }) {
117
  onClick={() => setActiveTemplate(template)}>
118
  <div>
119
  <h4 className="m-0 font-bold">{template.fields.title}</h4>
120
- <p className="m-0">{template.fields.categories.filter(c => c.toLowerCase() !== 'default').join(', ')}</p>
121
  </div>
122
  <Button
123
  isSecondary
29
  state => state.searchParams), [])
30
 
31
  // Fetch the templates then add them to the current state
32
+ // TODO: This works, but it's not really doing what it's intended to do
33
+ // as it has a side effect in there, and isn't pure. It should be updated
34
  const fetchTemplates = useCallback(async () => {
35
  setServerError('')
36
  setNothingFound(false)
37
  const response = await TemplatesApi.get(searchParams.current, nextPage.current)
38
  .catch((error) => {
39
+ console.error(error)
40
  setServerError(error && error.message
41
  ? error.message
42
  : __('Unknown error occured. Check browser console or contact support.', 'extendify-sdk'))
55
 
56
  // This loads the initial batch of templates
57
  useEffect(() => {
58
+ if (!Object.keys(searchParams.current.taxonomies).length) {
59
+ return
60
+ }
61
  setImagesLoaded([])
62
  fetchTemplates()
63
  }, [fetchTemplates, searchParams])
76
  <Button isTertiary onClick={() => {
77
  setImagesLoaded([])
78
  updateSearchParams({
79
+ taxonomies: {},
80
  search: '',
81
  })
82
  fetchTemplates()
123
  onClick={() => setActiveTemplate(template)}>
124
  <div>
125
  <h4 className="m-0 font-bold">{template.fields.title}</h4>
126
+ <p className="m-0">{template?.fields?.tax_categories?.filter(c => c.toLowerCase() !== 'default').join(', ')}</p>
127
  </div>
128
  <Button
129
  isSecondary
extendify-sdk/src/components/TemplatesSingle.js CHANGED
@@ -3,11 +3,15 @@ import { __ } from '@wordpress/i18n'
3
  import classNames from 'classnames'
4
  import { useUserStore } from '../state/User'
5
  import { ExternalLink } from '@wordpress/components'
 
 
6
 
7
  export default function Templates({ template }) {
8
- const { categories } = template.fields
9
  const apiKey = useUserStore(state => state.apiKey)
10
 
 
 
11
  return <div className="flex flex-col min-h-screen bg-white sm:min-h-0 items-start overflow-y-auto h-full sm:pr-8 lg:pl-px lg:-ml-px">
12
  <div className="flex flex-col lg:flex-row items-start justify-start lg:items-center lg:justify-between w-full max-w-screen-xl">
13
  <div className="text-left m-0 sm:mb-6 p-6 sm:p-0">
3
  import classNames from 'classnames'
4
  import { useUserStore } from '../state/User'
5
  import { ExternalLink } from '@wordpress/components'
6
+ import { useEffect } from '@wordpress/element'
7
+ import { Templates as TemplatesApi } from '../api/Templates'
8
 
9
  export default function Templates({ template }) {
10
+ const { tax_categories: categories } = template.fields
11
  const apiKey = useUserStore(state => state.apiKey)
12
 
13
+ useEffect(() => { TemplatesApi.single(template) }, [template])
14
+
15
  return <div className="flex flex-col min-h-screen bg-white sm:min-h-0 items-start overflow-y-auto h-full sm:pr-8 lg:pl-px lg:-ml-px">
16
  <div className="flex flex-col lg:flex-row items-start justify-start lg:items-center lg:justify-between w-full max-w-screen-xl">
17
  <div className="text-left m-0 sm:mb-6 p-6 sm:p-0">
extendify-sdk/src/layout/Content.js CHANGED
@@ -7,6 +7,7 @@ import HasSidebar from './HasSidebar'
7
  import TypeSelect from '../components/TypeSelect'
8
  import { __ } from '@wordpress/i18n'
9
  import SidebarSingle from '../components/SidebarSingle'
 
10
 
11
  export default function Content({ className, initialFocus }) {
12
  const templates = useTemplatesStore(state => state.templates)
@@ -28,6 +29,7 @@ export default function Content({ className, initialFocus }) {
28
  <Filtering initialFocus={initialFocus}/>
29
  <>
30
  <TypeSelect/>
 
31
  <div className="relative h-full z-30 bg-white">
32
  <div className="absolute z-20 inset-0 lg:static h-screen lg:h-full overflow-y-auto pt-4 sm:pt-0 px-6 sm:pl-0 sm:pr-8">
33
  <TemplatesList templates={templates}/>
7
  import TypeSelect from '../components/TypeSelect'
8
  import { __ } from '@wordpress/i18n'
9
  import SidebarSingle from '../components/SidebarSingle'
10
+ import TaxonomyBreadcrumbs from '../components/TaxonomyBreadcrumbs'
11
 
12
  export default function Content({ className, initialFocus }) {
13
  const templates = useTemplatesStore(state => state.templates)
29
  <Filtering initialFocus={initialFocus}/>
30
  <>
31
  <TypeSelect/>
32
+ <TaxonomyBreadcrumbs/>
33
  <div className="relative h-full z-30 bg-white">
34
  <div className="absolute z-20 inset-0 lg:static h-screen lg:h-full overflow-y-auto pt-4 sm:pt-0 px-6 sm:pl-0 sm:pr-8">
35
  <TemplatesList templates={templates}/>
extendify-sdk/src/layout/HasSidebar.js CHANGED
@@ -6,7 +6,7 @@ export default function HasSidebar({ children }) {
6
 
7
  return <>
8
  <aside className="flex-shrink-0 sm:pl-12 py-0 sm:py-6 relative">
9
- <div className="lg:w-72 sticky flex flex-col h-full">{children[0]}</div>
10
  <div className="hidden sm:flex flex-col absolute bottom-0 bg-white p-4 w-72 text-left space-y-4">
11
  <div>
12
  <Button isSecondary target="_blank" href="https://extendify.com/feedback">
@@ -19,7 +19,7 @@ export default function HasSidebar({ children }) {
19
  <main
20
  id="extendify-templates"
21
  tabIndex="0"
22
- className="w-full smpl-12 sm:pt-6 h-full">
23
  {children[1]}
24
  </main>
25
  </>
6
 
7
  return <>
8
  <aside className="flex-shrink-0 sm:pl-12 py-0 sm:py-6 relative">
9
+ <div className="sm:w-56 lg:w-72 sticky flex flex-col h-full">{children[0]}</div>
10
  <div className="hidden sm:flex flex-col absolute bottom-0 bg-white p-4 w-72 text-left space-y-4">
11
  <div>
12
  <Button isSecondary target="_blank" href="https://extendify.com/feedback">
19
  <main
20
  id="extendify-templates"
21
  tabIndex="0"
22
+ className="w-full smp:l-12 sm:pt-6 h-full">
23
  {children[1]}
24
  </main>
25
  </>
extendify-sdk/src/listeners/template-inserted.js CHANGED
@@ -15,8 +15,12 @@ export const templateHandler = {
15
  type: 'snackbar',
16
  },
17
  )
18
- increaseImports()
19
- Templates.import(event.detail?.template)
 
 
 
 
20
  })
21
  },
22
  }
15
  type: 'snackbar',
16
  },
17
  )
18
+ // This is put off to the stack in attempt to fix a bug where
19
+ // some users are having their imports go from 3->0 in an instant
20
+ setTimeout(() => {
21
+ increaseImports()
22
+ Templates.import(event.detail?.template)
23
+ },0)
24
  })
25
  },
26
  }
extendify-sdk/src/state/Templates.js CHANGED
@@ -2,17 +2,18 @@ import create from 'zustand'
2
  import { templates as config } from '../config'
3
  import { createBlocksFromInnerBlocksTemplate } from '../util/blocks'
4
 
5
- const defaultCategoryForType = (type) => type === 'pattern'
6
- ? ['Default']
7
- : []
8
 
9
  export const useTemplatesStore = create((set, get) => ({
10
  templates: [],
11
  fetchToken: null,
12
  activeTemplate: {},
13
  activeTemplateBlocks: {},
 
14
  searchParams: {
15
- categories: defaultCategoryForType(config.defaultType),
16
  type: config.defaultType,
17
  search: '',
18
  },
@@ -27,12 +28,26 @@ export const useTemplatesStore = create((set, get) => ({
27
  appendTemplates: (templates) => set({
28
  templates: [...new Map([...get().templates, ...templates].map(item => [item.id, item])).values()],
29
  }),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
30
  setActive: (template) => {
31
  set({
32
  activeTemplate: template,
33
  })
34
 
35
- // This will convert the template to blocks for quick injection
36
  if (template?.fields?.code) {
37
  const { parse } = window.wp.blocks
38
  set({
@@ -40,10 +55,37 @@ export const useTemplatesStore = create((set, get) => ({
40
  })
41
  }
42
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
43
  updateSearchParams: (params) => {
44
- // If categories are set to [] or not set at all, lets compute the default
45
- if (params?.categories && !params.categories.length || !Object.prototype.hasOwnProperty.call(params, 'categories')) {
46
- params.categories = defaultCategoryForType(params?.type ?? get().searchParams.type)
47
  }
48
  set({
49
  templates: [],
2
  import { templates as config } from '../config'
3
  import { createBlocksFromInnerBlocksTemplate } from '../util/blocks'
4
 
5
+ const defaultCategoryForType = (type, tax) => type === 'pattern' && tax === 'tax_categories'
6
+ ? 'Default'
7
+ : ''
8
 
9
  export const useTemplatesStore = create((set, get) => ({
10
  templates: [],
11
  fetchToken: null,
12
  activeTemplate: {},
13
  activeTemplateBlocks: {},
14
+ taxonomyDefaultState: {},
15
  searchParams: {
16
+ taxonomies: {},
17
  type: config.defaultType,
18
  search: '',
19
  },
28
  appendTemplates: (templates) => set({
29
  templates: [...new Map([...get().templates, ...templates].map(item => [item.id, item])).values()],
30
  }),
31
+ setupDefaultTaxonomies: (taxonomies) => {
32
+ // This will transform ['tax_categories', 'tax_another'] to {tax_categories: 'Default', tax_another: ''}
33
+ const defaultState = (tax) => defaultCategoryForType(get().searchParams.type, tax)
34
+ const taxonomyDefaultState = Object.keys(taxonomies).reduce((theObject, current) => (theObject[current] = defaultState(current), theObject), {})
35
+ const tax = {}
36
+ tax.taxonomies = taxonomyDefaultState
37
+
38
+ set({
39
+ taxonomyDefaultState: taxonomyDefaultState,
40
+ searchParams: {
41
+ ...Object.assign(get().searchParams, tax),
42
+ },
43
+ })
44
+ },
45
  setActive: (template) => {
46
  set({
47
  activeTemplate: template,
48
  })
49
 
50
+ // This will convert the template to blocks for quick(er) injection
51
  if (template?.fields?.code) {
52
  const { parse } = window.wp.blocks
53
  set({
55
  })
56
  }
57
  },
58
+ resetTaxonomies: () => {
59
+ // Special default state for tax_categories
60
+ const taxCatException = {
61
+ tax_categories: get().searchParams.type === 'pattern'
62
+ ? 'Default'
63
+ : '',
64
+ }
65
+ get().updateSearchParams({
66
+ taxonomies: Object.assign(get().taxonomyDefaultState, taxCatException),
67
+ })
68
+ },
69
+ updateTaxonomies: (params) => {
70
+ // Special case for when the user isn't searching defaults. This way it mimics "all"
71
+ // if (!Object.values(params).includes('Default') && !Object.keys(params).includes('tax_categories')) {
72
+ // console.log(get().searchParams.type,get().searchParams.taxonomies.tax_categories === 'Default')
73
+ // if (get().searchParams.type === 'pattern' && get().searchParams.taxonomies.tax_categories === 'Default') {
74
+ // params.tax_categories = ''
75
+ // }
76
+ // }
77
+
78
+ const tax = {}
79
+ tax.taxonomies = Object.assign(
80
+ {}, get().searchParams.taxonomies, params,
81
+ )
82
+ get().updateSearchParams(tax)
83
+ },
84
+ // TODO: Something is calling this too often
85
  updateSearchParams: (params) => {
86
+ // If taxonomies are set to {}, lets use the default
87
+ if (params?.taxonomies && !Object.keys(params.taxonomies).length) {
88
+ params.taxonomies = get().taxonomyDefaultState
89
  }
90
  set({
91
  templates: [],
extendify-sdk/src/state/User.js CHANGED
@@ -14,6 +14,7 @@ export const useUserStore = create(persist((set, get) => ({
14
  email: '',
15
  allowedImports: 0,
16
  entryPoint: 'not-set',
 
17
  incrementImports: () => set({
18
  imports: get().imports + 1,
19
  }),
14
  email: '',
15
  allowedImports: 0,
16
  entryPoint: 'not-set',
17
+ enabled: true,
18
  incrementImports: () => set({
19
  imports: get().imports + 1,
20
  }),