MetaSlider - Version 3.22.0

Version Description

  • 2021/Aug/05 =
  • TWEAK: Remove plugin dependency from editor library
Download this release

Release Info

Developer metaslider
Plugin Icon 128x128 MetaSlider
Version 3.22.0
Comparing to
See all releases

Code changes from version 3.21.0 to 3.22.0

Files changed (33) hide show
  1. extendify-sdk/app/Admin.php +1 -1
  2. extendify-sdk/app/ApiRouter.php +1 -14
  3. extendify-sdk/app/App.php +7 -0
  4. extendify-sdk/app/User.php +2 -0
  5. extendify-sdk/bootstrap.php +1 -3
  6. extendify-sdk/editorplus/EditorPlus.php +8 -12
  7. extendify-sdk/extendify-sdk.php +1 -1
  8. extendify-sdk/public/build/extendify-sdk.css +1 -1
  9. extendify-sdk/public/build/extendify-sdk.js +1 -1
  10. extendify-sdk/readme.txt +1 -1
  11. extendify-sdk/src/api/Templates.js +3 -0
  12. extendify-sdk/src/components/ImportButton.js +12 -1
  13. extendify-sdk/src/components/TaxonomyList.js +39 -0
  14. extendify-sdk/src/components/TemplatesList.js +1 -1
  15. extendify-sdk/src/components/TemplatesSingle.js +16 -12
  16. extendify-sdk/src/layout/HasSidebar.js +2 -2
  17. extendify-sdk/src/layout/MainWindow.js +6 -5
  18. extendify-sdk/src/{components → layout}/SidebarSingle.js +12 -41
  19. extendify-sdk/src/layout/Toolbar.js +2 -2
  20. extendify-sdk/src/middleware/NeedsPermissionModal.js +42 -0
  21. extendify-sdk/src/middleware/hasPluginsActivated/ActivatePluginsModal.js +8 -2
  22. extendify-sdk/src/middleware/hasPluginsActivated/ActivatingModal.js +11 -10
  23. extendify-sdk/src/middleware/hasRequiredPlugins/InstallingModal.js +5 -1
  24. extendify-sdk/src/middleware/hasRequiredPlugins/RequiredPluginsModal.js +8 -2
  25. extendify-sdk/src/middleware/helpers.js +5 -4
  26. extendify-sdk/src/middleware/index.js +1 -1
  27. extendify-sdk/src/pages/Content.js +4 -5
  28. extendify-sdk/src/pages/Welcome.js +1 -2
  29. extendify-sdk/src/state/GlobalState.js +1 -0
  30. extendify-sdk/src/state/Templates.js +4 -2
  31. extendify-sdk/src/state/User.js +2 -0
  32. ml-slider.php +2 -2
  33. readme.txt +4 -1
extendify-sdk/app/Admin.php CHANGED
@@ -46,7 +46,7 @@ class Admin
46
  \add_action(
47
  'admin_enqueue_scripts',
48
  function ($hook) {
49
- if (!current_user_can('install_plugins')) {
50
  return;
51
  }
52
 
46
  \add_action(
47
  'admin_enqueue_scripts',
48
  function ($hook) {
49
+ if (!current_user_can(App::$requiredCapability)) {
50
  return;
51
  }
52
 
extendify-sdk/app/ApiRouter.php CHANGED
@@ -34,7 +34,7 @@ class ApiRouter extends \WP_REST_Controller
34
  */
35
  public function __construct()
36
  {
37
- $this->capability = 'install_plugins';
38
  add_filter(
39
  'rest_request_before_callbacks',
40
  // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClassBeforeLastUsed
@@ -51,19 +51,6 @@ class ApiRouter extends \WP_REST_Controller
51
  );
52
  }
53
 
54
- /**
55
- * Check the capability
56
- *
57
- * @param string $capability - The capability.
58
- *
59
- * @return boolean
60
- */
61
- public function permission($capability)
62
- {
63
- $this->capability = $capability;
64
- return $this;
65
- }
66
-
67
  /**
68
  * Check the authorization of the request
69
  *
34
  */
35
  public function __construct()
36
  {
37
+ $this->capability = App::$requiredCapability;
38
  add_filter(
39
  'rest_request_before_callbacks',
40
  // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClassBeforeLastUsed
51
  );
52
  }
53
 
 
 
 
 
 
 
 
 
 
 
 
 
 
54
  /**
55
  * Check the authorization of the request
56
  *
extendify-sdk/app/App.php CHANGED
@@ -62,6 +62,13 @@ class App
62
  */
63
  public static $sourcePlugin = 'Not set';
64
 
 
 
 
 
 
 
 
65
  /**
66
  * Plugin config
67
  *
62
  */
63
  public static $sourcePlugin = 'Not set';
64
 
65
+ /**
66
+ * Host plugin
67
+ *
68
+ * @var string
69
+ */
70
+ public static $requiredCapability = 'upload_files';
71
+
72
  /**
73
  * Plugin config
74
  *
extendify-sdk/app/User.php CHANGED
@@ -110,6 +110,8 @@ class User
110
  }
111
 
112
  $userData['state']['uuid'] = self::data('uuid');
 
 
113
 
114
  return \wp_json_encode($userData);
115
  }
110
  }
111
 
112
  $userData['state']['uuid'] = self::data('uuid');
113
+ $userData['state']['canInstallPlugins'] = \current_user_can('install_plugins');
114
+ $userData['state']['canActivatePlugins'] = \current_user_can('activate_plugins');
115
 
116
  return \wp_json_encode($userData);
117
  }
extendify-sdk/bootstrap.php CHANGED
@@ -20,9 +20,7 @@ if (is_readable(EXTENDIFYSDK_PATH . 'vendor/autoload.php')) {
20
  $extendifysdkAdmin = new Admin();
21
 
22
  require EXTENDIFYSDK_PATH . 'routes/api.php';
23
-
24
- // Temporary disabled.
25
- // require EXTENDIFYSDK_PATH . 'editorplus/EditorPlus.php';.
26
 
27
 
28
  \add_action(
20
  $extendifysdkAdmin = new Admin();
21
 
22
  require EXTENDIFYSDK_PATH . 'routes/api.php';
23
+ require EXTENDIFYSDK_PATH . 'editorplus/EditorPlus.php';
 
 
24
 
25
 
26
  \add_action(
extendify-sdk/editorplus/EditorPlus.php CHANGED
@@ -203,23 +203,19 @@ if (!class_exists('edpl__EditorPlus')) {
203
  return $template;
204
  }
205
 
206
- // Return default template if we don't have a custom one defined.
207
- if (!isset($this->templates[get_post_meta($post->ID, '_wp_page_template', true)])) {
 
 
208
  return $template;
209
  }
210
 
211
- $file = plugin_dir_path(__FILE__) . get_post_meta(
212
- $post->ID,
213
- '_wp_page_template',
214
- true
215
- );
216
-
217
- // Just to be safe, we check if the file exist first.
218
- if (file_exists($file)) {
219
- return $file;
220
  }
221
 
222
- return $template;
223
  }
224
  // phpcs:ignore Squiz.Classes.ClassDeclaration.SpaceBeforeCloseBrace
225
  }
203
  return $template;
204
  }
205
 
206
+ $currentTemplate = get_post_meta($post->ID, '_wp_page_template', true);
207
+
208
+ // Check that the set template is one we have defined.
209
+ if (!array_key_exists($currentTemplate, $this->templates)) {
210
  return $template;
211
  }
212
 
213
+ $file = plugin_dir_path(__FILE__) . $currentTemplate;
214
+ if (!file_exists($file)) {
215
+ return $template;
 
 
 
 
 
 
216
  }
217
 
218
+ return $file;
219
  }
220
  // phpcs:ignore Squiz.Classes.ClassDeclaration.SpaceBeforeCloseBrace
221
  }
extendify-sdk/extendify-sdk.php CHANGED
@@ -30,7 +30,7 @@ if (!class_exists('ExtendifySdk')) :
30
  return;
31
  }
32
 
33
- if (version_compare(PHP_VERSION, '5.6', '<') || version_compare($GLOBALS['wp_version'], '5.4', '<')) {
34
  return;
35
  }
36
 
30
  return;
31
  }
32
 
33
+ if (version_compare(PHP_VERSION, '5.6', '<') || version_compare($GLOBALS['wp_version'], '5.5', '<')) {
34
  return;
35
  }
36
 
extendify-sdk/public/build/extendify-sdk.css CHANGED
@@ -1 +1 @@
1
- *,:after,:before{--tw-border-opacity:1;border-color:rgba(224,224,224,var(--tw-border-opacity))}.extendify-sdk .sr-only{clip:rect(0,0,0,0);border-width:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}.extendify-sdk .focus\:not-sr-only:focus{clip:auto;height:auto;margin:0;overflow:visible;padding:0;position:static;white-space:normal;width:auto}.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{bottom:0;left:0;right:0;top:0}.extendify-sdk .top-0{top:0}.extendify-sdk .top-16{top:4rem}.extendify-sdk .right-0{right:0}.extendify-sdk .bottom-0{bottom:0}.extendify-sdk .left-0{left:0}.extendify-sdk .z-0{z-index:0}.extendify-sdk .z-10{z-index:10}.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 .m-0{margin:0}.extendify-sdk .m-6{margin:1.5rem}.extendify-sdk .m-auto{margin:auto}.extendify-sdk .mx-auto{margin-left:auto;margin-right:auto}.extendify-sdk .my-2{margin-bottom:.5rem;margin-top:.5rem}.extendify-sdk .my-4{margin-bottom:1rem;margin-top:1rem}.extendify-sdk .mt-1{margin-top:.25rem}.extendify-sdk .mt-5{margin-top:1.25rem}.extendify-sdk .mt-px{margin-top:1px}.extendify-sdk .-mt-1{margin-top:-.25rem}.extendify-sdk .-mt-2{margin-top:-.5rem}.extendify-sdk .-mt-6{margin-top:-1.5rem}.extendify-sdk .-mt-16{margin-top:-4rem}.extendify-sdk .mr-2{margin-right:.5rem}.extendify-sdk .mb-1{margin-bottom:.25rem}.extendify-sdk .mb-2{margin-bottom:.5rem}.extendify-sdk .mb-4{margin-bottom:1rem}.extendify-sdk .mb-6{margin-bottom:1.5rem}.extendify-sdk .mb-12{margin-bottom:3rem}.extendify-sdk .mb-2\.5{margin-bottom:.625rem}.extendify-sdk .ml-4{margin-left:1rem}.extendify-sdk .ml-8{margin-left:2rem}.extendify-sdk .-ml-px{margin-left:-1px}.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 .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 .max-h-60{max-height:15rem}.extendify-sdk .min-h-screen{min-height:100vh}.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 .max-w-xs{max-width:20rem}.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 .flex-1{flex:1 1 0%}.extendify-sdk .flex-shrink-0{flex-shrink:0}.extendify-sdk .flex-grow{flex-grow:1}.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-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 .rotate-180{--tw-rotate:180deg}@-webkit-keyframes spin{to{transform:rotate(1turn)}}@keyframes spin{to{transform:rotate(1turn)}}@-webkit-keyframes ping{75%,to{opacity:0;transform:scale(2)}}@keyframes ping{75%,to{opacity:0;transform:scale(2)}}@-webkit-keyframes pulse{50%{opacity:.5}}@keyframes pulse{50%{opacity:.5}}@-webkit-keyframes bounce{0%,to{-webkit-animation-timing-function:cubic-bezier(.8,0,1,1);animation-timing-function:cubic-bezier(.8,0,1,1);transform:translateY(-25%)}50%{-webkit-animation-timing-function:cubic-bezier(0,0,.2,1);animation-timing-function:cubic-bezier(0,0,.2,1);transform:none}}@keyframes bounce{0%,to{-webkit-animation-timing-function:cubic-bezier(.8,0,1,1);animation-timing-function:cubic-bezier(.8,0,1,1);transform:translateY(-25%)}50%{-webkit-animation-timing-function:cubic-bezier(0,0,.2,1);animation-timing-function:cubic-bezier(0,0,.2,1);transform:none}}.extendify-sdk .cursor-pointer{cursor:pointer}.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-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 .justify-items-center{justify-items:center}.extendify-sdk .gap-6{gap:1.5rem}.extendify-sdk .space-x-1>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(.25rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(.25rem*var(--tw-space-x-reverse))}.extendify-sdk .space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(.5rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(.5rem*var(--tw-space-x-reverse))}.extendify-sdk .space-x-3>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(.75rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(.75rem*var(--tw-space-x-reverse))}.extendify-sdk .space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(1rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(1rem*var(--tw-space-x-reverse))}.extendify-sdk .space-x-12>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(3rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(3rem*var(--tw-space-x-reverse))}.extendify-sdk .space-x-1\.5>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(.375rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(.375rem*var(--tw-space-x-reverse))}.extendify-sdk .space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(1rem*var(--tw-space-y-reverse));margin-top:calc(1rem*(1 - var(--tw-space-y-reverse)))}.extendify-sdk .space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(1.5rem*var(--tw-space-y-reverse));margin-top:calc(1.5rem*(1 - var(--tw-space-y-reverse)))}.extendify-sdk .space-y-16>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(4rem*var(--tw-space-y-reverse));margin-top:calc(4rem*(1 - var(--tw-space-y-reverse)))}.extendify-sdk .divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse:0;border-bottom-width:calc(1px*var(--tw-divide-y-reverse));border-top-width:calc(1px*(1 - var(--tw-divide-y-reverse)))}.extendify-sdk .overflow-hidden{overflow:hidden}.extendify-sdk .overflow-y-auto{overflow-y:auto}.extendify-sdk .whitespace-nowrap{white-space:nowrap}.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-t{border-top-width:1px}.extendify-sdk .border-r{border-right-width:1px}.extendify-sdk .border-b-0{border-bottom-width:0}.extendify-sdk .border-b{border-bottom-width:1px}.extendify-sdk .border-l{border-left-width:1px}.extendify-sdk .border-solid{border-style:solid}.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 .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 .hover\:bg-gray-50:hover{--tw-bg-opacity:1;background-color:rgba(250,250,250,var(--tw-bg-opacity))}.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 .fill-current{fill:currentColor}.extendify-sdk .stroke-current{stroke:currentColor}.extendify-sdk .object-cover{-o-object-fit:cover;object-fit:cover}.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-8{padding:2rem}.extendify-sdk .p-1\.5{padding:.375rem}.extendify-sdk .p-3\.5{padding:.875rem}.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 .px-6{padding-left:1.5rem;padding-right:1.5rem}.extendify-sdk .py-0{padding-bottom:0;padding-top:0}.extendify-sdk .py-1{padding-bottom:.25rem;padding-top:.25rem}.extendify-sdk .py-2{padding-bottom:.5rem;padding-top:.5rem}.extendify-sdk .py-6{padding-bottom:1.5rem;padding-top:1.5rem}.extendify-sdk .py-1\.5{padding-bottom:.375rem;padding-top:.375rem}.extendify-sdk .pt-1{padding-top:.25rem}.extendify-sdk .pt-4{padding-top:1rem}.extendify-sdk .pt-14{padding-top:3.5rem}.extendify-sdk .pt-20{padding-top:5rem}.extendify-sdk .pt-px{padding-top:1px}.extendify-sdk .pr-2{padding-right:.5rem}.extendify-sdk .pr-4{padding-right:1rem}.extendify-sdk .pb-2{padding-bottom:.5rem}.extendify-sdk .pb-4{padding-bottom:1rem}.extendify-sdk .pb-6{padding-bottom:1.5rem}.extendify-sdk .pb-20{padding-bottom:5rem}.extendify-sdk .pb-32{padding-bottom:8rem}.extendify-sdk .pl-6{padding-left:1.5rem}.extendify-sdk .pl-12{padding-left:3rem}.extendify-sdk .text-left{text-align:left}.extendify-sdk .text-center{text-align:center}.extendify-sdk .text-xs{font-size:.75rem;line-height:1rem}.extendify-sdk .text-sm{font-size:.875rem;line-height:1.25rem}.extendify-sdk .text-base{font-size:1rem;line-height:1.5rem}.extendify-sdk .text-lg{font-size:1.125rem;line-height:1.75rem}.extendify-sdk .text-2xl{font-size:1.5rem;line-height:2rem}.extendify-sdk .font-normal{font-weight:400}.extendify-sdk .font-medium{font-weight:500}.extendify-sdk .font-bold{font-weight:700}.extendify-sdk .leading-none{line-height:1}.extendify-sdk .leading-tight{line-height:1.25}.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-extendify-link{--tw-text-opacity:1;color:rgba(41,152,117,var(--tw-text-opacity))}.extendify-sdk .text-extendify-bright{--tw-text-opacity:1;color:rgba(48,168,80,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 .underline{text-decoration:underline}.extendify-sdk .no-underline{text-decoration:none}.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}*,:after,:before{--tw-shadow:0 0 #0000}.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 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.extendify-sdk .outline-none{outline:2px solid transparent;outline-offset:2px}*,:after,:before{--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 #0000;--tw-ring-shadow:0 0 #0000}.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 #0000)}.extendify-sdk .focus\:ring-wp-theme-500:focus{--tw-ring-color:var(--wp-admin-theme-color)}.extendify-sdk .ring-offset-1{--tw-ring-offset-width:1px}.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 .transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.extendify-sdk .transition{transition-duration:.15s;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)}.extendify-sdk .transition-opacity{transition-duration:.15s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}.extendify-sdk .duration-150{transition-duration:.15s}.extendify-sdk .duration-200{transition-duration:.2s}.extendify-sdk .duration-300{transition-duration:.3s}.extendify-sdk .ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}.extendify-sdk *,.extendify-sdk :after,.extendify-sdk :before{border:0 solid #e5e7eb;box-sizing:border-box}.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);--tw-ring-color:var(--wp-admin-theme-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.extendify-sdk .button-focus{--tw-ring-offset-width:1px}.button-extendify-main{--tw-bg-opacity:1;background-color:rgba(0,129,96,var(--tw-bg-opacity));cursor:pointer}.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{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-duration:.15s;transition-duration:.2s;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)}.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);--tw-ring-color:var(--wp-admin-theme-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.extendify-sdk .button-extendify-main{--tw-ring-offset-width:1px}.extendify-sdk .components-panel__body>.components-panel__body-title{background-color:transparent;border-bottom:1px solid #e0e0e0!important}@media (min-width:600px){.extendify-sdk .sm\:static{position:static}.extendify-sdk .sm\:top-auto{top:auto}.extendify-sdk .sm\:m-0{margin:0}.extendify-sdk .sm\:my-6{margin-bottom:1.5rem;margin-top:1.5rem}.extendify-sdk .sm\:mt-64{margin-top:16rem}.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\:ml-px{margin-left:1px}.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\:min-h-0{min-height:0}.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}.extendify-sdk .sm\:space-x-12>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(3rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(3rem*var(--tw-space-x-reverse))}.extendify-sdk .sm\:border-0{border-width:0}.extendify-sdk .sm\:p-0{padding:0}.extendify-sdk .sm\:p-16{padding:4rem}.extendify-sdk .sm\:px-0{padding-left:0;padding-right:0}.extendify-sdk .sm\:px-5{padding-left:1.25rem;padding-right:1.25rem}.extendify-sdk .sm\:px-12{padding-left:3rem;padding-right:3rem}.extendify-sdk .sm\:py-2{padding-bottom:.5rem;padding-top:.5rem}.extendify-sdk .sm\:py-6{padding-bottom:1.5rem;padding-top:1.5rem}.extendify-sdk .sm\:py-2\.5{padding-bottom:.625rem;padding-top:.625rem}.extendify-sdk .sm\:pt-0{padding-top:0}.extendify-sdk .sm\:pt-6{padding-top:1.5rem}.extendify-sdk .sm\:pr-8{padding-right:2rem}.extendify-sdk .sm\:pb-6{padding-bottom:1.5rem}.extendify-sdk .sm\:pl-0{padding-left:0}.extendify-sdk .sm\:pl-12{padding-left:3rem}.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\:opacity-0{opacity:0}}@media (min-width:782px){.extendify-sdk .md\:-mt-32{margin-top:-8rem}.extendify-sdk .md\:flex{display:flex}.extendify-sdk .md\:flex-row{flex-direction:row}.extendify-sdk .md\:space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(1rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(1rem*var(--tw-space-x-reverse))}.extendify-sdk .md\:space-y-0>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(0px*var(--tw-space-y-reverse));margin-top:calc(0px*(1 - var(--tw-space-y-reverse)))}}@media (min-width:1080px){.extendify-sdk .lg\:static{position:static}.extendify-sdk .lg\:absolute{position:absolute}.extendify-sdk .lg\:-mx-2{margin-left:-.5rem;margin-right:-.5rem}.extendify-sdk .lg\:-ml-px{margin-left:-1px}.extendify-sdk .lg\:block{display:block}.extendify-sdk .lg\:flex{display:flex}.extendify-sdk .lg\:hidden{display:none}.extendify-sdk .lg\:h-auto{height:auto}.extendify-sdk .lg\:h-full{height:100%}.extendify-sdk .lg\:w-72{width:18rem}.extendify-sdk .lg\:w-auto{width:auto}.extendify-sdk .lg\:w-1\/2{width:50%}.extendify-sdk .lg\:w-2\/5{width:40%}.extendify-sdk .lg\:max-w-none{max-width: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\:space-x-8>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(2rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(2rem*var(--tw-space-x-reverse))}.extendify-sdk .lg\:space-y-0>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(0px*var(--tw-space-y-reverse));margin-top:calc(0px*(1 - var(--tw-space-y-reverse)))}.extendify-sdk .lg\:divide-x-2>:not([hidden])~:not([hidden]){--tw-divide-x-reverse:0;border-left-width:calc(2px*(1 - var(--tw-divide-x-reverse)));border-right-width:calc(2px*var(--tw-divide-x-reverse))}.extendify-sdk .lg\:overflow-hidden{overflow:hidden}.extendify-sdk .lg\:border{border-width:1px}.extendify-sdk .lg\:p-5{padding:1.25rem}.extendify-sdk .lg\:p-8{padding:2rem}.extendify-sdk .lg\:px-0{padding-left:0;padding-right:0}.extendify-sdk .lg\:px-2{padding-left:.5rem;padding-right:.5rem}.extendify-sdk .lg\:pl-px{padding-left:1px}.extendify-sdk .lg\:leading-none{line-height:1}}@media (min-width:1280px){.extendify-sdk .xl\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.extendify-sdk .xl\:space-x-8>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(2rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(2rem*var(--tw-space-x-reverse))}.extendify-sdk .xl\:space-x-16>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(4rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(4rem*var(--tw-space-x-reverse))}}@media (min-width:1440px){.extendify-sdk .\32xl\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}
1
+ *,:after,:before{--tw-border-opacity:1;border-color:rgba(224,224,224,var(--tw-border-opacity))}.extendify-sdk .sr-only{clip:rect(0,0,0,0);border-width:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}.extendify-sdk .focus\:not-sr-only:focus{clip:auto;height:auto;margin:0;overflow:visible;padding:0;position:static;white-space:normal;width:auto}.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{bottom:0;left:0;right:0;top:0}.extendify-sdk .top-0{top:0}.extendify-sdk .top-16{top:4rem}.extendify-sdk .right-0{right:0}.extendify-sdk .bottom-0{bottom:0}.extendify-sdk .left-0{left:0}.extendify-sdk .z-0{z-index:0}.extendify-sdk .z-10{z-index:10}.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 .m-0{margin:0}.extendify-sdk .m-6{margin:1.5rem}.extendify-sdk .m-auto{margin:auto}.extendify-sdk .mx-auto{margin-left:auto;margin-right:auto}.extendify-sdk .my-2{margin-bottom:.5rem;margin-top:.5rem}.extendify-sdk .my-4{margin-bottom:1rem;margin-top:1rem}.extendify-sdk .mt-0{margin-top:0}.extendify-sdk .mt-1{margin-top:.25rem}.extendify-sdk .mt-4{margin-top:1rem}.extendify-sdk .mt-5{margin-top:1.25rem}.extendify-sdk .mt-px{margin-top:1px}.extendify-sdk .-mt-1{margin-top:-.25rem}.extendify-sdk .-mt-2{margin-top:-.5rem}.extendify-sdk .-mt-6{margin-top:-1.5rem}.extendify-sdk .-mt-16{margin-top:-4rem}.extendify-sdk .mb-1{margin-bottom:.25rem}.extendify-sdk .mb-2{margin-bottom:.5rem}.extendify-sdk .mb-4{margin-bottom:1rem}.extendify-sdk .mb-6{margin-bottom:1.5rem}.extendify-sdk .mb-12{margin-bottom:3rem}.extendify-sdk .mb-2\.5{margin-bottom:.625rem}.extendify-sdk .ml-4{margin-left:1rem}.extendify-sdk .ml-8{margin-left:2rem}.extendify-sdk .-ml-px{margin-left:-1px}.extendify-sdk .block{display: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 .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 .max-h-60{max-height:15rem}.extendify-sdk .min-h-screen{min-height:100vh}.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 .max-w-xs{max-width:20rem}.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 .flex-1{flex:1 1 0%}.extendify-sdk .flex-shrink-0{flex-shrink:0}.extendify-sdk .flex-grow{flex-grow:1}.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-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 .rotate-180{--tw-rotate:180deg}@-webkit-keyframes spin{to{transform:rotate(1turn)}}@keyframes spin{to{transform:rotate(1turn)}}@-webkit-keyframes ping{75%,to{opacity:0;transform:scale(2)}}@keyframes ping{75%,to{opacity:0;transform:scale(2)}}@-webkit-keyframes pulse{50%{opacity:.5}}@keyframes pulse{50%{opacity:.5}}@-webkit-keyframes bounce{0%,to{-webkit-animation-timing-function:cubic-bezier(.8,0,1,1);animation-timing-function:cubic-bezier(.8,0,1,1);transform:translateY(-25%)}50%{-webkit-animation-timing-function:cubic-bezier(0,0,.2,1);animation-timing-function:cubic-bezier(0,0,.2,1);transform:none}}@keyframes bounce{0%,to{-webkit-animation-timing-function:cubic-bezier(.8,0,1,1);animation-timing-function:cubic-bezier(.8,0,1,1);transform:translateY(-25%)}50%{-webkit-animation-timing-function:cubic-bezier(0,0,.2,1);animation-timing-function:cubic-bezier(0,0,.2,1);transform:none}}.extendify-sdk .cursor-pointer{cursor:pointer}.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-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 .justify-items-center{justify-items:center}.extendify-sdk .gap-6{gap:1.5rem}.extendify-sdk .space-x-1>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(.25rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(.25rem*var(--tw-space-x-reverse))}.extendify-sdk .space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(.5rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(.5rem*var(--tw-space-x-reverse))}.extendify-sdk .space-x-3>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(.75rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(.75rem*var(--tw-space-x-reverse))}.extendify-sdk .space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(1rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(1rem*var(--tw-space-x-reverse))}.extendify-sdk .space-x-12>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(3rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(3rem*var(--tw-space-x-reverse))}.extendify-sdk .space-x-1\.5>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(.375rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(.375rem*var(--tw-space-x-reverse))}.extendify-sdk .space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(1rem*var(--tw-space-y-reverse));margin-top:calc(1rem*(1 - var(--tw-space-y-reverse)))}.extendify-sdk .space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(1.5rem*var(--tw-space-y-reverse));margin-top:calc(1.5rem*(1 - var(--tw-space-y-reverse)))}.extendify-sdk .space-y-16>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(4rem*var(--tw-space-y-reverse));margin-top:calc(4rem*(1 - var(--tw-space-y-reverse)))}.extendify-sdk .divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse:0;border-bottom-width:calc(1px*var(--tw-divide-y-reverse));border-top-width:calc(1px*(1 - var(--tw-divide-y-reverse)))}.extendify-sdk .overflow-hidden{overflow:hidden}.extendify-sdk .overflow-y-auto{overflow-y:auto}.extendify-sdk .whitespace-nowrap{white-space:nowrap}.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-t{border-top-width:1px}.extendify-sdk .border-r{border-right-width:1px}.extendify-sdk .border-b-0{border-bottom-width:0}.extendify-sdk .border-b{border-bottom-width:1px}.extendify-sdk .border-l{border-left-width:1px}.extendify-sdk .border-solid{border-style:solid}.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 .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-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 .hover\:bg-gray-50:hover{--tw-bg-opacity:1;background-color:rgba(250,250,250,var(--tw-bg-opacity))}.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 .fill-current{fill:currentColor}.extendify-sdk .stroke-current{stroke:currentColor}.extendify-sdk .object-cover{-o-object-fit:cover;object-fit:cover}.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-8{padding:2rem}.extendify-sdk .p-1\.5{padding:.375rem}.extendify-sdk .p-3\.5{padding:.875rem}.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 .px-6{padding-left:1.5rem;padding-right:1.5rem}.extendify-sdk .py-0{padding-bottom:0;padding-top:0}.extendify-sdk .py-1{padding-bottom:.25rem;padding-top:.25rem}.extendify-sdk .py-2{padding-bottom:.5rem;padding-top:.5rem}.extendify-sdk .py-4{padding-bottom:1rem;padding-top:1rem}.extendify-sdk .py-6{padding-bottom:1.5rem;padding-top:1.5rem}.extendify-sdk .py-1\.5{padding-bottom:.375rem;padding-top:.375rem}.extendify-sdk .pt-1{padding-top:.25rem}.extendify-sdk .pt-4{padding-top:1rem}.extendify-sdk .pt-14{padding-top:3.5rem}.extendify-sdk .pt-20{padding-top:5rem}.extendify-sdk .pt-px{padding-top:1px}.extendify-sdk .pr-2{padding-right:.5rem}.extendify-sdk .pr-4{padding-right:1rem}.extendify-sdk .pb-2{padding-bottom:.5rem}.extendify-sdk .pb-4{padding-bottom:1rem}.extendify-sdk .pb-6{padding-bottom:1.5rem}.extendify-sdk .pb-20{padding-bottom:5rem}.extendify-sdk .pb-32{padding-bottom:8rem}.extendify-sdk .pl-6{padding-left:1.5rem}.extendify-sdk .pl-12{padding-left:3rem}.extendify-sdk .text-left{text-align:left}.extendify-sdk .text-center{text-align:center}.extendify-sdk .text-xs{font-size:.75rem;line-height:1rem}.extendify-sdk .text-sm{font-size:.875rem;line-height:1.25rem}.extendify-sdk .text-base{font-size:1rem;line-height:1.5rem}.extendify-sdk .text-lg{font-size:1.125rem;line-height:1.75rem}.extendify-sdk .text-2xl{font-size:1.5rem;line-height:2rem}.extendify-sdk .font-normal{font-weight:400}.extendify-sdk .font-medium{font-weight:500}.extendify-sdk .font-bold{font-weight:700}.extendify-sdk .leading-none{line-height:1}.extendify-sdk .leading-tight{line-height:1.25}.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-extendify-link{--tw-text-opacity:1;color:rgba(41,152,117,var(--tw-text-opacity))}.extendify-sdk .text-extendify-bright{--tw-text-opacity:1;color:rgba(48,168,80,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 .underline{text-decoration:underline}.extendify-sdk .no-underline{text-decoration:none}.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}*,:after,:before{--tw-shadow:0 0 #0000}.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 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.extendify-sdk .outline-none{outline:2px solid transparent;outline-offset:2px}*,:after,:before{--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 #0000;--tw-ring-shadow:0 0 #0000}.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 #0000)}.extendify-sdk .focus\:ring-wp-theme-500:focus{--tw-ring-color:var(--wp-admin-theme-color)}.extendify-sdk .ring-offset-1{--tw-ring-offset-width:1px}.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 .transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.extendify-sdk .transition{transition-duration:.15s;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)}.extendify-sdk .transition-opacity{transition-duration:.15s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}.extendify-sdk .duration-150{transition-duration:.15s}.extendify-sdk .duration-200{transition-duration:.2s}.extendify-sdk .duration-300{transition-duration:.3s}.extendify-sdk .ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}.extendify-sdk *,.extendify-sdk :after,.extendify-sdk :before{border:0 solid #e5e7eb;box-sizing:border-box}.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);--tw-ring-color:var(--wp-admin-theme-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.extendify-sdk .button-focus{--tw-ring-offset-width:1px}.button-extendify-main{--tw-bg-opacity:1;background-color:rgba(0,129,96,var(--tw-bg-opacity));cursor:pointer}.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{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-duration:.15s;transition-duration:.2s;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)}.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);--tw-ring-color:var(--wp-admin-theme-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.extendify-sdk .button-extendify-main{--tw-ring-offset-width:1px}.extendify-sdk .components-panel__body>.components-panel__body-title{background-color:transparent;border-bottom:1px solid #e0e0e0!important}@media (min-width:600px){.extendify-sdk .sm\:static{position:static}.extendify-sdk .sm\:top-auto{top:auto}.extendify-sdk .sm\:m-0{margin:0}.extendify-sdk .sm\:my-6{margin-bottom:1.5rem;margin-top:1.5rem}.extendify-sdk .sm\:mt-64{margin-top:16rem}.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\:ml-px{margin-left:1px}.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\:min-h-0{min-height:0}.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}.extendify-sdk .sm\:space-x-12>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(3rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(3rem*var(--tw-space-x-reverse))}.extendify-sdk .sm\:border-0{border-width:0}.extendify-sdk .sm\:p-0{padding:0}.extendify-sdk .sm\:p-16{padding:4rem}.extendify-sdk .sm\:px-0{padding-left:0;padding-right:0}.extendify-sdk .sm\:px-5{padding-left:1.25rem;padding-right:1.25rem}.extendify-sdk .sm\:px-12{padding-left:3rem;padding-right:3rem}.extendify-sdk .sm\:py-2{padding-bottom:.5rem;padding-top:.5rem}.extendify-sdk .sm\:py-6{padding-bottom:1.5rem;padding-top:1.5rem}.extendify-sdk .sm\:py-2\.5{padding-bottom:.625rem;padding-top:.625rem}.extendify-sdk .sm\:pt-0{padding-top:0}.extendify-sdk .sm\:pt-6{padding-top:1.5rem}.extendify-sdk .sm\:pr-8{padding-right:2rem}.extendify-sdk .sm\:pb-6{padding-bottom:1.5rem}.extendify-sdk .sm\:pl-0{padding-left:0}.extendify-sdk .sm\:pl-12{padding-left:3rem}.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\:opacity-0{opacity:0}}@media (min-width:782px){.extendify-sdk .md\:-mt-32{margin-top:-8rem}.extendify-sdk .md\:flex{display:flex}.extendify-sdk .md\:flex-row{flex-direction:row}.extendify-sdk .md\:space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(1rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(1rem*var(--tw-space-x-reverse))}.extendify-sdk .md\:space-y-0>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(0px*var(--tw-space-y-reverse));margin-top:calc(0px*(1 - var(--tw-space-y-reverse)))}}@media (min-width:1080px){.extendify-sdk .lg\:static{position:static}.extendify-sdk .lg\:absolute{position:absolute}.extendify-sdk .lg\:-mx-2{margin-left:-.5rem;margin-right:-.5rem}.extendify-sdk .lg\:-ml-px{margin-left:-1px}.extendify-sdk .lg\:block{display:block}.extendify-sdk .lg\:flex{display:flex}.extendify-sdk .lg\:hidden{display:none}.extendify-sdk .lg\:h-auto{height:auto}.extendify-sdk .lg\:h-full{height:100%}.extendify-sdk .lg\:w-72{width:18rem}.extendify-sdk .lg\:w-auto{width:auto}.extendify-sdk .lg\:w-1\/2{width:50%}.extendify-sdk .lg\:w-2\/5{width:40%}.extendify-sdk .lg\:max-w-none{max-width: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\:space-x-8>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(2rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(2rem*var(--tw-space-x-reverse))}.extendify-sdk .lg\:space-y-0>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(0px*var(--tw-space-y-reverse));margin-top:calc(0px*(1 - var(--tw-space-y-reverse)))}.extendify-sdk .lg\:divide-x-2>:not([hidden])~:not([hidden]){--tw-divide-x-reverse:0;border-left-width:calc(2px*(1 - var(--tw-divide-x-reverse)));border-right-width:calc(2px*var(--tw-divide-x-reverse))}.extendify-sdk .lg\:overflow-hidden{overflow:hidden}.extendify-sdk .lg\:border{border-width:1px}.extendify-sdk .lg\:p-5{padding:1.25rem}.extendify-sdk .lg\:p-8{padding:2rem}.extendify-sdk .lg\:px-0{padding-left:0;padding-right:0}.extendify-sdk .lg\:px-2{padding-left:.5rem;padding-right:.5rem}.extendify-sdk .lg\:pl-px{padding-left:1px}.extendify-sdk .lg\:leading-none{line-height:1}}@media (min-width:1280px){.extendify-sdk .xl\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.extendify-sdk .xl\:space-x-8>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(2rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(2rem*var(--tw-space-x-reverse))}.extendify-sdk .xl\:space-x-16>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(4rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(4rem*var(--tw-space-x-reverse))}}@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),s=n(574),u=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||"",h=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";d.Authorization="Basic "+btoa(m+":"+h)}var v=s(e.baseURL,e.url);if(p.open(e.method.toUpperCase(),a(v,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?u(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(v))&&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 s(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 u=s(n(141));u.Axios=i,u.create=function(e){return s(a(u.defaults,e))},u.Cancel=n(132),u.CancelToken=n(603),u.isCancel=n(475),u.all=function(e){return Promise.all(e)},u.spread=n(739),u.isAxiosError=n(835),e.exports=u,e.exports.default=u},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),s=n(941);function u(e){this.defaults=e,this.interceptors={request:new i,response:new i}}u.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=s(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},u.prototype.getUri=function(e){return e=s(this.defaults,e),o(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},r.forEach(["delete","get","head","options"],(function(e){u.prototype[e]=function(t,n){return this.request(s(n||{},{method:e,url:t,data:(n||{}).data}))}})),r.forEach(["post","put","patch"],(function(e){u.prototype[e]=function(t,n,r){return this.request(s(r||{},{method:e,url:t,data:n}))}})),e.exports=u},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 s(e){e.cancelToken&&e.cancelToken.throwIfRequested()}e.exports=function(e){return s(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 s(e),t.data=o(t.data,t.headers,e.transformResponse),t}),(function(t){return i(t)||(s(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"],s=["validateStatus"];function u(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]=u(void 0,e[o])):n[o]=u(e[o],t[o])}r.forEach(o,(function(e){r.isUndefined(t[e])||(n[e]=u(void 0,t[e]))})),r.forEach(i,c),r.forEach(a,(function(o){r.isUndefined(t[o])?r.isUndefined(e[o])||(n[o]=u(void 0,e[o])):n[o]=u(void 0,t[o])})),r.forEach(s,(function(r){r in t?n[r]=u(e[r],t[r]):r in e&&(n[r]=u(void 0,e[r]))}));var l=o.concat(i).concat(a).concat(s),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 s(e,t){!o.isUndefined(e)&&o.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var u,c={adapter:(("undefined"!=typeof XMLHttpRequest||void 0!==r&&"[object process]"===Object.prototype.toString.call(r))&&(u=n(387)),u),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)?(s(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):o.isObject(e)?(s(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 s=e.indexOf("#");-1!==s&&(e=e.slice(0,s)),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 s=[];s.push(e+"="+encodeURIComponent(t)),r.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),r.isString(o)&&s.push("path="+o),r.isString(i)&&s.push("domain="+i),!0===a&&s.push("secure"),document.cookie=s.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 s(e){return null!==e&&"object"==typeof e}function u(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:s,isPlainObject:u,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 s(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){u(t[r])&&u(n)?t[r]=e(t[r],n):u(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}}},299:(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 s(){const n=r(t);if(!i(a,n)){const t=a;e(a=n,t)}}return n.add(s),()=>n.delete(s)})(e,r,i):(n.add(e),()=>n.delete(e)),destroy:()=>n.clear()};return t=e(r,o,i),i}const s="undefined"==typeof window||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent)?o.useEffect:o.useLayoutEffect;const u=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),u=(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||u.current!==e||c.current!==n||l.current)&&(d=e(i),p=!n(f.current,d)),s((()=>{p&&(f.current=d),a.current=i,u.current=e,c.current=n,l.current=!1}));const m=(0,o.useRef)(i);return s((()=>{const e=()=>{try{const e=t.getState(),n=u.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");const e=[n,t];return{next(){const t=e.length<=0;return{value:e.shift(),done: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=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){s=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(s)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 h(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){v(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 v(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 x(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 x(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 x(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 x(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=u((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:h({},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:h({},Object.assign(t().searchParams,n))})}}})),b=u((function(e){return{open:!1,currentPage:"welcome",setOpen:function(t){e({open:t}),t&&g.getState().removeTemplates()}}})),w=n(135),j=n.n(w),k=Object.defineProperty,S=Object.getOwnPropertySymbols,E=Object.prototype.hasOwnProperty,_=Object.prototype.propertyIsEnumerable,N=(e,t,n)=>t in e?k(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,O=(e,t)=>{for(var n in t||(t={}))E.call(t,n)&&N(e,n,t[n]);if(S)for(var n of S(t))_.call(t,n)&&N(e,n,t[n]);return e};const C=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then:e=>C(e)(n),catch(e){return this}}}catch(e){return{then(e){return this},catch:t=>C(t)(e)}}},F=(e,t)=>(n,r,o)=>{const{name:i,getStorage:a=(()=>localStorage),serialize:s=JSON.stringify,deserialize:u=JSON.parse,blacklist:c,whitelist:l,onRehydrateStorage:f,version:d=0,migrate:p,merge:m=((e,t)=>O(O({},t),e))}=t||{};let h;try{h=a()}catch(e){}if(!h)return e(((...e)=>{console.warn(`Persist middleware: unable to update ${i}, the given storage is currently unavailable.`),n(...e)}),r,o);const v=C(s),y=()=>{const e=O({},r());let t;l&&Object.keys(e).forEach((t=>{!l.includes(t)&&delete e[t]})),c&&c.forEach((t=>delete e[t]));const n=v({state:e,version:d}).then((e=>h.setItem(i,e))).catch((e=>{t=e}));if(t)throw t;return n},x=o.setState;o.setState=(e,t)=>{x(e,t),y()};const g=e(((...e)=>{n(...e),y()}),r,o);let b;const w=(null==f?void 0:f(r()))||void 0;return C(h.getItem.bind(h))(i).then((e=>{if(e)return u(e)})).then((e=>{if(e){if("number"!=typeof e.version||e.version===d)return e.state;if(p)return p(e.state,e.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}})).then((e=>(b=m(e,g),n(b,!0),y()))).then((()=>{null==w||w(b,void 0)})).catch((e=>{null==w||w(void 0,e)})),b||g};var A=n(206),P=n.n(A)().create({baseURL:window.extendifySdkData.root,headers:{"X-WP-Nonce":window.extendifySdkData.nonce,"X-Requested-With":"XMLHttpRequest","X-Extendify":!0}});function T(e){return Object.prototype.hasOwnProperty.call(e,"data")?e.data:e}P.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}(T(e))}),(function(e){return function(e){if(e.response)return console.error(e.response),Promise.reject(T(e.response))}(e)})),P.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=W.getState().remainingImports(),e.data.entry_point=W.getState().entryPoint,e.data.total_imports=W.getState().imports),e}(e))}),(function(e){return e}));var L=function(){return P.get("user")},I=function(e){return P.get("user-meta",{params:{key:e}})},R=function(e,t){var n=new FormData;return n.append("email",e),n.append("key",t),P.post("login",n,{headers:{"Content-Type":"multipart/form-data"}})},D=function(e){var t=new FormData;return t.append("data",JSON.stringify(e)),P.post("user",t,{headers:{"Content-Type":"multipart/form-data"}})};function V(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).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){V(i,r,o,a,s,"next",e)}function s(e){V(i,r,o,a,s,"throw",e)}a(void 0)}))}}var H,B,U,q,Z={getItem:(B=M(j().mark((function e(){return j().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,L();case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)}))),function(){return B.apply(this,arguments)}),setItem:(H=M(j().mark((function e(t,n){return j().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,D(n);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)}))),function(e,t){return H.apply(this,arguments)})},W=u(F((function(e,t){return{apiKey:"",imports:0,uuid:"",email:"",allowedImports:0,entryPoint:"not-set",enabled:!0,hasClickedThroughWelcomePage:!1,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 Z}}));function z(){return(z=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 $(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 G(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 K(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 G(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)?G(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 Y(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,Y),a}function X(e){var t=e.props,n=e.slot,r=e.defaultTag,o=e.features,i=e.visible,a=void 0===i||i,s=e.name;if(a)return J(t,n,r,s);var u=null!=o?o:U.None;if(u&U.Static){var c=t.static,l=void 0!==c&&c,f=$(t,["static"]);if(l)return J(f,n,r,s)}if(u&U.RenderStrategy){var d,p=t.unmount,m=void 0===p||p,h=$(t,["unmount"]);return Y(m?q.Unmount:q.Hidden,((d={})[q.Unmount]=function(){return null},d[q.Hidden]=function(){return J(z({},h,{hidden:!0,style:{display:"none"}}),n,r,s)},d))}return J(t,n,r,s)}function J(e,t,n,r){var i;void 0===t&&(t={});var a=ee(e,["unmount","static"]),s=a.as,u=void 0===s?n:s,c=a.children,l=a.refName,f=void 0===l?"ref":l,d=$(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)),u===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=K(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}(ee(d,["ref"])),m.props,["onClick"]),p))}return(0,o.createElement)(u,Object.assign({},ee(d,["ref"]),u!==o.Fragment&&p),m)}function Q(e){var t;return Object.assign((0,o.forwardRef)(e),{displayName:null!=(t=e.displayName)?t:e.name})}function ee(e,t){void 0===t&&(t=[]);for(var n,r=Object.assign({},e),o=K(t);!(n=o()).done;){var i=n.value;i in r&&delete r[i]}return r}!function(e){e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static"}(U||(U={})),function(e){e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden"}(q||(q={}));var te="undefined"!=typeof window?o.useLayoutEffect:o.useEffect,ne={serverHandoffComplete:!1};function re(){var e=(0,o.useState)(ne.serverHandoffComplete),t=e[0],n=e[1];return(0,o.useEffect)((function(){!0!==t&&n(!0)}),[t]),(0,o.useEffect)((function(){!1===ne.serverHandoffComplete&&(ne.serverHandoffComplete=!0)}),[]),t}var oe=0;function ie(){return++oe}function ae(){var e=re(),t=(0,o.useState)(e?ie:null),n=t[0],r=t[1];return te((function(){null===n&&r(ie())}),[n]),null!=n?""+n:void 0}function se(){var e=(0,o.useRef)(!1);return(0,o.useEffect)((function(){return e.current=!0,function(){e.current=!1}}),[]),e}var ue,ce,le=(0,o.createContext)(null);function fe(){return(0,o.useContext)(le)}function de(e){var t=e.value,n=e.children;return i().createElement(le.Provider,{value:t},n)}function pe(){var e=(0,o.useRef)(!0);return(0,o.useEffect)((function(){e.current=!1}),[]),e.current}function me(){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=K(e.splice(0));!(t=n()).done;){var r=t.value;r()}}};return t}function he(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 ve(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 ye(e,t,n,r,o,i){var a=me(),s=void 0!==i?function(e){var t={called:!1};return function(){if(!t.called)return t.called=!0,e.apply(void 0,arguments)}}(i):function(){};return ve.apply(void 0,[e].concat(o)),he.apply(void 0,[e].concat(t,n)),a.nextFrame((function(){ve.apply(void 0,[e].concat(n)),he.apply(void 0,[e].concat(r)),a.add(function(e,t){var n=me();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(ce.Finished)}),i+a):t(ce.Finished),n.add((function(){return t(ce.Cancelled)})),n.dispose}(e,(function(n){return ve.apply(void 0,[e].concat(r,t)),he.apply(void 0,[e].concat(o)),s(n)})))})),a.add((function(){return ve.apply(void 0,[e].concat(t,n,r,o))})),a.add((function(){return s(ce.Cancelled)})),a.dispose}function xe(e){return void 0===e&&(e=""),(0,o.useMemo)((function(){return e.split(" ").filter((function(e){return e.trim().length>1}))}),[e])}le.displayName="OpenClosedContext",function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(ue||(ue={})),function(e){e.Finished="finished",e.Cancelled="cancelled"}(ce||(ce={}));var ge,be=(0,o.createContext)(null);be.displayName="TransitionContext",function(e){e.Visible="visible",e.Hidden="hidden"}(ge||(ge={}));var we=(0,o.createContext)(null);function je(e){return"children"in e?je(e.children):e.current.filter((function(e){return e.state===ge.Visible})).length>0}function ke(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=q.Hidden);var a=n.current.findIndex((function(t){return t.id===e}));-1!==a&&(Y(o,((i={})[q.Unmount]=function(){n.current.splice(a,1)},i[q.Hidden]=function(){n.current[a].state=ge.Hidden},i)),!je(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!==ge.Visible&&(t.state=ge.Visible):n.current.push({id:e,state:ge.Visible}),function(){return i(e,q.Unmount)}}),[n,i]);return(0,o.useMemo)((function(){return{children:n,register:a,unregister:i}}),[a,i,n])}function Se(){}we.displayName="NestingContext";var Ee=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function _e(e){for(var t,n={},r=K(Ee);!(t=r()).done;){var o,i=t.value;n[i]=null!=(o=e[i])?o:Se}return n}var Ne,Oe=U.RenderStrategy;function Ce(e){var t,n=e.beforeEnter,r=e.afterEnter,a=e.beforeLeave,s=e.afterLeave,u=e.enter,c=e.enterFrom,l=e.enterTo,f=e.entered,d=e.leave,p=e.leaveFrom,m=e.leaveTo,h=$(e,["beforeEnter","afterEnter","beforeLeave","afterLeave","enter","enterFrom","enterTo","entered","leave","leaveFrom","leaveTo"]),v=(0,o.useRef)(null),y=(0,o.useState)(ge.Visible),x=y[0],g=y[1],b=h.unmount?q.Unmount:q.Hidden,w=function(){var e=(0,o.useContext)(be);if(null===e)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}(),j=w.show,k=w.appear,S=function(){var e=(0,o.useContext)(we);if(null===e)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}(),E=S.register,_=S.unregister,N=pe(),O=ae(),C=(0,o.useRef)(!1),F=ke((function(){C.current||(g(ge.Hidden),_(O),V.current.afterLeave())}));te((function(){if(O)return E(O)}),[E,O]),te((function(){var e;b===q.Hidden&&O&&(j&&x!==ge.Visible?g(ge.Visible):Y(x,((e={})[ge.Hidden]=function(){return _(O)},e[ge.Visible]=function(){return E(O)},e)))}),[x,O,E,_,j,b]);var A=xe(u),P=xe(c),T=xe(l),L=xe(f),I=xe(d),R=xe(p),D=xe(m),V=function(e){var t=(0,o.useRef)(_e(e));return(0,o.useEffect)((function(){t.current=_e(e)}),[e]),t}({beforeEnter:n,afterEnter:r,beforeLeave:a,afterLeave:s}),M=re();(0,o.useEffect)((function(){if(M&&x===ge.Visible&&null===v.current)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")}),[v,x,M]);var H=N&&!k;te((function(){var e=v.current;if(e&&!H)return C.current=!0,j&&V.current.beforeEnter(),j||V.current.beforeLeave(),j?ye(e,A,P,T,L,(function(e){C.current=!1,e===ce.Finished&&V.current.afterEnter()})):ye(e,I,R,D,L,(function(e){C.current=!1,e===ce.Finished&&(je(F)||(g(ge.Hidden),_(O),V.current.afterLeave()))}))}),[V,O,C,_,F,v,H,j,A,P,T,I,R,D]);var B={ref:v},U=h;return i().createElement(we.Provider,{value:F},i().createElement(de,{value:Y(x,(t={},t[ge.Visible]=ue.Open,t[ge.Hidden]=ue.Closed,t))},X({props:z({},U,B),defaultTag:"div",features:Oe,visible:x===ge.Visible,name:"Transition.Child"})))}function Fe(e){var t,n=e.show,r=e.appear,a=void 0!==r&&r,s=e.unmount,u=$(e,["show","appear","unmount"]),c=fe();void 0===n&&null!==c&&(n=Y(c,((t={})[ue.Open]=!0,t[ue.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?ge.Visible:ge.Hidden),f=l[0],d=l[1],p=ke((function(){d(ge.Hidden)})),m=pe(),h=(0,o.useMemo)((function(){return{show:n,appear:a||!m}}),[n,a,m]);(0,o.useEffect)((function(){n?d(ge.Visible):je(p)||d(ge.Hidden)}),[n,p]);var v={unmount:s};return i().createElement(we.Provider,{value:p},i().createElement(be.Provider,{value:h},X({props:z({},v,{as:o.Fragment,children:i().createElement(Ce,Object.assign({},v,u))}),defaultTag:o.Fragment,features:Oe,visible:f===ge.Visible,name:"Transition"})))}function Ae(){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=K(r.current);!(t=n()).done;){var o=t.value;null!=o&&("function"==typeof o?o(e):o.current=e)}}),[r])}function Pe(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 Te(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])}Fe.Child=function(e){var t=null!==(0,o.useContext)(be),n=null!==fe();return!t&&n?i().createElement(Fe,Object.assign({},e)):i().createElement(Ce,Object.assign({},e))},Fe.Root=Fe,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"}(Ne||(Ne={}));var Le,Ie,Re,De,Ve,Me=["[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){null==e||e.focus({preventScroll:!0})}function Be(e,t){var n=Array.isArray(e)?e:function(e){return void 0===e&&(e=document.body),null==e?[]:Array.from(e.querySelectorAll(Me))}(e),r=document.activeElement,o=function(){if(t&(Le.First|Le.Next))return Re.Next;if(t&(Le.Previous|Le.Last))return Re.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}:{},s=0,u=n.length,c=void 0;do{var l;if(s>=u||s+u<=0)return Ie.Error;var f=i+s;if(t&Le.WrapAround)f=(f+u)%u;else{if(f<0)return Ie.Underflow;if(f>=u)return Ie.Overflow}null==(l=c=n[f])||l.focus(a),s+=o}while(c!==document.activeElement);return c.hasAttribute("tabindex")||c.setAttribute("tabindex","0"),Ie.Success}function Ue(e,t,n){void 0===t&&(t=Ve.All);var r=void 0===n?{}:n,i=r.initialFocus,a=r.containers,s=(0,o.useRef)("undefined"!=typeof window?document.activeElement:null),u=(0,o.useRef)(null),c=se(),l=Boolean(t&Ve.RestoreFocus),f=Boolean(t&Ve.InitialFocus);(0,o.useEffect)((function(){l&&(s.current=document.activeElement)}),[l]),(0,o.useEffect)((function(){if(l)return function(){He(s.current),s.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(u.current=t)}else if(e.current.contains(t))return void(u.current=t);if(null==i?void 0:i.current)He(i.current);else if(Be(e.current,Le.First)===Ie.Error)throw new Error("There are no focusable elements inside the <FocusTrap />");u.current=document.activeElement}}),[e,i,f]),Te("keydown",(function(n){t&Ve.TabLock&&e.current&&n.key===Ne.Tab&&(n.preventDefault(),Be(e.current,(n.shiftKey?Le.Previous:Le.Next)|Le.WrapAround)===Ie.Success&&(u.current=document.activeElement))})),Te("focus",(function(n){if(t&Ve.FocusLock){var r=new Set(null==a?void 0:a.current);if(r.add(e),r.size){var o=u.current;if(o&&c.current){var i=n.target;i&&i instanceof HTMLElement?!function(e,t){for(var n,r=K(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(),He(o)):(u.current=i,He(i)):He(u.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"}(Ie||(Ie={})),function(e){e[e.Previous=-1]="Previous",e[e.Next=1]="Next"}(Re||(Re={})),function(e){e[e.Strict=0]="Strict",e[e.Loose=1]="Loose"}(De||(De={})),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"}(Ve||(Ve={}));var qe=new Set,Ze=new Map;function We(e){e.setAttribute("aria-hidden","true"),e.inert=!0}function ze(e){var t=Ze.get(e);t&&(null===t["aria-hidden"]?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",t["aria-hidden"]),e.inert=t.inert)}var $e=(0,o.createContext)(!1);function Ge(e){return i().createElement($e.Provider,{value:e.force},e.children)}const Ke=ReactDOM;function Ye(){var e=(0,o.useContext)($e),t=(0,o.useContext)(et),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 Xe=o.Fragment;function Je(e){var t=e,n=Ye(),r=(0,o.useState)((function(){return"undefined"==typeof window?null:document.createElement("div")}))[0],i=re();return te((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,Ke.createPortal)(X({props:t,defaultTag:Xe,name:"Portal"}),r):null}var Qe=o.Fragment,et=(0,o.createContext)(null);Je.Group=function(e){var t=e.target,n=$(e,["target"]);return i().createElement(et.Provider,{value:t},X({props:n,defaultTag:Qe,name:"Popover.Group"}))};var tt=(0,o.createContext)(null);function nt(){var e=(0,o.useContext)(tt);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,nt),t}return e}var rt,ot,it,at,st=(0,o.createContext)((function(){}));function ut(e){var t=e.children,n=e.onUpdate,r=e.type,a=e.element,s=(0,o.useContext)(st),u=(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),s.apply(void 0,t)}),[s,n]);return te((function(){return u(rt.Add,r,a),function(){return u(rt.Remove,r,a)}}),[u,r,a]),i().createElement(st.Provider,{value:u},t)}st.displayName="StackContext",function(e){e[e.Add=0]="Add",e[e.Remove=1]="Remove"}(rt||(rt={})),function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(it||(it={})),function(e){e[e.SetTitleId=0]="SetTitleId"}(at||(at={}));var ct=((ot={})[at.SetTitleId]=function(e,t){return e.titleId===t.id?e:z({},e,{titleId:t.id})},ot),lt=(0,o.createContext)(null);function ft(e){var t=(0,o.useContext)(lt);if(null===t){var n=new Error("<"+e+" /> is missing a parent <"+vt.displayName+" /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(n,ft),n}return t}function dt(e,t){return Y(t.type,ct,e,t)}lt.displayName="DialogContext";var pt=U.RenderStrategy|U.Static,mt=Q((function(e,t){var n,r=e.open,a=e.onClose,s=e.initialFocus,u=$(e,["open","onClose","initialFocus"]),c=(0,o.useState)(0),l=c[0],f=c[1],d=fe();void 0===r&&null!==d&&(r=Y(d,((n={})[ue.Open]=!0,n[ue.Closed]=!1,n)));var p=(0,o.useRef)(new Set),m=(0,o.useRef)(null),h=Ae(m,t),v=e.hasOwnProperty("open")||null!==d,y=e.hasOwnProperty("onClose");if(!v&&!y)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!v)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 x=r?it.Open:it.Closed,g=null!==d?d===ue.Open:x===it.Open,b=(0,o.useReducer)(dt,{titleId:null,descriptionId:null}),w=b[0],j=b[1],k=(0,o.useCallback)((function(){return a(!1)}),[a]),S=(0,o.useCallback)((function(e){return j({type:at.SetTitleId,id:e})}),[j]),E=re()&&x===it.Open,_=l>1,N=null!==(0,o.useContext)(lt);Ue(m,E?Y(_?"parent":"leaf",{parent:Ve.RestoreFocus,leaf:Ve.All}):Ve.None,{initialFocus:s,containers:p}),function(e,t){void 0===t&&(t=!0),te((function(){if(t&&e.current){var n=e.current;qe.add(n);for(var r,o=K(Ze.keys());!(r=o()).done;){var i=r.value;i.contains(n)&&(ze(i),Ze.delete(i))}return document.querySelectorAll("body > *").forEach((function(e){if(e instanceof HTMLElement){for(var t,n=K(qe);!(t=n()).done;){var r=t.value;if(e.contains(r))return}1===qe.size&&(Ze.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),We(e))}})),function(){if(qe.delete(n),qe.size>0)document.querySelectorAll("body > *").forEach((function(e){if(e instanceof HTMLElement&&!Ze.has(e)){for(var t,n=K(qe);!(t=n()).done;){var r=t.value;if(e.contains(r))return}Ze.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),We(e)}}));else for(var e,t=K(Ze.keys());!(e=t()).done;){var r=e.value;ze(r),Ze.delete(r)}}}}),[t])}(m,!!_&&E),Te("mousedown",(function(e){var t,n=e.target;x===it.Open&&(_||(null==(t=m.current)?void 0:t.contains(n))||k())})),(0,o.useEffect)((function(){if(x===it.Open&&!N){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}}}),[x,N]),(0,o.useEffect)((function(){if(x===it.Open&&m.current){var e=new IntersectionObserver((function(e){for(var t,n=K(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()}}}),[x,m,k]);var O=function(){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(tt.Provider,{value:r},e.children)}}),[n])]}(),C=O[0],F=O[1],A="headlessui-dialog-"+ae(),P=(0,o.useMemo)((function(){return[{dialogState:x,close:k,setTitleId:S},w]}),[x,w,k,S]),T=(0,o.useMemo)((function(){return{open:x===it.Open}}),[x]),L={ref:h,id:A,role:"dialog","aria-modal":x===it.Open||void 0,"aria-labelledby":w.titleId,"aria-describedby":C,onClick:function(e){e.stopPropagation()},onKeyDown:function(e){e.key===Ne.Escape&&x===it.Open&&(_||(e.preventDefault(),e.stopPropagation(),k()))}},I=u;return i().createElement(ut,{type:"Dialog",element:m,onUpdate:(0,o.useCallback)((function(e,t,n){var r;"Dialog"===t&&Y(e,((r={})[rt.Add]=function(){p.current.add(n),f((function(e){return e+1}))},r[rt.Remove]=function(){p.current.add(n),f((function(e){return e-1}))},r))}),[])},i().createElement(Ge,{force:!0},i().createElement(Je,null,i().createElement(lt.Provider,{value:P},i().createElement(Je.Group,{target:m},i().createElement(Ge,{force:!1},i().createElement(F,{slot:T,name:"Dialog.Description"},X({props:z({},I,L),slot:T,defaultTag:"div",features:pt,visible:g,name:"Dialog"}))))))))})),ht=Q((function e(t,n){var r=ft([vt.displayName,e.name].join("."))[0],i=r.dialogState,a=r.close,s=Ae(n),u="headlessui-dialog-overlay-"+ae(),c=(0,o.useCallback)((function(e){if(Pe(e.currentTarget))return e.preventDefault();e.preventDefault(),e.stopPropagation(),a()}),[a]),l=(0,o.useMemo)((function(){return{open:i===it.Open}}),[i]);return X({props:z({},t,{ref:s,id:u,"aria-hidden":!0,onClick:c}),slot:l,defaultTag:"div",name:"Dialog.Overlay"})}));var vt=Object.assign(mt,{Overlay:ht,Title:function e(t){var n=ft([vt.displayName,e.name].join("."))[0],r=n.dialogState,i=n.setTitleId,a="headlessui-dialog-title-"+ae();(0,o.useEffect)((function(){return i(a),function(){return i(null)}}),[a,i]);var s=(0,o.useMemo)((function(){return{open:r===it.Open}}),[r]);return X({props:z({},t,{id:a}),slot:s,defaultTag:"h2",name:"Dialog.Title"})},Description:function(e){var t=nt(),n="headlessui-description-"+ae();te((function(){return t.register(n)}),[n,t.register]);var r=e,o=z({},t.props,{id:n});return X({props:z({},r,o),slot:t.slot||{},defaultTag:"p",name:t.name||"Description"})}});const yt=wp.i18n;var xt=n(246);function gt(e){var t=e.className,n=e.hideLibrary,r=e.initialFocus,o=W((function(e){return e.remainingImports})),i=W((function(e){return e.apiKey})),a=W((function(e){return e.allowedImports}));return(0,xt.jsx)("div",{className:t,children:(0,xt.jsxs)("div",{className:"flex justify-between items-center px-6 sm:px-12 h-full",children:[(0,xt.jsxs)("div",{className:"flex space-x-12 h-full",children:[(0,xt.jsxs)("div",{className:"font-bold flex items-center space-x-1.5 lg:w-72",children:[(0,xt.jsxs)("svg",{className:"",width:"30",height:"30",viewBox:"0 0 103 103",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,xt.jsx)("rect",{y:"25.75",width:"70.8125",height:"77.25",fill:"#000000"}),(0,xt.jsx)("rect",{x:"45.0625",width:"57.9375",height:"57.9375",fill:"#37C2A2"})]}),(0,xt.jsx)("span",{className:"text-sm transform translate-y-0.5 whitespace-nowrap",children:(0,yt.__)("Extendify Library","extendify-sdk")})]}),!i.length&&(0,xt.jsx)(xt.Fragment,{children:(0,xt.jsxs)("div",{className:"items-center ml-8 h-full hidden md:flex",children:[(0,xt.jsxs)("div",{className:"h-full flex items-center px-6 border-l border-r border-gray-300 bg-extendify-lightest",children:[(0,xt.jsx)("a",{className:"button-extendify-main inline lg:hidden",target:"_blank",href:"https://extendify.com/pricing?utm_source=".concat(window.extendifySdkData.source,"&utm_medium=library&utm_campaign=sign_up&utm_content=main"),rel:"noreferrer",children:(0,yt.__)("Sign up","extendify-sdk")}),(0,xt.jsx)("a",{className:"button-extendify-main hidden lg:block",target:"_blank",href:"https://extendify.com/pricing?utm_source=".concat(window.extendifySdkData.source,"&utm_medium=library&utm_campaign=sign_up&utm_content=main"),rel:"noreferrer",children:(0,yt.__)("Sign up today to get unlimited access","extendify-sdk")})]}),(0,xt.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,yt.sprintf)((0,yt.__)("Imports left: %s / %s"),o(),Number(a))})]})})]}),(0,xt.jsx)("div",{className:"space-x-2 transform sm:translate-x-8",children:(0,xt.jsxs)("button",{ref:r,type:"button",className:"components-button has-icon",onClick:function(){return n()},children:[(0,xt.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,xt.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,xt.jsx)("span",{className:"sr-only",children:(0,yt.__)("Close library","extendify-sdk")})]})})]})})}const bt=wp.blockEditor,wt=lodash;var jt=function(){return P.get("taxonomies")};const kt=wp.components;var St=n(42),Et=n.n(St);function _t(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Nt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){s=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Ot(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 Ot(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 Ot(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 Ct(e){var t=Nt(e.taxonomy,2),n=t[0],o=t[1],i=e.open,a=g((function(e){return e.updateTaxonomies})),s=g((function(e){return e.resetTaxonomies})),u=g((function(e){return e.searchParams})),c=Nt((0,r.useState)({}),2),l=c[0],f=c[1],d=Nt((0,r.useState)({}),2),p=d[0],m=d[1],h=(0,r.useRef)(),v=(0,r.useRef)(),y=(0,r.useRef)(),x=(0,r.useRef)(!0),b=function(e){var t;return(null==u?void 0:u.taxonomies[n])===e.term||(null===(t=e.children)||void 0===t?void 0:t.filter((function(e){return e.term===(null==u?void 0:u.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(u.type)})).length:null==e||null===(t=e.type)||void 0===t?void 0:t.includes(u.type)};if((0,r.useEffect)((function(){x.current?x.current=!1:(f({}),s())}),[u.type,s]),(0,r.useEffect)((function(){Object.keys(l).length?setTimeout((function(){requestAnimationFrame((function(){m(h.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 j=n.replace("tax_","").replace("_"," ").replace(/\b\w/g,(function(e){return e.toUpperCase()}));return(0,xt.jsx)(kt.PanelBody,{title:j,initialOpen:i,children:(0,xt.jsx)(kt.PanelRow,{children:(0,xt.jsxs)("div",{className:"overflow-hidden w-full relative",style:{height:p},children:[(0,xt.jsxs)("ul",{className:Et()("p-1 m-0 w-full transform transition duration-200",{"-translate-x-full":Object.keys(l).length}),children:[(0,xt.jsx)("li",{className:"m-0",children:(0,xt.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:v,onClick:function(){a(_t({},n,"pattern"===u.type&&"tax_categories"===n?"Default":""))},children:(0,xt.jsx)("span",{className:Et()({"text-wp-theme-500":!u.taxonomies[n].length||"Default"===(null==u?void 0:u.taxonomies[n])}),children:"pattern"===u.type&&"tax_categories"===n?(0,yt.__)("Default","extendify-sdk"):(0,yt.__)("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,xt.jsx)("li",{className:"m-0 w-full",children:(0,xt.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(_t({},n,e.term))},children:[(0,xt.jsx)("span",{className:Et()({"text-wp-theme-500":b(e)}),children:e.term}),Object.prototype.hasOwnProperty.call(e,"children")&&(0,xt.jsx)("span",{className:"text-black",children:(0,xt.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,xt.jsx)("path",{d:"M1 12.5L6 6.99998L1 1.5",strokeWidth:"1.5"})})})]})},e.term)}))]}),(0,xt.jsxs)("ul",{ref:h,className:Et()("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,xt.jsx)("li",{className:"m-0",children:(0,xt.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({}),v.current.focus()},children:[(0,xt.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,xt.jsx)("path",{d:"M1 12.5L6 6.99998L1 1.5",strokeWidth:"1.5"})}),(0,xt.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,xt.jsx)("li",{className:"m-0 pl-6 w-full flex justify-between items-center",children:(0,xt.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(_t({},n,e.term))},children:(0,xt.jsx)("span",{className:Et()({"text-wp-theme-500":b(e)}),children:e.term})})},e.term)}))]})]})})})}function Ft(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}function At(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Ft(i,r,o,a,s,"next",e)}function s(e){Ft(i,r,o,a,s,"throw",e)}a(void 0)}))}}function Pt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){s=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Tt(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 Tt(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 Tt(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 Lt(){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,wt.debounce)((function(e){return t({taxonomies:{},search:e})}),500),a=Pt((0,r.useState)(null!==(e=null==o?void 0:o.search)&&void 0!==e?e:""),2),s=a[0],u=a[1],c=Pt((0,r.useState)({}),2),l=c[0],f=c[1],d=(0,r.useCallback)(At(j().mark((function e(){var t;return j().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,jt();case 2:t=e.sent,t=Object.keys(t).filter((function(e){return e.startsWith("tax_")})).reduce((function(e,n){return e[n]=t[n],e}),{}),n(t),f(t);case 6:case"end":return e.stop()}}),e)}))),[n]);return(0,r.useEffect)((function(){d()}),[d]),(0,xt.jsxs)(xt.Fragment,{children:[(0,xt.jsx)("div",{className:"pt-1 -mt-1 mb-1 bg-white",children:(0,xt.jsx)(bt.__experimentalSearchForm,{placeholder:(0,yt.__)("What are you looking for?","extendify-sdk"),onChange:function(e){g.setState({nextPage:""}),u(e),i(e)},value:s,className:"sm:ml-px sm:mr-1 sm:mb-6 px-6 sm:p-0 sm:px-0",autoComplete:"off"})}),(0,xt.jsx)("div",{className:"flex-grow hidden overflow-y-auto pb-32 pr-2 pt-px sm:block",children:(0,xt.jsx)(kt.Panel,{children:Object.entries(l).map((function(e,t){return(0,xt.jsx)(Ct,{open:!1,taxonomy:e},t)}))})})]})}function It(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 Rt(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}var Dt=0,Vt=function(e,t){return(n=j().mark((function n(){var r,o,i;return j().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return Dt++,o=A.CancelToken.source(),null!==(r=g.getState().fetchToken)&&void 0!==r&&r.cancel&&g.getState().fetchToken.cancel(),g.setState({fetchToken:o}),n.next=6,P.post("templates",{filterByFormula:It(e),pageSize:l,categories:e.taxonomies,search:e.search,type:e.type,offset:t,initial:1===Dt,request_count:Dt},{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){Rt(i,r,o,a,s,"next",e)}function s(e){Rt(i,r,o,a,s,"throw",e)}a(void 0)}))})();var n},Mt=function(e){var t;return P.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})},Ht=function(e){var t;return P.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})},Bt=function(e){var t;return P.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 Ut(){return(Ut=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 qt=new Map,Zt=new WeakMap,Wt=0;function zt(e){return Object.keys(e).sort().filter((function(t){return void 0!==e[t]})).map((function(t){return t+"_"+("root"===t?(n=e.root)?(Zt.has(n)||(Wt+=1,Zt.set(n,Wt.toString())),Zt.get(n)):"0":e[t]);var n})).toString()}function $t(e,t,n){if(void 0===n&&(n={}),!e)return function(){};var r=function(e){var t=zt(e),n=qt.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},qt.set(t,n)}return n}(n),o=r.id,i=r.observer,a=r.elements,s=a.get(e)||[];return a.has(e)||a.set(e,s),s.push(t),i.observe(e),function(){s.splice(s.indexOf(t),1),0===s.length&&(a.delete(e),i.unobserve(e)),0===a.size&&(i.disconnect(),qt.delete(o))}}function Gt(e){return"function"!=typeof e.children}var Kt=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(),Gt(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=$t(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(!Gt(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,s=r.tag,u=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||s||"div",Ut({ref:this.handleNode},u),i)},r}(o.Component);Kt.displayName="InView",Kt.defaultProps={threshold:0,triggerOnce:!1,initialInView:!1};function Yt(e){return function(e){if(Array.isArray(e))return tn(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||en(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 Xt(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}function Jt(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Xt(i,r,o,a,s,"next",e)}function s(e){Xt(i,r,o,a,s,"throw",e)}a(void 0)}))}}function Qt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){s=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}(e,t)||en(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 en(e,t){if(e){if("string"==typeof e)return tn(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)?tn(e,t):void 0}}function tn(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 nn(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})),s=Qt((0,r.useState)(""),2),u=s[0],c=s[1],l=Qt((0,r.useState)(!1),2),f=l[0],d=l[1],p=Qt((0,r.useState)([]),2),m=p[0],h=p[1],v=Qt(function(e){var t=void 0===e?{}:e,n=t.threshold,r=t.delay,i=t.trackVisibility,a=t.rootMargin,s=t.root,u=t.triggerOnce,c=t.skip,l=t.initialInView,f=(0,o.useRef)(),d=(0,o.useState)({inView:!!l}),p=d[0],m=d[1],h=(0,o.useCallback)((function(e){void 0!==f.current&&(f.current(),f.current=void 0),c||e&&(f.current=$t(e,(function(e,t){m({inView:e,entry:t}),t.isIntersecting&&u&&f.current&&(f.current(),f.current=void 0)}),{root:s,rootMargin:a,threshold:n,trackVisibility:i,delay:r}))}),[Array.isArray(n)?n.toString():n,s,a,u,c,i,r]);(0,o.useEffect)((function(){f.current||!p.entry||u||c||m({inView:!!l})}));var v=[h,p.inView,p.entry];return v.ref=v[0],v.inView=v[1],v.entry=v[2],v}(),2),y=v[0],x=v[1],b=g((function(e){return e.updateSearchParams})),w=g((function(e){return e.searchParams})),k=(0,r.useRef)(g.getState().nextPage),S=(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 S.current=e}),(function(e){return e.searchParams}))}),[]);var E=(0,r.useCallback)(Jt(j().mark((function e(){var t,n;return j().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return c(""),d(!1),e.next=4,Vt(S.current,k.current).catch((function(e){console.error(e),c(e&&e.message?e.message:(0,yt.__)("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===S.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(S.current.taxonomies).length&&(h([]),E())}),[E,S]),(0,r.useEffect)((function(){x&&E()}),[x,E]),u.length?(0,xt.jsxs)("div",{className:"text-left",children:[(0,xt.jsx)("h2",{className:"text-left",children:(0,yt.__)("Server error","extendify-sdk")}),(0,xt.jsx)("code",{className:"block max-w-xl p-4 mb-4",style:{minHeight:"10rem"},children:u}),(0,xt.jsx)(kt.Button,{isTertiary:!0,onClick:function(){h([]),b({taxonomies:{},search:""}),E()},children:(0,yt.__)("Press here to reload experience")})]}):f?null!=w&&w.search.length?(0,xt.jsx)("h2",{className:"text-left",children:(0,yt.sprintf)((0,yt.__)("No results for %s.","extendify-sdk"),null==w?void 0:w.search)}):(0,xt.jsx)("h2",{className:"text-left",children:(0,yt.__)("No results found.","extendify-sdk")}):t.length?(0,xt.jsxs)(xt.Fragment,{children:[(0,xt.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,s,u,c,l,f,d;return(0,xt.jsxs)("li",{className:"flex flex-col justify-between group overflow-hidden max-w-lg",children:[(0,xt.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,xt.jsx)("img",{role:"button",className:"max-w-full block m-auto object-cover",onLoad:function(){return h([].concat(Yt(m),[t]))},src:null!==(r=null==e||null===(o=e.fields)||void 0===o||null===(a=o.screenshot[0])||void 0===a||null===(s=a.thumbnails)||void 0===s||null===(u=s.large)||void 0===u?void 0:u.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,xt.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,xt.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,xt.jsxs)("div",{children:[(0,xt.jsx)("h4",{className:"m-0 font-bold",children:e.fields.title}),(0,xt.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,xt.jsx)(kt.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,yt.__)("View","extendify-sdk")})]})]},e.id)}))}),g.getState().nextPage&&!!m.length&&m.length===t.length&&(0,xt.jsxs)(xt.Fragment,{children:[(0,xt.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,xt.jsx)("div",{className:"my-4",children:(0,xt.jsx)(kt.Spinner,{})})]})]}):(0,xt.jsx)("div",{className:"flex items-center justify-center w-full sm:mt-64",children:(0,xt.jsx)(kt.Spinner,{})})}var rn=function(){return P.get("plugins")},on=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=new FormData;return t.append("plugins",JSON.stringify(e)),P.post("plugins",t,{headers:{"Content-Type":"multipart/form-data"}})},an=function(){return P.get("active-plugins")};function sn(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}function un(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){sn(i,r,o,a,s,"next",e)}function s(e){sn(i,r,o,a,s,"throw",e)}a(void 0)}))}}function cn(e){return ln.apply(this,arguments)}function ln(){return(ln=un(j().mark((function e(t){var n,r,o,i;return j().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((r=null!==(n=(0,wt.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,rn();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 fn(e){return dn.apply(this,arguments)}function dn(){return(dn=un(j().mark((function e(t){var n,r,o,i;return j().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((r=null!==(n=(0,wt.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,an();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,cn(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 pn=u(F((function(e){return{wantedTemplate:{},importOnLoad:!1,setWanted:function(t){return e({wantedTemplate:t})},removeWanted:function(){return e({wantedTemplate:{}})}}}),{name:"extendify-wanted-template"}));function mn(e){var t=e.msg;return(0,xt.jsxs)(kt.Modal,{style:{maxWidth:"500px"},title:(0,yt.__)("Error installing plugins","extendify-sdk"),isDismissible:!1,children:[(0,yt.__)("You have encountered an error that we cannot recover from. Please try again.","extendify-sdk"),(0,xt.jsx)("br",{}),(0,xt.jsx)(kt.Notice,{isDismissible:!1,status:"error",children:t}),(0,xt.jsx)(kt.Button,{isPrimary:!0,onClick:function(){return(0,r.render)((0,xt.jsx)(Sn,{}),document.getElementById("extendify-root"))},children:(0,yt.__)("Go back","extendify-sdk")})]})}const hn=wp.data;function vn(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){s=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return yn(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 yn(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 yn(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(){var e=vn((0,r.useState)(!1),2),t=e[0],n=e[1],o=function(){location.reload()};return(0,(0,hn.select)("core/editor").isEditedPostDirty)()?(0,xt.jsxs)(kt.Modal,{title:(0,yt.__)("Reload required","extendify-sdk"),isDismissible:!1,children:[(0,xt.jsx)("p",{style:{maxWidth:"400px"},children:(0,yt.__)("Just one more thing! We need to reload the page to continue.","extendify-sdk")}),(0,xt.jsxs)(kt.ButtonGroup,{children:[(0,xt.jsx)(kt.Button,{isPrimary:!0,onClick:o,disabled:t,children:(0,yt.__)("Reload page","extendify-sdk")}),(0,xt.jsx)(kt.Button,{isSecondary:!0,onClick:function(){n(!0),(0,hn.dispatch)("core/editor").savePost(),n(!1)},isBusy:t,style:{margin:"0 4px"},children:(0,yt.__)("Save changes","extendify-sdk")})]})]}):(o(),null)}function gn(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){s=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return bn(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 bn(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 bn(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 wn(){var e,t=gn((0,r.useState)(""),2),n=t[0],o=t[1],i=pn((function(e){return e.wantedTemplate}));return on(null==i||null===(e=i.fields)||void 0===e?void 0:e.required_plugins).then((function(){pn.setState({importOnLoad:!0}),(0,r.render)((0,xt.jsx)(xn,{}),document.getElementById("extendify-root"))})).catch((function(e){var t=e.message;o(t)})),n?(0,xt.jsx)(mn,{msg:n}):(0,xt.jsx)(kt.Modal,{title:(0,yt.__)("Installing plugins","extendify-sdk"),isDismissible:!1,children:(0,xt.jsx)(kt.Button,{style:{width:"100%"},disabled:!0,isPrimary:!0,isBusy:!0,onClick:function(){},children:(0,yt.__)("Installing...","extendify-sdk")})})}var jn=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";W.setState({entryPoint:e}),window.dispatchEvent(new CustomEvent("extendify-sdk::".concat(t,"-library"),{detail:e,bubbles:!0}))}(e,"open")};function kn(e){switch(e){case"editorplus":return"Editor Plus";case"ml-slider":return"MetaSlider"}return e}function Sn(e){var t,n,o,i,a,s,u,c=pn((function(e){return e.wantedTemplate})),l=function(){e.forceOpen||(0,r.render)((0,xt.jsx)(yr,{show:!0}),document.getElementById("extendify-root"))},f=(null==c||null===(t=c.fields)||void 0===t?void 0:t.required_plugins)||[];return(0,xt.jsxs)(kt.Modal,{title:null!==(n=e.title)&&void 0!==n?n:(0,yt.__)("Install required plugins","extendify-sdk"),closeButtonLabel:(0,yt.__)("No thanks, take me back","extendify-sdk"),onRequestClose:l,children:[(0,xt.jsx)("p",{style:{maxWidth:"400px"},children:null!==(o=e.message)&&void 0!==o?o:(0,yt.__)((0,yt.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===(s=e.message)||void 0===s?void 0:s.length)>0||(0,xt.jsx)("ul",{children:f.map((function(e){return(0,xt.jsx)("li",{children:kn(e)},e)}))}),(0,xt.jsxs)(kt.ButtonGroup,{children:[(0,xt.jsx)(kt.Button,{isPrimary:!0,onClick:function(){return(0,r.render)((0,xt.jsx)(wn,{}),document.getElementById("extendify-root"))},children:null!==(u=e.buttonLabel)&&void 0!==u?u:(0,yt.__)("Install Plugins","extendify-sdk")}),e.forceOpen||(0,xt.jsx)(kt.Button,{isTertiary:!0,onClick:l,style:{boxShadow:"none",margin:"0 4px"},children:(0,yt.__)("No thanks, take me back","extendify-sdk")})]})]})}function En(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}function _n(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){En(i,r,o,a,s,"next",e)}function s(e){En(i,r,o,a,s,"throw",e)}a(void 0)}))}}var Nn=function(){var e=_n(j().mark((function e(t){return j().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,cn(t);case 2:return e.t0=!e.sent,e.t1=function(){return _n(j().mark((function e(){return j().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})))()},e.t2=function(){return _n(j().mark((function e(){return j().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(){(0,r.render)((0,xt.jsx)(Sn,{}),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 On(e){var t=e.msg;return(0,xt.jsxs)(kt.Modal,{style:{maxWidth:"500px"},title:(0,yt.__)("Error Activating plugins","extendify-sdk"),isDismissible:!1,children:[(0,yt.__)("You have encountered an error that we cannot recover from. Please try again.","extendify-sdk"),(0,xt.jsx)("br",{}),(0,xt.jsx)(kt.Notice,{isDismissible:!1,status:"error",children:t}),(0,xt.jsx)(kt.Button,{isPrimary:!0,onClick:function(){(0,r.render)((0,xt.jsx)(Ln,{}),document.getElementById("extendify-root"))},children:(0,yt.__)("Go back","extendify-sdk")})]})}function Cn(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}function Fn(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Cn(i,r,o,a,s,"next",e)}function s(e){Cn(i,r,o,a,s,"throw",e)}a(void 0)}))}}function An(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){s=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Pn(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 Pn(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 Pn(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 Tn(){var e,t=An((0,r.useState)(""),2),n=t[0],o=t[1],i=pn((function(e){return e.wantedTemplate}));return on(null==i||null===(e=i.fields)||void 0===e?void 0:e.required_plugins).then((function(){pn.setState({importOnLoad:!0})})).then(Fn(j().mark((function e(){return j().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,xt.jsx)(xn,{}),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,xt.jsx)(On,{msg:n}):(0,xt.jsx)(kt.Modal,{title:(0,yt.__)("Activating plugins","extendify-sdk"),isDismissible:!1,children:(0,xt.jsx)(kt.Button,{style:{width:"100%"},disabled:!0,isPrimary:!0,isBusy:!0,onClick:function(){},children:(0,yt.__)("Activating...","extendify-sdk")})})}function Ln(e){var t,n,o,i,a=pn((function(e){return e.wantedTemplate})),s=function(){return(0,r.render)((0,xt.jsx)(yr,{show:!0}),document.getElementById("extendify-root"))},u=(null==a||null===(t=a.fields)||void 0===t?void 0:t.required_plugins)||[];return(0,xt.jsxs)(kt.Modal,{title:(0,yt.__)("Activate required plugins","extendify-sdk"),closeButtonLabel:(0,yt.__)("No thanks, return to library","extendify-sdk"),onRequestClose:s,children:[(0,xt.jsx)("p",{style:{maxWidth:"400px"},children:null!==(n=e.message)&&void 0!==n?n:(0,yt.__)((0,yt.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,xt.jsx)("ul",{children:u.map((function(e){return(0,xt.jsx)("li",{children:kn(e)},e)}))}),(0,xt.jsxs)(kt.ButtonGroup,{children:[(0,xt.jsx)(kt.Button,{isPrimary:!0,onClick:function(){return(0,r.render)((0,xt.jsx)(Tn,{}),document.getElementById("extendify-root"))},children:(0,yt.__)("Activate Plugins","extendify-sdk")}),e.showClose&&(0,xt.jsx)(kt.Button,{isTertiary:!0,onClick:s,style:{boxShadow:"none",margin:"0 4px"},children:(0,yt.__)("No thanks, return to library","extendify-sdk")})]})]})}function In(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}function Rn(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){In(i,r,o,a,s,"next",e)}function s(e){In(i,r,o,a,s,"throw",e)}a(void 0)}))}}var Dn=function(){var e=Rn(j().mark((function e(t){return j().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fn(t);case 2:return e.t0=!e.sent,e.t1=function(){return Rn(j().mark((function e(){return j().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})))()},e.t2=function(){return Rn(j().mark((function e(){return j().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(){(0,r.render)((0,xt.jsx)(Ln,{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 Vn(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 Mn(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 Mn(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,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function Mn(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 Hn(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}function Bn(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Hn(i,r,o,a,s,"next",e)}function s(e){Hn(i,r,o,a,s,"throw",e)}a(void 0)}))}}function Un(e){return function(){return new qn(e.apply(this,arguments))}}function qn(e){var t,n;function r(t,n){try{var i=e[t](n),a=i.value,s=a instanceof Zn;Promise.resolve(s?a.wrapped:a).then((function(e){s?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 s={key:e,arg:o,resolve:i,reject:a,next:null};n?n=n.next=s:(t=n=s,r(e,o))}))},"function"!=typeof e.return&&(this.return=void 0)}function Zn(e){this.wrapped=e}qn.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},qn.prototype.next=function(e){return this._invoke("next",e)},qn.prototype.throw=function(e){return this._invoke("throw",e)},qn.prototype.return=function(e){return this._invoke("return",e)};function Wn(){return(Wn=Bn(j().mark((function e(t){var n;return j().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=zn(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 zn(e){return $n.apply(this,arguments)}function $n(){return($n=Un(j().mark((function e(t){var n,r,o;return j().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=Vn(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 Gn(e,t){return(0,(0,hn.dispatch)("core/block-editor").insertBlocks)(e).then((function(){window.dispatchEvent(new CustomEvent("extendify-sdk::template-inserted",{detail:{template:t},bubbles:!0}))}))}function Kn(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){s=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Yn(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 Yn(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 Yn(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 Xn=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return{hasRequiredPlugins:Nn,hasPluginsActivated:Dn,stack:[],check:function(t){var n=this;return Bn(j().mark((function r(){var o,i,a;return j().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:o=Vn(e),r.prev=1,a=j().mark((function e(){var r,o;return j().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 Jn(e){var t=e.template,n=g((function(e){return e.activeTemplateBlocks})),o=W((function(e){return e.canImport})),i=W((function(e){return e.apiKey})),a=b((function(e){return e.setOpen})),s=Kn((0,r.useState)(!1),2),u=s[0],c=s[1],l=Kn((0,r.useState)(!1),2),f=l[0],d=l[1],p=pn((function(e){return e.setWanted})),m=function(){(function(e){return Wn.apply(this,arguments)})(Xn.stack).then((function(){setTimeout((function(){Gn(n,t).then((function(){return a(!1)}))}),100)}))};(0,r.useEffect)((function(){return Xn.check(t).then((function(){return d(!0)})),function(){return Xn.reset()&&d(!1)}}),[t]);return f&&Object.keys(n).length?i||o()?u?(0,xt.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,yt.__)("Importing...","extendify-sdk")}):(0,xt.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 Mt(t),c(!0),p(t),void m()},children:(0,yt.sprintf)((0,yt.__)("Add %s","extendify-sdk"),t.fields.type)}):(0,xt.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/pricing?utm_source=".concat(window.extendifySdkData.source,"&utm_medium=library&utm_campaign=sign_up&utm_content=single_page"),rel:"noreferrer",children:(0,yt.__)("Sign up now","extendify-sdk")}):""}function Qn(e){var t,n,o,i,a,s,u,c=e.template,l=c.fields.tax_categories,f=W((function(e){return e.apiKey}));return(0,r.useEffect)((function(){Ht(c)}),[c]),(0,xt.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,xt.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,xt.jsxs)("div",{className:"text-left m-0 sm:mb-6 p-6 sm:p-0",children:[(0,xt.jsx)("h1",{className:"leading-tight text-left mb-2.5 sm:text-3xl font-normal",children:c.fields.title}),(0,xt.jsx)(kt.ExternalLink,{href:c.fields.url,children:(0,yt.__)("Demo","extendify-sdk")})]}),(0,xt.jsx)("div",{className:Et()({"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,xt.jsx)(Jn,{template:c})})]}),(0,xt.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,xt.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===(s=c.fields)||void 0===s||null===(u=s.screenshot[0])||void 0===u?void 0:u.url})}),(0,xt.jsxs)("div",{className:"text-xs text-left p-6 w-full block sm:hidden",children:[(0,xt.jsx)("h3",{className:"m-0 mb-6",children:(0,yt.__)("Categories","extendify-sdk")}),(0,xt.jsx)("ul",{className:"text-sm",children:l.map((function(e){return(0,xt.jsx)("li",{className:"inline-block mr-2 px-4 py-2 bg-gray-100",children:e},e)}))})]})]})}function er(){return 0===W((function(e){return e.apiKey})).length?(0,xt.jsx)("button",{className:"components-button",onClick:function(){return b.setState({currentPage:"login"})},children:(0,yt.__)("Log into account","extendify-sdk")}):(0,xt.jsx)("button",{className:"components-button",onClick:function(){return W.setState({apiKey:""})},children:(0,yt.__)("Log out","extendify-sdk")})}function tr(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){s=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(s)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(e){var t=e.children,n=W((function(e){return e.apiKey})),o=tr((0,r.useState)(!1),2),i=o[0],a=o[1];return(0,r.useEffect)((function(){a(!n.length||window.location.search.indexOf("DEVMODE")>-1)}),[n]),(0,xt.jsxs)(xt.Fragment,{children:[(0,xt.jsxs)("aside",{className:"flex-shrink-0 sm:pl-12 py-0 sm:py-6 relative",children:[(0,xt.jsx)("div",{className:"sm:w-56 lg:w-72 sticky flex flex-col h-full",children:t[0]}),(0,xt.jsx)("div",{className:"hidden sm:flex flex-col absolute bottom-0 bg-white p-4 w-72 text-left space-y-4",children:i&&(0,xt.jsx)("div",{className:"border-t border-gray-300",children:(0,xt.jsx)(er,{})})})]}),(0,xt.jsx)("main",{id:"extendify-templates",tabIndex:"0",className:"w-full smp:l-12 sm:pt-6 h-full",children:t[1]})]})}function or(){var e=g((function(e){return e.updateSearchParams})),t=g((function(e){return e.searchParams})),n=function(t){return e({type:t})};return(0,xt.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,xt.jsx)("h4",{className:"sr-only",children:(0,yt.__)("Type select","extendify-sdk")}),(0,xt.jsxs)("button",{type:"button",className:Et()({"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,xt.jsx)("svg",{width:"17",height:"13",viewBox:"0 0 17 13",className:"fill-current",xmlns:"http://www.w3.org/2000/svg",children:(0,xt.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,xt.jsx)("span",{className:"",children:(0,yt.__)("Patterns","extendify-sdk")})]}),(0,xt.jsxs)("button",{type:"button",className:Et()({"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,xt.jsx)("svg",{width:"17",height:"13",viewBox:"0 0 17 13",className:"fill-current",xmlns:"http://www.w3.org/2000/svg",children:(0,xt.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,xt.jsx)("span",{className:"",children:(0,yt.__)("Page templates","extendify-sdk")})]})]})}function ir(e){var t=e.template,n=g((function(e){return e.setActive})),o=(0,r.useRef)(null),i=t.fields,a=i.tax_categories,s=i.required_plugins,u=W((function(e){return e.apiKey}));return(0,r.useEffect)((function(){o.current.focus()}),[]),(0,xt.jsxs)("div",{className:"flex flex-col items-start justify-start",children:[!u.length&&(0,xt.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,xt.jsx)("a",{className:"button-extendify-main",target:"_blank",href:"https://extendify.com/pricing?utm_source=".concat(window.extendifySdkData.source,"&utm_medium=library&utm_campaign=sign_up&utm_content=main"),rel:"noreferrer",children:(0,yt.__)("Sign up today to get unlimited access","extendify-sdk")}),(0,xt.jsx)("button",{className:"components-button",onClick:function(){return b.setState({currentPage:"login"})},children:(0,yt.__)("Log in","extendify-sdk")})]}),(0,xt.jsx)("div",{className:"p-6 sm:p-0",children:(0,xt.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,xt.jsx)("svg",{className:"fill-current",width:"8",height:"12",viewBox:"0 0 8 12",xmlns:"http://www.w3.org/2000/svg",children:(0,xt.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,xt.jsx)("span",{className:"ml-4",children:(0,yt.__)("Go back","extendify-sdk")})]})}),(0,xt.jsxs)("div",{className:"text-left pt-14 divide-y w-full hidden sm:block",children:[(0,xt.jsxs)("div",{className:"w-full py-6",children:[(0,xt.jsx)("h3",{className:"m-0 mb-6",children:(0,yt.__)("Categories","extendify-sdk")}),(0,xt.jsx)("ul",{className:"text-sm m-0",children:a.map((function(e){return(0,xt.jsx)("li",{className:"inline-block mr-2 px-4 py-2 bg-gray-100",children:e},e)}))})]}),s&&(0,xt.jsxs)("div",{className:"pt-4 w-full",children:[(0,xt.jsx)("h3",{className:"m-0 mb-6",children:(0,yt.__)("Required Plugins","extendify-sdk")}),(0,xt.jsx)("ul",{className:"text-sm",children:s.map((function(e){return(0,xt.jsx)("li",{className:"inline-block mr-2 px-4 py-2 bg-extendify-light",children:kn(e)},e)}))})]}),(0,xt.jsx)("div",{className:"py-6",children:(0,xt.jsx)("a",{href:"https://extendify.com/what-happens-when-a-template-is-added?utm_source=".concat(window.extendifySdkData.source,"&utm_medium=library&utm_campaign=sidebar"),rel:"noreferrer",target:"_blank",children:(0,yt.__)("What happens when a template is added?","extendify-sdk")})})]})]})}function ar(){var e=g((function(e){return e.searchParams}));return(0,xt.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]||"template"===e.type&&"tax_features"===t[0]||"pattern"===e.type&&"tax_page_types"===t[0]?"":(0,xt.jsxs)("div",{className:"lg:px-2 text-left",children:[(0,xt.jsx)("span",{className:"font-bold",children:(n=t[0],n.replace("tax_","").replace("_"," ").replace(/\b\w/g,(function(e){return e.toUpperCase()})))}),": ",(0,xt.jsx)("span",{children:t[1]?t[1]:"All"})]},t[0]);var n}))})}function sr(e){var t=e.className,n=e.initialFocus,r=g((function(e){return e.templates})),o=g((function(e){return e.activeTemplate}));return(0,xt.jsxs)("div",{className:t,children:[(0,xt.jsx)("a",{href:"#extendify-templates",className:"sr-only focus:not-sr-only focus:text-blue-500",children:(0,yt.__)("Skip to content","extendify-sdk")}),(0,xt.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,xt.jsx)("div",{className:"absolute bg-white sm:flex inset-0 z-50 sm:space-x-12",children:(0,xt.jsxs)(rr,{children:[(0,xt.jsx)(ir,{template:o}),(0,xt.jsx)(Qn,{template:o})]})}),(0,xt.jsxs)(rr,{children:[(0,xt.jsx)(Lt,{initialFocus:n}),(0,xt.jsxs)(xt.Fragment,{children:[(0,xt.jsx)(or,{}),(0,xt.jsx)(ar,{}),(0,xt.jsx)("div",{className:"relative h-full z-30 bg-white",children:(0,xt.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,xt.jsx)(nn,{templates:r})})})]})]})]})]})}function ur(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}function cr(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){s=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return lr(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 lr(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 lr(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 fr(){var e=cr((0,r.useState)(W.getState().apiKey),2),t=e[0],n=e[1],o=cr((0,r.useState)(W.getState().email),2),i=o[0],a=o[1],s=cr((0,r.useState)(""),2),u=s[0],c=s[1],l=cr((0,r.useState)("info"),2),f=l[0],d=l[1],p=cr((0,r.useState)(""),2),m=p[0],h=p[1];(0,r.useEffect)((function(){return function(){return d("info")}}),[]);var v=function(){var e,n=(e=j().mark((function e(n){var r,o,a,s,u,l;return j().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n.preventDefault(),c(""),r=i.length?i:m,e.next=5,R(r,t);case 5:if(o=e.sent,a=o.token,s=o.error,u=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(!s&&!u){e.next=16;break}return d("error"),e.abrupt("return",c(s.length?s:u));case 16:if(a&&"string"==typeof a){e.next=19;break}return d("error"),e.abrupt("return",c((0,yt.__)("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:W.setState({apiKey:a}),b.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){ur(i,r,o,a,s,"next",e)}function s(e){ur(i,r,o,a,s,"throw",e)}a(void 0)}))});return function(e){return n.apply(this,arguments)}}();return(0,r.useEffect)((function(){i||I("user_email").then((function(e){return h(e)}))}),[i]),(0,xt.jsxs)("section",{className:"w-96 text-left md:-mt-32",children:[(0,xt.jsx)("h1",{className:"border-b border-gray-900 mb-12 pb-4",children:(0,yt.__)("Welcome","extendify-sdk")}),u&&(0,xt.jsx)("div",{className:Et()({"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:u}),(0,xt.jsxs)("form",{onSubmit:v,className:" space-y-6",children:[(0,xt.jsxs)("div",{className:"flex items-center",children:[(0,xt.jsx)("label",{htmlFor:"extendifysdk-login-email",className:"w-32 font-bold",children:(0,yt.__)("Email:","extendify-sdk")}),(0,xt.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,xt.jsxs)("div",{className:"flex items-center",children:[(0,xt.jsx)("label",{htmlFor:"extendifysdk-login-license",className:"w-32 font-bold",children:(0,yt.__)("License:","extendify-sdk")}),(0,xt.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,xt.jsx)("div",{className:"flex justify-end",children:(0,xt.jsx)("button",{type:"submit",className:"button-extendify-main p-3 px-4",children:(0,yt.__)("Sign in","extendify-sdk")})})]})]})}function dr(e){var t=e.className;return(0,xt.jsxs)("div",{className:t,children:[(0,xt.jsx)("a",{href:"#extendify-templates",className:"sr-only focus:not-sr-only focus:text-blue-500",children:(0,yt.__)("Skip to content","extendify-sdk")}),(0,xt.jsx)("div",{className:"flex sm:space-x-12 relative mx-auto max-w-screen-4xl h-full",children:(0,xt.jsxs)("div",{className:"absolute flex inset-0 items-center justify-center z-20 sm:space-x-12",children:[(0,xt.jsx)("div",{className:"pl-12 py-6 absolute top-0 left-0",children:(0,xt.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 b.setState({currentPage:"content"})},children:[(0,xt.jsx)("svg",{className:"fill-current",width:"8",height:"12",viewBox:"0 0 8 12",xmlns:"http://www.w3.org/2000/svg",children:(0,xt.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,xt.jsx)("span",{className:"ml-4",children:(0,yt.__)("Go back","extendify-sdk")})]})}),(0,xt.jsx)("div",{className:"flex justify-center",children:(0,xt.jsx)(fr,{})})]})})]})}var pr=function(e){return P.post("simple-ping",{action:e})};function mr(e){var t=e.className,n=e.initialFocus,o=g((function(e){return e.updateSearchParams})),i=function(e){pr("welcome-".concat(null!=e?e:"closed")),e&&o({type:e}),W.setState({hasClickedThroughWelcomePage:!0}),b.setState({currentPage:"content"})};return(0,r.useEffect)((function(){pr("welcome-opened")}),[]),(0,xt.jsxs)("div",{className:t,children:[(0,xt.jsx)("div",{className:"w-full h-16 relative z-10 border-solid border-0 flex-shrink-0",children:(0,xt.jsxs)("div",{className:"flex justify-between items-center px-6 sm:px-12 h-full",children:[(0,xt.jsx)("div",{className:"flex space-x-12 h-full"}),(0,xt.jsx)("div",{className:"space-x-2 transform sm:translate-x-8",children:(0,xt.jsxs)("button",{ref:n,type:"button",className:"components-button has-icon",onClick:function(){return i()},children:[(0,xt.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,xt.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,xt.jsx)("span",{className:"sr-only",children:(0,yt.__)("Close library","extendify-sdk")})]})})]})}),(0,xt.jsx)("section",{className:"w-full lg:w-auto lg:flex sm:space-x-12 relative mx-auto max-w-screen-4xl h-full",children:(0,xt.jsx)("div",{className:"flex items-center justify-center",children:(0,xt.jsx)("div",{className:"-mt-16 h-screen lg:h-auto lg:p-8 w-full",children:(0,xt.jsxs)("div",{className:"bg-white overflow-y-auto h-screen lg:h-auto lg:flex pt-20 p-8 sm:p-16 space-y-16 lg:space-y-0 lg:space-x-8 xl:space-x-16 max-w-screen-xl lg:border border-gray-300",children:[(0,xt.jsxs)("div",{className:"flex-grow flex items-center space-y-4 md:space-y-0 md:space-x-4 xl:space-x-8 flex-col md:flex-row",children:[(0,xt.jsx)("div",{className:"flex-1 lg:w-1/2 w-full flex items-center max-w-xs h-full max-h-60",children:(0,xt.jsxs)("button",{onClick:function(){return i("pattern")},className:"bg-white hover:bg-gray-50 cursor-pointer border border-gray-300 flex w-full space-y-4 flex-col items-center justify-center p-8 lg:px-0",children:[(0,xt.jsx)("h3",{className:"m-0 text-gray-900",children:(0,yt.__)("Sections","extendify-sdk")}),(0,xt.jsx)("span",{children:(0,xt.jsxs)("svg",{className:"mt-1",xmlns:"http://www.w3.org/2000/svg",width:"206",height:"122",viewBox:"0 0 206 122",fill:"none",children:[(0,xt.jsx)("path",{d:"M69 0H0V59H69V0Z",fill:"#DFDFDF"}),(0,xt.jsx)("path",{d:"M204 0H79V60H204V0Z",fill:"#DFDFDF"}),(0,xt.jsx)("path",{d:"M62.166 25H9.16602V28H62.166V25Z",fill:"#F9F9F9"}),(0,xt.jsx)("path",{d:"M63.166 18H10.166V21H63.166V18Z",fill:"#F9F9F9"}),(0,xt.jsx)("path",{d:"M62.166 34H9.16602V39H62.166V34Z",fill:"#F9F9F9"}),(0,xt.jsx)("path",{d:"M62.166 43H9.16602V48H62.166V43Z",fill:"#F9F9F9"}),(0,xt.jsx)("path",{d:"M140.166 25H87.166V28H140.166V25Z",fill:"#F9F9F9"}),(0,xt.jsx)("path",{d:"M140.166 34H87.166V39H140.166V34Z",fill:"#F9F9F9"}),(0,xt.jsx)("path",{d:"M140.166 43H87.166V48H140.166V43Z",fill:"#F9F9F9"}),(0,xt.jsx)("path",{d:"M197.166 25H151.166V28H197.166V25Z",fill:"#F9F9F9"}),(0,xt.jsx)("path",{d:"M141.166 17H88.166V20H141.166V17Z",fill:"#F9F9F9"}),(0,xt.jsx)("path",{d:"M198.166 17H152.166V20H198.166V17Z",fill:"#F9F9F9"}),(0,xt.jsx)("path",{d:"M62.166 10H9.16602V13H62.166V10Z",fill:"#F9F9F9"}),(0,xt.jsx)("path",{d:"M140.166 9H87.166V12H140.166V9Z",fill:"#F9F9F9"}),(0,xt.jsx)("path",{d:"M197.166 9H151.166V12H197.166V9Z",fill:"#F9F9F9"}),(0,xt.jsx)("path",{d:"M197.166 34H151.166V39H197.166V34Z",fill:"#F9F9F9"}),(0,xt.jsx)("path",{d:"M197.166 43H151.166V48H197.166V43Z",fill:"#F9F9F9"}),(0,xt.jsx)("path",{d:"M154.172 77.8088H0V121.216H154.172V77.8088Z",fill:"#DFDFDF"}),(0,xt.jsx)("path",{d:"M133.637 110.446C141.077 110.446 147.109 104.75 147.109 97.7229C147.109 90.6963 141.077 85 133.637 85C126.197 85 120.166 90.6963 120.166 97.7229C120.166 104.75 126.197 110.446 133.637 110.446Z",fill:"#F9F9F9"}),(0,xt.jsx)("path",{d:"M205.166 78H162.166V121H205.166V78Z",fill:"#DFDFDF"}),(0,xt.jsx)("path",{d:"M183.803 111.637C191.243 111.637 197.275 105.941 197.275 98.9141C197.275 91.8874 191.243 86.1912 183.803 86.1912C176.363 86.1912 170.332 91.8874 170.332 98.9141C170.332 105.941 176.363 111.637 183.803 111.637Z",fill:"#F9F9F9"}),(0,xt.jsx)("path",{d:"M113.695 88.7898H13.4082V100.764H113.695V88.7898Z",fill:"#F9F9F9"}),(0,xt.jsx)("path",{d:"M113.695 105.255H13.4082V109.745H113.695V105.255Z",fill:"#F9F9F9"})]})}),(0,xt.jsx)("span",{className:"text-extendify-bright underline text-base font-bold",children:(0,yt.__)("View patterns","extendify-sdk")})]})}),(0,xt.jsx)("div",{className:"flex-1 lg:w-1/2 w-full flex items-center max-w-xs h-full max-h-60",children:(0,xt.jsxs)("button",{onClick:function(){return i("template")},className:"bg-white hover:bg-gray-50 cursor-pointer border border-gray-300 flex w-full space-y-4 flex-col items-center justify-center p-8 lg:px-0",children:[(0,xt.jsx)("h3",{className:"m-0 text-gray-900",children:(0,yt.__)("Full pages","extendify-sdk")}),(0,xt.jsx)("span",{children:(0,xt.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"156",height:"128",viewBox:"0 0 156 128",fill:"none",children:[(0,xt.jsx)("path",{d:"M155.006 38.4395H0.833984V81.8471H155.006V38.4395Z",fill:"#DFDFDF"}),(0,xt.jsx)("path",{d:"M155 0H1V36H155V0Z",fill:"#DFDFDF"}),(0,xt.jsx)("path",{d:"M148 7H10V28H148V7Z",fill:"#F9F9F9"}),(0,xt.jsx)("path",{d:"M147.521 47.4204H9.81445V50.414H147.521V47.4204Z",fill:"#F9F9F9"}),(0,xt.jsx)("path",{d:"M147.521 56.4012H9.81445V60.8917H147.521V56.4012Z",fill:"#F9F9F9"}),(0,xt.jsx)("path",{d:"M147.521 65.3821H9.81445V69.8726H147.521V65.3821Z",fill:"#F9F9F9"}),(0,xt.jsx)("path",{d:"M155.006 83.8089H0.833984V127.217H155.006V83.8089Z",fill:"#DFDFDF"}),(0,xt.jsx)("path",{d:"M21.7897 118.236C29.2297 118.236 35.261 112.539 35.261 105.513C35.261 98.486 29.2297 92.7898 21.7897 92.7898C14.3497 92.7898 8.31836 98.486 8.31836 105.513C8.31836 112.539 14.3497 118.236 21.7897 118.236Z",fill:"#F9F9F9"}),(0,xt.jsx)("path",{d:"M144.529 92.7898H44.2422V104.764H144.529V92.7898Z",fill:"#F9F9F9"}),(0,xt.jsx)("path",{d:"M144.529 109.255H44.2422V113.745H144.529V109.255Z",fill:"#F9F9F9"})]})}),(0,xt.jsx)("span",{className:"text-extendify-bright underline text-base font-bold",children:(0,yt.__)("View templates","extendify-sdk")})]})})]}),(0,xt.jsx)("div",{className:"lg:w-2/5 text-left",children:(0,xt.jsxs)("div",{className:"max-w-lg lg:max-w-none",children:[(0,xt.jsx)("h1",{className:"m-0 pb-4 mb-6 border-b border-gray-900 font-medium text-2xl",children:(0,yt.__)("Welcome to Extendify","extendify-sdk")}),(0,xt.jsxs)("div",{className:"mb-12",children:[(0,xt.jsx)("p",{children:(0,yt.__)("Congratulations! You have access to our entire library of Gutenberg patterns and templates. You can add up to 3 templates or patterns to your site completely free.","extendify-sdk")}),(0,xt.jsx)("p",{children:(0,yt.__)("All patterns and templates are pre-designed to look beautiful with options to fit your style. They also keep your site running lightning fast by using only core blocks with no 3rd party page builder required.","extendify-sdk")}),(0,xt.jsx)("a",{className:"text-sm text-extendify-link underline",href:"https://extendify.com?utm_source=".concat(window.extendifySdkData.source,"&utm_medium=library&utm_campaign=welcome"),target:"_blank",rel:"noreferrer",children:(0,yt.__)("Learn more about Extendify","extendify-sdk")})]}),(0,xt.jsx)("h2",{className:"text-base pb-2 mb-4 border-b border-gray-900",children:(0,yt.__)("Don't want the library in your editor?","extendify-sdk")}),(0,xt.jsxs)("div",{className:"text-xs",children:[(0,xt.jsx)("p",{children:(0,yt.sprintf)((0,yt.__)("Extendify was included with the %s plugin.","extendify-sdk"),window.extendifySdkData.source)}),(0,xt.jsx)("a",{className:"text-xs text-extendify-link underline",href:"https://extendify.com/how-to-disable-the-extendify-library/?utm_source=".concat(window.extendifySdkData.source,"&utm_medium=library&utm_campaign=welcome"),target:"_blank",rel:"noreferrer",children:(0,yt.__)("Learn how to remove the library","extendify-sdk")})]})]})})]})})})})]})}function hr(e){var t=e.show,n=function(){var e=document.getElementById("beacon-container");e&&(e.style.position="relative",e.style.zIndex=Number.MAX_SAFE_INTEGER,e.style.display="block")},o=function(){var e=document.getElementById("beacon-container");e&&(e.style.display="none",window.Beacon("close"))};return(0,r.useEffect)((function(){if(t)return window.Beacon?(n(),function(){return o()}):(function(e,t,n){function r(){var e,n=t.getElementsByTagName("script")[0],r=t.createElement("script");r.async=!0,r.src="https://beacon-v2.helpscout.net",null===(e=n.parentNode)||void 0===e||e.insertBefore(r,n)}if(e.Beacon=n=function(t,n,r){e.Beacon.readyQueue.push({method:t,options:n,data:r})},n.readyQueue=[],"complete"===t.readyState)return r();e.attachEvent?e.attachEvent("onload",r):e.addEventListener("load",r,!1)}(window,document,window.Beacon||function(){}),window.Beacon("init","2b8c11c0-5afc-4cb9-bee0-a5cb76b2fc91"),window.Beacon("on","ready",n),function(){window.Beacon("off","ready",n),o()})}),[t]),(0,xt.jsx)(xt.Fragment,{})}function vr(){var e=(0,r.useRef)(null),t=b((function(e){return e.open})),n=b((function(e){return e.setOpen})),o=b((function(e){return e.currentPage})),i=W((function(e){return e.hasClickedThroughWelcomePage}));return(0,r.useEffect)((function(){i&&b.setState({currentPage:"content"})}),[i]),(0,xt.jsx)(Fe.Root,{show:t,as:r.Fragment,children:(0,xt.jsx)(vt,{as:"div",static:!0,className:"extendify-sdk",initialFocus:e,onClose:function(){},children:(0,xt.jsx)("div",{className:"h-screen w-screen sm:h-auto sm:w-auto fixed z-high inset-0 overflow-y-auto",children:(0,xt.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,xt.jsx)(Fe.Child,{as:r.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",children:(0,xt.jsx)(vt.Overlay,{className:"fixed inset-0 bg-black bg-opacity-30 transition-opacity"})}),(0,xt.jsx)(Fe.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,xt.jsxs)("div",{className:"fixed lg:absolute inset-0 lg:overflow-hidden transform transition-all lg:p-5",children:["welcome"===o?(0,xt.jsx)(mr,{initialFocus:e,className:"w-full h-full flex flex-col items-center relative shadow-xl max-w-screen-4xl mx-auto bg-extendify-light"}):(0,xt.jsxs)("div",{className:"bg-white h-full flex flex-col items-center relative shadow-xl max-w-screen-4xl mx-auto",children:[(0,xt.jsx)(gt,{className:"w-full h-16 border-solid border-0 border-b border-gray-300 flex-shrink-0",initialFocus:e,hideLibrary:function(){return n(!1)}}),"content"===o&&(0,xt.jsx)(sr,{className:"w-full flex-grow overflow-hidden"}),"login"===o&&(0,xt.jsx)(dr,{className:"w-full flex-grow overflow-hidden bg-extendify-light"})]}),(0,xt.jsx)(hr,{show:t})]})})]})})})})}function yr(e){var t=e.show,n=void 0!==t&&t,o=b((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")&&W.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,xt.jsx)(vr,{})}const xr=wp.plugins,gr=wp.editPost;function br(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).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){br(i,r,o,a,s,"next",e)}function s(e){br(i,r,o,a,s,"throw",e)}a(void 0)}))}}var jr=function(e){var t,n;jn(null===(t=e.target.closest("[data-extendify-identifier]"))||void 0===t||null===(n=t.dataset)||void 0===n?void 0:n.extendifyIdentifier)},kr=function(){var e,t,n;return null===window.extendifySdkData.user||(null===(e=window.extendifySdkData)||void 0===e||null===(t=e.user)||void 0===t||null===(n=t.state)||void 0===n?void 0:n.enabled)},Sr=(0,xt.jsx)("div",{id:"extendify-templates-inserter",children:(0,xt.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,xt.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,xt.jsx)("rect",{y:"25.75",width:"70.8125",height:"77.25",fill:"#000000"}),(0,xt.jsx)("rect",{x:"45.0625",width:"57.9375",height:"57.9375",fill:"#37C2A2"})]}),(0,yt.__)("Library","extendify-sdk")]})});window._wpLoadBlockEditor&&window.wp.data.subscribe((function(){setTimeout((function(){kr()&&(document.getElementById("extendify-templates-inserter-btn")||document.querySelector(".edit-post-header-toolbar")&&(document.querySelector(".edit-post-header-toolbar").insertAdjacentHTML("beforeend",(0,r.renderToString)(Sr)),document.getElementById("extendify-templates-inserter-btn").addEventListener("click",jr)))}),0)})),window._wpLoadBlockEditor&&window.wp.data.subscribe((function(){setTimeout((function(){if(kr()&&document.querySelector("[id$=patterns-view]")&&!document.getElementById("extendify-cta-button")){var e=(0,xt.jsx)("div",{children:(0,xt.jsx)("button",{id:"extendify-cta-button",style:"margin:1rem 1rem 0","data-extendify-identifier":"patterns-cta",className:"components-button is-secondary",children:(0,yt.__)("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",jr)}}),0)}));window._wpLoadBlockEditor&&kr()&&(0,xr.registerPlugin)("extendify-temps-more-menu-trigger",{render:function(){return(0,xt.jsx)(gr.PluginSidebarMoreMenuItem,{"data-extendify-identifier":"sidebar-button",onClick:jr,icon:(0,xt.jsx)("span",{className:"components-menu-items__item-icon",children:(0,xt.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 103 103",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,xt.jsx)("rect",{y:"25.75",width:"70.8125",height:"77.25",fill:"#000000"}),(0,xt.jsx)("rect",{x:"45.0625",width:"57.9375",height:"57.9375",fill:"#37C2A2"})]})}),children:(0,yt.__)("Library","extendify-sdk")})}});window._wpLoadBlockEditor&&(0,xr.registerPlugin)("extendify-settings-enable-disable",{render:function(){return(0,xt.jsx)(gr.PluginSidebarMoreMenuItem,{onClick:wr(j().mark((function e(){var t;return j().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,L();case 2:return t=e.sent,(t=JSON.parse(t)).state.enabled=!kr(),e.next=7,D(JSON.stringify(Object.assign({},t)));case 7:location.reload();case 8:case"end":return e.stop()}}),e)}))),icon:(0,xt.jsx)(xt.Fragment,{}),children:kr()?(0,yt.__)("Disable Extendify","extendify-sdk"):(0,yt.__)("Enable Extendify","extendify-sdk")})}}),[{register:function(){var e=(0,hn.dispatch)("core/notices").createNotice,t=W.getState().incrementImports;window.addEventListener("extendify-sdk::template-inserted",(function(n){e("info",(0,yt.__)("Template Added"),{isDismissible:!0,type:"snackbar"}),setTimeout((function(){var e;t(),Bt(null===(e=n.detail)||void 0===e?void 0:e.template)}),0)}))}},{register:function(){var e=this;window.addEventListener("extendify-sdk::softerror-encountered",(function(t){e[(0,wt.camelCase)(t.detail.type)](t.detail)}))},versionOutdated:function(e){(0,r.render)((0,xt.jsx)(Sn,{title:e.data.title,message:e.data.message,buttonLabel:e.data.buttonLabel,forceOpen:!0}),document.getElementById("extendify-root"))}}].forEach((function(e){return e.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,xt.jsx)(yr,{}),e),pn.getState().importOnLoad){var t=pn.getState().wantedTemplate;setTimeout((function(){!function(e){if(!e)throw Error("Template not found");Gn(p((0,window.wp.blocks.parse)((0,wt.get)(e,"fields.code"))),e)}(t)}),0)}pn.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 s in n)r.call(n,s)&&n[s]&&e.push(s);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)}()},716:()=>{},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,s,u=o(e),c=1;c<arguments.length;c++){for(var l in a=Object(arguments[c]))n.call(a,l)&&(u[l]=a[l]);if(t){s=t(a);for(var f=0;f<s.length;f++)r.call(a,s[f])&&(u[s[f]]=a[s[f]])}}return u}},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 s,u=[],c=!1,l=-1;function f(){c&&s&&(c=!1,s.length?u=s.concat(u):l=-1,u.length&&d())}function d(){if(!c){var e=a(f);c=!0;for(var t=u.length;t;){for(s=u,u=[];++l<t;)s&&s[l].run();l=-1,t=u.length}s=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];u.push(new p(e,t)),1!==u.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,s=Object.prototype.hasOwnProperty,u={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)s.call(t,r)&&!u.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",s=o.toStringTag||"@@toStringTag";function u(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,n){return e[t]=n}}function c(e,t,n,r){var o=t&&t.prototype instanceof v?t:v,i=Object.create(o.prototype),a=new O(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 F()}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var s=E(a,n);if(s){if(s===h)continue;return s}}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 u=l(e,t,n);if("normal"===u.type){if(r=n.done?m:d,u.arg===h)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r=m,n.method="throw",n.arg=u.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",h={};function v(){}function y(){}function x(){}var g={};g[i]=function(){return this};var b=Object.getPrototypeOf,w=b&&b(b(C([])));w&&w!==n&&r.call(w,i)&&(g=w);var j=x.prototype=v.prototype=Object.create(g);function k(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function S(e,t){function n(o,i,a,s){var u=l(e[o],e,i);if("throw"!==u.type){var c=u.arg,f=c.value;return f&&"object"==typeof f&&r.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,a,s)}),(function(e){n("throw",e,a,s)})):t.resolve(f).then((function(e){c.value=e,a(c)}),(function(e){return n("throw",e,a,s)}))}s(u.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 E(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,E(e,n),"throw"===n.method))return h;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var o=l(r,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,h;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,h):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,h)}function _(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 N(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function O(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(_,this),this.reset(!0)}function C(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:F}}function F(){return{value:t,done:!0}}return y.prototype=j.constructor=x,x.constructor=y,y.displayName=u(x,s,"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,x):(e.__proto__=x,u(e,s,"GeneratorFunction")),e.prototype=Object.create(j),e},e.awrap=function(e){return{__await:e}},k(S.prototype),S.prototype[a]=function(){return this},e.AsyncIterator=S,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new S(c(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},k(j),u(j,s,"Generator"),j[i]=function(){return this},j.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=C,O.prototype={constructor:O,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(N),!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 s.type="throw",s.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],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(u&&c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){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,h):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),h},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),N(n),h}},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;N(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:C(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),h}},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],s=!0,u=0;u<n.length;u++)(!1&i||a>=i)&&Object.keys(r.O).every((e=>r.O[e](n[u])))?n.splice(u--,1):(s=!1,i<a&&(a=i));s&&(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,s,u]=n,c=0;for(o in s)r.o(s,o)&&(r.m[o]=s[o]);if(u)var l=u(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(299)));var o=r.O(void 0,[106],(()=>r(716)));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),i=n(570),o=n(940),a=n(581),s=n(574),u=n(845),l=n(338),c=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 h=e.auth.username||"",m=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";d.Authorization="Basic "+btoa(h+":"+m)}var v=s(e.baseURL,e.url);if(p.open(e.method.toUpperCase(),a(v,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?u(p.getAllResponseHeaders()):null,o={data:e.responseType&&"text"!==e.responseType?p.response:p.responseText,status:p.status,statusText:p.statusText,headers:r,config:e,request:p};i(t,n,o),p=null}},p.onabort=function(){p&&(n(c("Request aborted",e,"ECONNABORTED",p)),p=null)},p.onerror=function(){n(c("Network Error",e,null,p)),p=null},p.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(c(t,e,"ECONNABORTED",p)),p=null},r.isStandardBrowserEnv()){var y=(e.withCredentials||l(v))&&e.xsrfCookieName?o.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),i=n(875),o=n(29),a=n(941);function s(e){var t=new o(e),n=i(o.prototype.request,t);return r.extend(n,o.prototype,t),r.extend(n,t),n}var u=s(n(141));u.Axios=o,u.create=function(e){return s(a(u.defaults,e))},u.Cancel=n(132),u.CancelToken=n(603),u.isCancel=n(475),u.all=function(e){return Promise.all(e)},u.spread=n(739),u.isAxiosError=n(835),e.exports=u,e.exports.default=u},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 i(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))}))}i.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},i.source=function(){var e;return{token:new i((function(t){e=t})),cancel:e}},e.exports=i},475:e=>{"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},29:(e,t,n)=>{"use strict";var r=n(485),i=n(581),o=n(96),a=n(9),s=n(941);function u(e){this.defaults=e,this.interceptors={request:new o,response:new o}}u.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=s(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},u.prototype.getUri=function(e){return e=s(this.defaults,e),i(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},r.forEach(["delete","get","head","options"],(function(e){u.prototype[e]=function(t,n){return this.request(s(n||{},{method:e,url:t,data:(n||{}).data}))}})),r.forEach(["post","put","patch"],(function(e){u.prototype[e]=function(t,n,r){return this.request(s(r||{},{method:e,url:t,data:n}))}})),e.exports=u},96:(e,t,n)=>{"use strict";var r=n(485);function i(){this.handlers=[]}i.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},i.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},i.prototype.forEach=function(e){r.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=i},574:(e,t,n)=>{"use strict";var r=n(642),i=n(288);e.exports=function(e,t){return e&&!r(t)?i(e,t):t}},524:(e,t,n)=>{"use strict";var r=n(953);e.exports=function(e,t,n,i,o){var a=new Error(e);return r(a,t,n,i,o)}},9:(e,t,n)=>{"use strict";var r=n(485),i=n(212),o=n(475),a=n(141);function s(e){e.cancelToken&&e.cancelToken.throwIfRequested()}e.exports=function(e){return s(e),e.headers=e.headers||{},e.data=i(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 s(e),t.data=i(t.data,t.headers,e.transformResponse),t}),(function(t){return o(t)||(s(e),t&&t.response&&(t.response.data=i(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},953:e=>{"use strict";e.exports=function(e,t,n,r,i){return e.config=t,n&&(e.code=n),e.request=r,e.response=i,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={},i=["url","method","data"],o=["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"],s=["validateStatus"];function u(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 l(i){r.isUndefined(t[i])?r.isUndefined(e[i])||(n[i]=u(void 0,e[i])):n[i]=u(e[i],t[i])}r.forEach(i,(function(e){r.isUndefined(t[e])||(n[e]=u(void 0,t[e]))})),r.forEach(o,l),r.forEach(a,(function(i){r.isUndefined(t[i])?r.isUndefined(e[i])||(n[i]=u(void 0,e[i])):n[i]=u(void 0,t[i])})),r.forEach(s,(function(r){r in t?n[r]=u(e[r],t[r]):r in e&&(n[r]=u(void 0,e[r]))}));var c=i.concat(o).concat(a).concat(s),f=Object.keys(e).concat(Object.keys(t)).filter((function(e){return-1===c.indexOf(e)}));return r.forEach(f,l),n}},570:(e,t,n)=>{"use strict";var r=n(524);e.exports=function(e,t,n){var i=n.config.validateStatus;n.status&&i&&!i(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),i=n(485),o=n(446),a={"Content-Type":"application/x-www-form-urlencoded"};function s(e,t){!i.isUndefined(e)&&i.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var u,l={adapter:(("undefined"!=typeof XMLHttpRequest||void 0!==r&&"[object process]"===Object.prototype.toString.call(r))&&(u=n(387)),u),transformRequest:[function(e,t){return o(t,"Accept"),o(t,"Content-Type"),i.isFormData(e)||i.isArrayBuffer(e)||i.isBuffer(e)||i.isStream(e)||i.isFile(e)||i.isBlob(e)?e:i.isArrayBufferView(e)?e.buffer:i.isURLSearchParams(e)?(s(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):i.isObject(e)?(s(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}};l.headers={common:{Accept:"application/json, text/plain, */*"}},i.forEach(["delete","get","head"],(function(e){l.headers[e]={}})),i.forEach(["post","put","patch"],(function(e){l.headers[e]=i.merge(a)})),e.exports=l},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 i(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 o;if(n)o=n(t);else if(r.isURLSearchParams(t))o=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(i(t)+"="+i(e))})))})),o=a.join("&")}if(o){var s=e.indexOf("#");-1!==s&&(e=e.slice(0,s)),e+=(-1===e.indexOf("?")?"?":"&")+o}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,i,o,a){var s=[];s.push(e+"="+encodeURIComponent(t)),r.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),r.isString(i)&&s.push("path="+i),r.isString(o)&&s.push("domain="+o),!0===a&&s.push("secure"),document.cookie=s.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 i(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=i(window.location.href),function(t){var n=r.isString(t)?i(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),i=["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,o,a={};return e?(r.forEach(e.split("\n"),(function(e){if(o=e.indexOf(":"),t=r.trim(e.substr(0,o)).toLowerCase(),n=r.trim(e.substr(o+1)),t){if(a[t]&&i.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),i=Object.prototype.toString;function o(e){return"[object Array]"===i.call(e)}function a(e){return void 0===e}function s(e){return null!==e&&"object"==typeof e}function u(e){if("[object Object]"!==i.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function l(e){return"[object Function]"===i.call(e)}function c(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),o(e))for(var n=0,r=e.length;n<r;n++)t.call(null,e[n],n,e);else for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.call(null,e[i],i,e)}e.exports={isArray:o,isArrayBuffer:function(e){return"[object ArrayBuffer]"===i.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:s,isPlainObject:u,isUndefined:a,isDate:function(e){return"[object Date]"===i.call(e)},isFile:function(e){return"[object File]"===i.call(e)},isBlob:function(e){return"[object Blob]"===i.call(e)},isFunction:l,isStream:function(e){return s(e)&&l(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:c,merge:function e(){var t={};function n(n,r){u(t[r])&&u(n)?t[r]=e(t[r],n):u(n)?t[r]=e({},n):o(n)?t[r]=n.slice():t[r]=n}for(var r=0,i=arguments.length;r<i;r++)c(arguments[r],n);return t},extend:function(e,t,n){return c(t,(function(t,i){e[i]=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}}},394:(e,t,n)=>{"use strict";const r=wp.element;var i=n(804),o=n.n(i);function a(e){let t;const n=new Set,r=(e,r)=>{const i="function"==typeof e?e(t):e;if(i!==t){const e=t;t=r?i:Object.assign({},t,i),n.forEach((n=>n(t,e)))}},i=()=>t,o={setState:r,getState:i,subscribe:(e,r,o)=>r||o?((e,r=i,o=Object.is)=>{let a=r(t);function s(){const n=r(t);if(!o(a,n)){const t=a;e(a=n,t)}}return n.add(s),()=>n.delete(s)})(e,r,o):(n.add(e),()=>n.delete(e)),destroy:()=>n.clear()};return t=e(r,i,o),o}const s="undefined"==typeof window||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent)?i.useEffect:i.useLayoutEffect;const u=function(e){const t="function"==typeof e?a(e):e,n=(e=t.getState,n=Object.is)=>{const[,r]=(0,i.useReducer)((e=>e+1),0),o=t.getState(),a=(0,i.useRef)(o),u=(0,i.useRef)(e),l=(0,i.useRef)(n),c=(0,i.useRef)(!1),f=(0,i.useRef)();let d;void 0===f.current&&(f.current=e(o));let p=!1;(a.current!==o||u.current!==e||l.current!==n||c.current)&&(d=e(o),p=!n(f.current,d)),s((()=>{p&&(f.current=d),a.current=o,u.current=e,l.current=n,c.current=!1}));const h=(0,i.useRef)(o);return s((()=>{const e=()=>{try{const e=t.getState(),n=u.current(e);l.current(f.current,n)||(a.current=e,f.current=n,r())}catch(e){c.current=!0,r()}},n=t.subscribe(e);return t.getState()!==h.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");const e=[n,t];return{next(){const t=e.length<=0;return{value:e.shift(),done:t}}}},n};var l="pattern",c=12;function f(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,o=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}(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],i=n[1],o=n[2];return t(r,i,p(void 0===o?[]:o))}))}function h(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?h(Object(n),!0).forEach((function(t){v(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):h(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function v(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 x(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 x(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 x(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 x(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=u((function(e,t){return{templates:[],fetchToken:null,activeTemplate:{},activeTemplateBlocks:{},taxonomyDefaultState:{},searchParams:{taxonomies:{},type:l,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}),{}),i={};i.taxonomies=Object.assign({},r,t().searchParams.taxonomies),e({taxonomyDefaultState:r,searchParams:m({},Object.assign(t().searchParams,i))})},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=v({},"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:m({},Object.assign(t().searchParams,n))})}}})),b=u((function(e){return{open:!1,currentPage:"welcome",setOpen:function(t){e({open:t}),t&&g.getState().removeTemplates()}}})),w=n(135),j=n.n(w),k=Object.defineProperty,S=Object.getOwnPropertySymbols,_=Object.prototype.hasOwnProperty,E=Object.prototype.propertyIsEnumerable,N=(e,t,n)=>t in e?k(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,O=(e,t)=>{for(var n in t||(t={}))_.call(t,n)&&N(e,n,t[n]);if(S)for(var n of S(t))E.call(t,n)&&N(e,n,t[n]);return e};const C=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then:e=>C(e)(n),catch(e){return this}}}catch(e){return{then(e){return this},catch:t=>C(t)(e)}}},P=(e,t)=>(n,r,i)=>{const{name:o,getStorage:a=(()=>localStorage),serialize:s=JSON.stringify,deserialize:u=JSON.parse,blacklist:l,whitelist:c,onRehydrateStorage:f,version:d=0,migrate:p,merge:h=((e,t)=>O(O({},t),e))}=t||{};let m;try{m=a()}catch(e){}if(!m)return e(((...e)=>{console.warn(`Persist middleware: unable to update ${o}, the given storage is currently unavailable.`),n(...e)}),r,i);const v=C(s),y=()=>{const e=O({},r());let t;c&&Object.keys(e).forEach((t=>{!c.includes(t)&&delete e[t]})),l&&l.forEach((t=>delete e[t]));const n=v({state:e,version:d}).then((e=>m.setItem(o,e))).catch((e=>{t=e}));if(t)throw t;return n},x=i.setState;i.setState=(e,t)=>{x(e,t),y()};const g=e(((...e)=>{n(...e),y()}),r,i);let b;const w=(null==f?void 0:f(r()))||void 0;return C(m.getItem.bind(m))(o).then((e=>{if(e)return u(e)})).then((e=>{if(e){if("number"!=typeof e.version||e.version===d)return e.state;if(p)return p(e.state,e.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}})).then((e=>(b=h(e,g),n(b,!0),y()))).then((()=>{null==w||w(b,void 0)})).catch((e=>{null==w||w(void 0,e)})),b||g};var A=n(206),F=n.n(A)().create({baseURL:window.extendifySdkData.root,headers:{"X-WP-Nonce":window.extendifySdkData.nonce,"X-Requested-With":"XMLHttpRequest","X-Extendify":!0}});function T(e){return Object.prototype.hasOwnProperty.call(e,"data")?e.data:e}F.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}(T(e))}),(function(e){return function(e){if(e.response)return console.error(e.response),Promise.reject(T(e.response))}(e)})),F.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=W.getState().remainingImports(),e.data.entry_point=W.getState().entryPoint,e.data.total_imports=W.getState().imports),e}(e))}),(function(e){return e}));var L=function(){return F.get("user")},I=function(e){return F.get("user-meta",{params:{key:e}})},R=function(e,t){var n=new FormData;return n.append("email",e),n.append("key",t),F.post("login",n,{headers:{"Content-Type":"multipart/form-data"}})},D=function(e){var t=new FormData;return t.append("data",JSON.stringify(e)),F.post("user",t,{headers:{"Content-Type":"multipart/form-data"}})};function V(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function M(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){V(o,r,i,a,s,"next",e)}function s(e){V(o,r,i,a,s,"throw",e)}a(void 0)}))}}var H,B,U,q,Z={getItem:(B=M(j().mark((function e(){return j().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,L();case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)}))),function(){return B.apply(this,arguments)}),setItem:(H=M(j().mark((function e(t,n){return j().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,D(n);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)}))),function(e,t){return H.apply(this,arguments)})},W=u(P((function(e,t){return{apiKey:"",imports:0,uuid:"",email:"",allowedImports:0,entryPoint:"not-set",enabled:!0,hasClickedThroughWelcomePage:!1,canInstallPlugins:!1,canActivatePlugins:!1,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 Z}}));function z(){return(z=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 $(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}function G(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 K(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 G(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)?G(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 Y(e,t){if(e in t){for(var n=t[e],r=arguments.length,i=new Array(r>2?r-2:0),o=2;o<r;o++)i[o-2]=arguments[o];return"function"==typeof n?n.apply(void 0,i):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,Y),a}function X(e){var t=e.props,n=e.slot,r=e.defaultTag,i=e.features,o=e.visible,a=void 0===o||o,s=e.name;if(a)return J(t,n,r,s);var u=null!=i?i:U.None;if(u&U.Static){var l=t.static,c=void 0!==l&&l,f=$(t,["static"]);if(c)return J(f,n,r,s)}if(u&U.RenderStrategy){var d,p=t.unmount,h=void 0===p||p,m=$(t,["unmount"]);return Y(h?q.Unmount:q.Hidden,((d={})[q.Unmount]=function(){return null},d[q.Hidden]=function(){return J(z({},m,{hidden:!0,style:{display:"none"}}),n,r,s)},d))}return J(t,n,r,s)}function J(e,t,n,r){var o;void 0===t&&(t={});var a=ee(e,["unmount","static"]),s=a.as,u=void 0===s?n:s,l=a.children,c=a.refName,f=void 0===c?"ref":c,d=$(a,["as","children","refName"]),p=void 0!==e.ref?((o={})[f]=e.ref,o):{},h="function"==typeof l?l(t):l;if(d.className&&"function"==typeof d.className&&(d.className=d.className(t)),u===i.Fragment&&Object.keys(d).length>0){if(!(0,i.isValidElement)(h)||Array.isArray(h)&&h.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,i.cloneElement)(h,Object.assign({},function(e,t,n){for(var r,i=Object.assign({},e),o=function(){var n,o=r.value;void 0!==e[o]&&void 0!==t[o]&&Object.assign(i,((n={})[o]=function(n){n.defaultPrevented||e[o](n),n.defaultPrevented||t[o](n)},n))},a=K(n);!(r=a()).done;)o();return i}(function(e){var t=Object.assign({},e);for(var n in t)void 0===t[n]&&delete t[n];return t}(ee(d,["ref"])),h.props,["onClick"]),p))}return(0,i.createElement)(u,Object.assign({},ee(d,["ref"]),u!==i.Fragment&&p),h)}function Q(e){var t;return Object.assign((0,i.forwardRef)(e),{displayName:null!=(t=e.displayName)?t:e.name})}function ee(e,t){void 0===t&&(t=[]);for(var n,r=Object.assign({},e),i=K(t);!(n=i()).done;){var o=n.value;o in r&&delete r[o]}return r}!function(e){e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static"}(U||(U={})),function(e){e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden"}(q||(q={}));var te="undefined"!=typeof window?i.useLayoutEffect:i.useEffect,ne={serverHandoffComplete:!1};function re(){var e=(0,i.useState)(ne.serverHandoffComplete),t=e[0],n=e[1];return(0,i.useEffect)((function(){!0!==t&&n(!0)}),[t]),(0,i.useEffect)((function(){!1===ne.serverHandoffComplete&&(ne.serverHandoffComplete=!0)}),[]),t}var ie=0;function oe(){return++ie}function ae(){var e=re(),t=(0,i.useState)(e?oe:null),n=t[0],r=t[1];return te((function(){null===n&&r(oe())}),[n]),null!=n?""+n:void 0}function se(){var e=(0,i.useRef)(!1);return(0,i.useEffect)((function(){return e.current=!0,function(){e.current=!1}}),[]),e}var ue,le,ce=(0,i.createContext)(null);function fe(){return(0,i.useContext)(ce)}function de(e){var t=e.value,n=e.children;return o().createElement(ce.Provider,{value:t},n)}function pe(){var e=(0,i.useRef)(!0);return(0,i.useEffect)((function(){e.current=!1}),[]),e.current}function he(){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=K(e.splice(0));!(t=n()).done;){var r=t.value;r()}}};return t}function me(e){for(var t,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];e&&r.length>0&&(t=e.classList).add.apply(t,r)}function ve(e){for(var t,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];e&&r.length>0&&(t=e.classList).remove.apply(t,r)}function ye(e,t,n,r,i,o){var a=he(),s=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 ve.apply(void 0,[e].concat(i)),me.apply(void 0,[e].concat(t,n)),a.nextFrame((function(){ve.apply(void 0,[e].concat(n)),me.apply(void 0,[e].concat(r)),a.add(function(e,t){var n=he();if(!e)return n.dispose;var r=getComputedStyle(e),i=[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})),o=i[0],a=i[1];return 0!==o?n.setTimeout((function(){t(le.Finished)}),o+a):t(le.Finished),n.add((function(){return t(le.Cancelled)})),n.dispose}(e,(function(n){return ve.apply(void 0,[e].concat(r,t)),me.apply(void 0,[e].concat(i)),s(n)})))})),a.add((function(){return ve.apply(void 0,[e].concat(t,n,r,i))})),a.add((function(){return s(le.Cancelled)})),a.dispose}function xe(e){return void 0===e&&(e=""),(0,i.useMemo)((function(){return e.split(" ").filter((function(e){return e.trim().length>1}))}),[e])}ce.displayName="OpenClosedContext",function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(ue||(ue={})),function(e){e.Finished="finished",e.Cancelled="cancelled"}(le||(le={}));var ge,be=(0,i.createContext)(null);be.displayName="TransitionContext",function(e){e.Visible="visible",e.Hidden="hidden"}(ge||(ge={}));var we=(0,i.createContext)(null);function je(e){return"children"in e?je(e.children):e.current.filter((function(e){return e.state===ge.Visible})).length>0}function ke(e){var t=(0,i.useRef)(e),n=(0,i.useRef)([]),r=se();(0,i.useEffect)((function(){t.current=e}),[e]);var o=(0,i.useCallback)((function(e,i){var o;void 0===i&&(i=q.Hidden);var a=n.current.findIndex((function(t){return t.id===e}));-1!==a&&(Y(i,((o={})[q.Unmount]=function(){n.current.splice(a,1)},o[q.Hidden]=function(){n.current[a].state=ge.Hidden},o)),!je(n)&&r.current&&(null==t.current||t.current()))}),[t,r,n]),a=(0,i.useCallback)((function(e){var t=n.current.find((function(t){return t.id===e}));return t?t.state!==ge.Visible&&(t.state=ge.Visible):n.current.push({id:e,state:ge.Visible}),function(){return o(e,q.Unmount)}}),[n,o]);return(0,i.useMemo)((function(){return{children:n,register:a,unregister:o}}),[a,o,n])}function Se(){}we.displayName="NestingContext";var _e=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function Ee(e){for(var t,n={},r=K(_e);!(t=r()).done;){var i,o=t.value;n[o]=null!=(i=e[o])?i:Se}return n}var Ne,Oe=U.RenderStrategy;function Ce(e){var t,n=e.beforeEnter,r=e.afterEnter,a=e.beforeLeave,s=e.afterLeave,u=e.enter,l=e.enterFrom,c=e.enterTo,f=e.entered,d=e.leave,p=e.leaveFrom,h=e.leaveTo,m=$(e,["beforeEnter","afterEnter","beforeLeave","afterLeave","enter","enterFrom","enterTo","entered","leave","leaveFrom","leaveTo"]),v=(0,i.useRef)(null),y=(0,i.useState)(ge.Visible),x=y[0],g=y[1],b=m.unmount?q.Unmount:q.Hidden,w=function(){var e=(0,i.useContext)(be);if(null===e)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}(),j=w.show,k=w.appear,S=function(){var e=(0,i.useContext)(we);if(null===e)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}(),_=S.register,E=S.unregister,N=pe(),O=ae(),C=(0,i.useRef)(!1),P=ke((function(){C.current||(g(ge.Hidden),E(O),V.current.afterLeave())}));te((function(){if(O)return _(O)}),[_,O]),te((function(){var e;b===q.Hidden&&O&&(j&&x!==ge.Visible?g(ge.Visible):Y(x,((e={})[ge.Hidden]=function(){return E(O)},e[ge.Visible]=function(){return _(O)},e)))}),[x,O,_,E,j,b]);var A=xe(u),F=xe(l),T=xe(c),L=xe(f),I=xe(d),R=xe(p),D=xe(h),V=function(e){var t=(0,i.useRef)(Ee(e));return(0,i.useEffect)((function(){t.current=Ee(e)}),[e]),t}({beforeEnter:n,afterEnter:r,beforeLeave:a,afterLeave:s}),M=re();(0,i.useEffect)((function(){if(M&&x===ge.Visible&&null===v.current)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")}),[v,x,M]);var H=N&&!k;te((function(){var e=v.current;if(e&&!H)return C.current=!0,j&&V.current.beforeEnter(),j||V.current.beforeLeave(),j?ye(e,A,F,T,L,(function(e){C.current=!1,e===le.Finished&&V.current.afterEnter()})):ye(e,I,R,D,L,(function(e){C.current=!1,e===le.Finished&&(je(P)||(g(ge.Hidden),E(O),V.current.afterLeave()))}))}),[V,O,C,E,P,v,H,j,A,F,T,I,R,D]);var B={ref:v},U=m;return o().createElement(we.Provider,{value:P},o().createElement(de,{value:Y(x,(t={},t[ge.Visible]=ue.Open,t[ge.Hidden]=ue.Closed,t))},X({props:z({},U,B),defaultTag:"div",features:Oe,visible:x===ge.Visible,name:"Transition.Child"})))}function Pe(e){var t,n=e.show,r=e.appear,a=void 0!==r&&r,s=e.unmount,u=$(e,["show","appear","unmount"]),l=fe();void 0===n&&null!==l&&(n=Y(l,((t={})[ue.Open]=!0,t[ue.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 c=(0,i.useState)(n?ge.Visible:ge.Hidden),f=c[0],d=c[1],p=ke((function(){d(ge.Hidden)})),h=pe(),m=(0,i.useMemo)((function(){return{show:n,appear:a||!h}}),[n,a,h]);(0,i.useEffect)((function(){n?d(ge.Visible):je(p)||d(ge.Hidden)}),[n,p]);var v={unmount:s};return o().createElement(we.Provider,{value:p},o().createElement(be.Provider,{value:m},X({props:z({},v,{as:i.Fragment,children:o().createElement(Ce,Object.assign({},v,u))}),defaultTag:i.Fragment,features:Oe,visible:f===ge.Visible,name:"Transition"})))}function Ae(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=(0,i.useRef)(t);return(0,i.useEffect)((function(){r.current=t}),[t]),(0,i.useCallback)((function(e){for(var t,n=K(r.current);!(t=n()).done;){var i=t.value;null!=i&&("function"==typeof i?i(e):i.current=e)}}),[r])}function Fe(e){for(var t,n,r=e.parentElement,i=null;r&&!(r instanceof HTMLFieldSetElement);)r instanceof HTMLLegendElement&&(i=r),r=r.parentElement;var o=null!=(t=""===(null==(n=r)?void 0:n.getAttribute("disabled")))&&t;return(!o||!function(e){if(!e)return!1;var t=e.previousElementSibling;for(;null!==t;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}(i))&&o}function Te(e,t,n){var r=(0,i.useRef)(t);r.current=t,(0,i.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])}Pe.Child=function(e){var t=null!==(0,i.useContext)(be),n=null!==fe();return!t&&n?o().createElement(Pe,Object.assign({},e)):o().createElement(Ce,Object.assign({},e))},Pe.Root=Pe,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"}(Ne||(Ne={}));var Le,Ie,Re,De,Ve,Me=["[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){null==e||e.focus({preventScroll:!0})}function Be(e,t){var n=Array.isArray(e)?e:function(e){return void 0===e&&(e=document.body),null==e?[]:Array.from(e.querySelectorAll(Me))}(e),r=document.activeElement,i=function(){if(t&(Le.First|Le.Next))return Re.Next;if(t&(Le.Previous|Le.Last))return Re.Previous;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")}(),o=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}:{},s=0,u=n.length,l=void 0;do{var c;if(s>=u||s+u<=0)return Ie.Error;var f=o+s;if(t&Le.WrapAround)f=(f+u)%u;else{if(f<0)return Ie.Underflow;if(f>=u)return Ie.Overflow}null==(c=l=n[f])||c.focus(a),s+=i}while(l!==document.activeElement);return l.hasAttribute("tabindex")||l.setAttribute("tabindex","0"),Ie.Success}function Ue(e,t,n){void 0===t&&(t=Ve.All);var r=void 0===n?{}:n,o=r.initialFocus,a=r.containers,s=(0,i.useRef)("undefined"!=typeof window?document.activeElement:null),u=(0,i.useRef)(null),l=se(),c=Boolean(t&Ve.RestoreFocus),f=Boolean(t&Ve.InitialFocus);(0,i.useEffect)((function(){c&&(s.current=document.activeElement)}),[c]),(0,i.useEffect)((function(){if(c)return function(){He(s.current),s.current=null}}),[c]),(0,i.useEffect)((function(){if(f&&e.current){var t=document.activeElement;if(null==o?void 0:o.current){if((null==o?void 0:o.current)===t)return void(u.current=t)}else if(e.current.contains(t))return void(u.current=t);if(null==o?void 0:o.current)He(o.current);else if(Be(e.current,Le.First)===Ie.Error)throw new Error("There are no focusable elements inside the <FocusTrap />");u.current=document.activeElement}}),[e,o,f]),Te("keydown",(function(n){t&Ve.TabLock&&e.current&&n.key===Ne.Tab&&(n.preventDefault(),Be(e.current,(n.shiftKey?Le.Previous:Le.Next)|Le.WrapAround)===Ie.Success&&(u.current=document.activeElement))})),Te("focus",(function(n){if(t&Ve.FocusLock){var r=new Set(null==a?void 0:a.current);if(r.add(e),r.size){var i=u.current;if(i&&l.current){var o=n.target;o&&o instanceof HTMLElement?!function(e,t){for(var n,r=K(e);!(n=r()).done;){var i;if(null==(i=n.value.current)?void 0:i.contains(t))return!0}return!1}(r,o)?(n.preventDefault(),n.stopPropagation(),He(i)):(u.current=o,He(o)):He(u.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"}(Ie||(Ie={})),function(e){e[e.Previous=-1]="Previous",e[e.Next=1]="Next"}(Re||(Re={})),function(e){e[e.Strict=0]="Strict",e[e.Loose=1]="Loose"}(De||(De={})),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"}(Ve||(Ve={}));var qe=new Set,Ze=new Map;function We(e){e.setAttribute("aria-hidden","true"),e.inert=!0}function ze(e){var t=Ze.get(e);t&&(null===t["aria-hidden"]?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",t["aria-hidden"]),e.inert=t.inert)}var $e=(0,i.createContext)(!1);function Ge(e){return o().createElement($e.Provider,{value:e.force},e.children)}const Ke=ReactDOM;function Ye(){var e=(0,i.useContext)($e),t=(0,i.useContext)(et),n=(0,i.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],o=n[1];return(0,i.useEffect)((function(){e||null!==t&&o(t.current)}),[t,o,e]),r}var Xe=i.Fragment;function Je(e){var t=e,n=Ye(),r=(0,i.useState)((function(){return"undefined"==typeof window?null:document.createElement("div")}))[0],o=re();return te((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]),o&&n&&r?(0,Ke.createPortal)(X({props:t,defaultTag:Xe,name:"Portal"}),r):null}var Qe=i.Fragment,et=(0,i.createContext)(null);Je.Group=function(e){var t=e.target,n=$(e,["target"]);return o().createElement(et.Provider,{value:t},X({props:n,defaultTag:Qe,name:"Popover.Group"}))};var tt=(0,i.createContext)(null);function nt(){var e=(0,i.useContext)(tt);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,nt),t}return e}var rt,it,ot,at,st=(0,i.createContext)((function(){}));function ut(e){var t=e.children,n=e.onUpdate,r=e.type,a=e.element,s=(0,i.useContext)(st),u=(0,i.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),s.apply(void 0,t)}),[s,n]);return te((function(){return u(rt.Add,r,a),function(){return u(rt.Remove,r,a)}}),[u,r,a]),o().createElement(st.Provider,{value:u},t)}st.displayName="StackContext",function(e){e[e.Add=0]="Add",e[e.Remove=1]="Remove"}(rt||(rt={})),function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(ot||(ot={})),function(e){e[e.SetTitleId=0]="SetTitleId"}(at||(at={}));var lt=((it={})[at.SetTitleId]=function(e,t){return e.titleId===t.id?e:z({},e,{titleId:t.id})},it),ct=(0,i.createContext)(null);function ft(e){var t=(0,i.useContext)(ct);if(null===t){var n=new Error("<"+e+" /> is missing a parent <"+vt.displayName+" /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(n,ft),n}return t}function dt(e,t){return Y(t.type,lt,e,t)}ct.displayName="DialogContext";var pt=U.RenderStrategy|U.Static,ht=Q((function(e,t){var n,r=e.open,a=e.onClose,s=e.initialFocus,u=$(e,["open","onClose","initialFocus"]),l=(0,i.useState)(0),c=l[0],f=l[1],d=fe();void 0===r&&null!==d&&(r=Y(d,((n={})[ue.Open]=!0,n[ue.Closed]=!1,n)));var p=(0,i.useRef)(new Set),h=(0,i.useRef)(null),m=Ae(h,t),v=e.hasOwnProperty("open")||null!==d,y=e.hasOwnProperty("onClose");if(!v&&!y)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!v)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 x=r?ot.Open:ot.Closed,g=null!==d?d===ue.Open:x===ot.Open,b=(0,i.useReducer)(dt,{titleId:null,descriptionId:null}),w=b[0],j=b[1],k=(0,i.useCallback)((function(){return a(!1)}),[a]),S=(0,i.useCallback)((function(e){return j({type:at.SetTitleId,id:e})}),[j]),_=re()&&x===ot.Open,E=c>1,N=null!==(0,i.useContext)(ct);Ue(h,_?Y(E?"parent":"leaf",{parent:Ve.RestoreFocus,leaf:Ve.All}):Ve.None,{initialFocus:s,containers:p}),function(e,t){void 0===t&&(t=!0),te((function(){if(t&&e.current){var n=e.current;qe.add(n);for(var r,i=K(Ze.keys());!(r=i()).done;){var o=r.value;o.contains(n)&&(ze(o),Ze.delete(o))}return document.querySelectorAll("body > *").forEach((function(e){if(e instanceof HTMLElement){for(var t,n=K(qe);!(t=n()).done;){var r=t.value;if(e.contains(r))return}1===qe.size&&(Ze.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),We(e))}})),function(){if(qe.delete(n),qe.size>0)document.querySelectorAll("body > *").forEach((function(e){if(e instanceof HTMLElement&&!Ze.has(e)){for(var t,n=K(qe);!(t=n()).done;){var r=t.value;if(e.contains(r))return}Ze.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),We(e)}}));else for(var e,t=K(Ze.keys());!(e=t()).done;){var r=e.value;ze(r),Ze.delete(r)}}}}),[t])}(h,!!E&&_),Te("mousedown",(function(e){var t,n=e.target;x===ot.Open&&(E||(null==(t=h.current)?void 0:t.contains(n))||k())})),(0,i.useEffect)((function(){if(x===ot.Open&&!N){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}}}),[x,N]),(0,i.useEffect)((function(){if(x===ot.Open&&h.current){var e=new IntersectionObserver((function(e){for(var t,n=K(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(h.current),function(){return e.disconnect()}}}),[x,h,k]);var O=function(){var e=(0,i.useState)([]),t=e[0],n=e[1];return[t.length>0?t.join(" "):void 0,(0,i.useMemo)((function(){return function(e){var t=(0,i.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,i.useMemo)((function(){return{register:t,slot:e.slot,name:e.name,props:e.props}}),[t,e.slot,e.name,e.props]);return o().createElement(tt.Provider,{value:r},e.children)}}),[n])]}(),C=O[0],P=O[1],A="headlessui-dialog-"+ae(),F=(0,i.useMemo)((function(){return[{dialogState:x,close:k,setTitleId:S},w]}),[x,w,k,S]),T=(0,i.useMemo)((function(){return{open:x===ot.Open}}),[x]),L={ref:m,id:A,role:"dialog","aria-modal":x===ot.Open||void 0,"aria-labelledby":w.titleId,"aria-describedby":C,onClick:function(e){e.stopPropagation()},onKeyDown:function(e){e.key===Ne.Escape&&x===ot.Open&&(E||(e.preventDefault(),e.stopPropagation(),k()))}},I=u;return o().createElement(ut,{type:"Dialog",element:h,onUpdate:(0,i.useCallback)((function(e,t,n){var r;"Dialog"===t&&Y(e,((r={})[rt.Add]=function(){p.current.add(n),f((function(e){return e+1}))},r[rt.Remove]=function(){p.current.add(n),f((function(e){return e-1}))},r))}),[])},o().createElement(Ge,{force:!0},o().createElement(Je,null,o().createElement(ct.Provider,{value:F},o().createElement(Je.Group,{target:h},o().createElement(Ge,{force:!1},o().createElement(P,{slot:T,name:"Dialog.Description"},X({props:z({},I,L),slot:T,defaultTag:"div",features:pt,visible:g,name:"Dialog"}))))))))})),mt=Q((function e(t,n){var r=ft([vt.displayName,e.name].join("."))[0],o=r.dialogState,a=r.close,s=Ae(n),u="headlessui-dialog-overlay-"+ae(),l=(0,i.useCallback)((function(e){if(Fe(e.currentTarget))return e.preventDefault();e.preventDefault(),e.stopPropagation(),a()}),[a]),c=(0,i.useMemo)((function(){return{open:o===ot.Open}}),[o]);return X({props:z({},t,{ref:s,id:u,"aria-hidden":!0,onClick:l}),slot:c,defaultTag:"div",name:"Dialog.Overlay"})}));var vt=Object.assign(ht,{Overlay:mt,Title:function e(t){var n=ft([vt.displayName,e.name].join("."))[0],r=n.dialogState,o=n.setTitleId,a="headlessui-dialog-title-"+ae();(0,i.useEffect)((function(){return o(a),function(){return o(null)}}),[a,o]);var s=(0,i.useMemo)((function(){return{open:r===ot.Open}}),[r]);return X({props:z({},t,{id:a}),slot:s,defaultTag:"h2",name:"Dialog.Title"})},Description:function(e){var t=nt(),n="headlessui-description-"+ae();te((function(){return t.register(n)}),[n,t.register]);var r=e,i=z({},t.props,{id:n});return X({props:z({},r,i),slot:t.slot||{},defaultTag:"p",name:t.name||"Description"})}});const yt=wp.i18n;var xt=n(246);function gt(e){var t=e.className,n=e.hideLibrary,r=W((function(e){return e.remainingImports})),i=W((function(e){return e.apiKey})),o=W((function(e){return e.allowedImports}));return(0,xt.jsx)("div",{className:t,children:(0,xt.jsxs)("div",{className:"flex justify-between items-center px-6 sm:px-12 h-full",children:[(0,xt.jsxs)("div",{className:"flex space-x-12 h-full",children:[(0,xt.jsxs)("div",{className:"font-bold flex items-center space-x-1.5 lg:w-72",children:[(0,xt.jsxs)("svg",{className:"",width:"30",height:"30",viewBox:"0 0 103 103",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,xt.jsx)("rect",{y:"25.75",width:"70.8125",height:"77.25",fill:"#000000"}),(0,xt.jsx)("rect",{x:"45.0625",width:"57.9375",height:"57.9375",fill:"#37C2A2"})]}),(0,xt.jsx)("span",{className:"text-sm transform translate-y-0.5 whitespace-nowrap",children:(0,yt.__)("Extendify Library","extendify-sdk")})]}),!i.length&&(0,xt.jsx)(xt.Fragment,{children:(0,xt.jsxs)("div",{className:"items-center ml-8 h-full hidden md:flex",children:[(0,xt.jsxs)("div",{className:"h-full flex items-center px-6 border-l border-r border-gray-300 bg-extendify-lightest",children:[(0,xt.jsx)("a",{className:"button-extendify-main inline lg:hidden",target:"_blank",href:"https://extendify.com/pricing?utm_source=".concat(window.extendifySdkData.source,"&utm_medium=library&utm_campaign=sign_up&utm_content=main"),rel:"noreferrer",children:(0,yt.__)("Sign up","extendify-sdk")}),(0,xt.jsx)("a",{className:"button-extendify-main hidden lg:block",target:"_blank",href:"https://extendify.com/pricing?utm_source=".concat(window.extendifySdkData.source,"&utm_medium=library&utm_campaign=sign_up&utm_content=main"),rel:"noreferrer",children:(0,yt.__)("Sign up today to get unlimited access","extendify-sdk")})]}),(0,xt.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,yt.sprintf)((0,yt.__)("Imports left: %s / %s"),r(),Number(o))})]})})]}),(0,xt.jsx)("div",{className:"space-x-2 transform sm:translate-x-8",children:(0,xt.jsxs)("button",{type:"button",className:"components-button has-icon",onClick:function(){return n()},children:[(0,xt.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,xt.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,xt.jsx)("span",{className:"sr-only",children:(0,yt.__)("Close library","extendify-sdk")})]})})]})})}const bt=wp.blockEditor,wt=lodash;var jt=function(){return F.get("taxonomies")};const kt=wp.components;var St=n(42),_t=n.n(St);function Et(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Nt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,o=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Ot(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 Ot(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 Ot(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 Ct(e){var t=Nt(e.taxonomy,2),n=t[0],i=t[1],o=e.open,a=g((function(e){return e.updateTaxonomies})),s=g((function(e){return e.resetTaxonomies})),u=g((function(e){return e.searchParams})),l=Nt((0,r.useState)({}),2),c=l[0],f=l[1],d=Nt((0,r.useState)({}),2),p=d[0],h=d[1],m=(0,r.useRef)(),v=(0,r.useRef)(),y=(0,r.useRef)(),x=(0,r.useRef)(!0),b=function(e){var t;return(null==u?void 0:u.taxonomies[n])===e.term||(null===(t=e.children)||void 0===t?void 0:t.filter((function(e){return e.term===(null==u?void 0:u.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(u.type)})).length:null==e||null===(t=e.type)||void 0===t?void 0:t.includes(u.type)};if((0,r.useEffect)((function(){x.current?x.current=!1:(f({}),s())}),[u.type,s]),(0,r.useEffect)((function(){Object.keys(c).length?setTimeout((function(){requestAnimationFrame((function(){h(m.current.clientHeight),y.current.focus()}))}),200):h("auto")}),[c]),!Object.keys(i).length||!Object.values(i).filter((function(e){return w(e)})).length)return"";var j=n.replace("tax_","").replace("_"," ").replace(/\b\w/g,(function(e){return e.toUpperCase()}));return(0,xt.jsx)(kt.PanelBody,{title:j,initialOpen:o,children:(0,xt.jsx)(kt.PanelRow,{children:(0,xt.jsxs)("div",{className:"overflow-hidden w-full relative",style:{height:p},children:[(0,xt.jsxs)("ul",{className:_t()("p-1 m-0 w-full transform transition duration-200",{"-translate-x-full":Object.keys(c).length}),children:[(0,xt.jsx)("li",{className:"m-0",children:(0,xt.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:v,onClick:function(){a(Et({},n,"pattern"===u.type&&"tax_categories"===n?"Default":""))},children:(0,xt.jsx)("span",{className:_t()({"text-wp-theme-500":!u.taxonomies[n].length||"Default"===(null==u?void 0:u.taxonomies[n])}),children:"pattern"===u.type&&"tax_categories"===n?(0,yt.__)("Default","extendify-sdk"):(0,yt.__)("All","extendify-sdk")})})}),Object.values(i).filter((function(e){return w(e)})).sort((function(e,t){return e.term.localeCompare(t.term)})).map((function(e){return(0,xt.jsx)("li",{className:"m-0 w-full",children:(0,xt.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(Et({},n,e.term))},children:[(0,xt.jsx)("span",{className:_t()({"text-wp-theme-500":b(e)}),children:e.term}),Object.prototype.hasOwnProperty.call(e,"children")&&(0,xt.jsx)("span",{className:"text-black",children:(0,xt.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,xt.jsx)("path",{d:"M1 12.5L6 6.99998L1 1.5",strokeWidth:"1.5"})})})]})},e.term)}))]}),(0,xt.jsxs)("ul",{ref:m,className:_t()("p-1 m-0 w-full transform transition duration-200 absolute top-0 right-0",{"translate-x-full":!Object.keys(c).length}),children:[Object.values(c).length>0&&(0,xt.jsx)("li",{className:"m-0",children:(0,xt.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({}),v.current.focus()},children:[(0,xt.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,xt.jsx)("path",{d:"M1 12.5L6 6.99998L1 1.5",strokeWidth:"1.5"})}),(0,xt.jsx)("span",{children:c.term})]})}),Object.values(c).length&&Object.values(c.children).filter((function(e){return w(e)})).sort((function(e,t){return e.term.localeCompare(t.term)})).map((function(e){return(0,xt.jsx)("li",{className:"m-0 pl-6 w-full flex justify-between items-center",children:(0,xt.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(Et({},n,e.term))},children:(0,xt.jsx)("span",{className:_t()({"text-wp-theme-500":b(e)}),children:e.term})})},e.term)}))]})]})})})}function Pt(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function At(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){Pt(o,r,i,a,s,"next",e)}function s(e){Pt(o,r,i,a,s,"throw",e)}a(void 0)}))}}function Ft(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,o=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Tt(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 Tt(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 Tt(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 Lt(){var e,t=g((function(e){return e.updateSearchParams})),n=g((function(e){return e.setupDefaultTaxonomies})),i=g((function(e){return e.searchParams})),o=(0,wt.debounce)((function(e){return t({taxonomies:{},search:e})}),500),a=Ft((0,r.useState)(null!==(e=null==i?void 0:i.search)&&void 0!==e?e:""),2),s=a[0],u=a[1],l=Ft((0,r.useState)({}),2),c=l[0],f=l[1],d=(0,r.useCallback)(At(j().mark((function e(){var t;return j().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,jt();case 2:t=e.sent,t=Object.keys(t).filter((function(e){return e.startsWith("tax_")})).reduce((function(e,n){return e[n]=t[n],e}),{}),n(t),f(t);case 6:case"end":return e.stop()}}),e)}))),[n]);return(0,r.useEffect)((function(){d()}),[d]),(0,xt.jsxs)(xt.Fragment,{children:[(0,xt.jsx)("div",{className:"pt-1 -mt-1 mb-1 bg-white",children:(0,xt.jsx)(bt.__experimentalSearchForm,{placeholder:(0,yt.__)("What are you looking for?","extendify-sdk"),onChange:function(e){g.setState({nextPage:""}),u(e),o(e)},value:s,className:"sm:ml-px sm:mr-1 sm:mb-6 px-6 sm:p-0 sm:px-0",autoComplete:"off"})}),(0,xt.jsx)("div",{className:"flex-grow hidden overflow-y-auto pb-32 pr-2 pt-px sm:block",children:(0,xt.jsx)(kt.Panel,{children:Object.entries(c).map((function(e,t){return(0,xt.jsx)(Ct,{open:!1,taxonomy:e},t)}))})})]})}function It(e){var t=e.taxonomies,n=e.search,r=e.type,i=[],o=Object.entries(t).filter((function(e){return Boolean(e[1].length)})).map((function(e){return"".concat(e[0],' = "').concat(e[1],'"')})).join(", ");return o.length&&i.push(o),n.length&&i.push('OR(FIND(LOWER("'.concat(n,'"), LOWER(title))!= 0, FIND(LOWER("').concat(n,'"), LOWER({tax_categories})) != 0)')),r.length&&i.push('{type}="'.concat(r,'"')),i.length?"AND(".concat(i.join(", "),")").replace(/\r?\n|\r/g,""):""}function Rt(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}var Dt=0,Vt=function(e,t){return(n=j().mark((function n(){var r,i,o;return j().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return Dt++,i=A.CancelToken.source(),null!==(r=g.getState().fetchToken)&&void 0!==r&&r.cancel&&g.getState().fetchToken.cancel(),g.setState({fetchToken:i}),n.next=6,F.post("templates",{filterByFormula:It(e),pageSize:c,categories:e.taxonomies,search:e.search,type:e.type,offset:t,initial:1===Dt,request_count:Dt},{cancelToken:i.token});case 6:return o=n.sent,g.setState({fetchToken:null}),n.abrupt("return",o);case 9:case"end":return n.stop()}}),n)})),function(){var e=this,t=arguments;return new Promise((function(r,i){var o=n.apply(e,t);function a(e){Rt(o,r,i,a,s,"next",e)}function s(e){Rt(o,r,i,a,s,"throw",e)}a(void 0)}))})();var n},Mt=function(e){var t;return F.post("templates/".concat(e.id),{template_id:e.id,maybe_import:!0,type:e.fields.type,pageSize:c,template_name:null===(t=e.fields)||void 0===t?void 0:t.title})},Ht=function(e){var t;return F.post("templates/".concat(e.id),{template_id:e.id,single:!0,type:e.fields.type,pageSize:c,template_name:null===(t=e.fields)||void 0===t?void 0:t.title})},Bt=function(e){var t;return F.post("templates/".concat(e.id),{template_id:e.id,imported:!0,type:e.fields.type,pageSize:c,template_name:null===(t=e.fields)||void 0===t?void 0:t.title})};function Ut(){return(Ut=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 qt=new Map,Zt=new WeakMap,Wt=0;function zt(e){return Object.keys(e).sort().filter((function(t){return void 0!==e[t]})).map((function(t){return t+"_"+("root"===t?(n=e.root)?(Zt.has(n)||(Wt+=1,Zt.set(n,Wt.toString())),Zt.get(n)):"0":e[t]);var n})).toString()}function $t(e,t,n){if(void 0===n&&(n={}),!e)return function(){};var r=function(e){var t=zt(e),n=qt.get(t);if(!n){var r,i=new Map,o=new IntersectionObserver((function(t){t.forEach((function(t){var n,o=t.isIntersecting&&r.some((function(e){return t.intersectionRatio>=e}));e.trackVisibility&&void 0===t.isVisible&&(t.isVisible=o),null==(n=i.get(t.target))||n.forEach((function(e){e(o,t)}))}))}),e);r=o.thresholds||(Array.isArray(e.threshold)?e.threshold:[e.threshold||0]),n={id:t,observer:o,elements:i},qt.set(t,n)}return n}(n),i=r.id,o=r.observer,a=r.elements,s=a.get(e)||[];return a.has(e)||a.set(e,s),s.push(t),o.observe(e),function(){s.splice(s.indexOf(t),1),0===s.length&&(a.delete(e),o.unobserve(e)),0===a.size&&(o.disconnect(),qt.delete(i))}}function Gt(e){return"function"!=typeof e.children}var Kt=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(),Gt(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 o=r.prototype;return o.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())},o.componentWillUnmount=function(){this.unobserve(),this.node=null},o.observeNode=function(){if(this.node&&!this.props.skip){var e=this.props,t=e.threshold,n=e.root,r=e.rootMargin,i=e.trackVisibility,o=e.delay;this._unobserveCb=$t(this.node,this.handleChange,{threshold:t,root:n,rootMargin:r,trackVisibility:i,delay:o})}},o.unobserve=function(){this._unobserveCb&&(this._unobserveCb(),this._unobserveCb=null)},o.render=function(){if(!Gt(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,o=r.children,a=r.as,s=r.tag,u=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(r,["children","as","tag","triggerOnce","threshold","root","rootMargin","onChange","skip","trackVisibility","delay","initialInView"]);return(0,i.createElement)(a||s||"div",Ut({ref:this.handleNode},u),o)},r}(i.Component);Kt.displayName="InView",Kt.defaultProps={threshold:0,triggerOnce:!1,initialInView:!1};function Yt(e){return function(e){if(Array.isArray(e))return tn(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||en(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 Xt(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function Jt(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){Xt(o,r,i,a,s,"next",e)}function s(e){Xt(o,r,i,a,s,"throw",e)}a(void 0)}))}}function Qt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,o=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}(e,t)||en(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 en(e,t){if(e){if("string"==typeof e)return tn(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)?tn(e,t):void 0}}function tn(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 nn(e){var t=e.templates,n=g((function(e){return e.setActive})),o=g((function(e){return e.activeTemplate})),a=g((function(e){return e.appendTemplates})),s=Qt((0,r.useState)(""),2),u=s[0],l=s[1],c=Qt((0,r.useState)(!1),2),f=c[0],d=c[1],p=Qt((0,r.useState)([]),2),h=p[0],m=p[1],v=Qt(function(e){var t=void 0===e?{}:e,n=t.threshold,r=t.delay,o=t.trackVisibility,a=t.rootMargin,s=t.root,u=t.triggerOnce,l=t.skip,c=t.initialInView,f=(0,i.useRef)(),d=(0,i.useState)({inView:!!c}),p=d[0],h=d[1],m=(0,i.useCallback)((function(e){void 0!==f.current&&(f.current(),f.current=void 0),l||e&&(f.current=$t(e,(function(e,t){h({inView:e,entry:t}),t.isIntersecting&&u&&f.current&&(f.current(),f.current=void 0)}),{root:s,rootMargin:a,threshold:n,trackVisibility:o,delay:r}))}),[Array.isArray(n)?n.toString():n,s,a,u,l,o,r]);(0,i.useEffect)((function(){f.current||!p.entry||u||l||h({inView:!!c})}));var v=[m,p.inView,p.entry];return v.ref=v[0],v.inView=v[1],v.entry=v[2],v}(),2),y=v[0],x=v[1],b=g((function(e){return e.updateSearchParams})),w=g((function(e){return e.searchParams})),k=(0,r.useRef)(g.getState().nextPage),S=(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 S.current=e}),(function(e){return e.searchParams}))}),[]);var _=(0,r.useCallback)(Jt(j().mark((function e(){var t,n;return j().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return l(""),d(!1),e.next=4,Vt(S.current,k.current).catch((function(e){console.error(e),l(e&&e.message?e.message:(0,yt.__)("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&&l(null==n?void 0:n.error),null!=n&&n.records&&w===S.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(S.current.taxonomies).length&&(m([]),_())}),[_,S]),(0,r.useEffect)((function(){x&&_()}),[x,_]),u.length?(0,xt.jsxs)("div",{className:"text-left",children:[(0,xt.jsx)("h2",{className:"text-left",children:(0,yt.__)("Server error","extendify-sdk")}),(0,xt.jsx)("code",{className:"block max-w-xl p-4 mb-4",style:{minHeight:"10rem"},children:u}),(0,xt.jsx)(kt.Button,{isTertiary:!0,onClick:function(){m([]),b({taxonomies:{},search:""}),_()},children:(0,yt.__)("Press here to reload experience")})]}):f?null!=w&&w.search.length?(0,xt.jsx)("h2",{className:"text-left",children:(0,yt.sprintf)((0,yt.__)("No results for %s.","extendify-sdk"),null==w?void 0:w.search)}):(0,xt.jsx)("h2",{className:"text-left",children:(0,yt.__)("No results found.","extendify-sdk")}):t.length?(0,xt.jsxs)(xt.Fragment,{children:[(0,xt.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,i,a,s,u,l,c,f,d;return(0,xt.jsxs)("li",{className:"flex flex-col justify-between group overflow-hidden max-w-lg",children:[(0,xt.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,xt.jsx)("img",{role:"button",className:"max-w-full block m-auto object-cover",onLoad:function(){return m([].concat(Yt(h),[t]))},src:null!==(r=null==e||null===(i=e.fields)||void 0===i||null===(a=i.screenshot[0])||void 0===a||null===(s=a.thumbnails)||void 0===s||null===(u=s.large)||void 0===u?void 0:u.url)&&void 0!==r?r:null==e||null===(l=e.fields)||void 0===l||null===(c=l.screenshot[0])||void 0===c?void 0:c.url})}),(0,xt.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,xt.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,xt.jsxs)("div",{children:[(0,xt.jsx)("h4",{className:"m-0 font-bold",children:e.fields.display_title}),(0,xt.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,xt.jsx)(kt.Button,{isSecondary:!0,tabIndex:Object.keys(o).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,yt.__)("View","extendify-sdk")})]})]},e.id)}))}),g.getState().nextPage&&!!h.length&&h.length===t.length&&(0,xt.jsxs)(xt.Fragment,{children:[(0,xt.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,xt.jsx)("div",{className:"my-4",children:(0,xt.jsx)(kt.Spinner,{})})]})]}):(0,xt.jsx)("div",{className:"flex items-center justify-center w-full sm:mt-64",children:(0,xt.jsx)(kt.Spinner,{})})}var rn=function(){return F.get("plugins")},on=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=new FormData;return t.append("plugins",JSON.stringify(e)),F.post("plugins",t,{headers:{"Content-Type":"multipart/form-data"}})},an=function(){return F.get("active-plugins")};function sn(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function un(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){sn(o,r,i,a,s,"next",e)}function s(e){sn(o,r,i,a,s,"throw",e)}a(void 0)}))}}function ln(e){return cn.apply(this,arguments)}function cn(){return(cn=un(j().mark((function e(t){var n,r,i,o;return j().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((r=(r=null!==(n=(0,wt.get)(t,"fields.required_plugins"))&&void 0!==n?n:[]).filter((function(e){return"editorplus"!==e}))).length){e.next=4;break}return e.abrupt("return",!1);case 4:return e.t0=Object,e.next=7,rn();case 7:return e.t1=e.sent,i=e.t0.keys.call(e.t0,e.t1),o=!!r.length&&r.filter((function(e){return!i.some((function(t){return t.includes(e)}))})),e.abrupt("return",o.length);case 11:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function fn(e){return dn.apply(this,arguments)}function dn(){return(dn=un(j().mark((function e(t){var n,r,i,o;return j().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((r=(r=null!==(n=(0,wt.get)(t,"fields.required_plugins"))&&void 0!==n?n:[]).filter((function(e){return"editorplus"!==e}))).length){e.next=4;break}return e.abrupt("return",!1);case 4:return e.t0=Object,e.next=7,an();case 7:if(e.t1=e.sent,i=e.t0.values.call(e.t0,e.t1),!(o=!!r.length&&r.filter((function(e){return!i.some((function(t){return t.includes(e)}))})))){e.next=15;break}return e.next=13,ln(t);case 13:if(!e.sent){e.next=15;break}return e.abrupt("return",!1);case 15:return e.abrupt("return",o.length);case 16:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var pn=u(P((function(e){return{wantedTemplate:{},importOnLoad:!1,setWanted:function(t){return e({wantedTemplate:t})},removeWanted:function(){return e({wantedTemplate:{}})}}}),{name:"extendify-wanted-template"}));function hn(e){var t=e.msg;return(0,xt.jsxs)(kt.Modal,{style:{maxWidth:"500px"},title:(0,yt.__)("Error installing plugins","extendify-sdk"),isDismissible:!1,children:[(0,yt.__)("You have encountered an error that we cannot recover from. Please try again.","extendify-sdk"),(0,xt.jsx)("br",{}),(0,xt.jsx)(kt.Notice,{isDismissible:!1,status:"error",children:t}),(0,xt.jsx)(kt.Button,{isPrimary:!0,onClick:function(){return(0,r.render)((0,xt.jsx)(_n,{}),document.getElementById("extendify-root"))},children:(0,yt.__)("Go back","extendify-sdk")})]})}const mn=wp.data;function vn(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,o=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return yn(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 yn(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 yn(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(){var e=vn((0,r.useState)(!1),2),t=e[0],n=e[1],i=function(){location.reload()};return(0,(0,mn.select)("core/editor").isEditedPostDirty)()?(0,xt.jsxs)(kt.Modal,{title:(0,yt.__)("Reload required","extendify-sdk"),isDismissible:!1,children:[(0,xt.jsx)("p",{style:{maxWidth:"400px"},children:(0,yt.__)("Just one more thing! We need to reload the page to continue.","extendify-sdk")}),(0,xt.jsxs)(kt.ButtonGroup,{children:[(0,xt.jsx)(kt.Button,{isPrimary:!0,onClick:i,disabled:t,children:(0,yt.__)("Reload page","extendify-sdk")}),(0,xt.jsx)(kt.Button,{isSecondary:!0,onClick:function(){n(!0),(0,mn.dispatch)("core/editor").savePost(),n(!1)},isBusy:t,style:{margin:"0 4px"},children:(0,yt.__)("Save changes","extendify-sdk")})]})]}):(i(),null)}function gn(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,o=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return bn(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 bn(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 bn(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 wn(){var e,t=gn((0,r.useState)(""),2),n=t[0],i=t[1],o=pn((function(e){return e.wantedTemplate})),a=null==o||null===(e=o.fields)||void 0===e?void 0:e.required_plugins.filter((function(e){return"editorplus"!==e}));return on(a).then((function(){pn.setState({importOnLoad:!0}),(0,r.render)((0,xt.jsx)(xn,{}),document.getElementById("extendify-root"))})).catch((function(e){var t=e.message;i(t)})),n?(0,xt.jsx)(hn,{msg:n}):(0,xt.jsx)(kt.Modal,{title:(0,yt.__)("Installing plugins","extendify-sdk"),isDismissible:!1,children:(0,xt.jsx)(kt.Button,{style:{width:"100%"},disabled:!0,isPrimary:!0,isBusy:!0,onClick:function(){},children:(0,yt.__)("Installing...","extendify-sdk")})})}var jn=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";W.setState({entryPoint:e}),window.dispatchEvent(new CustomEvent("extendify-sdk::".concat(t,"-library"),{detail:e,bubbles:!0}))}(e,"open")};function kn(e){switch(e){case"editorplus":return"Editor Plus";case"ml-slider":return"MetaSlider"}return e}function Sn(){var e,t,n,i=pn((function(e){return e.wantedTemplate})),o=function(){return(0,r.render)((0,xt.jsx)(gr,{show:!0}),document.getElementById("extendify-root"))},a=(null==i||null===(e=i.fields)||void 0===e?void 0:e.required_plugins)||[];return(0,xt.jsxs)(kt.Modal,{title:(0,yt.__)("Plugins required","extendify-sdk"),closeButtonLabel:(0,yt.__)("Return to library","extendify-sdk"),onRequestClose:o,children:[(0,xt.jsx)("p",{style:{maxWidth:"400px"},children:(0,yt.sprintf)((0,yt.__)("In order to add this %s to your site, the following plugins are required to be installed and activated.","extendify-sdk"),null!==(t=null==i||null===(n=i.fields)||void 0===n?void 0:n.type)&&void 0!==t?t:"template")}),(0,xt.jsx)("ul",{children:a.filter((function(e){return"editorplus"!==e})).map((function(e){return(0,xt.jsx)("li",{children:kn(e)},e)}))}),(0,xt.jsx)("p",{style:{maxWidth:"400px",fontWeight:"bold"},children:(0,yt.__)("Please contact a site admin for assistance in adding these plugins to your site.","extendify-sdk")}),(0,xt.jsx)(kt.Button,{isPrimary:!0,onClick:o,style:{boxShadow:"none"},children:(0,yt.__)("Return to library","extendify-sdk")})]})}function _n(e){var t,n,i,o,a,s,u,l,c=pn((function(e){return e.wantedTemplate})),f=function(){e.forceOpen||(0,r.render)((0,xt.jsx)(gr,{show:!0}),document.getElementById("extendify-root"))},d=(null==c||null===(t=c.fields)||void 0===t?void 0:t.required_plugins)||[];return null!==(n=W.getState())&&void 0!==n&&n.canInstallPlugins?(0,xt.jsxs)(kt.Modal,{title:null!==(i=e.title)&&void 0!==i?i:(0,yt.__)("Install required plugins","extendify-sdk"),closeButtonLabel:(0,yt.__)("No thanks, take me back","extendify-sdk"),onRequestClose:f,children:[(0,xt.jsx)("p",{style:{maxWidth:"400px"},children:null!==(o=e.message)&&void 0!==o?o:(0,yt.__)((0,yt.sprintf)("There is just one more step. This %s requires the following to be automatically installed and activated:",null!==(a=null==c||null===(s=c.fields)||void 0===s?void 0:s.type)&&void 0!==a?a:"template"),"extendify-sdk")}),(null===(u=e.message)||void 0===u?void 0:u.length)>0||(0,xt.jsx)("ul",{children:d.filter((function(e){return"editorplus"!==e})).map((function(e){return(0,xt.jsx)("li",{children:kn(e)},e)}))}),(0,xt.jsxs)(kt.ButtonGroup,{children:[(0,xt.jsx)(kt.Button,{isPrimary:!0,onClick:function(){return(0,r.render)((0,xt.jsx)(wn,{}),document.getElementById("extendify-root"))},children:null!==(l=e.buttonLabel)&&void 0!==l?l:(0,yt.__)("Install Plugins","extendify-sdk")}),e.forceOpen||(0,xt.jsx)(kt.Button,{isTertiary:!0,onClick:f,style:{boxShadow:"none",margin:"0 4px"},children:(0,yt.__)("No thanks, take me back","extendify-sdk")})]})]}):(0,xt.jsx)(Sn,{})}function En(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function Nn(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){En(o,r,i,a,s,"next",e)}function s(e){En(o,r,i,a,s,"throw",e)}a(void 0)}))}}var On=function(){var e=Nn(j().mark((function e(t){return j().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ln(t);case 2:return e.t0=!e.sent,e.t1=function(){return Nn(j().mark((function e(){return j().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})))()},e.t2=function(){return Nn(j().mark((function e(){return j().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(){(0,r.render)((0,xt.jsx)(_n,{}),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 Cn(e){var t=e.msg;return(0,xt.jsxs)(kt.Modal,{style:{maxWidth:"500px"},title:(0,yt.__)("Error Activating plugins","extendify-sdk"),isDismissible:!1,children:[(0,yt.__)("You have encountered an error that we cannot recover from. Please try again.","extendify-sdk"),(0,xt.jsx)("br",{}),(0,xt.jsx)(kt.Notice,{isDismissible:!1,status:"error",children:t}),(0,xt.jsx)(kt.Button,{isPrimary:!0,onClick:function(){(0,r.render)((0,xt.jsx)(In,{}),document.getElementById("extendify-root"))},children:(0,yt.__)("Go back","extendify-sdk")})]})}function Pn(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function An(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){Pn(o,r,i,a,s,"next",e)}function s(e){Pn(o,r,i,a,s,"throw",e)}a(void 0)}))}}function Fn(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,o=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Tn(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 Tn(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 Tn(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 Ln(){var e,t=Fn((0,r.useState)(""),2),n=t[0],i=t[1],o=pn((function(e){return e.wantedTemplate})),a=null==o||null===(e=o.fields)||void 0===e?void 0:e.required_plugins.filter((function(e){return"editorplus"!==e}));return on(a).then((function(){pn.setState({importOnLoad:!0})})).then(An(j().mark((function e(){return j().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,xt.jsx)(xn,{}),document.getElementById("extendify-root"));case 3:case"end":return e.stop()}}),e)})))).catch((function(e){var t=e.response;i(t.data.message)})),n?(0,xt.jsx)(Cn,{msg:n}):(0,xt.jsx)(kt.Modal,{title:(0,yt.__)("Activating plugins","extendify-sdk"),isDismissible:!1,children:(0,xt.jsx)(kt.Button,{style:{width:"100%"},disabled:!0,isPrimary:!0,isBusy:!0,onClick:function(){},children:(0,yt.__)("Activating...","extendify-sdk")})})}function In(e){var t,n,i,o,a,s=pn((function(e){return e.wantedTemplate})),u=function(){return(0,r.render)((0,xt.jsx)(gr,{show:!0}),document.getElementById("extendify-root"))},l=(null==s||null===(t=s.fields)||void 0===t?void 0:t.required_plugins)||[];return null!==(n=W.getState())&&void 0!==n&&n.canActivatePlugins?(0,xt.jsxs)(kt.Modal,{title:(0,yt.__)("Activate required plugins","extendify-sdk"),closeButtonLabel:(0,yt.__)("No thanks, return to library","extendify-sdk"),onRequestClose:u,children:[(0,xt.jsx)("p",{style:{maxWidth:"400px"},children:null!==(i=e.message)&&void 0!==i?i:(0,yt.__)((0,yt.sprintf)("There is just one more step. This %s requires the following plugins to be installed and activated:",null!==(o=null==s||null===(a=s.fields)||void 0===a?void 0:a.type)&&void 0!==o?o:"template"),"extendify-sdk")}),(0,xt.jsx)("ul",{children:l.filter((function(e){return"editorplus"!==e})).map((function(e){return(0,xt.jsx)("li",{children:kn(e)},e)}))}),(0,xt.jsxs)(kt.ButtonGroup,{children:[(0,xt.jsx)(kt.Button,{isPrimary:!0,onClick:function(){return(0,r.render)((0,xt.jsx)(Ln,{}),document.getElementById("extendify-root"))},children:(0,yt.__)("Activate Plugins","extendify-sdk")}),e.showClose&&(0,xt.jsx)(kt.Button,{isTertiary:!0,onClick:u,style:{boxShadow:"none",margin:"0 4px"},children:(0,yt.__)("No thanks, return to library","extendify-sdk")})]})]}):(0,xt.jsx)(Sn,{})}function Rn(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function Dn(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){Rn(o,r,i,a,s,"next",e)}function s(e){Rn(o,r,i,a,s,"throw",e)}a(void 0)}))}}var Vn=function(){var e=Dn(j().mark((function e(t){return j().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fn(t);case 2:return e.t0=!e.sent,e.t1=function(){return Dn(j().mark((function e(){return j().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})))()},e.t2=function(){return Dn(j().mark((function e(){return j().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(){(0,r.render)((0,xt.jsx)(In,{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 Mn(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 Hn(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 Hn(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function Hn(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 Bn(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function Un(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){Bn(o,r,i,a,s,"next",e)}function s(e){Bn(o,r,i,a,s,"throw",e)}a(void 0)}))}}function qn(e){return function(){return new Zn(e.apply(this,arguments))}}function Zn(e){var t,n;function r(t,n){try{var o=e[t](n),a=o.value,s=a instanceof Wn;Promise.resolve(s?a.wrapped:a).then((function(e){s?r("return"===t?"return":"next",e):i(o.done?"return":"normal",e)}),(function(e){r("throw",e)}))}catch(e){i("throw",e)}}function i(e,i){switch(e){case"return":t.resolve({value:i,done:!0});break;case"throw":t.reject(i);break;default:t.resolve({value:i,done:!1})}(t=t.next)?r(t.key,t.arg):n=null}this._invoke=function(e,i){return new Promise((function(o,a){var s={key:e,arg:i,resolve:o,reject:a,next:null};n?n=n.next=s:(t=n=s,r(e,i))}))},"function"!=typeof e.return&&(this.return=void 0)}function Wn(e){this.wrapped=e}Zn.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},Zn.prototype.next=function(e){return this._invoke("next",e)},Zn.prototype.throw=function(e){return this._invoke("throw",e)},Zn.prototype.return=function(e){return this._invoke("return",e)};function zn(){return(zn=Un(j().mark((function e(t){var n;return j().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=$n(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 $n(e){return Gn.apply(this,arguments)}function Gn(){return(Gn=qn(j().mark((function e(t){var n,r,i;return j().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=Mn(t),e.prev=1,n.s();case 3:if((r=n.n()).done){e.next=9;break}return i=r.value,e.next=7,i();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 Kn(e,t){return(0,(0,mn.dispatch)("core/block-editor").insertBlocks)(e).then((function(){window.dispatchEvent(new CustomEvent("extendify-sdk::template-inserted",{detail:{template:t},bubbles:!0}))}))}function Yn(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,o=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}(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}var Jn=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return{hasRequiredPlugins:On,hasPluginsActivated:Vn,stack:[],check:function(t){var n=this;return Un(j().mark((function r(){var i,o,a;return j().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:i=Mn(e),r.prev=1,a=j().mark((function e(){var r,i;return j().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=o.value,e.next=3,n["".concat(r)](t);case 3:i=e.sent,setTimeout((function(){n.stack.push(i.pass?i.allow:i.deny)}),0);case 5:case"end":return e.stop()}}),e)})),i.s();case 4:if((o=i.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),i.e(r.t1);case 13:return r.prev=13,i.f(),r.finish(13);case 16:case"end":return r.stop()}}),r,null,[[1,10,13,16]])})))()},reset:function(){this.stack=[]}}}(["hasRequiredPlugins","hasPluginsActivated"]);function Qn(e){var t=e.template,n=(0,r.useRef)(null),i=g((function(e){return e.activeTemplateBlocks})),o=W((function(e){return e.canImport})),a=W((function(e){return e.apiKey})),s=b((function(e){return e.setOpen})),u=Yn((0,r.useState)(!1),2),l=u[0],c=u[1],f=Yn((0,r.useState)(!1),2),d=f[0],p=f[1],h=pn((function(e){return e.setWanted})),m=function(){(function(e){return zn.apply(this,arguments)})(Jn.stack).then((function(){setTimeout((function(){Kn(i,t).then((function(){return s(!1)}))}),100)}))};(0,r.useEffect)((function(){return Jn.check(t).then((function(){return p(!0)})),function(){return Jn.reset()&&p(!1)}}),[t]),(0,r.useEffect)((function(){!l&&n.current&&n.current.focus()}),[n,l,d]);return d&&Object.keys(i).length?a||o()?l?(0,xt.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,yt.__)("Importing...","extendify-sdk")}):(0,xt.jsx)("button",{ref:n,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 Mt(t),c(!0),h(t),void m()},children:(0,yt.sprintf)((0,yt.__)("Add %s","extendify-sdk"),t.fields.type)}):(0,xt.jsx)("a",{ref:n,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/pricing?utm_source=".concat(window.extendifySdkData.source,"&utm_medium=library&utm_campaign=sign_up&utm_content=single_page"),rel:"noreferrer",children:(0,yt.__)("Sign up now","extendify-sdk")}):""}function er(e){var t=e.categories,n=e.styles,r=e.types,i=e.requiredPlugins;return(0,xt.jsxs)(xt.Fragment,{children:[t&&(0,xt.jsxs)("div",{className:"w-full pb-4",children:[(0,xt.jsx)("h3",{className:"text-sm m-0 mb-2",children:(0,yt.__)("Categories:","extendify-sdk")}),(0,xt.jsx)("div",{children:t.join(", ")})]}),n&&(0,xt.jsxs)("div",{className:"w-full py-4",children:[(0,xt.jsx)("h3",{className:"text-sm m-0 my-2",children:(0,yt.__)("Styles:","extendify-sdk")}),(0,xt.jsx)("div",{children:n.join(", ")})]}),r&&(0,xt.jsxs)("div",{className:"w-full py-4",children:[(0,xt.jsx)("h3",{className:"text-sm m-0 my-2",children:(0,yt.__)("Types:","extendify-sdk")}),(0,xt.jsx)("div",{children:r.join(", ")})]}),i.filter((function(e){return"editorplus"!==e})).length>0&&(0,xt.jsxs)("div",{className:"pt-4 w-full",children:[(0,xt.jsx)("h3",{className:"text-sm m-0 my-2",children:(0,yt.__)("Required Plugins:","extendify-sdk")}),(0,xt.jsx)("div",{children:i.filter((function(e){return"editorplus"!==e})).map((function(e){return kn(e)})).join(", ")})]}),(0,xt.jsx)("div",{className:"py-4 mt-4",children:(0,xt.jsx)("a",{href:"https://extendify.com/what-happens-when-a-template-is-added?utm_source=".concat(window.extendifySdkData.source,"&utm_medium=library&utm_campaign=sidebar"),rel:"noreferrer",target:"_blank",children:(0,yt.__)("What happens when a template is added?","extendify-sdk")})})]})}function tr(e){var t,n,i,o,a,s,u,l=e.template,c=l.fields,f=c.tax_categories,d=c.required_plugins,p=c.tax_style,h=c.tax_pattern_types,m=W((function(e){return e.apiKey}));return(0,r.useEffect)((function(){Ht(l)}),[l]),(0,xt.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,xt.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,xt.jsxs)("div",{className:"text-left m-0 h-full p-6 sm:p-0",children:[(0,xt.jsx)("h1",{className:"leading-tight text-left mb-2.5 mt-0 sm:text-3xl font-normal",children:l.fields.display_title}),(0,xt.jsx)(kt.ExternalLink,{href:l.fields.url,children:(0,yt.__)("Demo","extendify-sdk")})]}),(0,xt.jsx)("div",{className:_t()({"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":!m.length,"top-0":m.length>0}),children:(0,xt.jsx)(Qn,{template:l})})]}),(0,xt.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,xt.jsx)("img",{className:"max-w-full w-full block",src:null!==(t=null==l||null===(n=l.fields)||void 0===n||null===(i=n.screenshot[0])||void 0===i||null===(o=i.thumbnails)||void 0===o||null===(a=o.full)||void 0===a?void 0:a.url)&&void 0!==t?t:null==l||null===(s=l.fields)||void 0===s||null===(u=s.screenshot[0])||void 0===u?void 0:u.url})}),(0,xt.jsx)("div",{className:"text-xs text-left p-6 w-full block sm:hidden divide-y",children:(0,xt.jsx)(er,{categories:f,types:h,requiredPlugins:d,styles:p})})]})}function nr(){return 0===W((function(e){return e.apiKey})).length?(0,xt.jsx)("button",{className:"components-button",onClick:function(){return b.setState({currentPage:"login"})},children:(0,yt.__)("Log into account","extendify-sdk")}):(0,xt.jsx)("button",{className:"components-button",onClick:function(){return W.setState({apiKey:""})},children:(0,yt.__)("Log out","extendify-sdk")})}function rr(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,o=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return ir(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 ir(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 ir(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.children,n=W((function(e){return e.apiKey})),i=rr((0,r.useState)(!1),2),o=i[0],a=i[1];return(0,r.useEffect)((function(){a(!n.length||window.location.search.indexOf("DEVMODE")>-1)}),[n]),(0,xt.jsxs)(xt.Fragment,{children:[(0,xt.jsxs)("aside",{className:"flex-shrink-0 sm:pl-12 py-0 sm:py-6 relative",children:[(0,xt.jsx)("div",{className:"sm:w-56 lg:w-72 sticky flex flex-col lg:h-full",children:t[0]}),(0,xt.jsx)("div",{className:"hidden sm:flex flex-col absolute bottom-0 bg-white p-4 w-72 text-left space-y-4",children:o&&(0,xt.jsx)("div",{className:"border-t border-gray-300",children:(0,xt.jsx)(nr,{})})})]}),(0,xt.jsx)("main",{id:"extendify-templates",tabIndex:"0",className:"w-full smp:l-12 sm:pt-6 h-full overflow-hidden",children:t[1]})]})}function ar(){var e=g((function(e){return e.updateSearchParams})),t=g((function(e){return e.searchParams})),n=function(t){return e({type:t})};return(0,xt.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,xt.jsx)("h4",{className:"sr-only",children:(0,yt.__)("Type select","extendify-sdk")}),(0,xt.jsxs)("button",{type:"button",className:_t()({"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,xt.jsx)("svg",{width:"17",height:"13",viewBox:"0 0 17 13",className:"fill-current",xmlns:"http://www.w3.org/2000/svg",children:(0,xt.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,xt.jsx)("span",{className:"",children:(0,yt.__)("Patterns","extendify-sdk")})]}),(0,xt.jsxs)("button",{type:"button",className:_t()({"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,xt.jsx)("svg",{width:"17",height:"13",viewBox:"0 0 17 13",className:"fill-current",xmlns:"http://www.w3.org/2000/svg",children:(0,xt.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,xt.jsx)("span",{className:"",children:(0,yt.__)("Page templates","extendify-sdk")})]})]})}function sr(e){var t=e.template,n=g((function(e){return e.setActive})),r=t.fields,i=r.tax_categories,o=r.required_plugins,a=r.tax_style,s=r.tax_pattern_types,u=W((function(e){return e.apiKey}));return(0,xt.jsxs)("div",{className:"flex flex-col items-start justify-start",children:[!u.length&&(0,xt.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,xt.jsx)("a",{className:"button-extendify-main",target:"_blank",href:"https://extendify.com/pricing?utm_source=".concat(window.extendifySdkData.source,"&utm_medium=library&utm_campaign=sign_up&utm_content=main"),rel:"noreferrer",children:(0,yt.__)("Sign up today to get unlimited access","extendify-sdk")}),(0,xt.jsx)("button",{className:"components-button",onClick:function(){return b.setState({currentPage:"login"})},children:(0,yt.__)("Log in","extendify-sdk")})]}),(0,xt.jsx)("div",{className:"p-6 sm:p-0",children:(0,xt.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 n({})},children:[(0,xt.jsx)("svg",{className:"fill-current",width:"8",height:"12",viewBox:"0 0 8 12",xmlns:"http://www.w3.org/2000/svg",children:(0,xt.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,xt.jsx)("span",{className:"ml-4",children:(0,yt.__)("Go back","extendify-sdk")})]})}),(0,xt.jsx)("div",{className:"text-left pt-14 divide-y w-full hidden sm:block",children:(0,xt.jsx)(er,{categories:i,types:s,requiredPlugins:o,styles:a})})]})}function ur(){var e=g((function(e){return e.searchParams}));return(0,xt.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]||"template"===e.type&&"tax_features"===t[0]||"pattern"===e.type&&"tax_page_types"===t[0]?"":(0,xt.jsxs)("div",{className:"lg:px-2 text-left",children:[(0,xt.jsx)("span",{className:"font-bold",children:(n=t[0],n.replace("tax_","").replace("_"," ").replace(/\b\w/g,(function(e){return e.toUpperCase()})))}),": ",(0,xt.jsx)("span",{children:t[1]?t[1]:"All"})]},t[0]);var n}))})}function lr(e){var t=e.className,n=g((function(e){return e.templates})),r=g((function(e){return e.activeTemplate}));return(0,xt.jsxs)("div",{className:t,children:[(0,xt.jsx)("a",{href:"#extendify-templates",className:"sr-only focus:not-sr-only focus:text-blue-500",children:(0,yt.__)("Skip to content","extendify-sdk")}),(0,xt.jsxs)("div",{className:"sm:flex sm:space-x-12 relative bg-white mx-auto max-w-screen-4xl h-full",children:[!!Object.keys(r).length&&(0,xt.jsx)("div",{className:"absolute bg-white sm:flex inset-0 z-50 sm:space-x-12",children:(0,xt.jsxs)(or,{children:[(0,xt.jsx)(sr,{template:r}),(0,xt.jsx)(tr,{template:r})]})}),(0,xt.jsxs)(or,{children:[(0,xt.jsx)(Lt,{}),(0,xt.jsxs)(xt.Fragment,{children:[(0,xt.jsx)(ar,{}),(0,xt.jsx)(ur,{}),(0,xt.jsx)("div",{className:"relative h-full z-30 bg-white",children:(0,xt.jsx)("div",{className:"absolute z-20 inset-0 lg:static h-screen overflow-y-auto pt-4 sm:pt-0 px-6 sm:pl-0 sm:pr-8",children:(0,xt.jsx)(nn,{templates:n})})})]})]})]})]})}function cr(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function fr(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,o=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return dr(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 dr(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 dr(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 pr(){var e=fr((0,r.useState)(W.getState().apiKey),2),t=e[0],n=e[1],i=fr((0,r.useState)(W.getState().email),2),o=i[0],a=i[1],s=fr((0,r.useState)(""),2),u=s[0],l=s[1],c=fr((0,r.useState)("info"),2),f=c[0],d=c[1],p=fr((0,r.useState)(""),2),h=p[0],m=p[1];(0,r.useEffect)((function(){return function(){return d("info")}}),[]);var v=function(){var e,n=(e=j().mark((function e(n){var r,i,a,s,u,c;return j().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n.preventDefault(),l(""),r=o.length?o:h,e.next=5,R(r,t);case 5:if(i=e.sent,a=i.token,s=i.error,u=i.exception,void 0===(c=i.message)){e.next=13;break}return d("error"),e.abrupt("return",l(c.length?c:"Error: Are you interacting with the wrong server?"));case 13:if(!s&&!u){e.next=16;break}return d("error"),e.abrupt("return",l(s.length?s:u));case 16:if(a&&"string"==typeof a){e.next=19;break}return d("error"),e.abrupt("return",l((0,yt.__)("Something went wrong","extendify-sdk")));case 19:return d("success"),l("Success!"),e.next=23,new Promise((function(e){return setTimeout(e,1500)}));case 23:W.setState({apiKey:a}),b.setState({currentPage:"content"});case 25:case"end":return e.stop()}}),e)})),function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){cr(o,r,i,a,s,"next",e)}function s(e){cr(o,r,i,a,s,"throw",e)}a(void 0)}))});return function(e){return n.apply(this,arguments)}}();return(0,r.useEffect)((function(){o||I("user_email").then((function(e){return m(e)}))}),[o]),(0,xt.jsxs)("section",{className:"w-96 text-left md:-mt-32",children:[(0,xt.jsx)("h1",{className:"border-b border-gray-900 mb-12 pb-4",children:(0,yt.__)("Welcome","extendify-sdk")}),u&&(0,xt.jsx)("div",{className:_t()({"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:u}),(0,xt.jsxs)("form",{onSubmit:v,className:" space-y-6",children:[(0,xt.jsxs)("div",{className:"flex items-center",children:[(0,xt.jsx)("label",{htmlFor:"extendifysdk-login-email",className:"w-32 font-bold",children:(0,yt.__)("Email:","extendify-sdk")}),(0,xt.jsx)("input",{id:"extendifysdk-login-email",name:"extendifysdk-login-email",type:"email",className:"border px-2 w-full",placeholder:"Email",value:o.length?o:h,onChange:function(e){return a(e.target.value)}})]}),(0,xt.jsxs)("div",{className:"flex items-center",children:[(0,xt.jsx)("label",{htmlFor:"extendifysdk-login-license",className:"w-32 font-bold",children:(0,yt.__)("License:","extendify-sdk")}),(0,xt.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,xt.jsx)("div",{className:"flex justify-end",children:(0,xt.jsx)("button",{type:"submit",className:"button-extendify-main p-3 px-4",children:(0,yt.__)("Sign in","extendify-sdk")})})]})]})}function hr(e){var t=e.className;return(0,xt.jsxs)("div",{className:t,children:[(0,xt.jsx)("a",{href:"#extendify-templates",className:"sr-only focus:not-sr-only focus:text-blue-500",children:(0,yt.__)("Skip to content","extendify-sdk")}),(0,xt.jsx)("div",{className:"flex sm:space-x-12 relative mx-auto max-w-screen-4xl h-full",children:(0,xt.jsxs)("div",{className:"absolute flex inset-0 items-center justify-center z-20 sm:space-x-12",children:[(0,xt.jsx)("div",{className:"pl-12 py-6 absolute top-0 left-0",children:(0,xt.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 b.setState({currentPage:"content"})},children:[(0,xt.jsx)("svg",{className:"fill-current",width:"8",height:"12",viewBox:"0 0 8 12",xmlns:"http://www.w3.org/2000/svg",children:(0,xt.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,xt.jsx)("span",{className:"ml-4",children:(0,yt.__)("Go back","extendify-sdk")})]})}),(0,xt.jsx)("div",{className:"flex justify-center",children:(0,xt.jsx)(pr,{})})]})})]})}var mr=function(e){return F.post("simple-ping",{action:e})};function vr(e){var t=e.className,n=g((function(e){return e.updateSearchParams})),i=function(e){mr("welcome-".concat(null!=e?e:"closed")),e&&n({type:e}),W.setState({hasClickedThroughWelcomePage:!0}),b.setState({currentPage:"content"})};return(0,r.useEffect)((function(){mr("welcome-opened")}),[]),(0,xt.jsxs)("div",{className:t,children:[(0,xt.jsx)("div",{className:"w-full h-16 relative z-10 border-solid border-0 flex-shrink-0",children:(0,xt.jsxs)("div",{className:"flex justify-between items-center px-6 sm:px-12 h-full",children:[(0,xt.jsx)("div",{className:"flex space-x-12 h-full"}),(0,xt.jsx)("div",{className:"space-x-2 transform sm:translate-x-8",children:(0,xt.jsxs)("button",{type:"button",className:"components-button has-icon",onClick:function(){return i()},children:[(0,xt.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,xt.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,xt.jsx)("span",{className:"sr-only",children:(0,yt.__)("Close library","extendify-sdk")})]})})]})}),(0,xt.jsx)("section",{className:"w-full lg:w-auto lg:flex sm:space-x-12 relative mx-auto max-w-screen-4xl h-full",children:(0,xt.jsx)("div",{className:"flex items-center justify-center",children:(0,xt.jsx)("div",{className:"-mt-16 h-screen lg:h-auto lg:p-8 w-full",children:(0,xt.jsxs)("div",{className:"bg-white overflow-y-auto h-screen lg:h-auto lg:flex pt-20 p-8 sm:p-16 space-y-16 lg:space-y-0 lg:space-x-8 xl:space-x-16 max-w-screen-xl lg:border border-gray-300",children:[(0,xt.jsxs)("div",{className:"flex-grow flex items-center space-y-4 md:space-y-0 md:space-x-4 xl:space-x-8 flex-col md:flex-row",children:[(0,xt.jsx)("div",{className:"flex-1 lg:w-1/2 w-full flex items-center max-w-xs h-full max-h-60",children:(0,xt.jsxs)("button",{onClick:function(){return i("pattern")},className:"bg-white hover:bg-gray-50 cursor-pointer border border-gray-300 flex w-full space-y-4 flex-col items-center justify-center p-8 lg:px-0",children:[(0,xt.jsx)("h3",{className:"m-0 text-gray-900",children:(0,yt.__)("Sections","extendify-sdk")}),(0,xt.jsx)("span",{children:(0,xt.jsxs)("svg",{className:"mt-1",xmlns:"http://www.w3.org/2000/svg",width:"206",height:"122",viewBox:"0 0 206 122",fill:"none",children:[(0,xt.jsx)("path",{d:"M69 0H0V59H69V0Z",fill:"#DFDFDF"}),(0,xt.jsx)("path",{d:"M204 0H79V60H204V0Z",fill:"#DFDFDF"}),(0,xt.jsx)("path",{d:"M62.166 25H9.16602V28H62.166V25Z",fill:"#F9F9F9"}),(0,xt.jsx)("path",{d:"M63.166 18H10.166V21H63.166V18Z",fill:"#F9F9F9"}),(0,xt.jsx)("path",{d:"M62.166 34H9.16602V39H62.166V34Z",fill:"#F9F9F9"}),(0,xt.jsx)("path",{d:"M62.166 43H9.16602V48H62.166V43Z",fill:"#F9F9F9"}),(0,xt.jsx)("path",{d:"M140.166 25H87.166V28H140.166V25Z",fill:"#F9F9F9"}),(0,xt.jsx)("path",{d:"M140.166 34H87.166V39H140.166V34Z",fill:"#F9F9F9"}),(0,xt.jsx)("path",{d:"M140.166 43H87.166V48H140.166V43Z",fill:"#F9F9F9"}),(0,xt.jsx)("path",{d:"M197.166 25H151.166V28H197.166V25Z",fill:"#F9F9F9"}),(0,xt.jsx)("path",{d:"M141.166 17H88.166V20H141.166V17Z",fill:"#F9F9F9"}),(0,xt.jsx)("path",{d:"M198.166 17H152.166V20H198.166V17Z",fill:"#F9F9F9"}),(0,xt.jsx)("path",{d:"M62.166 10H9.16602V13H62.166V10Z",fill:"#F9F9F9"}),(0,xt.jsx)("path",{d:"M140.166 9H87.166V12H140.166V9Z",fill:"#F9F9F9"}),(0,xt.jsx)("path",{d:"M197.166 9H151.166V12H197.166V9Z",fill:"#F9F9F9"}),(0,xt.jsx)("path",{d:"M197.166 34H151.166V39H197.166V34Z",fill:"#F9F9F9"}),(0,xt.jsx)("path",{d:"M197.166 43H151.166V48H197.166V43Z",fill:"#F9F9F9"}),(0,xt.jsx)("path",{d:"M154.172 77.8088H0V121.216H154.172V77.8088Z",fill:"#DFDFDF"}),(0,xt.jsx)("path",{d:"M133.637 110.446C141.077 110.446 147.109 104.75 147.109 97.7229C147.109 90.6963 141.077 85 133.637 85C126.197 85 120.166 90.6963 120.166 97.7229C120.166 104.75 126.197 110.446 133.637 110.446Z",fill:"#F9F9F9"}),(0,xt.jsx)("path",{d:"M205.166 78H162.166V121H205.166V78Z",fill:"#DFDFDF"}),(0,xt.jsx)("path",{d:"M183.803 111.637C191.243 111.637 197.275 105.941 197.275 98.9141C197.275 91.8874 191.243 86.1912 183.803 86.1912C176.363 86.1912 170.332 91.8874 170.332 98.9141C170.332 105.941 176.363 111.637 183.803 111.637Z",fill:"#F9F9F9"}),(0,xt.jsx)("path",{d:"M113.695 88.7898H13.4082V100.764H113.695V88.7898Z",fill:"#F9F9F9"}),(0,xt.jsx)("path",{d:"M113.695 105.255H13.4082V109.745H113.695V105.255Z",fill:"#F9F9F9"})]})}),(0,xt.jsx)("span",{className:"text-extendify-bright underline text-base font-bold",children:(0,yt.__)("View patterns","extendify-sdk")})]})}),(0,xt.jsx)("div",{className:"flex-1 lg:w-1/2 w-full flex items-center max-w-xs h-full max-h-60",children:(0,xt.jsxs)("button",{onClick:function(){return i("template")},className:"bg-white hover:bg-gray-50 cursor-pointer border border-gray-300 flex w-full space-y-4 flex-col items-center justify-center p-8 lg:px-0",children:[(0,xt.jsx)("h3",{className:"m-0 text-gray-900",children:(0,yt.__)("Full pages","extendify-sdk")}),(0,xt.jsx)("span",{children:(0,xt.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"156",height:"128",viewBox:"0 0 156 128",fill:"none",children:[(0,xt.jsx)("path",{d:"M155.006 38.4395H0.833984V81.8471H155.006V38.4395Z",fill:"#DFDFDF"}),(0,xt.jsx)("path",{d:"M155 0H1V36H155V0Z",fill:"#DFDFDF"}),(0,xt.jsx)("path",{d:"M148 7H10V28H148V7Z",fill:"#F9F9F9"}),(0,xt.jsx)("path",{d:"M147.521 47.4204H9.81445V50.414H147.521V47.4204Z",fill:"#F9F9F9"}),(0,xt.jsx)("path",{d:"M147.521 56.4012H9.81445V60.8917H147.521V56.4012Z",fill:"#F9F9F9"}),(0,xt.jsx)("path",{d:"M147.521 65.3821H9.81445V69.8726H147.521V65.3821Z",fill:"#F9F9F9"}),(0,xt.jsx)("path",{d:"M155.006 83.8089H0.833984V127.217H155.006V83.8089Z",fill:"#DFDFDF"}),(0,xt.jsx)("path",{d:"M21.7897 118.236C29.2297 118.236 35.261 112.539 35.261 105.513C35.261 98.486 29.2297 92.7898 21.7897 92.7898C14.3497 92.7898 8.31836 98.486 8.31836 105.513C8.31836 112.539 14.3497 118.236 21.7897 118.236Z",fill:"#F9F9F9"}),(0,xt.jsx)("path",{d:"M144.529 92.7898H44.2422V104.764H144.529V92.7898Z",fill:"#F9F9F9"}),(0,xt.jsx)("path",{d:"M144.529 109.255H44.2422V113.745H144.529V109.255Z",fill:"#F9F9F9"})]})}),(0,xt.jsx)("span",{className:"text-extendify-bright underline text-base font-bold",children:(0,yt.__)("View templates","extendify-sdk")})]})})]}),(0,xt.jsx)("div",{className:"lg:w-2/5 text-left",children:(0,xt.jsxs)("div",{className:"max-w-lg lg:max-w-none",children:[(0,xt.jsx)("h1",{className:"m-0 pb-4 mb-6 border-b border-gray-900 font-medium text-2xl",children:(0,yt.__)("Welcome to Extendify","extendify-sdk")}),(0,xt.jsxs)("div",{className:"mb-12",children:[(0,xt.jsx)("p",{children:(0,yt.__)("Congratulations! You have access to our entire library of Gutenberg patterns and templates. You can add up to 3 templates or patterns to your site completely free.","extendify-sdk")}),(0,xt.jsx)("p",{children:(0,yt.__)("All patterns and templates are pre-designed to look beautiful with options to fit your style. They also keep your site running lightning fast by using only core blocks with no 3rd party page builder required.","extendify-sdk")}),(0,xt.jsx)("a",{className:"text-sm text-extendify-link underline",href:"https://extendify.com?utm_source=".concat(window.extendifySdkData.source,"&utm_medium=library&utm_campaign=welcome"),target:"_blank",rel:"noreferrer",children:(0,yt.__)("Learn more about Extendify","extendify-sdk")})]}),(0,xt.jsx)("h2",{className:"text-base pb-2 mb-4 border-b border-gray-900",children:(0,yt.__)("Don't want the library in your editor?","extendify-sdk")}),(0,xt.jsxs)("div",{className:"text-xs",children:[(0,xt.jsx)("p",{children:(0,yt.sprintf)((0,yt.__)("Extendify was included with the %s plugin.","extendify-sdk"),window.extendifySdkData.source)}),(0,xt.jsx)("a",{className:"text-xs text-extendify-link underline",href:"https://extendify.com/how-to-disable-the-extendify-library/?utm_source=".concat(window.extendifySdkData.source,"&utm_medium=library&utm_campaign=welcome"),target:"_blank",rel:"noreferrer",children:(0,yt.__)("Learn how to remove the library","extendify-sdk")})]})]})})]})})})})]})}function yr(e){var t=e.show,n=function(){var e=document.getElementById("beacon-container");e&&(e.style.position="relative",e.style.zIndex=Number.MAX_SAFE_INTEGER,e.style.display="block")},i=function(){var e=document.getElementById("beacon-container");e&&(e.style.display="none",window.Beacon("close"))};return(0,r.useEffect)((function(){if(t)return window.Beacon?(n(),function(){return i()}):(function(e,t,n){function r(){var e,n=t.getElementsByTagName("script")[0],r=t.createElement("script");r.async=!0,r.src="https://beacon-v2.helpscout.net",null===(e=n.parentNode)||void 0===e||e.insertBefore(r,n)}if(e.Beacon=n=function(t,n,r){e.Beacon.readyQueue.push({method:t,options:n,data:r})},n.readyQueue=[],"complete"===t.readyState)return r();e.attachEvent?e.attachEvent("onload",r):e.addEventListener("load",r,!1)}(window,document,window.Beacon||function(){}),window.Beacon("init","2b8c11c0-5afc-4cb9-bee0-a5cb76b2fc91"),window.Beacon("on","ready",n),function(){window.Beacon("off","ready",n),i()})}),[t]),(0,xt.jsx)(xt.Fragment,{})}function xr(){var e=(0,r.useRef)(null),t=b((function(e){return e.open})),n=b((function(e){return e.setOpen})),i=b((function(e){return e.currentPage})),o=W((function(e){return e.hasClickedThroughWelcomePage}));return(0,r.useEffect)((function(){o&&b.setState({currentPage:"content"})}),[o]),(0,xt.jsx)(Pe.Root,{show:t,as:r.Fragment,children:(0,xt.jsx)(vt,{as:"div",static:!0,className:"extendify-sdk",initialFocus:e,onClose:function(){},children:(0,xt.jsx)("div",{className:"h-screen w-screen sm:h-auto sm:w-auto fixed z-high inset-0 overflow-y-auto",children:(0,xt.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,xt.jsx)(Pe.Child,{as:r.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",children:(0,xt.jsx)(vt.Overlay,{className:"fixed inset-0 bg-black bg-opacity-30 transition-opacity"})}),(0,xt.jsx)(Pe.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,xt.jsxs)("div",{ref:e,tabIndex:"0",className:"fixed lg:absolute inset-0 lg:overflow-hidden transform transition-all lg:p-5",children:["welcome"===i?(0,xt.jsx)(vr,{className:"w-full h-full flex flex-col items-center relative shadow-xl max-w-screen-4xl mx-auto bg-extendify-light"}):(0,xt.jsxs)("div",{className:"bg-white h-full flex flex-col items-center relative shadow-xl max-w-screen-4xl mx-auto",children:[(0,xt.jsx)(gt,{className:"w-full h-16 border-solid border-0 border-b border-gray-300 flex-shrink-0",hideLibrary:function(){return n(!1)}}),"content"===i&&(0,xt.jsx)(lr,{className:"w-full flex-grow overflow-hidden"}),"login"===i&&(0,xt.jsx)(hr,{className:"w-full flex-grow overflow-hidden bg-extendify-light"})]}),(0,xt.jsx)(yr,{show:t})]})})]})})})})}function gr(e){var t=e.show,n=void 0!==t&&t,i=b((function(e){return e.setOpen})),o=(0,r.useCallback)((function(){return i(!0)}),[i]),a=(0,r.useCallback)((function(){i(!1)}),[i]);return(0,r.useEffect)((function(){n&&i(!0)}),[n,i]),(0,r.useEffect)((function(){return window.localStorage.getItem("etfy_library__key")&&W.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",o),window.addEventListener("extendify-sdk::close-library",a),function(){window.removeEventListener("extendify-sdk::open-library",o),window.removeEventListener("extendify-sdk::close-library",a)}}),[a,o]),(0,xt.jsx)(xr,{})}const br=wp.plugins,wr=wp.editPost;function jr(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function kr(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){jr(o,r,i,a,s,"next",e)}function s(e){jr(o,r,i,a,s,"throw",e)}a(void 0)}))}}var Sr=function(e){var t,n;jn(null===(t=e.target.closest("[data-extendify-identifier]"))||void 0===t||null===(n=t.dataset)||void 0===n?void 0:n.extendifyIdentifier)},_r=function(){var e,t,n;return null===window.extendifySdkData.user||(null===(e=window.extendifySdkData)||void 0===e||null===(t=e.user)||void 0===t||null===(n=t.state)||void 0===n?void 0:n.enabled)},Er=(0,xt.jsx)("div",{id:"extendify-templates-inserter",children:(0,xt.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,xt.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,xt.jsx)("rect",{y:"25.75",width:"70.8125",height:"77.25",fill:"#000000"}),(0,xt.jsx)("rect",{x:"45.0625",width:"57.9375",height:"57.9375",fill:"#37C2A2"})]}),(0,yt.__)("Library","extendify-sdk")]})});window._wpLoadBlockEditor&&window.wp.data.subscribe((function(){setTimeout((function(){_r()&&(document.getElementById("extendify-templates-inserter-btn")||document.querySelector(".edit-post-header-toolbar")&&(document.querySelector(".edit-post-header-toolbar").insertAdjacentHTML("beforeend",(0,r.renderToString)(Er)),document.getElementById("extendify-templates-inserter-btn").addEventListener("click",Sr)))}),0)})),window._wpLoadBlockEditor&&window.wp.data.subscribe((function(){setTimeout((function(){if(_r()&&document.querySelector("[id$=patterns-view]")&&!document.getElementById("extendify-cta-button")){var e=(0,xt.jsx)("div",{children:(0,xt.jsx)("button",{id:"extendify-cta-button",style:"margin:1rem 1rem 0","data-extendify-identifier":"patterns-cta",className:"components-button is-secondary",children:(0,yt.__)("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",Sr)}}),0)}));window._wpLoadBlockEditor&&_r()&&(0,br.registerPlugin)("extendify-temps-more-menu-trigger",{render:function(){return(0,xt.jsx)(wr.PluginSidebarMoreMenuItem,{"data-extendify-identifier":"sidebar-button",onClick:Sr,icon:(0,xt.jsx)("span",{className:"components-menu-items__item-icon",children:(0,xt.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 103 103",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,xt.jsx)("rect",{y:"25.75",width:"70.8125",height:"77.25",fill:"#000000"}),(0,xt.jsx)("rect",{x:"45.0625",width:"57.9375",height:"57.9375",fill:"#37C2A2"})]})}),children:(0,yt.__)("Library","extendify-sdk")})}});window._wpLoadBlockEditor&&(0,br.registerPlugin)("extendify-settings-enable-disable",{render:function(){return(0,xt.jsx)(wr.PluginSidebarMoreMenuItem,{onClick:kr(j().mark((function e(){var t;return j().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,L();case 2:return t=e.sent,(t=JSON.parse(t)).state.enabled=!_r(),e.next=7,D(JSON.stringify(Object.assign({},t)));case 7:location.reload();case 8:case"end":return e.stop()}}),e)}))),icon:(0,xt.jsx)(xt.Fragment,{}),children:_r()?(0,yt.__)("Disable Extendify","extendify-sdk"):(0,yt.__)("Enable Extendify","extendify-sdk")})}}),[{register:function(){var e=(0,mn.dispatch)("core/notices").createNotice,t=W.getState().incrementImports;window.addEventListener("extendify-sdk::template-inserted",(function(n){e("info",(0,yt.__)("Template Added"),{isDismissible:!0,type:"snackbar"}),setTimeout((function(){var e;t(),Bt(null===(e=n.detail)||void 0===e?void 0:e.template)}),0)}))}},{register:function(){var e=this;window.addEventListener("extendify-sdk::softerror-encountered",(function(t){e[(0,wt.camelCase)(t.detail.type)](t.detail)}))},versionOutdated:function(e){(0,r.render)((0,xt.jsx)(_n,{title:e.data.title,message:e.data.message,buttonLabel:e.data.buttonLabel,forceOpen:!0}),document.getElementById("extendify-root"))}}].forEach((function(e){return e.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,xt.jsx)(gr,{}),e),pn.getState().importOnLoad){var t=pn.getState().wantedTemplate;setTimeout((function(){!function(e){if(!e)throw Error("Template not found");Kn(p((0,window.wp.blocks.parse)((0,wt.get)(e,"fields.code"))),e)}(t)}),0)}pn.setState({importOnLoad:!1,wantedTemplate:{}})}))},42:(e,t)=>{var n;!function(){"use strict";var r={}.hasOwnProperty;function i(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var o=typeof n;if("string"===o||"number"===o)e.push(n);else if(Array.isArray(n)){if(n.length){var a=i.apply(null,n);a&&e.push(a)}}else if("object"===o)if(n.toString===Object.prototype.toString)for(var s in n)r.call(n,s)&&n[s]&&e.push(s);else e.push(n.toString())}}return e.join(" ")}e.exports?(i.default=i,e.exports=i):void 0===(n=function(){return i}.apply(t,[]))||(e.exports=n)}()},716:()=>{},525:e=>{"use strict";var t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;function i(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,o){for(var a,s,u=i(e),l=1;l<arguments.length;l++){for(var c in a=Object(arguments[l]))n.call(a,c)&&(u[c]=a[c]);if(t){s=t(a);for(var f=0;f<s.length;f++)r.call(a,s[f])&&(u[s[f]]=a[s[f]])}}return u}},61:e=>{var t,n,r=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function a(e){if(t===setTimeout)return setTimeout(e,0);if((t===i||!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:i}catch(e){t=i}try{n="function"==typeof clearTimeout?clearTimeout:o}catch(e){n=o}}();var s,u=[],l=!1,c=-1;function f(){l&&s&&(l=!1,s.length?u=s.concat(u):c=-1,u.length&&d())}function d(){if(!l){var e=a(f);l=!0;for(var t=u.length;t;){for(s=u,u=[];++c<t;)s&&s[c].run();c=-1,t=u.length}s=null,l=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===o||!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 h(){}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];u.push(new p(e,t)),1!==u.length||l||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=h,r.addListener=h,r.once=h,r.off=h,r.removeListener=h,r.removeAllListeners=h,r.emit=h,r.prependListener=h,r.prependOnceListener=h,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),i=60103;if(t.Fragment=60107,"function"==typeof Symbol&&Symbol.for){var o=Symbol.for;i=o("react.element"),t.Fragment=o("react.fragment")}var a=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s=Object.prototype.hasOwnProperty,u={key:!0,ref:!0,__self:!0,__source:!0};function l(e,t,n){var r,o={},l=null,c=null;for(r in void 0!==n&&(l=""+n),void 0!==t.key&&(l=""+t.key),void 0!==t.ref&&(c=t.ref),t)s.call(t,r)&&!u.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===o[r]&&(o[r]=t[r]);return{$$typeof:i,type:e,key:l,ref:c,props:o,_owner:a.current}}t.jsx=l,t.jsxs=l},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,i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function u(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,n){return e[t]=n}}function l(e,t,n,r){var i=t&&t.prototype instanceof v?t:v,o=Object.create(i.prototype),a=new O(r||[]);return o._invoke=function(e,t,n){var r=f;return function(i,o){if(r===p)throw new Error("Generator is already running");if(r===h){if("throw"===i)throw o;return P()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=_(a,n);if(s){if(s===m)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===f)throw r=h,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=p;var u=c(e,t,n);if("normal"===u.type){if(r=n.done?h:d,u.arg===m)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r=h,n.method="throw",n.arg=u.arg)}}}(e,n,a),o}function c(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var f="suspendedStart",d="suspendedYield",p="executing",h="completed",m={};function v(){}function y(){}function x(){}var g={};g[o]=function(){return this};var b=Object.getPrototypeOf,w=b&&b(b(C([])));w&&w!==n&&r.call(w,o)&&(g=w);var j=x.prototype=v.prototype=Object.create(g);function k(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function S(e,t){function n(i,o,a,s){var u=c(e[i],e,o);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==typeof f&&r.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,a,s)}),(function(e){n("throw",e,a,s)})):t.resolve(f).then((function(e){l.value=e,a(l)}),(function(e){return n("throw",e,a,s)}))}s(u.arg)}var i;this._invoke=function(e,r){function o(){return new t((function(t,i){n(e,r,t,i)}))}return i=i?i.then(o,o):o()}}function _(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,_(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 i=c(r,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,m;var o=i.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,m):o:(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 N(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function O(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function C(e){if(e){var n=e[o];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function n(){for(;++i<e.length;)if(r.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return a.next=a}}return{next:P}}function P(){return{value:t,done:!0}}return y.prototype=j.constructor=x,x.constructor=y,y.displayName=u(x,s,"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,x):(e.__proto__=x,u(e,s,"GeneratorFunction")),e.prototype=Object.create(j),e},e.awrap=function(e){return{__await:e}},k(S.prototype),S.prototype[a]=function(){return this},e.AsyncIterator=S,e.async=function(t,n,r,i,o){void 0===o&&(o=Promise);var a=new S(l(t,n,r,i),o);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},k(j),u(j,s,"Generator"),j[o]=function(){return this},j.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=C,O.prototype={constructor:O,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(N),!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 i(r,i){return s.type="throw",s.arg=e,n.next=r,i&&(n.method="next",n.arg=t),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),l=r.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.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),N(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 i=r.arg;N(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:C(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 i=n[e];if(void 0!==i)return i.exports;var o=n[e]={exports:{}};return t[e](o,o.exports,r),o.exports}r.m=t,e=[],r.O=(t,n,i,o)=>{if(!n){var a=1/0;for(l=0;l<e.length;l++){for(var[n,i,o]=e[l],s=!0,u=0;u<n.length;u++)(!1&o||a>=o)&&Object.keys(r.O).every((e=>r.O[e](n[u])))?n.splice(u--,1):(s=!1,o<a&&(a=o));s&&(e.splice(l--,1),t=i())}return t}o=o||0;for(var l=e.length;l>0&&e[l-1][2]>o;l--)e[l]=e[l-1];e[l]=[n,i,o]},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 i,o,[a,s,u]=n,l=0;for(i in s)r.o(s,i)&&(r.m[i]=s[i]);if(u)var c=u(r);for(t&&t(n);l<a.length;l++)o=a[l],r.o(e,o)&&e[o]&&e[o][0](),e[a[l]]=0;return r.O(c)},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(394)));var i=r.O(void 0,[106],(()=>r(716)));i=r.O(i)})();
extendify-sdk/readme.txt CHANGED
@@ -1,5 +1,5 @@
1
  === Extendify Sdk ===
2
  Requires at least: 5.4
3
- Stable tag: 4.8
4
  Requires PHP: 5.6
5
  Tested up to: 5.7.0
1
  === Extendify Sdk ===
2
  Requires at least: 5.4
3
+ Stable tag: 5.7
4
  Requires PHP: 5.6
5
  Tested up to: 5.7.0
extendify-sdk/src/api/Templates.js CHANGED
@@ -42,6 +42,7 @@ export const Templates = {
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
  })
@@ -50,6 +51,7 @@ export const Templates = {
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
  })
@@ -58,6 +60,7 @@ export const Templates = {
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
  })
42
  return api.post(`templates/${template.id}`, {
43
  template_id: template.id,
44
  maybe_import: true,
45
+ type: template.fields.type,
46
  pageSize: config.templatesPerRequest,
47
  template_name: template.fields?.title,
48
  })
51
  return api.post(`templates/${template.id}`, {
52
  template_id: template.id,
53
  single: true,
54
+ type: template.fields.type,
55
  pageSize: config.templatesPerRequest,
56
  template_name: template.fields?.title,
57
  })
60
  return api.post(`templates/${template.id}`, {
61
  template_id: template.id,
62
  imported: true,
63
+ type: template.fields.type,
64
  pageSize: config.templatesPerRequest,
65
  template_name: template.fields?.title,
66
  })
extendify-sdk/src/components/ImportButton.js CHANGED
@@ -1,4 +1,6 @@
1
- import { useEffect, useState } from '@wordpress/element'
 
 
2
  import { useTemplatesStore } from '../state/Templates'
3
  import { AuthorizationCheck, Middleware } from '../middleware'
4
  import { injectTemplateBlocks } from '../util/templateInjection'
@@ -10,6 +12,7 @@ import { Templates as TemplatesApi } from '../api/Templates'
10
 
11
  const canImportMiddleware = Middleware(['hasRequiredPlugins', 'hasPluginsActivated'])
12
  export function ImportButton({ template }) {
 
13
  const activeTemplateBlocks = useTemplatesStore(state => state.activeTemplateBlocks)
14
  const canImport = useUserStore(state => state.canImport)
15
  const apiKey = useUserStore(state => state.apiKey)
@@ -31,6 +34,12 @@ export function ImportButton({ template }) {
31
  return () => canImportMiddleware.reset() && setMiddlewareChecked(false)
32
  }, [template])
33
 
 
 
 
 
 
 
34
  const importTemplate = () => {
35
  // This was added here to make the call fire before rendering is finished.
36
  // This is because some users would drop this call otherwise.
@@ -46,6 +55,7 @@ export function ImportButton({ template }) {
46
 
47
  if (!apiKey && !canImport()) {
48
  return <a
 
49
  className="button-extendify-main text-lg sm:text-2xl py-1.5 px-3 sm:py-2.5 sm:px-5"
50
  target="_blank"
51
  href={`https://extendify.com/pricing?utm_source=${window.extendifySdkData.source}&utm_medium=library&utm_campaign=sign_up&utm_content=single_page`}
@@ -65,6 +75,7 @@ export function ImportButton({ template }) {
65
  }
66
 
67
  return <button
 
68
  type="button"
69
  className="components-button is-primary text-lg sm:text-2xl h-auto py-1.5 px-3 sm:py-2.5 sm:px-5"
70
  onClick={() => importTemplate()}>
1
+ import {
2
+ useEffect, useState, useRef,
3
+ } from '@wordpress/element'
4
  import { useTemplatesStore } from '../state/Templates'
5
  import { AuthorizationCheck, Middleware } from '../middleware'
6
  import { injectTemplateBlocks } from '../util/templateInjection'
12
 
13
  const canImportMiddleware = Middleware(['hasRequiredPlugins', 'hasPluginsActivated'])
14
  export function ImportButton({ template }) {
15
+ const importButtonRef = useRef(null)
16
  const activeTemplateBlocks = useTemplatesStore(state => state.activeTemplateBlocks)
17
  const canImport = useUserStore(state => state.canImport)
18
  const apiKey = useUserStore(state => state.apiKey)
34
  return () => canImportMiddleware.reset() && setMiddlewareChecked(false)
35
  }, [template])
36
 
37
+ useEffect(() => {
38
+ if (!importing && importButtonRef.current) {
39
+ importButtonRef.current.focus()
40
+ }
41
+ }, [importButtonRef, importing, middlewareChecked])
42
+
43
  const importTemplate = () => {
44
  // This was added here to make the call fire before rendering is finished.
45
  // This is because some users would drop this call otherwise.
55
 
56
  if (!apiKey && !canImport()) {
57
  return <a
58
+ ref={importButtonRef}
59
  className="button-extendify-main text-lg sm:text-2xl py-1.5 px-3 sm:py-2.5 sm:px-5"
60
  target="_blank"
61
  href={`https://extendify.com/pricing?utm_source=${window.extendifySdkData.source}&utm_medium=library&utm_campaign=sign_up&utm_content=single_page`}
75
  }
76
 
77
  return <button
78
+ ref={importButtonRef}
79
  type="button"
80
  className="components-button is-primary text-lg sm:text-2xl h-auto py-1.5 px-3 sm:py-2.5 sm:px-5"
81
  onClick={() => importTemplate()}>
extendify-sdk/src/components/TaxonomyList.js ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { getPluginDescription } from '../util/general'
2
+ import { __ } from '@wordpress/i18n'
3
+
4
+ export default function TaxonomyList({ categories, styles, types, requiredPlugins }) {
5
+ return <>
6
+ {categories && <div className="w-full pb-4">
7
+ <h3 className="text-sm m-0 mb-2">{__('Categories:', 'extendify-sdk')}</h3>
8
+ <div>{categories.join(', ')}</div>
9
+ </div>}
10
+ {styles && <div className="w-full py-4">
11
+ <h3 className="text-sm m-0 my-2">{__('Styles:', 'extendify-sdk')}</h3>
12
+ <div>{styles.join(', ')}</div>
13
+ </div>}
14
+ {types && <div className="w-full py-4">
15
+ <h3 className="text-sm m-0 my-2">{__('Types:', 'extendify-sdk')}</h3>
16
+ <div>{types.join(', ')}</div>
17
+ </div>}
18
+ {/* // Hardcoded temporarily to not force EP install */}
19
+ {/* {requiredPlugins && <div className="pt-4 w-full"> */}
20
+ {requiredPlugins.filter((p) => p !== 'editorplus').length > 0 && <div className="pt-4 w-full">
21
+ <h3 className="text-sm m-0 my-2">{__('Required Plugins:', 'extendify-sdk')}</h3>
22
+ <div>
23
+ {
24
+ // Hardcoded temporarily to not force EP install
25
+ // requiredPlugins.map(p => getPluginDescription(p)).join(', ')
26
+ requiredPlugins.filter((p) => p !== 'editorplus').map(p => getPluginDescription(p)).join(', ')
27
+ }
28
+ </div>
29
+ </div>}
30
+ <div className="py-4 mt-4">
31
+ <a
32
+ href={`https://extendify.com/what-happens-when-a-template-is-added?utm_source=${window.extendifySdkData.source}&utm_medium=library&utm_campaign=sidebar`}
33
+ rel="noreferrer"
34
+ target="_blank">
35
+ {__('What happens when a template is added?', 'extendify-sdk')}
36
+ </a>
37
+ </div>
38
+ </>
39
+ }
extendify-sdk/src/components/TemplatesList.js CHANGED
@@ -122,7 +122,7 @@ export default function TemplatesList({ templates }) {
122
  role="button"
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
122
  role="button"
123
  onClick={() => setActiveTemplate(template)}>
124
  <div>
125
+ <h4 className="m-0 font-bold">{template.fields.display_title}</h4>
126
  <p className="m-0">{template?.fields?.tax_categories?.filter(c => c.toLowerCase() !== 'default').join(', ')}</p>
127
  </div>
128
  <Button
extendify-sdk/src/components/TemplatesSingle.js CHANGED
@@ -5,17 +5,23 @@ 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">
18
- <h1 className="leading-tight text-left mb-2.5 sm:text-3xl font-normal">{template.fields.title}</h1>
19
  <ExternalLink href={template.fields.url}>
20
  {__('Demo', 'extendify-sdk')}
21
  </ExternalLink>
@@ -30,18 +36,16 @@ export default function Templates({ template }) {
30
  </div>
31
  <div className="max-w-screen-xl sm:w-full sm:m-0 sm:mb-12 m-6 border border-gray-300 m-46">
32
  <img
33
- className="max-w-full w-full"
34
  src={template?.fields?.screenshot[0]?.thumbnails?.full?.url ?? template?.fields?.screenshot[0]?.url}/>
35
  </div>
36
  {/* Hides on desktop and is repeated in the single sidebar too */}
37
- <div className="text-xs text-left p-6 w-full block sm:hidden">
38
- <h3 className="m-0 mb-6">{__('Categories', 'extendify-sdk')}</h3>
39
- <ul className="text-sm">
40
- {categories.map((category) =>
41
- <li key={category} className="inline-block mr-2 px-4 py-2 bg-gray-100">
42
- {category}
43
- </li>)}
44
- </ul>
45
  </div>
46
  </div>
47
  }
5
  import { ExternalLink } from '@wordpress/components'
6
  import { useEffect } from '@wordpress/element'
7
  import { Templates as TemplatesApi } from '../api/Templates'
8
+ import TaxonomyList from '../components/TaxonomyList'
9
 
10
  export default function Templates({ template }) {
11
+ const {
12
+ tax_categories: categories,
13
+ required_plugins: requiredPlugins,
14
+ tax_style: styles,
15
+ tax_pattern_types: types,
16
+ } = template.fields
17
  const apiKey = useUserStore(state => state.apiKey)
18
 
19
  useEffect(() => { TemplatesApi.single(template) }, [template])
20
 
21
  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">
22
  <div className="flex flex-col lg:flex-row items-start justify-start lg:items-center lg:justify-between w-full max-w-screen-xl">
23
+ <div className="text-left m-0 h-full p-6 sm:p-0">
24
+ <h1 className="leading-tight text-left mb-2.5 mt-0 sm:text-3xl font-normal">{template.fields.display_title}</h1>
25
  <ExternalLink href={template.fields.url}>
26
  {__('Demo', 'extendify-sdk')}
27
  </ExternalLink>
36
  </div>
37
  <div className="max-w-screen-xl sm:w-full sm:m-0 sm:mb-12 m-6 border border-gray-300 m-46">
38
  <img
39
+ className="max-w-full w-full block"
40
  src={template?.fields?.screenshot[0]?.thumbnails?.full?.url ?? template?.fields?.screenshot[0]?.url}/>
41
  </div>
42
  {/* Hides on desktop and is repeated in the single sidebar too */}
43
+ <div className="text-xs text-left p-6 w-full block sm:hidden divide-y">
44
+ <TaxonomyList
45
+ categories={categories}
46
+ types={types}
47
+ requiredPlugins={requiredPlugins}
48
+ styles={styles}/>
 
 
49
  </div>
50
  </div>
51
  }
extendify-sdk/src/layout/HasSidebar.js CHANGED
@@ -10,7 +10,7 @@ export default function HasSidebar({ children }) {
10
  }, [apiKey])
11
  return <>
12
  <aside className="flex-shrink-0 sm:pl-12 py-0 sm:py-6 relative">
13
- <div className="sm:w-56 lg:w-72 sticky flex flex-col h-full">{children[0]}</div>
14
  <div className="hidden sm:flex flex-col absolute bottom-0 bg-white p-4 w-72 text-left space-y-4">
15
  {canLogInOut && <div className="border-t border-gray-300"><LoginButton/></div>}
16
  </div>
@@ -18,7 +18,7 @@ export default function HasSidebar({ children }) {
18
  <main
19
  id="extendify-templates"
20
  tabIndex="0"
21
- className="w-full smp:l-12 sm:pt-6 h-full">
22
  {children[1]}
23
  </main>
24
  </>
10
  }, [apiKey])
11
  return <>
12
  <aside className="flex-shrink-0 sm:pl-12 py-0 sm:py-6 relative">
13
+ <div className="sm:w-56 lg:w-72 sticky flex flex-col lg:h-full">{children[0]}</div>
14
  <div className="hidden sm:flex flex-col absolute bottom-0 bg-white p-4 w-72 text-left space-y-4">
15
  {canLogInOut && <div className="border-t border-gray-300"><LoginButton/></div>}
16
  </div>
18
  <main
19
  id="extendify-templates"
20
  tabIndex="0"
21
+ className="w-full smp:l-12 sm:pt-6 h-full overflow-hidden">
22
  {children[1]}
23
  </main>
24
  </>
extendify-sdk/src/layout/MainWindow.js CHANGED
@@ -11,7 +11,7 @@ import { useGlobalStore } from '../state/GlobalState'
11
  import { useUserStore } from '../state/User'
12
 
13
  export default function MainWindow() {
14
- const initialFocus = useRef(null)
15
  const open = useGlobalStore(state => state.open)
16
  const setOpen = useGlobalStore(state => state.setOpen)
17
  const currentPage = useGlobalStore(state => state.currentPage)
@@ -29,7 +29,7 @@ export default function MainWindow() {
29
  as="div"
30
  static
31
  className="extendify-sdk"
32
- initialFocus={initialFocus}
33
  onClose={() => {}}
34
  >
35
  <div className="h-screen w-screen sm:h-auto sm:w-auto fixed z-high inset-0 overflow-y-auto">
@@ -48,16 +48,17 @@ export default function MainWindow() {
48
  enterFrom="opacity-0 translate-y-4 sm:translate-y-5"
49
  enterTo="opacity-100 translate-y-0"
50
  >
51
- <div className="fixed lg:absolute inset-0 lg:overflow-hidden transform transition-all lg:p-5">
 
 
 
52
  {/* TODO: With all the new pages, it's probably a good time to refactor this and organize things better here */}
53
  {currentPage === 'welcome'
54
  ? <Welcome
55
- initialFocus={initialFocus}
56
  className="w-full h-full flex flex-col items-center relative shadow-xl max-w-screen-4xl mx-auto bg-extendify-light"/>
57
  : <div className="bg-white h-full flex flex-col items-center relative shadow-xl max-w-screen-4xl mx-auto">
58
  <Toolbar
59
  className="w-full h-16 border-solid border-0 border-b border-gray-300 flex-shrink-0"
60
- initialFocus={initialFocus}
61
  hideLibrary={() => setOpen(false)}/>
62
  {currentPage === 'content' &&
63
  <Content className="w-full flex-grow overflow-hidden"/>
11
  import { useUserStore } from '../state/User'
12
 
13
  export default function MainWindow() {
14
+ const containerRef = useRef(null)
15
  const open = useGlobalStore(state => state.open)
16
  const setOpen = useGlobalStore(state => state.setOpen)
17
  const currentPage = useGlobalStore(state => state.currentPage)
29
  as="div"
30
  static
31
  className="extendify-sdk"
32
+ initialFocus={containerRef}
33
  onClose={() => {}}
34
  >
35
  <div className="h-screen w-screen sm:h-auto sm:w-auto fixed z-high inset-0 overflow-y-auto">
48
  enterFrom="opacity-0 translate-y-4 sm:translate-y-5"
49
  enterTo="opacity-100 translate-y-0"
50
  >
51
+ <div
52
+ ref={containerRef}
53
+ tabIndex="0"
54
+ className="fixed lg:absolute inset-0 lg:overflow-hidden transform transition-all lg:p-5">
55
  {/* TODO: With all the new pages, it's probably a good time to refactor this and organize things better here */}
56
  {currentPage === 'welcome'
57
  ? <Welcome
 
58
  className="w-full h-full flex flex-col items-center relative shadow-xl max-w-screen-4xl mx-auto bg-extendify-light"/>
59
  : <div className="bg-white h-full flex flex-col items-center relative shadow-xl max-w-screen-4xl mx-auto">
60
  <Toolbar
61
  className="w-full h-16 border-solid border-0 border-b border-gray-300 flex-shrink-0"
 
62
  hideLibrary={() => setOpen(false)}/>
63
  {currentPage === 'content' &&
64
  <Content className="w-full flex-grow overflow-hidden"/>
extendify-sdk/src/{components → layout}/SidebarSingle.js RENAMED
@@ -1,20 +1,19 @@
1
- import { useEffect, useRef } from '@wordpress/element'
2
  import { __ } from '@wordpress/i18n'
3
  import { useGlobalStore } from '../state/GlobalState'
4
  import { useTemplatesStore } from '../state/Templates'
5
  import { useUserStore } from '../state/User'
6
- import { getPluginDescription } from '../util/general'
7
 
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(() => {
15
- goBackRef.current.focus()
16
- }, [])
17
-
18
  return <div className="flex flex-col items-start justify-start">
19
  {!apiKey.length && <div className="h-full flex sm:hidden w-full p-4 justify-between border items-center border-gray-300 bg-extendify-lightest">
20
  <a
@@ -34,7 +33,6 @@ export default function SidebarSingle({ template }) {
34
  </div>}
35
  <div className="p-6 sm:p-0">
36
  <button
37
- ref={goBackRef}
38
  type="button"
39
  className="cursor-pointer text-black bg-transparent font-medium flex items-center p-3 transform -translate-x-3 button-focus"
40
  onClick={() => setActiveTemplate({})}>
@@ -46,38 +44,11 @@ export default function SidebarSingle({ template }) {
46
  </div>
47
  {/* Hides on mobile and is repeated at the bottom of the single page too */}
48
  <div className="text-left pt-14 divide-y w-full hidden sm:block">
49
- <div className="w-full py-6">
50
- <h3 className="m-0 mb-6">{__('Categories', 'extendify-sdk')}</h3>
51
- <ul className="text-sm m-0">
52
- {categories.map((category) =>
53
- <li key={category} className="inline-block mr-2 px-4 py-2 bg-gray-100">
54
- {category}
55
- </li>)}
56
- </ul>
57
- </div>
58
- {/* // Hardcoded temporarily to not force EP install */}
59
- {/* {requiredPlugins.filter((p) => p !== 'editorplus').length > 0 && <div className="pt-4 w-full"> */}
60
- {requiredPlugins && <div className="pt-4 w-full">
61
- <h3 className="m-0 mb-6">{__('Required Plugins', 'extendify-sdk')}</h3>
62
- <ul className="text-sm">
63
- {
64
- // Hardcoded temporarily to not force EP install
65
- // requiredPlugins.filter((p) => p !== 'editorplus').map((plugin) =>
66
- requiredPlugins.map((plugin) =>
67
- <li key={plugin} className="inline-block mr-2 px-4 py-2 bg-extendify-light">
68
- {getPluginDescription(plugin)}
69
- </li>)
70
- }
71
- </ul>
72
- </div>}
73
- <div className="py-6">
74
- <a
75
- href={`https://extendify.com/what-happens-when-a-template-is-added?utm_source=${window.extendifySdkData.source}&utm_medium=library&utm_campaign=sidebar`}
76
- rel="noreferrer"
77
- target="_blank">
78
- {__('What happens when a template is added?', 'extendify-sdk')}
79
- </a>
80
- </div>
81
  </div>
82
  </div>
83
  }
 
1
  import { __ } from '@wordpress/i18n'
2
  import { useGlobalStore } from '../state/GlobalState'
3
  import { useTemplatesStore } from '../state/Templates'
4
  import { useUserStore } from '../state/User'
5
+ import TaxonomyList from '../components/TaxonomyList'
6
 
7
  export default function SidebarSingle({ template }) {
8
  const setActiveTemplate = useTemplatesStore(state => state.setActive)
9
+ const {
10
+ tax_categories: categories,
11
+ required_plugins: requiredPlugins,
12
+ tax_style: styles,
13
+ tax_pattern_types: types,
14
+ } = template.fields
15
  const apiKey = useUserStore(state => state.apiKey)
16
 
 
 
 
 
17
  return <div className="flex flex-col items-start justify-start">
18
  {!apiKey.length && <div className="h-full flex sm:hidden w-full p-4 justify-between border items-center border-gray-300 bg-extendify-lightest">
19
  <a
33
  </div>}
34
  <div className="p-6 sm:p-0">
35
  <button
 
36
  type="button"
37
  className="cursor-pointer text-black bg-transparent font-medium flex items-center p-3 transform -translate-x-3 button-focus"
38
  onClick={() => setActiveTemplate({})}>
44
  </div>
45
  {/* Hides on mobile and is repeated at the bottom of the single page too */}
46
  <div className="text-left pt-14 divide-y w-full hidden sm:block">
47
+ <TaxonomyList
48
+ categories={categories}
49
+ types={types}
50
+ requiredPlugins={requiredPlugins}
51
+ styles={styles}/>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
52
  </div>
53
  </div>
54
  }
extendify-sdk/src/layout/Toolbar.js CHANGED
@@ -1,7 +1,7 @@
1
  import { __, sprintf } from '@wordpress/i18n'
2
  import { useUserStore } from '../state/User'
3
 
4
- export default function Toolbar({ className, hideLibrary, initialFocus }) {
5
  const remainingImports = useUserStore(state => state.remainingImports)
6
  const apiKey = useUserStore(state => state.apiKey)
7
  const allowedImports = useUserStore(state => state.allowedImports)
@@ -45,7 +45,7 @@ export default function Toolbar({ className, hideLibrary, initialFocus }) {
45
  </>}
46
  </div>
47
  <div className="space-x-2 transform sm:translate-x-8">
48
- <button ref={initialFocus} type="button" className="components-button has-icon" onClick={() => hideLibrary()}>
49
  <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"><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"></path></svg>
50
  <span className="sr-only">{__('Close library', 'extendify-sdk')}</span>
51
  </button>
1
  import { __, sprintf } from '@wordpress/i18n'
2
  import { useUserStore } from '../state/User'
3
 
4
+ export default function Toolbar({ className, hideLibrary }) {
5
  const remainingImports = useUserStore(state => state.remainingImports)
6
  const apiKey = useUserStore(state => state.apiKey)
7
  const allowedImports = useUserStore(state => state.allowedImports)
45
  </>}
46
  </div>
47
  <div className="space-x-2 transform sm:translate-x-8">
48
+ <button type="button" className="components-button has-icon" onClick={() => hideLibrary()}>
49
  <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"><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"></path></svg>
50
  <span className="sr-only">{__('Close library', 'extendify-sdk')}</span>
51
  </button>
extendify-sdk/src/middleware/NeedsPermissionModal.js ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { __, sprintf } from '@wordpress/i18n'
2
+ import { Modal, Button } from '@wordpress/components'
3
+ import { render } from '@wordpress/element'
4
+ import ExtendifyLibrary from '../layout/ExtendifyLibrary'
5
+ import { useWantedTemplateStore } from '../state/Importing'
6
+ import { getPluginDescription } from '../util/general'
7
+
8
+ export default function NeedsPermissionModal() {
9
+ const wantedTemplate = useWantedTemplateStore(store => store.wantedTemplate)
10
+ const closeModal = () => render(<ExtendifyLibrary show={true}/>, document.getElementById('extendify-root'))
11
+ const requiredPlugins = wantedTemplate?.fields?.required_plugins || []
12
+ return <Modal
13
+ title={__('Plugins required', 'extendify-sdk')}
14
+ closeButtonLabel={__('Return to library', 'extendify-sdk')}
15
+ onRequestClose={closeModal}>
16
+ <p style={{
17
+ maxWidth: '400px',
18
+ }}>
19
+ {sprintf(__('In order to add this %s to your site, the following plugins are required to be installed and activated.', 'extendify-sdk'), wantedTemplate?.fields?.type ?? 'template')}
20
+ </p>
21
+ <ul>
22
+ {
23
+ // Hardcoded temporarily to not force EP install
24
+ // requiredPlugins.map((plugin) =>
25
+ requiredPlugins.filter((p) => p !== 'editorplus').map((plugin) =>
26
+ <li key={plugin}>
27
+ {getPluginDescription(plugin)}
28
+ </li>)
29
+ }
30
+ </ul>
31
+ <p style={{
32
+ maxWidth: '400px',fontWeight: 'bold',
33
+ }}>
34
+ {__('Please contact a site admin for assistance in adding these plugins to your site.', 'extendify-sdk')}
35
+ </p>
36
+ <Button isPrimary onClick={closeModal} style={{
37
+ boxShadow: 'none',
38
+ }}>
39
+ {__('Return to library', 'extendify-sdk')}
40
+ </Button>
41
+ </Modal>
42
+ }
extendify-sdk/src/middleware/hasPluginsActivated/ActivatePluginsModal.js CHANGED
@@ -7,6 +7,8 @@ import ActivatingModal from './ActivatingModal'
7
  import ExtendifyLibrary from '../../layout/ExtendifyLibrary'
8
  import { useWantedTemplateStore } from '../../state/Importing'
9
  import { getPluginDescription } from '../../util/general'
 
 
10
 
11
  export default function ActivatePluginsModal(props) {
12
  const wantedTemplate = useWantedTemplateStore(store => store.wantedTemplate)
@@ -14,6 +16,10 @@ export default function ActivatePluginsModal(props) {
14
  const installPlugins = () => render(<ActivatingModal />, document.getElementById('extendify-root'))
15
  const requiredPlugins = wantedTemplate?.fields?.required_plugins || []
16
 
 
 
 
 
17
  return <Modal
18
  title={__('Activate required plugins', 'extendify-sdk')}
19
  closeButtonLabel={__('No thanks, return to library', 'extendify-sdk')}
@@ -29,8 +35,8 @@ export default function ActivatePluginsModal(props) {
29
  <ul>
30
  {
31
  // Hardcoded temporarily to not force EP install
32
- // requiredPlugins.filter((p) => p !== 'editorplus').map((plugin) =>
33
- requiredPlugins.map((plugin) =>
34
  <li key={plugin}>
35
  {getPluginDescription(plugin)}
36
  </li>)
7
  import ExtendifyLibrary from '../../layout/ExtendifyLibrary'
8
  import { useWantedTemplateStore } from '../../state/Importing'
9
  import { getPluginDescription } from '../../util/general'
10
+ import { useUserStore } from '../../state/User'
11
+ import NeedsPermissionModal from '../NeedsPermissionModal'
12
 
13
  export default function ActivatePluginsModal(props) {
14
  const wantedTemplate = useWantedTemplateStore(store => store.wantedTemplate)
16
  const installPlugins = () => render(<ActivatingModal />, document.getElementById('extendify-root'))
17
  const requiredPlugins = wantedTemplate?.fields?.required_plugins || []
18
 
19
+ if (!useUserStore.getState()?.canActivatePlugins) {
20
+ return <NeedsPermissionModal/>
21
+ }
22
+
23
  return <Modal
24
  title={__('Activate required plugins', 'extendify-sdk')}
25
  closeButtonLabel={__('No thanks, return to library', 'extendify-sdk')}
35
  <ul>
36
  {
37
  // Hardcoded temporarily to not force EP install
38
+ // requiredPlugins.map((plugin) =>
39
+ requiredPlugins.filter((p) => p !== 'editorplus').map((plugin) =>
40
  <li key={plugin}>
41
  {getPluginDescription(plugin)}
42
  </li>)
extendify-sdk/src/middleware/hasPluginsActivated/ActivatingModal.js CHANGED
@@ -10,17 +10,18 @@ export default function ActivatingModal() {
10
  const [errorMessage, setErrorMessage] = useState('')
11
  const wantedTemplate = useWantedTemplateStore(store => store.wantedTemplate)
12
 
13
- Plugins.installAndActivate(wantedTemplate?.fields?.required_plugins)
14
- // Hardcoded temporarily to not force EP install
15
- // .filter(p => p !== 'editorplus')).then(() => {
16
- .then(() => {
17
- useWantedTemplateStore.setState({
18
- importOnLoad: true,
19
- })
20
- }).then(async () => {
21
- await new Promise((resolve) => setTimeout(resolve, 1000))
22
- render(<ReloadRequiredModal />, document.getElementById('extendify-root'))
23
  })
 
 
 
 
24
  .catch(({ response }) => {
25
  setErrorMessage(response.data.message)
26
  })
10
  const [errorMessage, setErrorMessage] = useState('')
11
  const wantedTemplate = useWantedTemplateStore(store => store.wantedTemplate)
12
 
13
+ // Hardcoded temporarily to not force EP install
14
+ // const required = wantedTemplate?.fields?.required_plugins
15
+ const required = wantedTemplate?.fields?.required_plugins.filter(p => p !== 'editorplus')
16
+
17
+ Plugins.installAndActivate(required).then(() => {
18
+ useWantedTemplateStore.setState({
19
+ importOnLoad: true,
 
 
 
20
  })
21
+ }).then(async () => {
22
+ await new Promise((resolve) => setTimeout(resolve, 1000))
23
+ render(<ReloadRequiredModal />, document.getElementById('extendify-root'))
24
+ })
25
  .catch(({ response }) => {
26
  setErrorMessage(response.data.message)
27
  })
extendify-sdk/src/middleware/hasRequiredPlugins/InstallingModal.js CHANGED
@@ -10,7 +10,11 @@ export default function InstallingModal() {
10
  const [errorMessage, setErrorMessage] = useState('')
11
  const wantedTemplate = useWantedTemplateStore(store => store.wantedTemplate)
12
 
13
- Plugins.installAndActivate(wantedTemplate?.fields?.required_plugins).then(() => {
 
 
 
 
14
  useWantedTemplateStore.setState({
15
  importOnLoad: true,
16
  })
10
  const [errorMessage, setErrorMessage] = useState('')
11
  const wantedTemplate = useWantedTemplateStore(store => store.wantedTemplate)
12
 
13
+ // Hardcoded temporarily to not force EP install
14
+ // const required = wantedTemplate?.fields?.required_plugins
15
+ const required = wantedTemplate?.fields?.required_plugins.filter(p => p !== 'editorplus')
16
+
17
+ Plugins.installAndActivate(required).then(() => {
18
  useWantedTemplateStore.setState({
19
  importOnLoad: true,
20
  })
extendify-sdk/src/middleware/hasRequiredPlugins/RequiredPluginsModal.js CHANGED
@@ -7,6 +7,8 @@ import { render } from '@wordpress/element'
7
  import InstallingModal from './InstallingModal'
8
  import { useWantedTemplateStore } from '../../state/Importing'
9
  import { getPluginDescription } from '../../util/general'
 
 
10
 
11
  export default function RequiredPluginsModal(props) {
12
  const wantedTemplate = useWantedTemplateStore(store => store.wantedTemplate)
@@ -19,6 +21,10 @@ export default function RequiredPluginsModal(props) {
19
  const installPlugins = () => render(<InstallingModal />, document.getElementById('extendify-root'))
20
  const requiredPlugins = wantedTemplate?.fields?.required_plugins || []
21
 
 
 
 
 
22
  return <Modal
23
  title={props.title ?? __('Install required plugins', 'extendify-sdk')}
24
  closeButtonLabel={__('No thanks, take me back', 'extendify-sdk')}
@@ -34,8 +40,8 @@ export default function RequiredPluginsModal(props) {
34
  {props.message?.length > 0 || <ul>
35
  {
36
  // Hardcoded temporarily to not force EP install
37
- // requiredPlugins.filter((p) => p !== 'editorplus').map((plugin) =>
38
- requiredPlugins.map((plugin) =>
39
  <li key={plugin}>
40
  {getPluginDescription(plugin)}
41
  </li>)
7
  import InstallingModal from './InstallingModal'
8
  import { useWantedTemplateStore } from '../../state/Importing'
9
  import { getPluginDescription } from '../../util/general'
10
+ import { useUserStore } from '../../state/User'
11
+ import NeedsPermissionModal from '../NeedsPermissionModal'
12
 
13
  export default function RequiredPluginsModal(props) {
14
  const wantedTemplate = useWantedTemplateStore(store => store.wantedTemplate)
21
  const installPlugins = () => render(<InstallingModal />, document.getElementById('extendify-root'))
22
  const requiredPlugins = wantedTemplate?.fields?.required_plugins || []
23
 
24
+ if (!useUserStore.getState()?.canInstallPlugins) {
25
+ return <NeedsPermissionModal/>
26
+ }
27
+
28
  return <Modal
29
  title={props.title ?? __('Install required plugins', 'extendify-sdk')}
30
  closeButtonLabel={__('No thanks, take me back', 'extendify-sdk')}
40
  {props.message?.length > 0 || <ul>
41
  {
42
  // Hardcoded temporarily to not force EP install
43
+ // requiredPlugins.map((plugin) =>
44
+ requiredPlugins.filter((p) => p !== 'editorplus').map((plugin) =>
45
  <li key={plugin}>
46
  {getPluginDescription(plugin)}
47
  </li>)
extendify-sdk/src/middleware/helpers.js CHANGED
@@ -1,10 +1,11 @@
1
  import { Plugins } from '../api/Plugins'
2
  import { get } from 'lodash'
 
3
  export async function checkIfUserNeedsToInstallPlugins(template) {
4
  // TODO: for now assume required plugins is valid data (from Airtable)!
5
- const required = get(template, 'fields.required_plugins') ?? []
6
  // Hardcoded temporarily to not force EP install
7
- // required = required.filter((p) => p !== 'editorplus')
8
  if (!required.length) {
9
  return false
10
  }
@@ -25,10 +26,10 @@ export async function checkIfUserNeedsToInstallPlugins(template) {
25
 
26
  export async function checkIfUserNeedsToActivatePlugins(template) {
27
  // TODO: for now assume required plugins is valid data (from Airtable)!
28
- const required = get(template, 'fields.required_plugins') ?? []
29
 
30
  // Hardcoded temporarily to not force EP install
31
- // required = required.filter((p) => p !== 'editorplus')
32
  if (!required.length) {
33
  return false
34
  }
1
  import { Plugins } from '../api/Plugins'
2
  import { get } from 'lodash'
3
+
4
  export async function checkIfUserNeedsToInstallPlugins(template) {
5
  // TODO: for now assume required plugins is valid data (from Airtable)!
6
+ let required = get(template, 'fields.required_plugins') ?? []
7
  // Hardcoded temporarily to not force EP install
8
+ required = required.filter((p) => p !== 'editorplus')
9
  if (!required.length) {
10
  return false
11
  }
26
 
27
  export async function checkIfUserNeedsToActivatePlugins(template) {
28
  // TODO: for now assume required plugins is valid data (from Airtable)!
29
+ let required = get(template, 'fields.required_plugins') ?? []
30
 
31
  // Hardcoded temporarily to not force EP install
32
+ required = required.filter((p) => p !== 'editorplus')
33
  if (!required.length) {
34
  return false
35
  }
extendify-sdk/src/middleware/index.js CHANGED
@@ -8,7 +8,7 @@ export const Middleware = (middleware = []) => {
8
  stack: [],
9
  async check(template) {
10
  for (const m of middleware) {
11
- let cb = await this[`${m}`](template)
12
  setTimeout(() => {
13
  this.stack.push(cb.pass
14
  ? cb.allow
8
  stack: [],
9
  async check(template) {
10
  for (const m of middleware) {
11
+ const cb = await this[`${m}`](template)
12
  setTimeout(() => {
13
  this.stack.push(cb.pass
14
  ? cb.allow
extendify-sdk/src/pages/Content.js CHANGED
@@ -1,4 +1,3 @@
1
- // import { useEffect } from '@wordpress/element'
2
  import { useTemplatesStore } from '../state/Templates'
3
  import Filtering from '../components/Filtering'
4
  import TemplatesList from '../components/TemplatesList'
@@ -6,10 +5,10 @@ import TemplatesSingle from '../components/TemplatesSingle'
6
  import HasSidebar from '../layout/HasSidebar'
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)
14
  const activeTemplate = useTemplatesStore(state => state.activeTemplate)
15
  return <div className={className}>
@@ -26,13 +25,13 @@ export default function Content({ className, initialFocus }) {
26
  </div>
27
  }
28
  <HasSidebar>
29
- <Filtering initialFocus={initialFocus}/>
30
  <>
31
  <TypeSelect/>
32
  {/* TODO: we may want to inject this as a portal so it can directly share state with Filtering.js */}
33
  <TaxonomyBreadcrumbs/>
34
  <div className="relative h-full z-30 bg-white">
35
- <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">
36
  <TemplatesList templates={templates}/>
37
  </div>
38
  </div>
 
1
  import { useTemplatesStore } from '../state/Templates'
2
  import Filtering from '../components/Filtering'
3
  import TemplatesList from '../components/TemplatesList'
5
  import HasSidebar from '../layout/HasSidebar'
6
  import TypeSelect from '../components/TypeSelect'
7
  import { __ } from '@wordpress/i18n'
8
+ import SidebarSingle from '../layout/SidebarSingle'
9
  import TaxonomyBreadcrumbs from '../components/TaxonomyBreadcrumbs'
10
 
11
+ export default function Content({ className }) {
12
  const templates = useTemplatesStore(state => state.templates)
13
  const activeTemplate = useTemplatesStore(state => state.activeTemplate)
14
  return <div className={className}>
25
  </div>
26
  }
27
  <HasSidebar>
28
+ <Filtering/>
29
  <>
30
  <TypeSelect/>
31
  {/* TODO: we may want to inject this as a portal so it can directly share state with Filtering.js */}
32
  <TaxonomyBreadcrumbs/>
33
  <div className="relative h-full z-30 bg-white">
34
+ <div className="absolute z-20 inset-0 lg:static h-screen overflow-y-auto pt-4 sm:pt-0 px-6 sm:pl-0 sm:pr-8">
35
  <TemplatesList templates={templates}/>
36
  </div>
37
  </div>
extendify-sdk/src/pages/Welcome.js CHANGED
@@ -6,7 +6,7 @@ import { useUserStore } from '../state/User'
6
  import { SimplePing } from '../api/SimplePing'
7
  import { useEffect } from '@wordpress/element'
8
 
9
- export default function Login({ className, initialFocus }) {
10
  const updateSearchParams = useTemplatesStore(state => state.updateSearchParams)
11
  const updateTypeAndClose = (type) => {
12
  SimplePing.action(`welcome-${type ?? 'closed'}`)
@@ -32,7 +32,6 @@ export default function Login({ className, initialFocus }) {
32
  </div>
33
  <div className="space-x-2 transform sm:translate-x-8">
34
  <button
35
- ref={initialFocus}
36
  type="button"
37
  className="components-button has-icon"
38
  onClick={() => updateTypeAndClose()}>
6
  import { SimplePing } from '../api/SimplePing'
7
  import { useEffect } from '@wordpress/element'
8
 
9
+ export default function Login({ className }) {
10
  const updateSearchParams = useTemplatesStore(state => state.updateSearchParams)
11
  const updateTypeAndClose = (type) => {
12
  SimplePing.action(`welcome-${type ?? 'closed'}`)
32
  </div>
33
  <div className="space-x-2 transform sm:translate-x-8">
34
  <button
 
35
  type="button"
36
  className="components-button has-icon"
37
  onClick={() => updateTypeAndClose()}>
extendify-sdk/src/state/GlobalState.js CHANGED
@@ -11,5 +11,6 @@ export const useGlobalStore = create((set) => ({
11
  // Reset the state if it's closed manualy
12
  // value && useTemplatesStore.getState().setActive({}) - Not this though
13
  value && useTemplatesStore.getState().removeTemplates()
 
14
  },
15
  }))
11
  // Reset the state if it's closed manualy
12
  // value && useTemplatesStore.getState().setActive({}) - Not this though
13
  value && useTemplatesStore.getState().removeTemplates()
14
+ // value && useTemplatesStore.getState().setActive({}) // This can be used to default to grid
15
  },
16
  }))
extendify-sdk/src/state/Templates.js CHANGED
@@ -33,7 +33,9 @@ export const useTemplatesStore = create((set, get) => ({
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,
@@ -58,7 +60,7 @@ export const useTemplatesStore = create((set, get) => ({
58
  resetTaxonomies: () => {
59
  // Special default state for tax_categories
60
  const taxCatException = {
61
- tax_categories: get().searchParams.type === 'pattern'
62
  ? 'Default'
63
  : '',
64
  }
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 = Object.assign(
37
+ {}, taxonomyDefaultState, get().searchParams.taxonomies,
38
+ )
39
 
40
  set({
41
  taxonomyDefaultState: taxonomyDefaultState,
60
  resetTaxonomies: () => {
61
  // Special default state for tax_categories
62
  const taxCatException = {
63
+ ['tax_categories']: get().searchParams.type === 'pattern'
64
  ? 'Default'
65
  : '',
66
  }
extendify-sdk/src/state/User.js CHANGED
@@ -16,6 +16,8 @@ export const useUserStore = create(persist((set, get) => ({
16
  entryPoint: 'not-set',
17
  enabled: true,
18
  hasClickedThroughWelcomePage: false,
 
 
19
  incrementImports: () => set({
20
  imports: get().imports + 1,
21
  }),
16
  entryPoint: 'not-set',
17
  enabled: true,
18
  hasClickedThroughWelcomePage: false,
19
+ canInstallPlugins: false,
20
+ canActivatePlugins: false,
21
  incrementImports: () => set({
22
  imports: get().imports + 1,
23
  }),
ml-slider.php CHANGED
@@ -6,7 +6,7 @@
6
  * Plugin Name: MetaSlider
7
  * Plugin URI: https://www.metaslider.com
8
  * Description: Easy to use slideshow plugin. Create SEO optimised responsive slideshows with Nivo Slider, Flex Slider, Coin Slider and Responsive Slides.
9
- * Version: 3.21.0
10
  * Author: MetaSlider
11
  * Author URI: https://www.metaslider.com
12
  * License: GPL-2.0+
@@ -35,7 +35,7 @@ class MetaSliderPlugin
35
  *
36
  * @var string
37
  */
38
- public $version = '3.21.0';
39
 
40
  /**
41
  * Pro installed version number
6
  * Plugin Name: MetaSlider
7
  * Plugin URI: https://www.metaslider.com
8
  * Description: Easy to use slideshow plugin. Create SEO optimised responsive slideshows with Nivo Slider, Flex Slider, Coin Slider and Responsive Slides.
9
+ * Version: 3.22.0
10
  * Author: MetaSlider
11
  * Author URI: https://www.metaslider.com
12
  * License: GPL-2.0+
35
  *
36
  * @var string
37
  */
38
+ public $version = '3.22.0';
39
 
40
  /**
41
  * Pro installed version number
readme.txt CHANGED
@@ -2,7 +2,7 @@
2
  Contributors: matchalabs, DavidAnderson, dnutbourne, kbat82
3
  Tags: slideshow, slider, image slider, carousel, gallery, flexslider, wordpress slider, nivoslider, rotating banner, responsive slideshow, seo slideshow, unsplash
4
  Requires at least: 3.5
5
- Stable tag: 3.21.0
6
  Requires PHP: 5.2
7
  Tested up to: 5.8
8
  License: GPLv2 or later
@@ -288,6 +288,9 @@ See https://www.metaslider.com/documentation/image-cropping/
288
 
289
  == Changelog ==
290
 
 
 
 
291
  = 3.21.0 - 2021/July/19 =
292
  * FEATURE: Adds MetaSLider patterns to editor Library
293
  * FIX: Fixes incorrect support URL link
2
  Contributors: matchalabs, DavidAnderson, dnutbourne, kbat82
3
  Tags: slideshow, slider, image slider, carousel, gallery, flexslider, wordpress slider, nivoslider, rotating banner, responsive slideshow, seo slideshow, unsplash
4
  Requires at least: 3.5
5
+ Stable tag: 3.22.0
6
  Requires PHP: 5.2
7
  Tested up to: 5.8
8
  License: GPLv2 or later
288
 
289
  == Changelog ==
290
 
291
+ = 3.22.0 - 2021/Aug/05 =
292
+ * TWEAK: Remove plugin dependency from editor library
293
+
294
  = 3.21.0 - 2021/July/19 =
295
  * FEATURE: Adds MetaSLider patterns to editor Library
296
  * FIX: Fixes incorrect support URL link