Responsive Menu - Version 4.1.5

Version Description

(17th Nov 2021) = Enhancement: Refactored code to use wp_enqueue functions while including JS and CSS Enhancement: Removed external dependencies (CDN url and third party server scripts) Enhancement: Removed legacy code and rollback feature Enhancement: Removed encrypted code from third party libraries Enhancement: "Sanitized, Escaped, and Validated" all variable, file uploads and data

Download this release

Release Info

Developer expresstech
Plugin Icon 128x128 Responsive Menu
Version 4.1.5
Comparing to
See all releases

Code changes from version 4.1.4 to 4.1.5

readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: expresstech, responsivemenu, imvarunkmr, surajkumarsingh, infosatech
3
  Tags: responsive, mega menu, navigation, mobile, hamburger
4
  Requires at least: 3.6
5
- Tested up to: 5.7
6
- Stable tag: 4.1.4
7
  Requires PHP: 5.6
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -103,6 +103,13 @@ To view our FAQ, please go to [https://responsive.menu/faq/](https://responsive.
103
 
104
  == Changelog ==
105
 
 
 
 
 
 
 
 
106
  = 4.1.4 (17th Sep 2021) =
107
  Bug: Fixed transparent background issue.
108
  Feature: Added option to search settings in customizer.
2
  Contributors: expresstech, responsivemenu, imvarunkmr, surajkumarsingh, infosatech
3
  Tags: responsive, mega menu, navigation, mobile, hamburger
4
  Requires at least: 3.6
5
+ Tested up to: 5.8
6
+ Stable tag: 4.1.5
7
  Requires PHP: 5.6
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
103
 
104
  == Changelog ==
105
 
106
+ = 4.1.5 (17th Nov 2021) =
107
+ Enhancement: Refactored code to use wp_enqueue functions while including JS and CSS
108
+ Enhancement: Removed external dependencies (CDN url and third party server scripts)
109
+ Enhancement: Removed legacy code and rollback feature
110
+ Enhancement: Removed encrypted code from third party libraries
111
+ Enhancement: "Sanitized, Escaped, and Validated" all variable, file uploads and data
112
+
113
  = 4.1.4 (17th Sep 2021) =
114
  Bug: Fixed transparent background issue.
115
  Feature: Added option to search settings in customizer.
responsive-menu.php CHANGED
@@ -4,7 +4,7 @@
4
  Plugin Name: Responsive Menu
5
  Plugin URI: https://expresstech.io
6
  Description: Highly Customisable Responsive Menu Plugin for WordPress
7
- Version: 4.1.4
8
  Author: ExpressTech
9
  Text Domain: responsive-menu
10
  Author URI: https://responsive.menu
@@ -16,7 +16,7 @@ Tags: responsive, menu, responsive menu, mega menu, max mega menu, max menu
16
  * Constant as plugin version.
17
  */
18
  if ( ! defined( 'RMP_PLUGIN_VERSION' ) ) {
19
- define( 'RMP_PLUGIN_VERSION', '4.1.4' );
20
  }
21
 
22
  define('RESPONSIVE_MENU_URL', plugin_dir_url( __FILE__ ) );
@@ -30,7 +30,7 @@ function check_responsive_menu_php_version() {
30
  }
31
 
32
  function responsive_menu_deactivation_text() {
33
- echo '<div class="error"><p>' . sprintf(
34
  'Responsive Menu requires PHP 5.4 or higher to function and has therefore been automatically disabled.
35
  You are still on %s.%sPlease speak to your web host about upgrading your PHP version.',
36
  PHP_VERSION,
@@ -41,220 +41,151 @@ function responsive_menu_deactivation_text() {
41
  if(version_compare(PHP_VERSION, '5.4', '<'))
42
  return;
43
 
44
- if ( empty( get_option( 'is_rmp_new_version') ) && ! empty( get_option('responsive_menu_version') ) ) {
 
 
 
45
 
46
  /**
47
- * Add admin notice to upgrade the plugin license.
48
  */
49
- add_action( 'admin_notices', 'rmp_move_new_version_admin_notice' );
50
- function rmp_move_new_version_admin_notice() {
 
51
 
52
- if ( ! empty( get_option( 'rm_upgrade_admin_notice' ) ) ) {
53
- return;
54
- }
 
 
 
55
 
56
- if ( empty( $_GET['page'] ) || 'responsive-menu' !== $_GET['page'] ) {
57
- return;
58
- }
59
- ?>
60
-
61
- <div class="notice-responsive-menu notice error is-dismissible rmp-version-upgrade-notice">
62
- <div class="notice-responsive-menu-logo">
63
- <img src="<?php echo RESPONSIVE_MENU_URL;?>/imgs/responsive-menu-logo.png" width="60" height="60" alt="logo" />
64
- </div>
65
- <div class="notice-responsive-menu-message">
66
- <h4 style="font-weight: 700;"><?php _e('Responsive Menu', 'responsive-menu-pro'); ?></h4>
67
- <p><?php _e( 'Try out our new version with improved layout, live preview and many more.', 'responsive-menu-pro' ); ?></p>
68
- </div>
69
- <div class="notice-responsive-menu-action">
70
- <a href="javascript:void(0)" class="rmp-upgrade-version" > <?php _e('Try, New version', 'responsive-menu-pro'); ?> </a>
71
- </div>
72
- </div>
73
- <?php
74
  }
75
 
76
- add_action( 'admin_notices', 'og_pro_deactivate_pro_version_notice');
 
 
 
 
 
77
 
78
- function og_pro_deactivate_pro_version_notice() {
79
- if(get_transient('og-admin-notice-activation-pro')) {
80
- ?>
81
- <div class="notice notice-error is-dismissible">
82
- <p>Responsive Menu Pro has been deactivated<p/>
 
83
 
84
- </div>
85
- <?php
86
- delete_transient('og-admin-notice-activation-pro');
87
- }
 
88
  }
89
 
90
- function og_deactivate_responsive_menu_pro() {
 
 
 
 
 
91
 
92
- $plugin = 'responsive-menu-pro/responsive-menu-pro.php';
 
 
93
 
94
- if( is_plugin_active($plugin) ){
95
- deactivate_plugins( 'responsive-menu-pro/responsive-menu-pro.php');
96
- set_transient( 'og-admin-notice-activation-pro', true, 5 );
97
 
98
- return;
99
- }
 
 
 
 
 
 
 
 
 
 
 
 
100
  }
101
- //to check weather another plugin is acivated or not.
102
- register_activation_hook( __FILE__, 'og_deactivate_responsive_menu_pro');
103
-
104
- include dirname(__FILE__) . '/vendor/autoload.php';
105
- include dirname(__FILE__) . '/config/default_options.php';
106
- include dirname(__FILE__) . '/config/services.php';
107
- include dirname(__FILE__) . '/config/wp/scripts.php';
108
- include dirname(__FILE__) . '/config/routing.php';
109
- include dirname(__FILE__) . '/migration.php';
110
- include dirname(__FILE__) . '/config/polylang.php';
111
-
112
- } else {
113
-
114
- // If this file called directly then abort.
115
- if ( ! defined( 'WPINC' ) ) {
116
- die;
117
- }
118
 
119
- /**
120
- * Constant as plugin file.
121
- */
122
- if ( ! defined( 'RMP_PLUGIN_FILE' ) ) {
123
- define('RMP_PLUGIN_FILE', plugin_dir_path( __FILE__ ) . 'responsive-menu.php');
124
- }
125
 
126
- /**
127
- * Constant as dir of plugin.
128
- */
129
- if ( ! defined( 'RMP_PLUGIN_DIR_NAME' ) ) {
130
- define( 'RMP_PLUGIN_DIR_NAME', untrailingslashit ( dirname( plugin_basename( __FILE__ ) ) ) );
131
- }
132
 
133
- /**
134
- * Constant as plugin path.
135
- */
136
- if ( ! defined( 'RMP_PLUGIN_PATH' ) ) {
137
- define( 'RMP_PLUGIN_PATH', untrailingslashit( plugin_dir_path( __FILE__ ) ) );
138
- }
139
 
140
- /**
141
- * Constant as plugin URL.
142
- */
143
- if ( ! defined( 'RMP_PLUGIN_URL' ) ) {
144
- define( 'RMP_PLUGIN_URL', untrailingslashit( plugin_dir_url( __FILE__ ) ) );
145
- }
146
 
147
- /**
148
- * Constant as URI of assets build.
149
- */
150
- if ( ! defined( 'RMP_PLUGIN_BUILD_URI' ) ) {
151
- define( 'RMP_PLUGIN_BUILD_URI', untrailingslashit( plugin_dir_url( __FILE__ ) ) . '/assets/build' );
152
  }
153
 
154
- /**
155
- * Constant as dir of assets build.
156
- */
157
- if ( ! defined( 'RMP_PLUGIN_BUILD_DIR' ) ) {
158
- define( 'RMP_PLUGIN_BUILD_DIR', untrailingslashit( plugin_dir_path( __FILE__ ) ) . '/assets/build' );
159
- }
160
 
161
- /**
162
- * Constant as path of template file.
163
- */
164
- if ( ! defined( 'RMP_PLUGIN_TEMPLATE_PATH' ) ) {
165
- define( 'RMP_PLUGIN_TEMPLATE_PATH', untrailingslashit( plugin_dir_path( __FILE__ ) ) . '/templates/' );
166
- }
 
 
167
 
168
- if ( ! defined( 'RMP_PLUGIN_PATH_V4' ) ) {
169
- define ( 'RMP_PLUGIN_PATH_V4', RMP_PLUGIN_PATH . '/v4.0.0' );
170
- }
 
 
 
 
 
171
 
172
- if ( ! defined( 'RMP_PLUGIN_URL_V4' ) ) {
173
- define ( 'RMP_PLUGIN_URL_V4', RMP_PLUGIN_URL . '/v4.0.0' );
174
- }
175
 
176
- /** Include the required files only*/
177
- require_once RMP_PLUGIN_PATH_V4 . '/inc/helpers/autoloader.php';
178
- require_once RMP_PLUGIN_PATH_V4 . '/inc/helpers/custom-functions.php';
179
- require_once RMP_PLUGIN_PATH_V4 . '/inc/helpers/default-options.php';
180
- require_once RMP_PLUGIN_PATH_V4 . '/libs/scssphp/vendor/autoload.php';
181
-
182
- /**
183
- * To load plugin manifest class.
184
- *
185
- * @return void
186
- */
187
- function responsive_menu_features_plugin_loader() {
188
- \RMP\Features\Inc\Plugin::get_instance();
189
  }
190
 
191
- responsive_menu_features_plugin_loader();
192
-
193
- // Active and de-active plugin hook.
194
- register_activation_hook( __FILE__, 'responsive_menu_plugin_activation' );
195
- register_deactivation_hook( __FILE__, 'responsive_menu_plugin_deactivation' );
196
-
197
- /**
198
- * Activation of plugin.
199
- *
200
- * @return void
201
- */
202
- function responsive_menu_plugin_activation() {
203
-
204
- $plugin = 'responsive-menu-pro/responsive-menu-pro.php';
205
-
206
- // Check if responsive menu (paid version) is activate then deactivate it.
207
- if( is_plugin_active( $plugin ) ) {
208
- deactivate_plugins( $plugin );
209
- set_transient( 'og-admin-notice-activation-pro', true, 5 );
210
- }
211
-
212
- flush_rewrite_rules();
213
- }
214
-
215
- /**
216
- * Deactivation of plugin.
217
- *
218
- * @return void
219
- */
220
- function responsive_menu_plugin_deactivation() {
221
- flush_rewrite_rules();
222
- }
223
-
224
- /**
225
- * Function to include the menu themes templates.
226
- *
227
- * @since 4.0.5
228
- *
229
- * @return void
230
- */
231
- function rm_includes_menu_theme_template() {
232
-
233
- $theme_manager = \RMP\Features\Inc\Theme_Manager::get_instance();
234
-
235
- //Check class theme manager has this method or not.
236
- if ( ! method_exists( $theme_manager, 'get_menu_active_themes' ) ) {
237
- return;
238
- }
239
-
240
- $active_themes = $theme_manager->get_menu_active_themes();
241
- if ( empty( $active_themes ) ) {
242
- return;
243
- }
244
 
245
- //Include the file from each theme which has php template.
246
- foreach( $active_themes as $key => $theme_name ) {
247
 
248
- $theme_index = $theme_manager->get_theme_index_file( $theme_name );
249
 
250
- if ( file_exists( $theme_index ) ) {
251
- require_once $theme_index;
252
- }
253
  }
254
-
255
  }
256
 
257
- rm_includes_menu_theme_template();
258
  }
259
 
 
 
 
260
  include( 'review-banner-class.php' );
4
  Plugin Name: Responsive Menu
5
  Plugin URI: https://expresstech.io
6
  Description: Highly Customisable Responsive Menu Plugin for WordPress
7
+ Version: 4.1.5
8
  Author: ExpressTech
9
  Text Domain: responsive-menu
10
  Author URI: https://responsive.menu
16
  * Constant as plugin version.
17
  */
18
  if ( ! defined( 'RMP_PLUGIN_VERSION' ) ) {
19
+ define( 'RMP_PLUGIN_VERSION', '4.1.5' );
20
  }
21
 
22
  define('RESPONSIVE_MENU_URL', plugin_dir_url( __FILE__ ) );
30
  }
31
 
32
  function responsive_menu_deactivation_text() {
33
+ echo '<div class="'.esc_attr( "error" ).'"><p>' . sprintf(
34
  'Responsive Menu requires PHP 5.4 or higher to function and has therefore been automatically disabled.
35
  You are still on %s.%sPlease speak to your web host about upgrading your PHP version.',
36
  PHP_VERSION,
41
  if(version_compare(PHP_VERSION, '5.4', '<'))
42
  return;
43
 
44
+ // If this file called directly then abort.
45
+ if ( ! defined( 'WPINC' ) ) {
46
+ die;
47
+ }
48
 
49
  /**
50
+ * Constant as plugin file.
51
  */
52
+ if ( ! defined( 'RMP_PLUGIN_FILE' ) ) {
53
+ define('RMP_PLUGIN_FILE', plugin_dir_path( __FILE__ ) . 'responsive-menu.php');
54
+ }
55
 
56
+ /**
57
+ * Constant as dir of plugin.
58
+ */
59
+ if ( ! defined( 'RMP_PLUGIN_DIR_NAME' ) ) {
60
+ define( 'RMP_PLUGIN_DIR_NAME', untrailingslashit ( dirname( plugin_basename( __FILE__ ) ) ) );
61
+ }
62
 
63
+ /**
64
+ * Constant as plugin path.
65
+ */
66
+ if ( ! defined( 'RMP_PLUGIN_PATH' ) ) {
67
+ define( 'RMP_PLUGIN_PATH', untrailingslashit( plugin_dir_path( __FILE__ ) ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
68
  }
69
 
70
+ /**
71
+ * Constant as plugin URL.
72
+ */
73
+ if ( ! defined( 'RMP_PLUGIN_URL' ) ) {
74
+ define( 'RMP_PLUGIN_URL', untrailingslashit( plugin_dir_url( __FILE__ ) ) );
75
+ }
76
 
77
+ /**
78
+ * Constant as URI of assets build.
79
+ */
80
+ if ( ! defined( 'RMP_PLUGIN_BUILD_URI' ) ) {
81
+ define( 'RMP_PLUGIN_BUILD_URI', untrailingslashit( plugin_dir_url( __FILE__ ) ) . '/assets/build' );
82
+ }
83
 
84
+ /**
85
+ * Constant as dir of assets build.
86
+ */
87
+ if ( ! defined( 'RMP_PLUGIN_BUILD_DIR' ) ) {
88
+ define( 'RMP_PLUGIN_BUILD_DIR', untrailingslashit( plugin_dir_path( __FILE__ ) ) . '/assets/build' );
89
  }
90
 
91
+ /**
92
+ * Constant as path of template file.
93
+ */
94
+ if ( ! defined( 'RMP_PLUGIN_TEMPLATE_PATH' ) ) {
95
+ define( 'RMP_PLUGIN_TEMPLATE_PATH', untrailingslashit( plugin_dir_path( __FILE__ ) ) . '/templates/' );
96
+ }
97
 
98
+ if ( ! defined( 'RMP_PLUGIN_PATH_V4' ) ) {
99
+ define ( 'RMP_PLUGIN_PATH_V4', RMP_PLUGIN_PATH . '/v4.0.0' );
100
+ }
101
 
102
+ if ( ! defined( 'RMP_PLUGIN_URL_V4' ) ) {
103
+ define ( 'RMP_PLUGIN_URL_V4', RMP_PLUGIN_URL . '/v4.0.0' );
104
+ }
105
 
106
+ /** Include the required files only*/
107
+ require_once RMP_PLUGIN_PATH_V4 . '/inc/helpers/autoloader.php';
108
+ require_once RMP_PLUGIN_PATH_V4 . '/inc/helpers/custom-functions.php';
109
+ require_once RMP_PLUGIN_PATH_V4 . '/inc/helpers/default-options.php';
110
+ require_once RMP_PLUGIN_PATH_V4 . '/libs/scssphp/vendor/autoload.php';
111
+ require_once RMP_PLUGIN_PATH_V4 . '/templates/rmp-roadmap.php';
112
+
113
+ /**
114
+ * To load plugin manifest class.
115
+ *
116
+ * @return void
117
+ */
118
+ function responsive_menu_features_plugin_loader() {
119
+ \RMP\Features\Inc\Plugin::get_instance();
120
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
121
 
122
+ responsive_menu_features_plugin_loader();
 
 
 
 
 
123
 
124
+ // Active and de-active plugin hook.
125
+ register_activation_hook( __FILE__, 'responsive_menu_plugin_activation' );
126
+ register_deactivation_hook( __FILE__, 'responsive_menu_plugin_deactivation' );
 
 
 
127
 
128
+ /**
129
+ * Activation of plugin.
130
+ *
131
+ * @return void
132
+ */
133
+ function responsive_menu_plugin_activation() {
134
 
135
+ $plugin = 'responsive-menu-pro/responsive-menu-pro.php';
 
 
 
 
 
136
 
137
+ // Check if responsive menu (paid version) is activate then deactivate it.
138
+ if( is_plugin_active( $plugin ) ) {
139
+ deactivate_plugins( $plugin );
140
+ set_transient( 'og-admin-notice-activation-pro', true, 5 );
 
141
  }
142
 
143
+ flush_rewrite_rules();
144
+ }
 
 
 
 
145
 
146
+ /**
147
+ * Deactivation of plugin.
148
+ *
149
+ * @return void
150
+ */
151
+ function responsive_menu_plugin_deactivation() {
152
+ flush_rewrite_rules();
153
+ }
154
 
155
+ /**
156
+ * Function to include the menu themes templates.
157
+ *
158
+ * @since 4.0.5
159
+ *
160
+ * @return void
161
+ */
162
+ function rm_includes_menu_theme_template() {
163
 
164
+ $theme_manager = \RMP\Features\Inc\Theme_Manager::get_instance();
 
 
165
 
166
+ //Check class theme manager has this method or not.
167
+ if ( ! method_exists( $theme_manager, 'get_menu_active_themes' ) ) {
168
+ return;
 
 
 
 
 
 
 
 
 
 
169
  }
170
 
171
+ $active_themes = $theme_manager->get_menu_active_themes();
172
+ if ( empty( $active_themes ) ) {
173
+ return;
174
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
175
 
176
+ //Include the file from each theme which has php template.
177
+ foreach( $active_themes as $key => $theme_name ) {
178
 
179
+ $theme_index = $theme_manager->get_theme_index_file( $theme_name );
180
 
181
+ if ( file_exists( $theme_index ) ) {
182
+ require_once $theme_index;
 
183
  }
 
184
  }
185
 
 
186
  }
187
 
188
+ rm_includes_menu_theme_template();
189
+
190
+
191
  include( 'review-banner-class.php' );
review-banner-class.php CHANGED
@@ -88,15 +88,28 @@ class RM_Review_Message {
88
  $already_url = esc_url( add_query_arg( 'rm_review_notice_check', 'already_did' ) );
89
  $nope_url = esc_url( add_query_arg( 'rm_review_notice_check', 'remove_message' ) );
90
  echo "<div class='updated'><br />";
91
- echo sprintf( __('Greetings! I just noticed that you have created %d Menus. That is
92
  awesome! Could you please help me out by giving this plugin a 5-star rating on WordPress? This
93
  will help us by helping other users discover this plugin. %s', 'responsive-menu-pro'),
94
  $this->check_results_amount(),
95
  '<br /><strong><em>~ RM Team</em></strong><br /><br />'
96
  );
97
- echo '&nbsp;<a target="_blank" href="https://wordpress.org/support/plugin/responsive-menu/reviews/#new-topic-0" class="button-primary">' . __( 'Yeah, you deserve it!', 'responsive-menu-pro' ) . '</a>';
98
- echo '&nbsp;<a href="' . esc_url( $already_url ) . '" class="button-secondary">' . __( 'I already did!', 'responsive-menu-pro' ) . '</a>';
99
- echo '&nbsp;<a href="' . esc_url( $nope_url ) . '" class="button-secondary">' . __( 'No, this plugin is not good enough', 'responsive-menu-pro' ) . '</a>';
 
 
 
 
 
 
 
 
 
 
 
 
 
100
  echo "<br /><br /></div>";
101
  }
102
 
88
  $already_url = esc_url( add_query_arg( 'rm_review_notice_check', 'already_did' ) );
89
  $nope_url = esc_url( add_query_arg( 'rm_review_notice_check', 'remove_message' ) );
90
  echo "<div class='updated'><br />";
91
+ echo sprintf( esc_html__('Greetings! I just noticed that you have created %d Menus. That is
92
  awesome! Could you please help me out by giving this plugin a 5-star rating on WordPress? This
93
  will help us by helping other users discover this plugin. %s', 'responsive-menu-pro'),
94
  $this->check_results_amount(),
95
  '<br /><strong><em>~ RM Team</em></strong><br /><br />'
96
  );
97
+ echo sprintf('<a target="%s" href="%s" class="%s">%s</a> ',
98
+ esc_attr( "_blank" ),
99
+ esc_url( "https://wordpress.org/support/plugin/responsive-menu/reviews/#new-topic-0"),
100
+ esc_attr( "button-primary" ),
101
+ esc_html__( 'Yeah, you deserve it!', 'responsive-menu-pro' )
102
+ );
103
+ echo sprintf('<a href="%s" class="%s">%s</a> ',
104
+ $already_url,
105
+ esc_attr( "button-secondary" ),
106
+ esc_html__( 'I already did!', 'responsive-menu-pro' )
107
+ );
108
+ echo sprintf('<a href="%s" class="%s">%s</a> ',
109
+ $nope_url,
110
+ esc_attr( "button-secondary" ),
111
+ esc_html__( 'No, this plugin is not good enough', 'responsive-menu-pro' )
112
+ );
113
  echo "<br /><br /></div>";
114
  }
115
 
v4.0.0/assets/admin/icons/export.png ADDED
Binary file
v4.0.0/assets/admin/js/dropzone.min.js ADDED
@@ -0,0 +1 @@
 
1
+ "use strict";function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _possibleConstructorReturn(e,t){return!t||"object"!==_typeof(t)&&"function"!=typeof t?_assertThisInitialized(e):t}function _getPrototypeOf(e){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&_setPrototypeOf(e,t)}function _setPrototypeOf(e,t){return(_setPrototypeOf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function _createClass(e,t,n){return t&&_defineProperties(e.prototype,t),n&&_defineProperties(e,n),e}var Emitter=function(){function e(){_classCallCheck(this,e)}return _createClass(e,[{key:"on",value:function(e,t){return this._callbacks=this._callbacks||{},this._callbacks[e]||(this._callbacks[e]=[]),this._callbacks[e].push(t),this}},{key:"emit",value:function(e){this._callbacks=this._callbacks||{};var t=this._callbacks[e];if(t){for(var n=arguments.length,i=new Array(1<n?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];var o=!0,a=!1,l=void 0;try{for(var s,u=t[Symbol.iterator]();!(o=(s=u.next()).done);o=!0){s.value.apply(this,i)}}catch(e){a=!0,l=e}finally{try{o||null==u.return||u.return()}finally{if(a)throw l}}}return this}},{key:"off",value:function(e,t){if(!this._callbacks||0===arguments.length)return this._callbacks={},this;var n=this._callbacks[e];if(!n)return this;if(1===arguments.length)return delete this._callbacks[e],this;for(var i=0;i<n.length;i++){if(n[i]===t){n.splice(i,1);break}}return this}}]),e}(),Dropzone=function(){function C(e,t){var n,i,r;if(_classCallCheck(this,C),(n=_possibleConstructorReturn(this,_getPrototypeOf(C).call(this))).element=e,n.version=C.version,n.defaultOptions.previewTemplate=n.defaultOptions.previewTemplate.replace(/\n*/g,""),n.clickableElements=[],n.listeners=[],n.files=[],"string"==typeof n.element&&(n.element=document.querySelector(n.element)),!n.element||null==n.element.nodeType)throw new Error("Invalid dropzone element.");if(n.element.dropzone)throw new Error("Dropzone already attached.");C.instances.push(_assertThisInitialized(n)),n.element.dropzone=_assertThisInitialized(n);var o=null!=(r=C.optionsForElement(n.element))?r:{};if(n.options=C.extend({},n.defaultOptions,o,null!=t?t:{}),n.options.forceFallback||!C.isBrowserSupported())return _possibleConstructorReturn(n,n.options.fallback.call(_assertThisInitialized(n)));if(null==n.options.url&&(n.options.url=n.element.getAttribute("action")),!n.options.url)throw new Error("No URL provided.");if(n.options.acceptedFiles&&n.options.acceptedMimeTypes)throw new Error("You can't provide both 'acceptedFiles' and 'acceptedMimeTypes'. 'acceptedMimeTypes' is deprecated.");if(n.options.uploadMultiple&&n.options.chunking)throw new Error("You cannot set both: uploadMultiple and chunking.");return n.options.acceptedMimeTypes&&(n.options.acceptedFiles=n.options.acceptedMimeTypes,delete n.options.acceptedMimeTypes),null!=n.options.renameFilename&&(n.options.renameFile=function(e){return n.options.renameFilename.call(_assertThisInitialized(n),e.name,e)}),n.options.method=n.options.method.toUpperCase(),(i=n.getExistingFallback())&&i.parentNode&&i.parentNode.removeChild(i),!1!==n.options.previewsContainer&&(n.options.previewsContainer?n.previewsContainer=C.getElement(n.options.previewsContainer,"previewsContainer"):n.previewsContainer=n.element),n.options.clickable&&(!0===n.options.clickable?n.clickableElements=[n.element]:n.clickableElements=C.getElements(n.options.clickable,"clickable")),n.init(),n}return _inherits(C,Emitter),_createClass(C,null,[{key:"initClass",value:function(){this.prototype.Emitter=Emitter,this.prototype.events=["drop","dragstart","dragend","dragenter","dragover","dragleave","addedfile","addedfiles","removedfile","thumbnail","error","errormultiple","processing","processingmultiple","uploadprogress","totaluploadprogress","sending","sendingmultiple","success","successmultiple","canceled","canceledmultiple","complete","completemultiple","reset","maxfilesexceeded","maxfilesreached","queuecomplete"],this.prototype.defaultOptions={url:null,method:"post",withCredentials:!1,timeout:3e4,parallelUploads:2,uploadMultiple:!1,chunking:!1,forceChunking:!1,chunkSize:2e6,parallelChunkUploads:!1,retryChunks:!1,retryChunksLimit:3,maxFilesize:256,paramName:"file",createImageThumbnails:!0,maxThumbnailFilesize:10,thumbnailWidth:120,thumbnailHeight:120,thumbnailMethod:"crop",resizeWidth:null,resizeHeight:null,resizeMimeType:null,resizeQuality:.8,resizeMethod:"contain",filesizeBase:1e3,maxFiles:null,headers:null,clickable:!0,ignoreHiddenFiles:!0,acceptedFiles:null,acceptedMimeTypes:null,autoProcessQueue:!0,autoQueue:!0,addRemoveLinks:!1,previewsContainer:null,hiddenInputContainer:"body",capture:null,renameFilename:null,renameFile:null,forceFallback:!1,dictDefaultMessage:"Drop files here to upload",dictFallbackMessage:"Your browser does not support drag'n'drop file uploads.",dictFallbackText:"Please use the fallback form below to upload your files like in the olden days.",dictFileTooBig:"File is too big ({{filesize}}MiB). Max filesize: {{maxFilesize}}MiB.",dictInvalidFileType:"You can't upload files of this type.",dictResponseError:"Server responded with {{statusCode}} code.",dictCancelUpload:"Cancel upload",dictUploadCanceled:"Upload canceled.",dictCancelUploadConfirmation:"Are you sure you want to cancel this upload?",dictRemoveFile:"Remove file",dictRemoveFileConfirmation:null,dictMaxFilesExceeded:"You can not upload any more files.",dictFileSizeUnits:{tb:"TB",gb:"GB",mb:"MB",kb:"KB",b:"b"},init:function(){},params:function(e,t,n){if(n)return{dzuuid:n.file.upload.uuid,dzchunkindex:n.index,dztotalfilesize:n.file.size,dzchunksize:this.options.chunkSize,dztotalchunkcount:n.file.upload.totalChunkCount,dzchunkbyteoffset:n.index*this.options.chunkSize}},accept:function(e,t){return t()},chunksUploaded:function(e,t){t()},fallback:function(){var e;this.element.className="".concat(this.element.className," dz-browser-not-supported");var t=!0,n=!1,i=void 0;try{for(var r,o=this.element.getElementsByTagName("div")[Symbol.iterator]();!(t=(r=o.next()).done);t=!0){var a=r.value;if(/(^| )dz-message($| )/.test(a.className)){(e=a).className="dz-message";break}}}catch(e){n=!0,i=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw i}}e||(e=C.createElement('<div class="dz-message"><span></span></div>'),this.element.appendChild(e));var l=e.getElementsByTagName("span")[0];return l&&(null!=l.textContent?l.textContent=this.options.dictFallbackMessage:null!=l.innerText&&(l.innerText=this.options.dictFallbackMessage)),this.element.appendChild(this.getFallbackForm())},resize:function(e,t,n,i){var r={srcX:0,srcY:0,srcWidth:e.width,srcHeight:e.height},o=e.width/e.height;null==t&&null==n?(t=r.srcWidth,n=r.srcHeight):null==t?t=n*o:null==n&&(n=t/o);var a=(t=Math.min(t,r.srcWidth))/(n=Math.min(n,r.srcHeight));if(r.srcWidth>t||r.srcHeight>n)if("crop"===i)a<o?(r.srcHeight=e.height,r.srcWidth=r.srcHeight*a):(r.srcWidth=e.width,r.srcHeight=r.srcWidth/a);else{if("contain"!==i)throw new Error("Unknown resizeMethod '".concat(i,"'"));a<o?n=t/o:t=n*o}return r.srcX=(e.width-r.srcWidth)/2,r.srcY=(e.height-r.srcHeight)/2,r.trgWidth=t,r.trgHeight=n,r},transformFile:function(e,t){return(this.options.resizeWidth||this.options.resizeHeight)&&e.type.match(/image.*/)?this.resizeImage(e,this.options.resizeWidth,this.options.resizeHeight,this.options.resizeMethod,t):t(e)},previewTemplate:'<div class="dz-preview dz-file-preview">\n <div class="dz-image"><img data-dz-thumbnail /></div>\n <div class="dz-details">\n <div class="dz-size"><span data-dz-size></span></div>\n <div class="dz-filename"><span data-dz-name></span></div>\n </div>\n <div class="dz-progress"><span class="dz-upload" data-dz-uploadprogress></span></div>\n <div class="dz-error-message"><span data-dz-errormessage></span></div>\n <div class="dz-success-mark">\n <svg width="54px" height="54px" viewBox="0 0 54 54" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>Check</title>\n <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <path d="M23.5,31.8431458 L17.5852419,25.9283877 C16.0248253,24.3679711 13.4910294,24.366835 11.9289322,25.9289322 C10.3700136,27.4878508 10.3665912,30.0234455 11.9283877,31.5852419 L20.4147581,40.0716123 C20.5133999,40.1702541 20.6159315,40.2626649 20.7218615,40.3488435 C22.2835669,41.8725651 24.794234,41.8626202 26.3461564,40.3106978 L43.3106978,23.3461564 C44.8771021,21.7797521 44.8758057,19.2483887 43.3137085,17.6862915 C41.7547899,16.1273729 39.2176035,16.1255422 37.6538436,17.6893022 L23.5,31.8431458 Z M27,53 C41.3594035,53 53,41.3594035 53,27 C53,12.6405965 41.3594035,1 27,1 C12.6405965,1 1,12.6405965 1,27 C1,41.3594035 12.6405965,53 27,53 Z" stroke-opacity="0.198794158" stroke="#747474" fill-opacity="0.816519475" fill="#FFFFFF"></path>\n </g>\n </svg>\n </div>\n <div class="dz-error-mark">\n <svg width="54px" height="54px" viewBox="0 0 54 54" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>Error</title>\n <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g stroke="#747474" stroke-opacity="0.198794158" fill="#FFFFFF" fill-opacity="0.816519475">\n <path d="M32.6568542,29 L38.3106978,23.3461564 C39.8771021,21.7797521 39.8758057,19.2483887 38.3137085,17.6862915 C36.7547899,16.1273729 34.2176035,16.1255422 32.6538436,17.6893022 L27,23.3431458 L21.3461564,17.6893022 C19.7823965,16.1255422 17.2452101,16.1273729 15.6862915,17.6862915 C14.1241943,19.2483887 14.1228979,21.7797521 15.6893022,23.3461564 L21.3431458,29 L15.6893022,34.6538436 C14.1228979,36.2202479 14.1241943,38.7516113 15.6862915,40.3137085 C17.2452101,41.8726271 19.7823965,41.8744578 21.3461564,40.3106978 L27,34.6568542 L32.6538436,40.3106978 C34.2176035,41.8744578 36.7547899,41.8726271 38.3137085,40.3137085 C39.8758057,38.7516113 39.8771021,36.2202479 38.3106978,34.6538436 L32.6568542,29 Z M27,53 C41.3594035,53 53,41.3594035 53,27 C53,12.6405965 41.3594035,1 27,1 C12.6405965,1 1,12.6405965 1,27 C1,41.3594035 12.6405965,53 27,53 Z"></path>\n </g>\n </g>\n </svg>\n </div>\n</div>',drop:function(){return this.element.classList.remove("dz-drag-hover")},dragstart:function(){},dragend:function(){return this.element.classList.remove("dz-drag-hover")},dragenter:function(){return this.element.classList.add("dz-drag-hover")},dragover:function(){return this.element.classList.add("dz-drag-hover")},dragleave:function(){return this.element.classList.remove("dz-drag-hover")},paste:function(){},reset:function(){return this.element.classList.remove("dz-started")},addedfile:function(t){var n=this;if(this.element===this.previewsContainer&&this.element.classList.add("dz-started"),this.previewsContainer){t.previewElement=C.createElement(this.options.previewTemplate.trim()),t.previewTemplate=t.previewElement,this.previewsContainer.appendChild(t.previewElement);var e=!0,i=!1,r=void 0;try{for(var o,a=t.previewElement.querySelectorAll("[data-dz-name]")[Symbol.iterator]();!(e=(o=a.next()).done);e=!0){var l=o.value;l.textContent=t.name}}catch(e){i=!0,r=e}finally{try{e||null==a.return||a.return()}finally{if(i)throw r}}var s=!0,u=!1,c=void 0;try{for(var d,p=t.previewElement.querySelectorAll("[data-dz-size]")[Symbol.iterator]();!(s=(d=p.next()).done);s=!0)(l=d.value).innerHTML=this.filesize(t.size)}catch(e){u=!0,c=e}finally{try{s||null==p.return||p.return()}finally{if(u)throw c}}this.options.addRemoveLinks&&(t._removeLink=C.createElement('<a class="dz-remove" href="javascript:undefined;" data-dz-remove>'.concat(this.options.dictRemoveFile,"</a>")),t.previewElement.appendChild(t._removeLink));var h=function(e){return e.preventDefault(),e.stopPropagation(),t.status===C.UPLOADING?C.confirm(n.options.dictCancelUploadConfirmation,function(){return n.removeFile(t)}):n.options.dictRemoveFileConfirmation?C.confirm(n.options.dictRemoveFileConfirmation,function(){return n.removeFile(t)}):n.removeFile(t)},f=!0,v=!1,m=void 0;try{for(var y,g=t.previewElement.querySelectorAll("[data-dz-remove]")[Symbol.iterator]();!(f=(y=g.next()).done);f=!0){y.value.addEventListener("click",h)}}catch(e){v=!0,m=e}finally{try{f||null==g.return||g.return()}finally{if(v)throw m}}}},removedfile:function(e){return null!=e.previewElement&&null!=e.previewElement.parentNode&&e.previewElement.parentNode.removeChild(e.previewElement),this._updateMaxFilesReachedClass()},thumbnail:function(e,t){if(e.previewElement){e.previewElement.classList.remove("dz-file-preview");var n=!0,i=!1,r=void 0;try{for(var o,a=e.previewElement.querySelectorAll("[data-dz-thumbnail]")[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var l=o.value;l.alt=e.name,l.src=t}}catch(e){i=!0,r=e}finally{try{n||null==a.return||a.return()}finally{if(i)throw r}}return setTimeout(function(){return e.previewElement.classList.add("dz-image-preview")},1)}},error:function(e,t){if(e.previewElement){e.previewElement.classList.add("dz-error"),"String"!=typeof t&&t.error&&(t=t.error);var n=!0,i=!1,r=void 0;try{for(var o,a=e.previewElement.querySelectorAll("[data-dz-errormessage]")[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){o.value.textContent=t}}catch(e){i=!0,r=e}finally{try{n||null==a.return||a.return()}finally{if(i)throw r}}}},errormultiple:function(){},processing:function(e){if(e.previewElement&&(e.previewElement.classList.add("dz-processing"),e._removeLink))return e._removeLink.innerHTML=this.options.dictCancelUpload},processingmultiple:function(){},uploadprogress:function(e,t){if(e.previewElement){var n=!0,i=!1,r=void 0;try{for(var o,a=e.previewElement.querySelectorAll("[data-dz-uploadprogress]")[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var l=o.value;"PROGRESS"===l.nodeName?l.value=t:l.style.width="".concat(t,"%")}}catch(e){i=!0,r=e}finally{try{n||null==a.return||a.return()}finally{if(i)throw r}}}},totaluploadprogress:function(){},sending:function(){},sendingmultiple:function(){},success:function(e){if(e.previewElement)return e.previewElement.classList.add("dz-success")},successmultiple:function(){},canceled:function(e){return this.emit("error",e,this.options.dictUploadCanceled)},canceledmultiple:function(){},complete:function(e){if(e._removeLink&&(e._removeLink.innerHTML=this.options.dictRemoveFile),e.previewElement)return e.previewElement.classList.add("dz-complete")},completemultiple:function(){},maxfilesexceeded:function(){},maxfilesreached:function(){},queuecomplete:function(){},addedfiles:function(){}},this.prototype._thumbnailQueue=[],this.prototype._processingThumbnail=!1}},{key:"extend",value:function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];for(var r=0,o=n;r<o.length;r++){var a=o[r];for(var l in a){var s=a[l];e[l]=s}}return e}}]),_createClass(C,[{key:"getAcceptedFiles",value:function(){return this.files.filter(function(e){return e.accepted}).map(function(e){return e})}},{key:"getRejectedFiles",value:function(){return this.files.filter(function(e){return!e.accepted}).map(function(e){return e})}},{key:"getFilesWithStatus",value:function(t){return this.files.filter(function(e){return e.status===t}).map(function(e){return e})}},{key:"getQueuedFiles",value:function(){return this.getFilesWithStatus(C.QUEUED)}},{key:"getUploadingFiles",value:function(){return this.getFilesWithStatus(C.UPLOADING)}},{key:"getAddedFiles",value:function(){return this.getFilesWithStatus(C.ADDED)}},{key:"getActiveFiles",value:function(){return this.files.filter(function(e){return e.status===C.UPLOADING||e.status===C.QUEUED}).map(function(e){return e})}},{key:"init",value:function(){var s=this;if("form"===this.element.tagName&&this.element.setAttribute("enctype","multipart/form-data"),this.element.classList.contains("dropzone")&&!this.element.querySelector(".dz-message")&&this.element.appendChild(C.createElement('<div class="dz-default dz-message"><button class="dz-button" type="button">'.concat(this.options.dictDefaultMessage,"</button></div>"))),this.clickableElements.length){!function l(){return s.hiddenFileInput&&s.hiddenFileInput.parentNode.removeChild(s.hiddenFileInput),s.hiddenFileInput=document.createElement("input"),s.hiddenFileInput.setAttribute("type","file"),(null===s.options.maxFiles||1<s.options.maxFiles)&&s.hiddenFileInput.setAttribute("multiple","multiple"),s.hiddenFileInput.className="dz-hidden-input",null!==s.options.acceptedFiles&&s.hiddenFileInput.setAttribute("accept",s.options.acceptedFiles),null!==s.options.capture&&s.hiddenFileInput.setAttribute("capture",s.options.capture),s.hiddenFileInput.style.visibility="hidden",s.hiddenFileInput.style.position="absolute",s.hiddenFileInput.style.top="0",s.hiddenFileInput.style.left="0",s.hiddenFileInput.style.height="0",s.hiddenFileInput.style.width="0",C.getElement(s.options.hiddenInputContainer,"hiddenInputContainer").appendChild(s.hiddenFileInput),s.hiddenFileInput.addEventListener("change",function(){var e=s.hiddenFileInput.files;if(e.length){var t=!0,n=!1,i=void 0;try{for(var r,o=e[Symbol.iterator]();!(t=(r=o.next()).done);t=!0){var a=r.value;s.addFile(a)}}catch(e){n=!0,i=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw i}}}return s.emit("addedfiles",e),l()})}()}this.URL=null!==window.URL?window.URL:window.webkitURL;var e=!0,t=!1,n=void 0;try{for(var i,r=this.events[Symbol.iterator]();!(e=(i=r.next()).done);e=!0){var o=i.value;this.on(o,this.options[o])}}catch(e){t=!0,n=e}finally{try{e||null==r.return||r.return()}finally{if(t)throw n}}this.on("uploadprogress",function(){return s.updateTotalUploadProgress()}),this.on("removedfile",function(){return s.updateTotalUploadProgress()}),this.on("canceled",function(e){return s.emit("complete",e)}),this.on("complete",function(e){if(0===s.getAddedFiles().length&&0===s.getUploadingFiles().length&&0===s.getQueuedFiles().length)return setTimeout(function(){return s.emit("queuecomplete")},0)});function a(e){var t;return(t=e).dataTransfer.types&&t.dataTransfer.types.some(function(e){return"Files"==e})&&(e.stopPropagation(),e.preventDefault?e.preventDefault():e.returnValue=!1)}return this.listeners=[{element:this.element,events:{dragstart:function(e){return s.emit("dragstart",e)},dragenter:function(e){return a(e),s.emit("dragenter",e)},dragover:function(e){var t;try{t=e.dataTransfer.effectAllowed}catch(e){}return e.dataTransfer.dropEffect="move"===t||"linkMove"===t?"move":"copy",a(e),s.emit("dragover",e)},dragleave:function(e){return s.emit("dragleave",e)},drop:function(e){return a(e),s.drop(e)},dragend:function(e){return s.emit("dragend",e)}}}],this.clickableElements.forEach(function(t){return s.listeners.push({element:t,events:{click:function(e){return t===s.element&&e.target!==s.element&&!C.elementInside(e.target,s.element.querySelector(".dz-message"))||s.hiddenFileInput.click(),!0}}})}),this.enable(),this.options.init.call(this)}},{key:"destroy",value:function(){return this.disable(),this.removeAllFiles(!0),null!=this.hiddenFileInput&&this.hiddenFileInput.parentNode&&(this.hiddenFileInput.parentNode.removeChild(this.hiddenFileInput),this.hiddenFileInput=null),delete this.element.dropzone,C.instances.splice(C.instances.indexOf(this),1)}},{key:"updateTotalUploadProgress",value:function(){var e,t=0,n=0;if(this.getActiveFiles().length){var i=!0,r=!1,o=void 0;try{for(var a,l=this.getActiveFiles()[Symbol.iterator]();!(i=(a=l.next()).done);i=!0){var s=a.value;t+=s.upload.bytesSent,n+=s.upload.total}}catch(e){r=!0,o=e}finally{try{i||null==l.return||l.return()}finally{if(r)throw o}}e=100*t/n}else e=100;return this.emit("totaluploadprogress",e,n,t)}},{key:"_getParamName",value:function(e){return"function"==typeof this.options.paramName?this.options.paramName(e):"".concat(this.options.paramName).concat(this.options.uploadMultiple?"[".concat(e,"]"):"")}},{key:"_renameFile",value:function(e){return"function"!=typeof this.options.renameFile?e.name:this.options.renameFile(e)}},{key:"getFallbackForm",value:function(){var e,t;if(e=this.getExistingFallback())return e;var n='<div class="dz-fallback">';this.options.dictFallbackText&&(n+="<p>".concat(this.options.dictFallbackText,"</p>")),n+='<input type="file" name="'.concat(this._getParamName(0),'" ').concat(this.options.uploadMultiple?'multiple="multiple"':void 0,' /><input type="submit" value="Upload!"></div>');var i=C.createElement(n);return"FORM"!==this.element.tagName?(t=C.createElement('<form action="'.concat(this.options.url,'" enctype="multipart/form-data" method="').concat(this.options.method,'"></form>'))).appendChild(i):(this.element.setAttribute("enctype","multipart/form-data"),this.element.setAttribute("method",this.options.method)),null!=t?t:i}},{key:"getExistingFallback",value:function(){for(var e=function(e){var t=!0,n=!1,i=void 0;try{for(var r,o=e[Symbol.iterator]();!(t=(r=o.next()).done);t=!0){var a=r.value;if(/(^| )fallback($| )/.test(a.className))return a}}catch(e){n=!0,i=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw i}}},t=0,n=["div","form"];t<n.length;t++){var i,r=n[t];if(i=e(this.element.getElementsByTagName(r)))return i}}},{key:"setupEventListeners",value:function(){return this.listeners.map(function(i){return function(){var e=[];for(var t in i.events){var n=i.events[t];e.push(i.element.addEventListener(t,n,!1))}return e}()})}},{key:"removeEventListeners",value:function(){return this.listeners.map(function(i){return function(){var e=[];for(var t in i.events){var n=i.events[t];e.push(i.element.removeEventListener(t,n,!1))}return e}()})}},{key:"disable",value:function(){var t=this;return this.clickableElements.forEach(function(e){return e.classList.remove("dz-clickable")}),this.removeEventListeners(),this.disabled=!0,this.files.map(function(e){return t.cancelUpload(e)})}},{key:"enable",value:function(){return delete this.disabled,this.clickableElements.forEach(function(e){return e.classList.add("dz-clickable")}),this.setupEventListeners()}},{key:"filesize",value:function(e){var t=0,n="b";if(0<e){for(var i=["tb","gb","mb","kb","b"],r=0;r<i.length;r++){var o=i[r];if(Math.pow(this.options.filesizeBase,4-r)/10<=e){t=e/Math.pow(this.options.filesizeBase,4-r),n=o;break}}t=Math.round(10*t)/10}return"<strong>".concat(t,"</strong> ").concat(this.options.dictFileSizeUnits[n])}},{key:"_updateMaxFilesReachedClass",value:function(){return null!=this.options.maxFiles&&this.getAcceptedFiles().length>=this.options.maxFiles?(this.getAcceptedFiles().length===this.options.maxFiles&&this.emit("maxfilesreached",this.files),this.element.classList.add("dz-max-files-reached")):this.element.classList.remove("dz-max-files-reached")}},{key:"drop",value:function(e){if(e.dataTransfer){this.emit("drop",e);for(var t=[],n=0;n<e.dataTransfer.files.length;n++)t[n]=e.dataTransfer.files[n];if(t.length){var i=e.dataTransfer.items;i&&i.length&&null!=i[0].webkitGetAsEntry?this._addFilesFromItems(i):this.handleFiles(t)}this.emit("addedfiles",t)}}},{key:"paste",value:function(e){if(null!=__guard__(null!=e?e.clipboardData:void 0,function(e){return e.items})){this.emit("paste",e);var t=e.clipboardData.items;return t.length?this._addFilesFromItems(t):void 0}}},{key:"handleFiles",value:function(e){var t=!0,n=!1,i=void 0;try{for(var r,o=e[Symbol.iterator]();!(t=(r=o.next()).done);t=!0){var a=r.value;this.addFile(a)}}catch(e){n=!0,i=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw i}}}},{key:"_addFilesFromItems",value:function(s){var u=this;return function(){var e=[],t=!0,n=!1,i=void 0;try{for(var r,o=s[Symbol.iterator]();!(t=(r=o.next()).done);t=!0){var a,l=r.value;null!=l.webkitGetAsEntry&&(a=l.webkitGetAsEntry())?a.isFile?e.push(u.addFile(l.getAsFile())):a.isDirectory?e.push(u._addFilesFromDirectory(a,a.name)):e.push(void 0):null!=l.getAsFile&&(null==l.kind||"file"===l.kind)?e.push(u.addFile(l.getAsFile())):e.push(void 0)}}catch(e){n=!0,i=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw i}}return e}()}},{key:"_addFilesFromDirectory",value:function(e,s){function t(t){return __guardMethod__(console,"log",function(e){return e.log(t)})}var u=this,n=e.createReader();return function l(){return n.readEntries(function(e){if(0<e.length){var t=!0,n=!1,i=void 0;try{for(var r,o=e[Symbol.iterator]();!(t=(r=o.next()).done);t=!0){var a=r.value;a.isFile?a.file(function(e){if(!u.options.ignoreHiddenFiles||"."!==e.name.substring(0,1))return e.fullPath="".concat(s,"/").concat(e.name),u.addFile(e)}):a.isDirectory&&u._addFilesFromDirectory(a,"".concat(s,"/").concat(a.name))}}catch(e){n=!0,i=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw i}}l()}return null},t)}()}},{key:"accept",value:function(e,t){this.options.maxFilesize&&e.size>1024*this.options.maxFilesize*1024?t(this.options.dictFileTooBig.replace("{{filesize}}",Math.round(e.size/1024/10.24)/100).replace("{{maxFilesize}}",this.options.maxFilesize)):C.isValidFile(e,this.options.acceptedFiles)?null!=this.options.maxFiles&&this.getAcceptedFiles().length>=this.options.maxFiles?(t(this.options.dictMaxFilesExceeded.replace("{{maxFiles}}",this.options.maxFiles)),this.emit("maxfilesexceeded",e)):this.options.accept.call(this,e,t):t(this.options.dictInvalidFileType)}},{key:"addFile",value:function(t){var n=this;t.upload={uuid:C.uuidv4(),progress:0,total:t.size,bytesSent:0,filename:this._renameFile(t)},this.files.push(t),t.status=C.ADDED,this.emit("addedfile",t),this._enqueueThumbnail(t),this.accept(t,function(e){e?(t.accepted=!1,n._errorProcessing([t],e)):(t.accepted=!0,n.options.autoQueue&&n.enqueueFile(t)),n._updateMaxFilesReachedClass()})}},{key:"enqueueFiles",value:function(e){var t=!0,n=!1,i=void 0;try{for(var r,o=e[Symbol.iterator]();!(t=(r=o.next()).done);t=!0){var a=r.value;this.enqueueFile(a)}}catch(e){n=!0,i=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw i}}return null}},{key:"enqueueFile",value:function(e){var t=this;if(e.status!==C.ADDED||!0!==e.accepted)throw new Error("This file can't be queued because it has already been processed or was rejected.");if(e.status=C.QUEUED,this.options.autoProcessQueue)return setTimeout(function(){return t.processQueue()},0)}},{key:"_enqueueThumbnail",value:function(e){var t=this;if(this.options.createImageThumbnails&&e.type.match(/image.*/)&&e.size<=1024*this.options.maxThumbnailFilesize*1024)return this._thumbnailQueue.push(e),setTimeout(function(){return t._processThumbnailQueue()},0)}},{key:"_processThumbnailQueue",value:function(){var t=this;if(!this._processingThumbnail&&0!==this._thumbnailQueue.length){this._processingThumbnail=!0;var n=this._thumbnailQueue.shift();return this.createThumbnail(n,this.options.thumbnailWidth,this.options.thumbnailHeight,this.options.thumbnailMethod,!0,function(e){return t.emit("thumbnail",n,e),t._processingThumbnail=!1,t._processThumbnailQueue()})}}},{key:"removeFile",value:function(e){if(e.status===C.UPLOADING&&this.cancelUpload(e),this.files=without(this.files,e),this.emit("removedfile",e),0===this.files.length)return this.emit("reset")}},{key:"removeAllFiles",value:function(e){null==e&&(e=!1);var t=!0,n=!1,i=void 0;try{for(var r,o=this.files.slice()[Symbol.iterator]();!(t=(r=o.next()).done);t=!0){var a=r.value;a.status===C.UPLOADING&&!e||this.removeFile(a)}}catch(e){n=!0,i=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw i}}return null}},{key:"resizeImage",value:function(r,e,t,n,o){var a=this;return this.createThumbnail(r,e,t,n,!0,function(e,t){if(null==t)return o(r);var n=a.options.resizeMimeType;null==n&&(n=r.type);var i=t.toDataURL(n,a.options.resizeQuality);return"image/jpeg"!==n&&"image/jpg"!==n||(i=ExifRestore.restore(r.dataURL,i)),o(C.dataURItoBlob(i))})}},{key:"createThumbnail",value:function(e,t,n,i,r,o){var a=this,l=new FileReader;l.onload=function(){e.dataURL=l.result,"image/svg+xml"!==e.type?a.createThumbnailFromUrl(e,t,n,i,r,o):null!=o&&o(l.result)},l.readAsDataURL(e)}},{key:"displayExistingFile",value:function(t,e,n,i,r){var o=this,a=!(4<arguments.length&&void 0!==r)||r;if(this.emit("addedfile",t),this.emit("complete",t),a){t.dataURL=e,this.createThumbnailFromUrl(t,this.options.thumbnailWidth,this.options.thumbnailHeight,this.options.resizeMethod,this.options.fixOrientation,function(e){o.emit("thumbnail",t,e),n&&n()},i)}else this.emit("thumbnail",t,e),n&&n()}},{key:"createThumbnailFromUrl",value:function(o,a,l,s,t,u,e){var c=this,d=document.createElement("img");return e&&(d.crossOrigin=e),d.onload=function(){var e=function(e){return e(1)};return"undefined"!=typeof EXIF&&null!==EXIF&&t&&(e=function(e){return EXIF.getData(d,function(){return e(EXIF.getTag(this,"Orientation"))})}),e(function(e){o.width=d.width,o.height=d.height;var t=c.options.resize.call(c,o,a,l,s),n=document.createElement("canvas"),i=n.getContext("2d");switch(n.width=t.trgWidth,n.height=t.trgHeight,4<e&&(n.width=t.trgHeight,n.height=t.trgWidth),e){case 2:i.translate(n.width,0),i.scale(-1,1);break;case 3:i.translate(n.width,n.height),i.rotate(Math.PI);break;case 4:i.translate(0,n.height),i.scale(1,-1);break;case 5:i.rotate(.5*Math.PI),i.scale(1,-1);break;case 6:i.rotate(.5*Math.PI),i.translate(0,-n.width);break;case 7:i.rotate(.5*Math.PI),i.translate(n.height,-n.width),i.scale(-1,1);break;case 8:i.rotate(-.5*Math.PI),i.translate(-n.height,0)}drawImageIOSFix(i,d,null!=t.srcX?t.srcX:0,null!=t.srcY?t.srcY:0,t.srcWidth,t.srcHeight,null!=t.trgX?t.trgX:0,null!=t.trgY?t.trgY:0,t.trgWidth,t.trgHeight);var r=n.toDataURL("image/png");if(null!=u)return u(r,n)})},null!=u&&(d.onerror=u),d.src=o.dataURL}},{key:"processQueue",value:function(){var e=this.options.parallelUploads,t=this.getUploadingFiles().length,n=t;if(!(e<=t)){var i=this.getQueuedFiles();if(0<i.length){if(this.options.uploadMultiple)return this.processFiles(i.slice(0,e-t));for(;n<e;){if(!i.length)return;this.processFile(i.shift()),n++}}}}},{key:"processFile",value:function(e){return this.processFiles([e])}},{key:"processFiles",value:function(e){var t=!0,n=!1,i=void 0;try{for(var r,o=e[Symbol.iterator]();!(t=(r=o.next()).done);t=!0){var a=r.value;a.processing=!0,a.status=C.UPLOADING,this.emit("processing",a)}}catch(e){n=!0,i=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw i}}return this.options.uploadMultiple&&this.emit("processingmultiple",e),this.uploadFiles(e)}},{key:"_getFilesWithXhr",value:function(t){return this.files.filter(function(e){return e.xhr===t}).map(function(e){return e})}},{key:"cancelUpload",value:function(e){if(e.status===C.UPLOADING){var t=this._getFilesWithXhr(e.xhr),n=!0,i=!1,r=void 0;try{for(var o,a=t[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){o.value.status=C.CANCELED}}catch(e){i=!0,r=e}finally{try{n||null==a.return||a.return()}finally{if(i)throw r}}void 0!==e.xhr&&e.xhr.abort();var l=!0,s=!1,u=void 0;try{for(var c,d=t[Symbol.iterator]();!(l=(c=d.next()).done);l=!0){var p=c.value;this.emit("canceled",p)}}catch(e){s=!0,u=e}finally{try{l||null==d.return||d.return()}finally{if(s)throw u}}this.options.uploadMultiple&&this.emit("canceledmultiple",t)}else e.status!==C.ADDED&&e.status!==C.QUEUED||(e.status=C.CANCELED,this.emit("canceled",e),this.options.uploadMultiple&&this.emit("canceledmultiple",[e]));if(this.options.autoProcessQueue)return this.processQueue()}},{key:"resolveOption",value:function(e){if("function"!=typeof e)return e;for(var t=arguments.length,n=new Array(1<t?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return e.apply(this,n)}},{key:"uploadFile",value:function(e){return this.uploadFiles([e])}},{key:"uploadFiles",value:function(s){var u=this;this._transformFiles(s,function(e){if(u.options.chunking){var t=e[0];s[0].upload.chunked=u.options.chunking&&(u.options.forceChunking||t.size>u.options.chunkSize),s[0].upload.totalChunkCount=Math.ceil(t.size/u.options.chunkSize)}if(s[0].upload.chunked){var r=s[0],o=e[0];r.upload.chunks=[];var i=function(){for(var e=0;void 0!==r.upload.chunks[e];)e++;if(!(e>=r.upload.totalChunkCount)){0;var t=e*u.options.chunkSize,n=Math.min(t+u.options.chunkSize,r.size),i={name:u._getParamName(0),data:o.webkitSlice?o.webkitSlice(t,n):o.slice(t,n),filename:r.upload.filename,chunkIndex:e};r.upload.chunks[e]={file:r,index:e,dataBlock:i,status:C.UPLOADING,progress:0,retries:0},u._uploadData(s,[i])}};if(r.upload.finishedChunkUpload=function(e){var t=!0;e.status=C.SUCCESS,e.dataBlock=null,e.xhr=null;for(var n=0;n<r.upload.totalChunkCount;n++){if(void 0===r.upload.chunks[n])return i();r.upload.chunks[n].status!==C.SUCCESS&&(t=!1)}t&&u.options.chunksUploaded(r,function(){u._finished(s,"",null)})},u.options.parallelChunkUploads)for(var n=0;n<r.upload.totalChunkCount;n++)i();else i()}else{for(var a=[],l=0;l<s.length;l++)a[l]={name:u._getParamName(l),data:e[l],filename:s[l].upload.filename};u._uploadData(s,a)}})}},{key:"_getChunk",value:function(e,t){for(var n=0;n<e.upload.totalChunkCount;n++)if(void 0!==e.upload.chunks[n]&&e.upload.chunks[n].xhr===t)return e.upload.chunks[n]}},{key:"_uploadData",value:function(t,e){var n=this,i=new XMLHttpRequest,r=!0,o=!1,a=void 0;try{for(var l,s=t[Symbol.iterator]();!(r=(l=s.next()).done);r=!0){l.value.xhr=i}}catch(e){o=!0,a=e}finally{try{r||null==s.return||s.return()}finally{if(o)throw a}}t[0].upload.chunked&&(t[0].upload.chunks[e[0].chunkIndex].xhr=i);var u=this.resolveOption(this.options.method,t),c=this.resolveOption(this.options.url,t);i.open(u,c,!0),i.timeout=this.resolveOption(this.options.timeout,t),i.withCredentials=!!this.options.withCredentials,i.onload=function(e){n._finishedUploading(t,i,e)},i.ontimeout=function(){n._handleUploadError(t,i,"Request timedout after ".concat(n.options.timeout," seconds"))},i.onerror=function(){n._handleUploadError(t,i)},(null!=i.upload?i.upload:i).onprogress=function(e){return n._updateFilesUploadProgress(t,i,e)};var d={Accept:"application/json","Cache-Control":"no-cache","X-Requested-With":"XMLHttpRequest"};for(var p in this.options.headers&&C.extend(d,this.options.headers),d){var h=d[p];h&&i.setRequestHeader(p,h)}var f=new FormData;if(this.options.params){var v=this.options.params;for(var m in"function"==typeof v&&(v=v.call(this,t,i,t[0].upload.chunked?this._getChunk(t[0],i):null)),v){var y=v[m];f.append(m,y)}}var g=!0,b=!1,k=void 0;try{for(var w,F=t[Symbol.iterator]();!(g=(w=F.next()).done);g=!0){var z=w.value;this.emit("sending",z,i,f)}}catch(e){b=!0,k=e}finally{try{g||null==F.return||F.return()}finally{if(b)throw k}}this.options.uploadMultiple&&this.emit("sendingmultiple",t,i,f),this._addFormElementData(f);for(var x=0;x<e.length;x++){var E=e[x];f.append(E.name,E.data,E.filename)}this.submitRequest(i,f,t)}},{key:"_transformFiles",value:function(n,i){for(var e=this,r=[],o=0,t=function(t){e.options.transformFile.call(e,n[t],function(e){r[t]=e,++o===n.length&&i(r)})},a=0;a<n.length;a++)t(a)}},{key:"_addFormElementData",value:function(e){if("FORM"===this.element.tagName){var t=!0,n=!1,i=void 0;try{for(var r,o=this.element.querySelectorAll("input, textarea, select, button")[Symbol.iterator]();!(t=(r=o.next()).done);t=!0){var a=r.value,l=a.getAttribute("name"),s=a.getAttribute("type");if(s=s&&s.toLowerCase(),null!=l)if("SELECT"===a.tagName&&a.hasAttribute("multiple")){var u=!0,c=!1,d=void 0;try{for(var p,h=a.options[Symbol.iterator]();!(u=(p=h.next()).done);u=!0){var f=p.value;f.selected&&e.append(l,f.value)}}catch(e){c=!0,d=e}finally{try{u||null==h.return||h.return()}finally{if(c)throw d}}}else(!s||"checkbox"!==s&&"radio"!==s||a.checked)&&e.append(l,a.value)}}catch(e){n=!0,i=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw i}}}}},{key:"_updateFilesUploadProgress",value:function(e,t,n){var i;if(void 0!==n){if(i=100*n.loaded/n.total,e[0].upload.chunked){var r=e[0],o=this._getChunk(r,t);o.progress=i,o.total=n.total,o.bytesSent=n.loaded;r.upload.progress=0,r.upload.total=0;for(var a=r.upload.bytesSent=0;a<r.upload.totalChunkCount;a++)void 0!==r.upload.chunks[a]&&void 0!==r.upload.chunks[a].progress&&(r.upload.progress+=r.upload.chunks[a].progress,r.upload.total+=r.upload.chunks[a].total,r.upload.bytesSent+=r.upload.chunks[a].bytesSent);r.upload.progress=r.upload.progress/r.upload.totalChunkCount}else{var l=!0,s=!1,u=void 0;try{for(var c,d=e[Symbol.iterator]();!(l=(c=d.next()).done);l=!0){var p=c.value;p.upload.progress=i,p.upload.total=n.total,p.upload.bytesSent=n.loaded}}catch(e){s=!0,u=e}finally{try{l||null==d.return||d.return()}finally{if(s)throw u}}}var h=!0,f=!1,v=void 0;try{for(var m,y=e[Symbol.iterator]();!(h=(m=y.next()).done);h=!0){var g=m.value;this.emit("uploadprogress",g,g.upload.progress,g.upload.bytesSent)}}catch(e){f=!0,v=e}finally{try{h||null==y.return||y.return()}finally{if(f)throw v}}}else{var b=!0,k=!0,w=!(i=100),F=void 0;try{for(var z,x=e[Symbol.iterator]();!(k=(z=x.next()).done);k=!0){var E=z.value;100===E.upload.progress&&E.upload.bytesSent===E.upload.total||(b=!1),E.upload.progress=i,E.upload.bytesSent=E.upload.total}}catch(e){w=!0,F=e}finally{try{k||null==x.return||x.return()}finally{if(w)throw F}}if(b)return;var C=!0,_=!1,S=void 0;try{for(var D,T=e[Symbol.iterator]();!(C=(D=T.next()).done);C=!0){var L=D.value;this.emit("uploadprogress",L,i,L.upload.bytesSent)}}catch(e){_=!0,S=e}finally{try{C||null==T.return||T.return()}finally{if(_)throw S}}}}},{key:"_finishedUploading",value:function(e,t,n){var i;if(e[0].status!==C.CANCELED&&4===t.readyState){if("arraybuffer"!==t.responseType&&"blob"!==t.responseType&&(i=t.responseText,t.getResponseHeader("content-type")&&~t.getResponseHeader("content-type").indexOf("application/json")))try{i=JSON.parse(i)}catch(e){n=e,i="Invalid JSON response from server."}this._updateFilesUploadProgress(e),200<=t.status&&t.status<300?e[0].upload.chunked?e[0].upload.finishedChunkUpload(this._getChunk(e[0],t)):this._finished(e,i,n):this._handleUploadError(e,t,i)}}},{key:"_handleUploadError",value:function(e,t,n){if(e[0].status!==C.CANCELED){if(e[0].upload.chunked&&this.options.retryChunks){var i=this._getChunk(e[0],t);if(i.retries++<this.options.retryChunksLimit)return void this._uploadData(e,[i.dataBlock]);console.warn("Retried this chunk too often. Giving up.")}this._errorProcessing(e,n||this.options.dictResponseError.replace("{{statusCode}}",t.status),t)}}},{key:"submitRequest",value:function(e,t){e.send(t)}},{key:"_finished",value:function(e,t,n){var i=!0,r=!1,o=void 0;try{for(var a,l=e[Symbol.iterator]();!(i=(a=l.next()).done);i=!0){var s=a.value;s.status=C.SUCCESS,this.emit("success",s,t,n),this.emit("complete",s)}}catch(e){r=!0,o=e}finally{try{i||null==l.return||l.return()}finally{if(r)throw o}}if(this.options.uploadMultiple&&(this.emit("successmultiple",e,t,n),this.emit("completemultiple",e)),this.options.autoProcessQueue)return this.processQueue()}},{key:"_errorProcessing",value:function(e,t,n){var i=!0,r=!1,o=void 0;try{for(var a,l=e[Symbol.iterator]();!(i=(a=l.next()).done);i=!0){var s=a.value;s.status=C.ERROR,this.emit("error",s,t,n),this.emit("complete",s)}}catch(e){r=!0,o=e}finally{try{i||null==l.return||l.return()}finally{if(r)throw o}}if(this.options.uploadMultiple&&(this.emit("errormultiple",e,t,n),this.emit("completemultiple",e)),this.options.autoProcessQueue)return this.processQueue()}}],[{key:"uuidv4",value:function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})}}]),C}();Dropzone.initClass(),Dropzone.version="5.7.0",Dropzone.options={},Dropzone.optionsForElement=function(e){return e.getAttribute("id")?Dropzone.options[camelize(e.getAttribute("id"))]:void 0},Dropzone.instances=[],Dropzone.forElement=function(e){if("string"==typeof e&&(e=document.querySelector(e)),null==(null!=e?e.dropzone:void 0))throw new Error("No Dropzone found for given element. This is probably because you're trying to access it before Dropzone had the time to initialize. Use the `init` option to setup any additional observers on your Dropzone.");return e.dropzone},Dropzone.autoDiscover=!0,Dropzone.discover=function(){var s;if(document.querySelectorAll)s=document.querySelectorAll(".dropzone");else{s=[];var e=function(l){return function(){var e=[],t=!0,n=!1,i=void 0;try{for(var r,o=l[Symbol.iterator]();!(t=(r=o.next()).done);t=!0){var a=r.value;/(^| )dropzone($| )/.test(a.className)?e.push(s.push(a)):e.push(void 0)}}catch(e){n=!0,i=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw i}}return e}()};e(document.getElementsByTagName("div")),e(document.getElementsByTagName("form"))}return function(){var e=[],t=!0,n=!1,i=void 0;try{for(var r,o=s[Symbol.iterator]();!(t=(r=o.next()).done);t=!0){var a=r.value;!1!==Dropzone.optionsForElement(a)?e.push(new Dropzone(a)):e.push(void 0)}}catch(e){n=!0,i=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw i}}return e}()},Dropzone.blacklistedBrowsers=[/opera.*(Macintosh|Windows Phone).*version\/12/i],Dropzone.isBrowserSupported=function(){var e=!0;if(window.File&&window.FileReader&&window.FileList&&window.Blob&&window.FormData&&document.querySelector)if("classList"in document.createElement("a")){var t=!0,n=!1,i=void 0;try{for(var r,o=Dropzone.blacklistedBrowsers[Symbol.iterator]();!(t=(r=o.next()).done);t=!0){r.value.test(navigator.userAgent)&&(e=!1)}}catch(e){n=!0,i=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw i}}}else e=!1;else e=!1;return e},Dropzone.dataURItoBlob=function(e){for(var t=atob(e.split(",")[1]),n=e.split(",")[0].split(":")[1].split(";")[0],i=new ArrayBuffer(t.length),r=new Uint8Array(i),o=0,a=t.length,l=0<=a;l?o<=a:a<=o;l?o++:o--)r[o]=t.charCodeAt(o);return new Blob([i],{type:n})};var without=function(e,t){return e.filter(function(e){return e!==t}).map(function(e){return e})},camelize=function(e){return e.replace(/[\-_](\w)/g,function(e){return e.charAt(1).toUpperCase()})};Dropzone.createElement=function(e){var t=document.createElement("div");return t.innerHTML=e,t.childNodes[0]},Dropzone.elementInside=function(e,t){if(e===t)return!0;for(;e=e.parentNode;)if(e===t)return!0;return!1},Dropzone.getElement=function(e,t){var n;if("string"==typeof e?n=document.querySelector(e):null!=e.nodeType&&(n=e),null==n)throw new Error("Invalid `".concat(t,"` option provided. Please provide a CSS selector or a plain HTML element."));return n},Dropzone.getElements=function(e,t){var n,i;if(e instanceof Array){i=[];try{var r=!0,o=!1,a=void 0;try{for(var l,s=e[Symbol.iterator]();!(r=(l=s.next()).done);r=!0)n=l.value,i.push(this.getElement(n,t))}catch(e){o=!0,a=e}finally{try{r||null==s.return||s.return()}finally{if(o)throw a}}}catch(e){i=null}}else if("string"==typeof e){var u=!0,c=!(i=[]),d=void 0;try{for(var p,h=document.querySelectorAll(e)[Symbol.iterator]();!(u=(p=h.next()).done);u=!0)n=p.value,i.push(n)}catch(e){c=!0,d=e}finally{try{u||null==h.return||h.return()}finally{if(c)throw d}}}else null!=e.nodeType&&(i=[e]);if(null==i||!i.length)throw new Error("Invalid `".concat(t,"` option provided. Please provide a CSS selector, a plain HTML element or a list of those."));return i},Dropzone.confirm=function(e,t,n){return window.confirm(e)?t():null!=n?n():void 0},Dropzone.isValidFile=function(e,t){if(!t)return!0;t=t.split(",");var n=e.type,i=n.replace(/\/.*$/,""),r=!0,o=!1,a=void 0;try{for(var l,s=t[Symbol.iterator]();!(r=(l=s.next()).done);r=!0){var u=l.value;if("."===(u=u.trim()).charAt(0)){if(-1!==e.name.toLowerCase().indexOf(u.toLowerCase(),e.name.length-u.length))return!0}else if(/\/\*$/.test(u)){if(i===u.replace(/\/.*$/,""))return!0}else if(n===u)return!0}}catch(e){o=!0,a=e}finally{try{r||null==s.return||s.return()}finally{if(o)throw a}}return!1},"undefined"!=typeof jQuery&&null!==jQuery&&(jQuery.fn.dropzone=function(e){return this.each(function(){return new Dropzone(this,e)})}),"undefined"!=typeof module&&null!==module?module.exports=Dropzone:window.Dropzone=Dropzone,Dropzone.ADDED="added",Dropzone.QUEUED="queued",Dropzone.ACCEPTED=Dropzone.QUEUED,Dropzone.UPLOADING="uploading",Dropzone.PROCESSING=Dropzone.UPLOADING,Dropzone.CANCELED="canceled",Dropzone.ERROR="error",Dropzone.SUCCESS="success";var detectVerticalSquash=function(e){e.naturalWidth;var t=e.naturalHeight,n=document.createElement("canvas");n.width=1,n.height=t;var i=n.getContext("2d");i.drawImage(e,0,0);for(var r=i.getImageData(1,0,1,t).data,o=0,a=t,l=t;o<l;){0===r[4*(l-1)+3]?a=l:o=l,l=a+o>>1}var s=l/t;return 0==s?1:s},drawImageIOSFix=function(e,t,n,i,r,o,a,l,s,u){var c=detectVerticalSquash(t);return e.drawImage(t,n,i,r,o,a,l,s,u/c)},ExifRestore=function(){function e(){_classCallCheck(this,e)}return _createClass(e,null,[{key:"initClass",value:function(){this.KEY_STR="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}},{key:"encode64",value:function(e){for(var t="",n=void 0,i=void 0,r="",o=void 0,a=void 0,l=void 0,s="",u=0;o=(n=e[u++])>>2,a=(3&n)<<4|(i=e[u++])>>4,l=(15&i)<<2|(r=e[u++])>>6,s=63&r,isNaN(i)?l=s=64:isNaN(r)&&(s=64),t=t+this.KEY_STR.charAt(o)+this.KEY_STR.charAt(a)+this.KEY_STR.charAt(l)+this.KEY_STR.charAt(s),n=i=r="",o=a=l=s="",u<e.length;);return t}},{key:"restore",value:function(e,t){if(!e.match("data:image/jpeg;base64,"))return t;var n=this.decode64(e.replace("data:image/jpeg;base64,","")),i=this.slice2Segments(n),r=this.exifManipulation(t,i);return"data:image/jpeg;base64,".concat(this.encode64(r))}},{key:"exifManipulation",value:function(e,t){var n=this.getExifArray(t),i=this.insertExif(e,n);return new Uint8Array(i)}},{key:"getExifArray",value:function(e){for(var t=void 0,n=0;n<e.length;){if(255===(t=e[n])[0]&225===t[1])return t;n++}return[]}},{key:"insertExif",value:function(e,t){var n=e.replace("data:image/jpeg;base64,",""),i=this.decode64(n),r=i.indexOf(255,3),o=i.slice(0,r),a=i.slice(r),l=o;return l=(l=l.concat(t)).concat(a)}},{key:"slice2Segments",value:function(e){for(var t=0,n=[];;){if(255===e[t]&218===e[t+1])break;if(255===e[t]&216===e[t+1])t+=2;else{var i=t+(256*e[t+2]+e[t+3])+2,r=e.slice(t,i);n.push(r),t=i}if(t>e.length)break}return n}},{key:"decode64",value:function(e){var t=void 0,n=void 0,i="",r=void 0,o=void 0,a="",l=0,s=[];for(/[^A-Za-z0-9\+\/\=]/g.exec(e)&&console.warn("There were invalid base64 characters in the input text.\nValid base64 characters are A-Z, a-z, 0-9, '+', '/',and '='\nExpect errors in decoding."),e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");t=this.KEY_STR.indexOf(e.charAt(l++))<<2|(r=this.KEY_STR.indexOf(e.charAt(l++)))>>4,n=(15&r)<<4|(o=this.KEY_STR.indexOf(e.charAt(l++)))>>2,i=(3&o)<<6|(a=this.KEY_STR.indexOf(e.charAt(l++))),s.push(t),64!==o&&s.push(n),64!==a&&s.push(i),t=n=i="",r=o=a="",l<e.length;);return s}}]),e}();ExifRestore.initClass();var contentLoaded=function(t,n){function i(e){if("readystatechange"!==e.type||"complete"===o.readyState)return("load"===e.type?t:o)[s](u+e.type,i,!1),!r&&(r=!0)?n.call(t,e.type||e):void 0}var r=!1,e=!0,o=t.document,a=o.documentElement,l=o.addEventListener?"addEventListener":"attachEvent",s=o.addEventListener?"removeEventListener":"detachEvent",u=o.addEventListener?"":"on";if("complete"!==o.readyState){if(o.createEventObject&&a.doScroll){try{e=!t.frameElement}catch(e){}e&&!function t(){try{a.doScroll("left")}catch(e){return void setTimeout(t,50)}return i("poll")}()}return o[l](u+"DOMContentLoaded",i,!1),o[l](u+"readystatechange",i,!1),t[l](u+"load",i,!1)}};function __guard__(e,t){return null!=e?t(e):void 0}function __guardMethod__(e,t,n){return null!=e&&"function"==typeof e[t]?n(e,t):void 0}Dropzone._autoDiscoverFunction=function(){if(Dropzone.autoDiscover)return Dropzone.discover()},contentLoaded(window,Dropzone._autoDiscoverFunction);
v4.0.0/assets/admin/scss/admin.css CHANGED
@@ -1885,17 +1885,38 @@ button.menu-save {
1885
  right: 10px;
1886
  }
1887
 
1888
- .rmp-theme-page,
1889
- .rmp-roadmap-page {
1890
  margin: 2% 0;
1891
  }
1892
 
1893
- #rmp-roadmap-iframe {
1894
- width: 100%;
1895
- min-height: 700px;
1896
- height: 100%;
 
 
 
 
 
 
 
1897
  }
1898
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1899
  .rmp-theme-page .pagination {
1900
  display: inline-flex;
1901
  }
1885
  right: 10px;
1886
  }
1887
 
1888
+ .rmp-theme-page {
 
1889
  margin: 2% 0;
1890
  }
1891
 
1892
+ .notice-responsive-menu-next {
1893
+ padding: 10px 35px 10px 10px;
1894
+ background: #fff;
1895
+ border: 1px solid #14a4fa;
1896
+ border-left-width: 4px;
1897
+ box-shadow: 0 1px 1px rgb(0 0 0 / 4%);
1898
+ margin: 5px 0 15px;
1899
+ position: relative;
1900
+ }
1901
+ #wpfooter .notice-responsive-menu-next p, #wpfooter .notice-responsive-menu-next h3{
1902
+ margin-bottom: 10px;
1903
  }
1904
 
1905
+ .notice-responsive-menu-next .rm-btn-link-seprate{
1906
+ margin-left: 10px;
1907
+ margin-right: 10px;
1908
+ }
1909
+
1910
+ .notice-responsive-menu-next .rm-btn-link {
1911
+ text-decoration: none;
1912
+ }
1913
+ .post-type-rmp_menu #wpfooter{
1914
+ position: relative;
1915
+ }
1916
+
1917
+ .notice-responsive-menu-next .notice-dismiss{
1918
+ text-decoration: none;
1919
+ }
1920
  .rmp-theme-page .pagination {
1921
  display: inline-flex;
1922
  }
v4.0.0/assets/images/giphy.webp ADDED
Binary file
v4.0.0/inc/classes/class-admin.php CHANGED
@@ -2,10 +2,10 @@
2
  /**
3
  * Admin class.
4
  * This is core class which is responsible for admin functionality.
5
- *
6
  * @version 4.0.0
7
  * @author Expresstech System
8
- *
9
  * @package responsive-menu-pro
10
  */
11
 
@@ -56,7 +56,7 @@ class Admin {
56
  add_action( 'wp_ajax_rmp_create_new_menu', [ $this, 'create_new_menu' ] );
57
  add_action( 'wp_ajax_rmp_export_menu', [ $this, 'rmp_export_menu' ] );
58
  add_action( 'wp_ajax_rmp_import_menu', [ $this, 'rmp_import_menu' ] );
59
-
60
  add_shortcode( 'rmp_menu', [ $this, 'register_menu_shortcode' ] );
61
  add_action( 'init', array($this,'rmp_menu_cpt'), 0 );
62
 
@@ -73,7 +73,7 @@ class Admin {
73
 
74
  /**
75
  * Function to save the global settings of setting page.
76
- *
77
  * @return json
78
  */
79
  public function save_menu_global_settings() {
@@ -81,19 +81,20 @@ class Admin {
81
  check_ajax_referer( 'rmp_nonce', 'ajax_nonce' );
82
 
83
  $options = array();
84
- parse_str( $_POST['form'], $options );
 
85
 
86
  foreach( $options as $key => $value ) {
87
  $options[$key] = sanitize_text_field( $value );
88
  }
89
 
90
  update_option( 'rmp_global_setting_options', $options );
91
-
92
  /**
93
  * Fires after global settings is saved.
94
- *
95
  * @since 4.0.0
96
- *
97
  * @param array $option List of global settings.
98
  */
99
  do_action( 'rmp_save_global_settings', $options );
@@ -105,7 +106,7 @@ class Admin {
105
  * Rollback to older version from setting page.
106
  *
107
  * @since 4.0.0
108
- *
109
  * @return void
110
  */
111
  public function rollback_version() {
@@ -121,7 +122,7 @@ class Admin {
121
  * Function to create a new theme.
122
  *
123
  * @since 4.0.0
124
- *
125
  * @return json
126
  */
127
  public function create_new_menu() {
@@ -201,7 +202,7 @@ class Admin {
201
 
202
  /**
203
  * Fires when menu is created and options is saved.
204
- *
205
  * @param int $menu_id Menu ID.
206
  */
207
  do_action( 'rmp_create_new_menu', $menu_id );
@@ -227,10 +228,10 @@ class Admin {
227
  * This function register the shortcode for menu.
228
  *
229
  * @since 4.0.0
230
- *
231
  * @param Array $atts Attributes List.
232
  * @param string $content It contain text from shortcode.
233
- *
234
  * @return HTML $output Menu contents.
235
  */
236
  public function register_menu_shortcode( $attrs = [] ) {
@@ -244,7 +245,7 @@ class Admin {
244
  return __( 'Please pass menu id as attribute.', 'responsive-menu-pro' );
245
  }
246
 
247
- $menu_id = $attrs['id'];
248
  if ( 'publish' !== get_post_status( $menu_id ) ) {
249
  return __( "Shortcode with menu id $menu_id is not published.", 'responsive-menu-pro' );
250
  }
@@ -267,9 +268,9 @@ class Admin {
267
 
268
  /**
269
  * Function to update the global options.
270
- *
271
  * @since 4.0.0
272
- *
273
  * @return void
274
  */
275
  public function set_global_options() {
@@ -306,29 +307,6 @@ class Admin {
306
  array( $this, 'rmp_theme_admin_page' )
307
  );
308
 
309
- add_submenu_page (
310
- 'edit.php?post_type=rmp_menu',
311
- __( 'What\'s Next', 'responsive-menu-pro' ),
312
- __( 'What\'s Next', 'responsive-menu-pro' ),
313
- 'manage_options',
314
- 'whats-next',
315
- array( $this, 'rmp_roadmap_admin_page' )
316
- );
317
-
318
- }
319
-
320
- /**
321
- * Add template for roadmap page.
322
- *
323
- * @since 4.0.1
324
- */
325
- public function rmp_roadmap_admin_page() {
326
- // Check user capabilities.
327
- if ( ! current_user_can( 'manage_options' ) ) {
328
- return;
329
- }
330
-
331
- include_once RMP_PLUGIN_PATH_V4 . '/templates/rmp-roadmap.php';
332
  }
333
 
334
  /**
@@ -350,7 +328,7 @@ class Admin {
350
  * Add template to the setting page.
351
  *
352
  * @since 4.0.0
353
- *
354
  * @return void
355
  */
356
  public function rmp_global_settings_page() {
@@ -365,9 +343,9 @@ class Admin {
365
 
366
  /**
367
  * Remove create new menu default link of rmp_menu post type.
368
- *
369
  * @since 4.0.0
370
- *
371
  * @return void
372
  */
373
  function remove_default_add_cpt_page() {
@@ -376,9 +354,9 @@ class Admin {
376
 
377
  /**
378
  * Function to add the new menu wizard template.
379
- *
380
  * @since 4.0.0
381
- *
382
  * @return void
383
  */
384
  public function add_new_menu_widget() {
@@ -391,10 +369,10 @@ class Admin {
391
  /**
392
  * Function to change the edit label and url.
393
  * @since 4.0.0
394
- *
395
  * @param array $actions List of post row actions.
396
  * @param Object $post Post object
397
- *
398
  * @return array $actions
399
  */
400
  public function rmp_menu_row_actions( $actions, $post ) {
@@ -412,15 +390,15 @@ class Admin {
412
 
413
  /**
414
  * Function to add the custom column.
415
- *
416
  * @since 4.0.0
417
- *
418
  * @param array $columns List of columns.
419
- *
420
- * @return array $columns Edited columns list.
421
  */
422
  public function set_custom_edit_menu_columns($columns) {
423
-
424
  unset( $columns['date'] );
425
  $columns['shortcode_place'] = __( 'Shortcode', 'responsive-menu-pro' );
426
  $columns['actions'] = __( 'Actions', 'responsive-menu-pro' );
@@ -431,17 +409,17 @@ class Admin {
431
 
432
  /**
433
  * Function to change the edit url of post type rmp_menu
434
- *
435
  * @since 4.0.0
436
- *
437
  * @param string $url Post edit URL.
438
  * @param int $post_id Post ID
439
- *
440
  * @return string $url Edited post url URL
441
  */
442
  public function my_edit_post_link( $url, $post_id ) {
443
 
444
- if ( 'rmp_menu' == get_post_type() ) {
445
  $url = get_admin_url() .'post.php?post='. $post_id .'&action=edit&editor=true';
446
  }
447
 
@@ -450,12 +428,12 @@ class Admin {
450
 
451
  /**
452
  * Function to add the data to the custom columns for the rmp_menu post type.
453
- *
454
  * @since 4.0.0
455
- *
456
  * @param string $column Column Name
457
  * @param int $post_id Post ID
458
- *
459
  * @return void
460
  */
461
  function add_custom_columns( $column, $post_id ) {
@@ -465,7 +443,7 @@ class Admin {
465
 
466
  case 'actions' :
467
  echo sprintf(
468
- '<a href="%s" class="button" aria-label="Customize">%s</a>',
469
  esc_url( get_edit_post_link( $post_id) ),
470
  __( 'Customize', 'responsive-menu-pro' )
471
  );
@@ -474,7 +452,7 @@ class Admin {
474
 
475
  $option = $option_manager->get_option( $post_id, 'menu_display_on' );
476
  if( 'shortcode' === $option ) {
477
- echo sprintf('<code>[rmp_menu id="%s"]</code>', $post_id );
478
  } else {
479
  esc_html_e( 'Shortcode deactivated', 'responsive-menu-pro' );
480
  }
@@ -545,7 +523,7 @@ class Admin {
545
  * Function to export the menu
546
  *
547
  * @since 4.0.0
548
- *
549
  * @return json
550
  */
551
  public function rmp_export_menu() {
@@ -567,7 +545,7 @@ class Admin {
567
  * Function to import the menu settings.
568
  *
569
  * @since 4.0.0
570
- *
571
  * @return json
572
  */
573
  public function rmp_import_menu() {
@@ -578,9 +556,7 @@ class Admin {
578
  wp_send_json_error( [ 'message' => __('Please add file !', 'responsive-menu-pro') ] );
579
  }
580
 
581
- $file_type = pathinfo( basename( $_FILES["file"]["name"] ), PATHINFO_EXTENSION );
582
-
583
- if( empty( $_FILES['file']['tmp_name'] ) || 'json' != $file_type ) {
584
  wp_send_json_error( [ 'message' => __('Please add json file !', 'responsive-menu-pro') ] );
585
  }
586
 
@@ -590,10 +566,10 @@ class Admin {
590
  }
591
 
592
  $file_contents = file_get_contents( $_FILES['file']['tmp_name'] );
593
- $import_options = json_decode( $file_contents, true );
594
 
595
  $option_manager = Option_Manager::get_instance();
596
- $exist_option = $option_manager->get_options( $menu_id );
597
 
598
  // Some required options replced in imported settings with existing menu settings.
599
  $import_options['menu_name'] = $exist_option['menu_name'];
@@ -605,9 +581,9 @@ class Admin {
605
  update_post_meta( $menu_id, 'rmp_menu_meta' , $import_options );
606
  /**
607
  * Fires when menu is imported.
608
- *
609
  * @since 4.0.0
610
- *
611
  * @param int $menu_id
612
  */
613
  do_action( 'rmp_import_menu', $menu_id );
2
  /**
3
  * Admin class.
4
  * This is core class which is responsible for admin functionality.
5
+ *
6
  * @version 4.0.0
7
  * @author Expresstech System
8
+ *
9
  * @package responsive-menu-pro
10
  */
11
 
56
  add_action( 'wp_ajax_rmp_create_new_menu', [ $this, 'create_new_menu' ] );
57
  add_action( 'wp_ajax_rmp_export_menu', [ $this, 'rmp_export_menu' ] );
58
  add_action( 'wp_ajax_rmp_import_menu', [ $this, 'rmp_import_menu' ] );
59
+
60
  add_shortcode( 'rmp_menu', [ $this, 'register_menu_shortcode' ] );
61
  add_action( 'init', array($this,'rmp_menu_cpt'), 0 );
62
 
73
 
74
  /**
75
  * Function to save the global settings of setting page.
76
+ *
77
  * @return json
78
  */
79
  public function save_menu_global_settings() {
81
  check_ajax_referer( 'rmp_nonce', 'ajax_nonce' );
82
 
83
  $options = array();
84
+ $form_data = $_POST['form'];
85
+ wp_parse_str( $form_data, $options );
86
 
87
  foreach( $options as $key => $value ) {
88
  $options[$key] = sanitize_text_field( $value );
89
  }
90
 
91
  update_option( 'rmp_global_setting_options', $options );
92
+
93
  /**
94
  * Fires after global settings is saved.
95
+ *
96
  * @since 4.0.0
97
+ *
98
  * @param array $option List of global settings.
99
  */
100
  do_action( 'rmp_save_global_settings', $options );
106
  * Rollback to older version from setting page.
107
  *
108
  * @since 4.0.0
109
+ *
110
  * @return void
111
  */
112
  public function rollback_version() {
122
  * Function to create a new theme.
123
  *
124
  * @since 4.0.0
125
+ *
126
  * @return json
127
  */
128
  public function create_new_menu() {
202
 
203
  /**
204
  * Fires when menu is created and options is saved.
205
+ *
206
  * @param int $menu_id Menu ID.
207
  */
208
  do_action( 'rmp_create_new_menu', $menu_id );
228
  * This function register the shortcode for menu.
229
  *
230
  * @since 4.0.0
231
+ *
232
  * @param Array $atts Attributes List.
233
  * @param string $content It contain text from shortcode.
234
+ *
235
  * @return HTML $output Menu contents.
236
  */
237
  public function register_menu_shortcode( $attrs = [] ) {
245
  return __( 'Please pass menu id as attribute.', 'responsive-menu-pro' );
246
  }
247
 
248
+ $menu_id = $attrs['id'];
249
  if ( 'publish' !== get_post_status( $menu_id ) ) {
250
  return __( "Shortcode with menu id $menu_id is not published.", 'responsive-menu-pro' );
251
  }
268
 
269
  /**
270
  * Function to update the global options.
271
+ *
272
  * @since 4.0.0
273
+ *
274
  * @return void
275
  */
276
  public function set_global_options() {
307
  array( $this, 'rmp_theme_admin_page' )
308
  );
309
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
310
  }
311
 
312
  /**
328
  * Add template to the setting page.
329
  *
330
  * @since 4.0.0
331
+ *
332
  * @return void
333
  */
334
  public function rmp_global_settings_page() {
343
 
344
  /**
345
  * Remove create new menu default link of rmp_menu post type.
346
+ *
347
  * @since 4.0.0
348
+ *
349
  * @return void
350
  */
351
  function remove_default_add_cpt_page() {
354
 
355
  /**
356
  * Function to add the new menu wizard template.
357
+ *
358
  * @since 4.0.0
359
+ *
360
  * @return void
361
  */
362
  public function add_new_menu_widget() {
369
  /**
370
  * Function to change the edit label and url.
371
  * @since 4.0.0
372
+ *
373
  * @param array $actions List of post row actions.
374
  * @param Object $post Post object
375
+ *
376
  * @return array $actions
377
  */
378
  public function rmp_menu_row_actions( $actions, $post ) {
390
 
391
  /**
392
  * Function to add the custom column.
393
+ *
394
  * @since 4.0.0
395
+ *
396
  * @param array $columns List of columns.
397
+ *
398
+ * @return array $columns Edited columns list.
399
  */
400
  public function set_custom_edit_menu_columns($columns) {
401
+
402
  unset( $columns['date'] );
403
  $columns['shortcode_place'] = __( 'Shortcode', 'responsive-menu-pro' );
404
  $columns['actions'] = __( 'Actions', 'responsive-menu-pro' );
409
 
410
  /**
411
  * Function to change the edit url of post type rmp_menu
412
+ *
413
  * @since 4.0.0
414
+ *
415
  * @param string $url Post edit URL.
416
  * @param int $post_id Post ID
417
+ *
418
  * @return string $url Edited post url URL
419
  */
420
  public function my_edit_post_link( $url, $post_id ) {
421
 
422
+ if ( 'rmp_menu' == get_post_type() ) {
423
  $url = get_admin_url() .'post.php?post='. $post_id .'&action=edit&editor=true';
424
  }
425
 
428
 
429
  /**
430
  * Function to add the data to the custom columns for the rmp_menu post type.
431
+ *
432
  * @since 4.0.0
433
+ *
434
  * @param string $column Column Name
435
  * @param int $post_id Post ID
436
+ *
437
  * @return void
438
  */
439
  function add_custom_columns( $column, $post_id ) {
443
 
444
  case 'actions' :
445
  echo sprintf(
446
+ '<a href="%s" class="' . esc_attr( "button" ) . '" aria-label="' . esc_attr( "Customize" ) . '">%s</a>',
447
  esc_url( get_edit_post_link( $post_id) ),
448
  __( 'Customize', 'responsive-menu-pro' )
449
  );
452
 
453
  $option = $option_manager->get_option( $post_id, 'menu_display_on' );
454
  if( 'shortcode' === $option ) {
455
+ echo sprintf('<code>[rmp_menu id="%s"]</code>', esc_attr( $post_id ) );
456
  } else {
457
  esc_html_e( 'Shortcode deactivated', 'responsive-menu-pro' );
458
  }
523
  * Function to export the menu
524
  *
525
  * @since 4.0.0
526
+ *
527
  * @return json
528
  */
529
  public function rmp_export_menu() {
545
  * Function to import the menu settings.
546
  *
547
  * @since 4.0.0
548
+ *
549
  * @return json
550
  */
551
  public function rmp_import_menu() {
556
  wp_send_json_error( [ 'message' => __('Please add file !', 'responsive-menu-pro') ] );
557
  }
558
 
559
+ if( empty( $_FILES['file']['tmp_name'] ) || 'application/json' != $_FILES['file']['type'] ) {
 
 
560
  wp_send_json_error( [ 'message' => __('Please add json file !', 'responsive-menu-pro') ] );
561
  }
562
 
566
  }
567
 
568
  $file_contents = file_get_contents( $_FILES['file']['tmp_name'] );
569
+ $import_options = json_decode( $file_contents, true );
570
 
571
  $option_manager = Option_Manager::get_instance();
572
+ $exist_option = $option_manager->get_options( $menu_id );
573
 
574
  // Some required options replced in imported settings with existing menu settings.
575
  $import_options['menu_name'] = $exist_option['menu_name'];
581
  update_post_meta( $menu_id, 'rmp_menu_meta' , $import_options );
582
  /**
583
  * Fires when menu is imported.
584
+ *
585
  * @since 4.0.0
586
+ *
587
  * @param int $menu_id
588
  */
589
  do_action( 'rmp_import_menu', $menu_id );
v4.0.0/inc/classes/class-assets.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /**
3
  * Assets class.
4
- *
5
  * This class is responsible to load the resources as per page call.
6
  *
7
  * @since 4.0.0
@@ -20,7 +20,7 @@ if ( ! defined( 'ABSPATH' ) ) {
20
 
21
  /**
22
  * Class Assets
23
- *
24
  */
25
  class Assets {
26
 
@@ -41,35 +41,37 @@ class Assets {
41
  protected function setup_hooks() {
42
 
43
  add_action( 'admin_enqueue_scripts', [ $this, 'admin_enqueue_scripts' ] );
44
- add_action('admin_head', [ $this, 'admin_custom_style_inline'] );
45
- add_action('admin_head', [ $this, 'rmp_menu_editor_style_inline'] );
46
  }
47
 
48
  /**
49
  * Add custom css to manage headerbar extra padding.
50
- *
51
  * @since 4.0.1
52
  */
53
  function rmp_menu_editor_style_inline() {
54
 
55
  $editor = filter_input( INPUT_GET, 'editor', FILTER_SANITIZE_STRING );
56
  if ( ! empty( $editor ) && get_post_type() == 'rmp_menu' && is_admin() ) {
57
- echo '<style>
58
- html.wp-toolbar {
59
  margin: 0;
60
  padding: 0 !important;
61
- }
62
- </style>';
63
  }
64
  }
65
 
66
  /**
67
  * Add custom css to manage size of admin menu logo.
68
- *
69
  * @since 4.0.0
70
  */
71
  function admin_custom_style_inline() {
72
- echo '<style>
 
 
 
73
  #adminmenu .menu-icon-rmp_menu .wp-menu-image img{
74
  height: 18px;
75
  }
@@ -78,8 +80,9 @@ class Assets {
78
  color: #f80668;
79
  font-weight: 600;
80
  }
 
 
81
 
82
- </style>';
83
  }
84
 
85
  /**
@@ -91,12 +94,11 @@ class Assets {
91
  */
92
  public function admin_enqueue_scripts( $hook_suffix ) {
93
 
94
-
95
 
96
- $post_type = get_post_type();
97
 
98
  if ( empty( $post_type ) && ! empty( $_GET['post_type'] ) ) {
99
- $post_type = $_GET['post_type'];
100
  }
101
 
102
  if ( 'rmp_menu' !== $post_type ) {
@@ -122,22 +124,6 @@ class Assets {
122
  wp_enqueue_media();
123
  }
124
 
125
- // wp_enqueue_script(
126
- // 'rmp_editor_scripts',
127
- // RMP_PLUGIN_URL_V4 . '/assets/admin/js/rmp-editor.js',
128
- // array('jquery'),
129
- // RMP_PLUGIN_VERSION,
130
- // true
131
- // );
132
-
133
- // wp_enqueue_script(
134
- // 'rmp_admin_icon_scripts',
135
- // RMP_PLUGIN_URL_V4 . '/assets/admin/js/rmp-icon.js',
136
- // array('jquery'),
137
- // RMP_PLUGIN_VERSION,
138
- // true
139
- // );
140
-
141
  wp_enqueue_script(
142
  'rmp_admin_selectize_scripts',
143
  RMP_PLUGIN_URL_V4 . '/assets/admin/js/selectize.js',
@@ -152,14 +138,6 @@ class Assets {
152
  RMP_PLUGIN_VERSION
153
  );
154
 
155
- //Color alpha feature in color input controls by below custom scripts.
156
- // wp_enqueue_script(
157
- // 'rmp_custom_color_alpha_scripts',
158
- // RMP_PLUGIN_URL_V4 . '/assets/admin/js/wp-color-alpha.js',
159
- // array('wp-color-picker'),
160
- // RMP_PLUGIN_VERSION
161
- // );
162
-
163
  wp_enqueue_style(
164
  'rmp_admin_main_styles',
165
  RMP_PLUGIN_URL_V4 . '/assets/admin/build/css/rmpMain.css',
@@ -170,7 +148,7 @@ class Assets {
170
 
171
  wp_enqueue_script(
172
  'rmp_admin_dropzone_scripts',
173
- 'https://cdnjs.cloudflare.com/ajax/libs/dropzone/5.7.0/min/dropzone.min.js',
174
  array('jquery'),
175
  RMP_PLUGIN_VERSION
176
  );
@@ -200,15 +178,8 @@ class Assets {
200
  )
201
  );
202
 
203
- wp_enqueue_script( 'rmp_admin_scripts' );
204
 
205
- // wp_enqueue_script(
206
- // 'rmp_preview_scripts',
207
- // RMP_PLUGIN_URL_V4 . '/assets/admin/js/rmp-preview.js',
208
- // array('jquery'),
209
- // RMP_PLUGIN_VERSION,
210
- // true
211
- // );
212
 
213
  /** Enqueue the icons resources */
214
 
1
  <?php
2
  /**
3
  * Assets class.
4
+ *
5
  * This class is responsible to load the resources as per page call.
6
  *
7
  * @since 4.0.0
20
 
21
  /**
22
  * Class Assets
23
+ *
24
  */
25
  class Assets {
26
 
41
  protected function setup_hooks() {
42
 
43
  add_action( 'admin_enqueue_scripts', [ $this, 'admin_enqueue_scripts' ] );
44
+ add_action('admin_enqueue_scripts', [ $this, 'admin_custom_style_inline'] );
45
+ add_action('admin_enqueue_scripts', [ $this, 'rmp_menu_editor_style_inline'] );
46
  }
47
 
48
  /**
49
  * Add custom css to manage headerbar extra padding.
50
+ *
51
  * @since 4.0.1
52
  */
53
  function rmp_menu_editor_style_inline() {
54
 
55
  $editor = filter_input( INPUT_GET, 'editor', FILTER_SANITIZE_STRING );
56
  if ( ! empty( $editor ) && get_post_type() == 'rmp_menu' && is_admin() ) {
57
+ $css_data = 'html.wp-toolbar {
 
58
  margin: 0;
59
  padding: 0 !important;
60
+ }';
61
+ wp_add_inline_style( 'rmp_admin_main_styles', $css_data );
62
  }
63
  }
64
 
65
  /**
66
  * Add custom css to manage size of admin menu logo.
67
+ *
68
  * @since 4.0.0
69
  */
70
  function admin_custom_style_inline() {
71
+ wp_register_style( 'rmp_admin_inline', false );
72
+ wp_enqueue_style( 'rmp_admin_inline' );
73
+
74
+ $css_data = '
75
  #adminmenu .menu-icon-rmp_menu .wp-menu-image img{
76
  height: 18px;
77
  }
80
  color: #f80668;
81
  font-weight: 600;
82
  }
83
+ ';
84
+ wp_add_inline_style( 'rmp_admin_inline', $css_data );
85
 
 
86
  }
87
 
88
  /**
94
  */
95
  public function admin_enqueue_scripts( $hook_suffix ) {
96
 
 
97
 
98
+ $post_type = get_post_type();
99
 
100
  if ( empty( $post_type ) && ! empty( $_GET['post_type'] ) ) {
101
+ $post_type = sanitize_text_field( $_GET['post_type'] );
102
  }
103
 
104
  if ( 'rmp_menu' !== $post_type ) {
124
  wp_enqueue_media();
125
  }
126
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
127
  wp_enqueue_script(
128
  'rmp_admin_selectize_scripts',
129
  RMP_PLUGIN_URL_V4 . '/assets/admin/js/selectize.js',
138
  RMP_PLUGIN_VERSION
139
  );
140
 
 
 
 
 
 
 
 
 
141
  wp_enqueue_style(
142
  'rmp_admin_main_styles',
143
  RMP_PLUGIN_URL_V4 . '/assets/admin/build/css/rmpMain.css',
148
 
149
  wp_enqueue_script(
150
  'rmp_admin_dropzone_scripts',
151
+ RMP_PLUGIN_URL_V4 . '/assets/admin/js/dropzone.min.js',
152
  array('jquery'),
153
  RMP_PLUGIN_VERSION
154
  );
178
  )
179
  );
180
 
 
181
 
182
+ wp_enqueue_script( 'rmp_admin_scripts' );
 
 
 
 
 
 
183
 
184
  /** Enqueue the icons resources */
185
 
v4.0.0/inc/classes/class-control-manager.php CHANGED
@@ -24,7 +24,7 @@ if ( ! defined( 'ABSPATH' ) ) {
24
  class Control_Manager {
25
 
26
  use Singleton;
27
-
28
  /**
29
  * Construct method.
30
  */
@@ -85,7 +85,7 @@ class Control_Manager {
85
  $group_classes = $param['group_classes'];
86
  }
87
 
88
- $html = sprintf('<div class="rmp-input-control-wrapper %s">', $group_classes );
89
 
90
  //Check tooltip text is added or not.
91
  $tool_tip = '';
@@ -99,8 +99,9 @@ class Control_Manager {
99
  if( ! empty( $param['feature_type'] ) ) {
100
  $is_disabled = 'disabled';
101
  $feature_label = sprintf(
102
- '<a target="_blank" class="upgrade-tooltip" href="https://responsive.menu/pricing?utm_source=free-plugin&utm_medium=option&utm_campaign=hide_on_mobile" > %s </a>',
103
- $param['feature_type']
 
104
  );
105
  }
106
 
@@ -176,12 +177,7 @@ class Control_Manager {
176
  */
177
  $html = apply_filters( 'rmp_text_control_html', $html, $param );
178
 
179
- // Check if echo parameter is empty or false.
180
- if ( empty( $param['echo'] ) ) {
181
- return $html;
182
- }
183
-
184
- echo $html;
185
  }
186
 
187
  /**
@@ -212,7 +208,7 @@ class Control_Manager {
212
  $group_classes = $param['group_classes'];
213
  }
214
 
215
- $html = sprintf('<div class="rmp-input-control-wrapper full-size %s">', $group_classes );
216
 
217
  //Check tooltip text is added or not.
218
  $tool_tip = '';
@@ -294,12 +290,7 @@ class Control_Manager {
294
  $html = apply_filters( 'rmp_text_control_html', $html, $param );
295
 
296
 
297
- // Check if echo parameter is empty or false.
298
- if ( empty( $param['echo'] ) ) {
299
- return $html;
300
- }
301
-
302
- echo $html;
303
 
304
  }
305
 
@@ -400,7 +391,7 @@ class Control_Manager {
400
  $group_classes = $param['group_classes'];
401
  }
402
 
403
- $html = sprintf('<div class="rmp-input-control-wrapper %s">', $group_classes );
404
 
405
  //Check tooltip text is added or not.
406
  $tool_tip = '';
@@ -447,12 +438,7 @@ class Control_Manager {
447
  */
448
  $html = apply_filters( 'rmp_color_control_html', $html, $param );
449
 
450
- // Check if echo parameter is empty or false.
451
- if ( empty( $param['echo'] ) ) {
452
- return $html;
453
- }
454
-
455
- echo $html;
456
  }
457
 
458
  /**
@@ -481,7 +467,7 @@ class Control_Manager {
481
  $group_classes = $param['group_classes'];
482
  }
483
 
484
- $html = sprintf( '<div class="rmp-input-control-wrapper %s">', $group_classes );
485
 
486
  $html .= '<div class="rmp-input-control">';
487
 
@@ -508,12 +494,7 @@ class Control_Manager {
508
  */
509
  $html = apply_filters( 'rmp_button_control_html', $html, $param );
510
 
511
- // Check if echo parameter is empty or false.
512
- if ( empty( $param['echo'] ) ) {
513
- return $html;
514
- }
515
-
516
- echo $html;
517
 
518
  }
519
 
@@ -545,7 +526,7 @@ class Control_Manager {
545
  $group_classes = $param['group_classes'];
546
  }
547
 
548
- $html = sprintf('<div class="rmp-input-control-wrapper rmp-input-control-switcher %s">', $group_classes );
549
 
550
  //Check tooltip text is added or not.
551
  $tool_tip = '';
@@ -559,7 +540,8 @@ class Control_Manager {
559
  if( ! empty( $param['feature_type'] ) ) {
560
  $is_disabled = 'disabled';
561
  $feature_label = sprintf(
562
- '<a target="_blank" class="upgrade-tooltip" href="https://responsive.menu/pricing?utm_source=free-plugin&utm_medium=option&utm_campaign=hide_on_mobile" > %s </a>',
 
563
  $param['feature_type']
564
  );
565
  }
@@ -618,12 +600,7 @@ class Control_Manager {
618
  */
619
  $html = apply_filters( 'rmp_switcher_control_html', $html, $param );
620
 
621
- // Check if echo parameter is empty or false.
622
- if ( empty( $param['echo'] ) ) {
623
- return $html;
624
- }
625
-
626
- echo $html;
627
  }
628
 
629
  /**
@@ -654,7 +631,7 @@ class Control_Manager {
654
  $group_classes = $param['group_classes'];
655
  }
656
 
657
- $html = sprintf('<div class="rmp-input-control-wrapper %s">', $group_classes );
658
 
659
  //Check tooltip text is added or not.
660
  $tool_tip = '';
@@ -668,7 +645,8 @@ class Control_Manager {
668
  if( ! empty( $param['feature_type'] ) ) {
669
  $is_disabled = 'disabled';
670
  $feature_label = sprintf(
671
- '<a target="_blank" class="upgrade-tooltip" href="https://responsive.menu/pricing?utm_source=free-plugin&utm_medium=option&utm_campaign=hide_on_mobile" > %s </a>',
 
672
  $param['feature_type']
673
  );
674
  }
@@ -757,12 +735,7 @@ class Control_Manager {
757
  */
758
  $html = apply_filters( 'rmp_select_control_html', $html, $param );
759
 
760
- // Check if echo parameter is empty or false.
761
- if ( empty( $param['echo'] ) ) {
762
- return $html;
763
- }
764
-
765
- echo $html;
766
  }
767
 
768
  /**
@@ -858,7 +831,7 @@ class Control_Manager {
858
  $group_classes = $param['group_classes'];
859
  }
860
 
861
- $html = sprintf('<div class="rmp-input-control-wrapper %s">', $group_classes );
862
 
863
  //Check tooltip text is added or not.
864
  $tool_tip = '';
@@ -872,7 +845,8 @@ class Control_Manager {
872
  if( ! empty( $param['feature_type'] ) ) {
873
  $is_disabled = 'disabled';
874
  $feature_label = sprintf(
875
- '<a target="_blank" class="upgrade-tooltip" href="https://responsive.menu/pricing?utm_source=free-plugin&utm_medium=option&utm_campaign=hide_on_mobile" > %s </a>',
 
876
  $param['feature_type']
877
  );
878
  }
@@ -953,12 +927,7 @@ class Control_Manager {
953
  */
954
  $html = apply_filters( 'rmp_icon_picker_control_html', $html, $param);
955
 
956
- // Check if echo parameter is empty or false.
957
- if ( empty( $param['echo'] ) ) {
958
- return $html;
959
- }
960
-
961
- echo $html;
962
  }
963
 
964
  /**
@@ -981,7 +950,7 @@ class Control_Manager {
981
  $group_classes = $param['group_classes'];
982
  }
983
 
984
- $html = sprintf('<div class="rmp-input-control-wrapper %s">', $group_classes );
985
 
986
  //Check tooltip text is added or not.
987
  $tool_tip = '';
@@ -1053,12 +1022,7 @@ class Control_Manager {
1053
  */
1054
  $html = apply_filters( 'rmp_add_image_control_html', $html, $param );
1055
 
1056
- // Check if echo parameter is empty or false.
1057
- if ( empty( $param['echo'] ) ) {
1058
- return $html;
1059
- }
1060
-
1061
- echo $html;
1062
  }
1063
 
1064
  /**
@@ -1081,7 +1045,7 @@ class Control_Manager {
1081
  $group_classes = $param['group_classes'];
1082
  }
1083
 
1084
- $html = sprintf('<div class="rmp-input-control-wrapper %s">', $group_classes );
1085
 
1086
  //Check tooltip text is added or not.
1087
  $tool_tip = '';
@@ -1156,12 +1120,7 @@ class Control_Manager {
1156
  */
1157
  $html = apply_filters( 'rmp_add_text_alignment_control_html', $html, $param );
1158
 
1159
- // Check if echo parameter is empty or false.
1160
- if ( empty( $param['echo'] ) ) {
1161
- return $html;
1162
- }
1163
-
1164
- echo $html;
1165
  }
1166
 
1167
  /**
@@ -1240,13 +1199,14 @@ class Control_Manager {
1240
  '<div class="rmp-input-control-wrapper full-size">
1241
  <label class="rmp-input-control-label">
1242
  %s
1243
- <a target="_blank" class="upgrade-tooltip" href="https://responsive.menu/pricing?utm_source=free-plugin&utm_medium=option&utm_campaign=hide_on_mobile" > PRO </a>
1244
  </label>
1245
  <div class="rmp-input-control">
1246
  %s
1247
  </div>
1248
  </div>',
1249
  __('Device Visibility', 'responsive-menu-pro'),
 
1250
  $device_options
1251
  );
1252
  }
@@ -1261,7 +1221,7 @@ class Control_Manager {
1261
  protected function get_device_options() {
1262
  return sprintf(
1263
  '<div class="rmp-device-switcher-holder">
1264
- <a target="_blank" class="upgrade-tooltip" href="https://responsive.menu/pricing?utm_source=free-plugin&utm_medium=option&utm_campaign=hide_on_mobile" > PRO </a>
1265
  <ul class="select rmp-device-switcher" >
1266
  <li data-device="mobile">
1267
  %s
@@ -1274,6 +1234,7 @@ class Control_Manager {
1274
  </li>
1275
  </ul>
1276
  </div>',
 
1277
  file_get_contents( RMP_PLUGIN_PATH_V4 .'/assets/admin/icons/svg/mobile.svg' ),
1278
  file_get_contents( RMP_PLUGIN_PATH_V4 .'/assets/admin/icons/svg/tablet.svg' ),
1279
  file_get_contents( RMP_PLUGIN_PATH_V4 .'/assets/admin/icons/svg/desktop.svg' )
@@ -1303,9 +1264,10 @@ class Control_Manager {
1303
  '<div class="upgrade-options">
1304
  <div class="upgrade-notes">
1305
  <p> %s </p>
1306
- <a target="_blank" href="https://responsive.menu/pricing?utm_source=free-plugin&utm_medium=option&utm_campaign=hide_on_mobile" class="button"> %s </a>
1307
  </div>
1308
  </div>',
 
1309
  __('This feature is not available in free version. <br/> Upgrade now to use', 'responsive-menu-pro'),
1310
  esc_html__('Upgrade to Pro', 'responsive-menu-pro')
1311
  );
24
  class Control_Manager {
25
 
26
  use Singleton;
27
+ static $pro_pricing_url = 'https://responsive.menu/pricing?utm_source=free-plugin&utm_medium=option&utm_campaign=hide_on_mobile';
28
  /**
29
  * Construct method.
30
  */
85
  $group_classes = $param['group_classes'];
86
  }
87
 
88
+ $html = sprintf('<div class="rmp-input-control-wrapper %s">', esc_attr( $group_classes ) );
89
 
90
  //Check tooltip text is added or not.
91
  $tool_tip = '';
99
  if( ! empty( $param['feature_type'] ) ) {
100
  $is_disabled = 'disabled';
101
  $feature_label = sprintf(
102
+ '<a target="_blank" class="upgrade-tooltip" href="%s" > %s </a>',
103
+ esc_url( $this->pro_pricing_url),
104
+ esc_html( $param['feature_type'] )
105
  );
106
  }
107
 
177
  */
178
  $html = apply_filters( 'rmp_text_control_html', $html, $param );
179
 
180
+ return $html;
 
 
 
 
 
181
  }
182
 
183
  /**
208
  $group_classes = $param['group_classes'];
209
  }
210
 
211
+ $html = sprintf('<div class="rmp-input-control-wrapper full-size %s">', esc_attr( $group_classes ) );
212
 
213
  //Check tooltip text is added or not.
214
  $tool_tip = '';
290
  $html = apply_filters( 'rmp_text_control_html', $html, $param );
291
 
292
 
293
+ return $html;
 
 
 
 
 
294
 
295
  }
296
 
391
  $group_classes = $param['group_classes'];
392
  }
393
 
394
+ $html = sprintf('<div class="rmp-input-control-wrapper %s">', esc_attr( $group_classes ) );
395
 
396
  //Check tooltip text is added or not.
397
  $tool_tip = '';
438
  */
439
  $html = apply_filters( 'rmp_color_control_html', $html, $param );
440
 
441
+ return $html;
 
 
 
 
 
442
  }
443
 
444
  /**
467
  $group_classes = $param['group_classes'];
468
  }
469
 
470
+ $html = sprintf( '<div class="rmp-input-control-wrapper %s">', esc_attr( $group_classes ) );
471
 
472
  $html .= '<div class="rmp-input-control">';
473
 
494
  */
495
  $html = apply_filters( 'rmp_button_control_html', $html, $param );
496
 
497
+ return $html;
 
 
 
 
 
498
 
499
  }
500
 
526
  $group_classes = $param['group_classes'];
527
  }
528
 
529
+ $html = sprintf('<div class="rmp-input-control-wrapper rmp-input-control-switcher %s">' , esc_attr( $group_classes ) );
530
 
531
  //Check tooltip text is added or not.
532
  $tool_tip = '';
540
  if( ! empty( $param['feature_type'] ) ) {
541
  $is_disabled = 'disabled';
542
  $feature_label = sprintf(
543
+ '<a target="_blank" class="upgrade-tooltip" href="%s" > %s </a>',
544
+ esc_url( $this->pro_pricing_url ),
545
  $param['feature_type']
546
  );
547
  }
600
  */
601
  $html = apply_filters( 'rmp_switcher_control_html', $html, $param );
602
 
603
+ return $html;
 
 
 
 
 
604
  }
605
 
606
  /**
631
  $group_classes = $param['group_classes'];
632
  }
633
 
634
+ $html = sprintf('<div class="rmp-input-control-wrapper %s">' , esc_attr( $group_classes ) );
635
 
636
  //Check tooltip text is added or not.
637
  $tool_tip = '';
645
  if( ! empty( $param['feature_type'] ) ) {
646
  $is_disabled = 'disabled';
647
  $feature_label = sprintf(
648
+ '<a target="_blank" class="upgrade-tooltip" href="%s" > %s </a>',
649
+ esc_url($this->pro_pricing_url),
650
  $param['feature_type']
651
  );
652
  }
735
  */
736
  $html = apply_filters( 'rmp_select_control_html', $html, $param );
737
 
738
+ return $html;
 
 
 
 
 
739
  }
740
 
741
  /**
831
  $group_classes = $param['group_classes'];
832
  }
833
 
834
+ $html = sprintf('<div class="rmp-input-control-wrapper %s">' , esc_attr( $group_classes ) );
835
 
836
  //Check tooltip text is added or not.
837
  $tool_tip = '';
845
  if( ! empty( $param['feature_type'] ) ) {
846
  $is_disabled = 'disabled';
847
  $feature_label = sprintf(
848
+ '<a target="_blank" class="upgrade-tooltip" href="%s" > %s </a>',
849
+ esc_attr($this->pro_pricing_url),
850
  $param['feature_type']
851
  );
852
  }
927
  */
928
  $html = apply_filters( 'rmp_icon_picker_control_html', $html, $param);
929
 
930
+ return $html;
 
 
 
 
 
931
  }
932
 
933
  /**
950
  $group_classes = $param['group_classes'];
951
  }
952
 
953
+ $html = sprintf('<div class="rmp-input-control-wrapper %s">' , esc_attr( $group_classes ) );
954
 
955
  //Check tooltip text is added or not.
956
  $tool_tip = '';
1022
  */
1023
  $html = apply_filters( 'rmp_add_image_control_html', $html, $param );
1024
 
1025
+ return $html;
 
 
 
 
 
1026
  }
1027
 
1028
  /**
1045
  $group_classes = $param['group_classes'];
1046
  }
1047
 
1048
+ $html = sprintf('<div class="rmp-input-control-wrapper %s">' , esc_attr( $group_classes ) );
1049
 
1050
  //Check tooltip text is added or not.
1051
  $tool_tip = '';
1120
  */
1121
  $html = apply_filters( 'rmp_add_text_alignment_control_html', $html, $param );
1122
 
1123
+ return $html;
 
 
 
 
 
1124
  }
1125
 
1126
  /**
1199
  '<div class="rmp-input-control-wrapper full-size">
1200
  <label class="rmp-input-control-label">
1201
  %s
1202
+ <a target="_blank" class="upgrade-tooltip" href="%s" > PRO </a>
1203
  </label>
1204
  <div class="rmp-input-control">
1205
  %s
1206
  </div>
1207
  </div>',
1208
  __('Device Visibility', 'responsive-menu-pro'),
1209
+ esc_url( $this->pro_pricing_url ),
1210
  $device_options
1211
  );
1212
  }
1221
  protected function get_device_options() {
1222
  return sprintf(
1223
  '<div class="rmp-device-switcher-holder">
1224
+ <a target="_blank" class="upgrade-tooltip" href="%s" > PRO </a>
1225
  <ul class="select rmp-device-switcher" >
1226
  <li data-device="mobile">
1227
  %s
1234
  </li>
1235
  </ul>
1236
  </div>',
1237
+ esc_url( $this->pro_pricing_url ),
1238
  file_get_contents( RMP_PLUGIN_PATH_V4 .'/assets/admin/icons/svg/mobile.svg' ),
1239
  file_get_contents( RMP_PLUGIN_PATH_V4 .'/assets/admin/icons/svg/tablet.svg' ),
1240
  file_get_contents( RMP_PLUGIN_PATH_V4 .'/assets/admin/icons/svg/desktop.svg' )
1264
  '<div class="upgrade-options">
1265
  <div class="upgrade-notes">
1266
  <p> %s </p>
1267
+ <a target="_blank" href="%s" class="button"> %s </a>
1268
  </div>
1269
  </div>',
1270
+ esc_url( $this->pro_pricing_url ),
1271
  __('This feature is not available in free version. <br/> Upgrade now to use', 'responsive-menu-pro'),
1272
  esc_html__('Upgrade to Pro', 'responsive-menu-pro')
1273
  );
v4.0.0/inc/classes/class-editor-manager.php CHANGED
@@ -2,10 +2,10 @@
2
  /**
3
  * Editor_Manager class.
4
  * This class is responsible for editing the menu functionality.
5
- *
6
  * @version 4.0.0
7
  * @author Expresstech System
8
- *
9
  * @package responsive-menu-pro
10
  */
11
 
@@ -37,7 +37,7 @@ class Editor_Manager {
37
  * To setup action/filter.
38
  *
39
  * @version 4.0.0
40
- *
41
  * @return void
42
  */
43
  protected function setup_hooks() {
@@ -54,9 +54,9 @@ class Editor_Manager {
54
 
55
  /**
56
  * This function save the settings and meta of mega menu item.
57
- *
58
  * @version 4.0.0
59
- *
60
  * @return json
61
  */
62
  public function rmp_save_mega_menu_item() {
@@ -70,7 +70,7 @@ class Editor_Manager {
70
 
71
  $menu_id = sanitize_text_field( $_POST['menu_id'] );
72
  if ( empty( $menu_id ) ) {
73
- wp_send_json_error(
74
  [ 'message' => __( 'Menu ID missing !', 'responsive-menu-pro' )]);
75
  }
76
 
@@ -83,16 +83,16 @@ class Editor_Manager {
83
  // Don't forget to sanitize the data using recursive.
84
  if ( is_array( $_POST['item_meta'] ) ) {
85
 
86
- $item_meta = $_POST['item_meta'];
87
  }
88
 
89
  update_post_meta( $menu_id, '_rmp_mega_menu_'. $item_id, $item_meta );
90
 
91
  /**
92
  * Fires when mega menu item settings update.
93
- *
94
- * @version 4.0.0
95
- *
96
  * @param int $menu_id Menu Id.
97
  * @param int $item_id Item ID for which mega menu settings are updated
98
  * @param array $item_meta List of mega menu settings of an item.
@@ -105,9 +105,9 @@ class Editor_Manager {
105
 
106
  /**
107
  * Function to update the enable option of mega menu item.
108
- *
109
  * @version 4.0.0
110
- *
111
  * @return json
112
  */
113
  public function enable_mega_menu_item() {
@@ -128,7 +128,7 @@ class Editor_Manager {
128
  wp_send_json_success( [ 'message' => __( 'Success', 'responsive-menu-pro' ) ] );
129
  }
130
 
131
- wp_send_json_error(
132
  [ 'message' => __( 'Menu not found', 'responsive-menu-pro' ) ]
133
  );
134
 
@@ -138,7 +138,7 @@ class Editor_Manager {
138
  * This function saved the menu options when click update in the menu editor.
139
  *
140
  * @since 4.0.0
141
- *
142
  * @return json
143
  */
144
  public function rmp_save_options() {
@@ -146,7 +146,8 @@ class Editor_Manager {
146
  check_ajax_referer( 'rmp_nonce', 'ajax_nonce' );
147
 
148
  $options = [];
149
- parse_str( $_POST['form'], $options );
 
150
 
151
  $menu_id = sanitize_text_field( $options['menu_id'] );
152
  if ( empty( $menu_id ) ) {
@@ -162,7 +163,7 @@ class Editor_Manager {
162
 
163
  /**
164
  * Fires when saved the options.
165
- *
166
  * @version 4.0.0
167
  * @param int $menu_id Menu ID.
168
  */
2
  /**
3
  * Editor_Manager class.
4
  * This class is responsible for editing the menu functionality.
5
+ *
6
  * @version 4.0.0
7
  * @author Expresstech System
8
+ *
9
  * @package responsive-menu-pro
10
  */
11
 
37
  * To setup action/filter.
38
  *
39
  * @version 4.0.0
40
+ *
41
  * @return void
42
  */
43
  protected function setup_hooks() {
54
 
55
  /**
56
  * This function save the settings and meta of mega menu item.
57
+ *
58
  * @version 4.0.0
59
+ *
60
  * @return json
61
  */
62
  public function rmp_save_mega_menu_item() {
70
 
71
  $menu_id = sanitize_text_field( $_POST['menu_id'] );
72
  if ( empty( $menu_id ) ) {
73
+ wp_send_json_error(
74
  [ 'message' => __( 'Menu ID missing !', 'responsive-menu-pro' )]);
75
  }
76
 
83
  // Don't forget to sanitize the data using recursive.
84
  if ( is_array( $_POST['item_meta'] ) ) {
85
 
86
+ $item_meta = intval( $_POST['item_meta'] );
87
  }
88
 
89
  update_post_meta( $menu_id, '_rmp_mega_menu_'. $item_id, $item_meta );
90
 
91
  /**
92
  * Fires when mega menu item settings update.
93
+ *
94
+ * @version 4.0.0
95
+ *
96
  * @param int $menu_id Menu Id.
97
  * @param int $item_id Item ID for which mega menu settings are updated
98
  * @param array $item_meta List of mega menu settings of an item.
105
 
106
  /**
107
  * Function to update the enable option of mega menu item.
108
+ *
109
  * @version 4.0.0
110
+ *
111
  * @return json
112
  */
113
  public function enable_mega_menu_item() {
128
  wp_send_json_success( [ 'message' => __( 'Success', 'responsive-menu-pro' ) ] );
129
  }
130
 
131
+ wp_send_json_error(
132
  [ 'message' => __( 'Menu not found', 'responsive-menu-pro' ) ]
133
  );
134
 
138
  * This function saved the menu options when click update in the menu editor.
139
  *
140
  * @since 4.0.0
141
+ *
142
  * @return json
143
  */
144
  public function rmp_save_options() {
146
  check_ajax_referer( 'rmp_nonce', 'ajax_nonce' );
147
 
148
  $options = [];
149
+ $form_data = $_POST['form'];
150
+ parse_str( $form_data, $options );
151
 
152
  $menu_id = sanitize_text_field( $options['menu_id'] );
153
  if ( empty( $menu_id ) ) {
163
 
164
  /**
165
  * Fires when saved the options.
166
+ *
167
  * @version 4.0.0
168
  * @param int $menu_id Menu ID.
169
  */
v4.0.0/inc/classes/class-plugin.php CHANGED
@@ -72,7 +72,7 @@ class Plugin {
72
  //Check post type.
73
  $post_type = get_post_type();
74
  if ( empty( $post_type ) && ! empty( $_GET['post_type'] ) ) {
75
- $post_type = $_GET['post_type'];
76
  }
77
 
78
  if ( 'rmp_menu' !== $post_type || ! empty( $_GET['page'] ) ) {
@@ -107,7 +107,7 @@ class Plugin {
107
  * Add plugin upgrade link.
108
  *
109
  * Add a link to the settings page on the responsive menu page.
110
- *
111
  * @param array $links List of existing plugin action links.
112
  * @return array List of modified plugin action links.
113
  */
@@ -123,15 +123,15 @@ class Plugin {
123
 
124
  /**
125
  * Function to add the admin notice to upgrade as pro.
126
- *
127
  * @version 4.1.0
128
- *
129
  */
130
  public function rmp_upgrade_pro_admin_notice() {
131
 
132
- $post_type = get_post_type();
133
  if ( empty( $post_type ) && ! empty( $_GET['post_type'] ) ) {
134
- $post_type = $_GET['post_type'];
135
  }
136
 
137
  if ( 'rmp_menu' !== $post_type ) {
@@ -156,7 +156,7 @@ class Plugin {
156
 
157
  /**
158
  * Function to show the admin notice if plugin deactivate.
159
- *
160
  * @return void
161
  */
162
  public function rmp_deactivate_paid_version_notice() {
@@ -165,7 +165,7 @@ class Plugin {
165
  '<div class="notice notice-error is-dismissible">
166
  <p>%s</p>
167
  </div>',
168
- __('Responsive Menu has been deactivated','responsive-menu-pro' )
169
  );
170
  delete_transient( 'og-admin-notice-activation-pro' );
171
  }
@@ -173,9 +173,9 @@ class Plugin {
173
 
174
  /**
175
  * Load plugin text domain.
176
- *
177
  * @version 4.0.0
178
- *
179
  * @return void
180
  */
181
  public function rmp_load_plugin_text_domain() {
@@ -184,22 +184,22 @@ class Plugin {
184
 
185
  /**
186
  * Function to render the nenu on frontend.
187
- *
188
  * @version 4.0.0
189
  */
190
  function menu_render_on_frontend() {
191
 
192
  $option_manager = Option_Manager::get_instance();
193
  $menu_ids = get_all_rmp_menu_ids();
194
-
195
  if ( empty( $menu_ids ) ) {
196
  return;
197
  }
198
-
199
  foreach ( $menu_ids as $menu_id ) {
200
 
201
  $menu_show_on = $option_manager->get_option( $menu_id, 'menu_display_on' );
202
-
203
  if ( ! empty( $menu_show_on ) && 'shortcode' === $menu_show_on ) {
204
  continue;
205
  }
@@ -211,9 +211,9 @@ class Plugin {
211
 
212
  /**
213
  * Check support of wp_body_open for plugins and themes.
214
- *
215
  * @since 4.0.0
216
- *
217
  * @param string $hook Name of hook.
218
  * @return boolean
219
  */
72
  //Check post type.
73
  $post_type = get_post_type();
74
  if ( empty( $post_type ) && ! empty( $_GET['post_type'] ) ) {
75
+ $post_type = intval( $_GET['post_type'] );
76
  }
77
 
78
  if ( 'rmp_menu' !== $post_type || ! empty( $_GET['page'] ) ) {
107
  * Add plugin upgrade link.
108
  *
109
  * Add a link to the settings page on the responsive menu page.
110
+ *
111
  * @param array $links List of existing plugin action links.
112
  * @return array List of modified plugin action links.
113
  */
123
 
124
  /**
125
  * Function to add the admin notice to upgrade as pro.
126
+ *
127
  * @version 4.1.0
128
+ *
129
  */
130
  public function rmp_upgrade_pro_admin_notice() {
131
 
132
+ $post_type = get_post_type();
133
  if ( empty( $post_type ) && ! empty( $_GET['post_type'] ) ) {
134
+ $post_type = intval( $_GET['post_type'] );
135
  }
136
 
137
  if ( 'rmp_menu' !== $post_type ) {
156
 
157
  /**
158
  * Function to show the admin notice if plugin deactivate.
159
+ *
160
  * @return void
161
  */
162
  public function rmp_deactivate_paid_version_notice() {
165
  '<div class="notice notice-error is-dismissible">
166
  <p>%s</p>
167
  </div>',
168
+ __('Responsive Menu has been deactivated','responsive-menu-pro' )
169
  );
170
  delete_transient( 'og-admin-notice-activation-pro' );
171
  }
173
 
174
  /**
175
  * Load plugin text domain.
176
+ *
177
  * @version 4.0.0
178
+ *
179
  * @return void
180
  */
181
  public function rmp_load_plugin_text_domain() {
184
 
185
  /**
186
  * Function to render the nenu on frontend.
187
+ *
188
  * @version 4.0.0
189
  */
190
  function menu_render_on_frontend() {
191
 
192
  $option_manager = Option_Manager::get_instance();
193
  $menu_ids = get_all_rmp_menu_ids();
194
+
195
  if ( empty( $menu_ids ) ) {
196
  return;
197
  }
198
+
199
  foreach ( $menu_ids as $menu_id ) {
200
 
201
  $menu_show_on = $option_manager->get_option( $menu_id, 'menu_display_on' );
202
+
203
  if ( ! empty( $menu_show_on ) && 'shortcode' === $menu_show_on ) {
204
  continue;
205
  }
211
 
212
  /**
213
  * Check support of wp_body_open for plugins and themes.
214
+ *
215
  * @since 4.0.0
216
+ *
217
  * @param string $hook Name of hook.
218
  * @return boolean
219
  */
v4.0.0/inc/classes/class-preview.php CHANGED
@@ -2,10 +2,10 @@
2
  /**
3
  * Preview class.
4
  * This class is responsible for preview related functionality.
5
- *
6
  * @version 4.0.0
7
  * @author Expresstech System
8
- *
9
  * @package responsive-menu-pro
10
  */
11
 
@@ -37,7 +37,7 @@ class Preview {
37
  * To setup action/filter.
38
  *
39
  * @version 4.0.0
40
- *
41
  * @return void
42
  */
43
  protected function setup_hooks() {
@@ -46,15 +46,15 @@ class Preview {
46
 
47
  /**
48
  * This function get the content of menu item for live preview element.
49
- *
50
  * @return HTML
51
  */
52
  public function enable_menu_item() {
53
 
54
  check_ajax_referer( 'rmp_nonce', 'ajax_nonce' );
55
 
56
- $menu_id = $_POST['menu_id'];
57
- $menu_element = $_POST['menu_element'];
58
  $menu = new RMP_Menu($menu_id);
59
 
60
  if ( $menu_element === 'menu' ) {
2
  /**
3
  * Preview class.
4
  * This class is responsible for preview related functionality.
5
+ *
6
  * @version 4.0.0
7
  * @author Expresstech System
8
+ *
9
  * @package responsive-menu-pro
10
  */
11
 
37
  * To setup action/filter.
38
  *
39
  * @version 4.0.0
40
+ *
41
  * @return void
42
  */
43
  protected function setup_hooks() {
46
 
47
  /**
48
  * This function get the content of menu item for live preview element.
49
+ *
50
  * @return HTML
51
  */
52
  public function enable_menu_item() {
53
 
54
  check_ajax_referer( 'rmp_nonce', 'ajax_nonce' );
55
 
56
+ $menu_id = intval( $_POST['menu_id'] );
57
+ $menu_element = intval( $_POST['menu_element'] );
58
  $menu = new RMP_Menu($menu_id);
59
 
60
  if ( $menu_element === 'menu' ) {
v4.0.0/inc/classes/class-rmp-menu.php CHANGED
@@ -102,7 +102,7 @@ if ( ! class_exists( 'RMP_Menu' ) ) :
102
 
103
  $html = sprintf( '%s<div id="rmp-container-%s" class="rmp-container %s">%s</div>',
104
  $menu_switcher,
105
- $this->menu_id,
106
  esc_attr( $menu_container_classes ),
107
  $html
108
  );
102
 
103
  $html = sprintf( '%s<div id="rmp-container-%s" class="rmp-container %s">%s</div>',
104
  $menu_switcher,
105
+ esc_attr( $this->menu_id ),
106
  esc_attr( $menu_container_classes ),
107
  $html
108
  );
v4.0.0/inc/classes/class-style-manager.php CHANGED
@@ -20,20 +20,20 @@ if ( ! defined( 'ABSPATH' ) ) {
20
 
21
  /**
22
  * Class Style_Manager
23
- *
24
  * This class is responsible for handle the styling from frontend.
25
- *
26
  * @version 4.0.0
27
  */
28
  class Style_Manager {
29
 
30
  use Singleton;
31
-
32
  /**
33
  * Instance of option manager class.
34
- *
35
  * @version 4.0.0
36
- *
37
  * @var array $option_manager.
38
  */
39
  protected $option_manager;
@@ -50,19 +50,19 @@ class Style_Manager {
50
  * To setup action/filter.
51
  *
52
  * @version 4.0.0
53
- *
54
  * @return void
55
  */
56
  protected function setup_hooks() {
57
 
58
- add_action( 'wp_head', array( $this , 'enqueue_styles_as_inline' ) );
59
  add_action( 'wp_enqueue_scripts', array( $this , 'add_rmp_menu_frontend_scripts' ) );
60
  add_action( 'rmp_create_new_menu', array( $this , 'save_style_css_on_file' ), 10 , 0 );
61
  add_action( 'rmp_save_menu', array( $this , 'save_style_css_on_file' ), 10, 0 );
62
  add_action( 'rmp_update_mega_menu_item', array( $this , 'save_style_css_on_file' ), 10, 0 );
63
  add_action( 'rmp_save_global_settings', array( $this , 'save_style_css_on_file' ), 10, 0 );
64
  add_action( 'rmp_theme_apply', array( $this , 'save_style_css_on_file' ), 10, 0 );
65
- add_action( 'rmp_migrate_menu_style', [ $this , 'save_style_css_on_file' ], 10, 0 );
66
  add_action( 'rmp_import_menu', [ $this , 'save_style_css_on_file' ], 10, 0 );
67
 
68
  // Hide adminbar.
@@ -73,7 +73,7 @@ class Style_Manager {
73
 
74
  /**
75
  * Function to call the css generate for all menu one by one.
76
- *
77
  * @return string $css
78
  */
79
  public function get_menus_scss_to_css() {
@@ -95,7 +95,7 @@ class Style_Manager {
95
  $css .= $this->option_manager->get_global_option( 'rmp_custom_css' );
96
 
97
  //If minify is enable from settings then minify the style css.
98
- if ( 'on' === $this->option_manager->get_global_option( 'rmp_minify_scripts' ) ) {
99
  $css = $this->minify( $css );
100
  }
101
 
@@ -116,7 +116,7 @@ class Style_Manager {
116
 
117
  $upload_dir = wp_upload_dir();
118
 
119
- $dir = trailingslashit( $upload_dir['basedir'] ) . 'rmp-menu/css/';
120
 
121
  if ( ! $wp_filesystem->is_dir( $dir ) ) {
122
  wp_mkdir_p( $dir );
@@ -161,9 +161,9 @@ class Style_Manager {
161
 
162
  /**
163
  * Function to minify the css to reduce the file size.
164
- *
165
  * @param string $row_css
166
- *
167
  * @return string $minified
168
  */
169
  public function minify( $row_css ) {
@@ -184,13 +184,13 @@ class Style_Manager {
184
 
185
  /**
186
  * Function to combine the options of all the menus.
187
- *
188
  * @version 4.0.0
189
- *
190
  * @return array $options;
191
  */
192
  public function get_all_menu_options() {
193
- $menu_ids = get_all_rmp_menu_ids();
194
  $menu_options = [];
195
 
196
  foreach ( $menu_ids as $menu_id ) {
@@ -206,9 +206,9 @@ class Style_Manager {
206
 
207
  /**
208
  * Function get the active item toggle icon.
209
- *
210
  * @version 4.0.0
211
- *
212
  * @param array options
213
  * @return HTML
214
  */
@@ -290,7 +290,7 @@ class Style_Manager {
290
 
291
  /**
292
  * Fires after frontend scripts are enqueued.
293
- *
294
  * @since 4.0.4
295
  */
296
  do_action( 'after_rmp_enqueue_frontend_scripts' );
@@ -298,7 +298,7 @@ class Style_Manager {
298
 
299
  /**
300
  * This function enqueue inline the menu style css.
301
- *
302
  * @version 4.0.0
303
  */
304
  public function enqueue_styles_as_inline() {
@@ -308,14 +308,16 @@ class Style_Manager {
308
  }
309
 
310
  $css = $this->get_menus_scss_to_css();
311
- echo '<style id="rmp-inline-menu-styles">'. $css . '</style>';
 
 
312
  }
313
 
314
  /**
315
  * This function convert the scss to css for menu.
316
- *
317
  * @param int $menu_id This is menu id for which converting the scss to css.
318
- *
319
  * @return string|WP_Error
320
  */
321
  public function get_css_for_menu( $menu_id ) {
@@ -588,7 +590,7 @@ class Style_Manager {
588
  $menu_title_section_padding_bottom = $options['menu_title_section_padding']['bottom'];
589
  }
590
 
591
-
592
  $menu_title_background = '';
593
  if ( ! empty( $options['menu_title_background_colour'] ) ) {
594
  $menu_title_background = $options['menu_title_background_colour'];
@@ -885,7 +887,7 @@ class Style_Manager {
885
  $menu_item_padding_unit = $options['menu_depth_0_unit'];
886
  }
887
 
888
-
889
 
890
  $menu_depth_side = '';
891
  if ( ! empty( $options['menu_depth_side'] ) ) {
@@ -1031,7 +1033,7 @@ class Style_Manager {
1031
  if ( ! empty( $options['submenu_links_height'] ) ) {
1032
  $submenu_item_height = $options['submenu_links_height'];
1033
  }
1034
-
1035
  $submenu_item_height_unit = '';
1036
  if ( ! empty( $options['submenu_links_height_unit'] ) ) {
1037
  $submenu_item_height = $options['submenu_links_height_unit'];
@@ -1329,8 +1331,8 @@ class Style_Manager {
1329
  'menu_title_background_hover' => $menu_title_background_hover,
1330
  'menu_title_font_color' => $menu_title_font_color,
1331
  'menu_title_font_color_hover' => $menu_title_font_color_hover,
1332
- 'menu_title_font_size' => $menu_title_font_size,
1333
- 'menu_title_image_width' => $menu_title_image_width,
1334
  'menu_title_image_height' => $menu_title_image_height,
1335
  'menu_title_text_alignment' => $menu_title_text_alignment,
1336
  'menu_title_section_padding_left' => $menu_title_section_padding_left,
@@ -1350,7 +1352,7 @@ class Style_Manager {
1350
  'menu_container_background_image' => "'" . $menu_container_background_image . "'",
1351
  'menu_container_appear_from' => $menu_container_appear_from,
1352
  'page_wrapper' => $page_wrapper,
1353
- 'menu_to_hide' => $menu_to_hide,
1354
  'menu_container_padding_left' => $menu_container_padding_left,
1355
  'menu_container_padding_top' => $menu_container_padding_top,
1356
  'menu_container_padding_bottom' => $menu_container_padding_bottom,
@@ -1482,9 +1484,9 @@ class Style_Manager {
1482
 
1483
  /**
1484
  * Apply before parse the scss to css.
1485
- *
1486
  * @since 4.1.0
1487
- *
1488
  * @param array $parse_options Parsed menu settings.
1489
  * @param int $menu_id Menu Id.
1490
  * @param array $options Menu options array.
@@ -1498,9 +1500,9 @@ class Style_Manager {
1498
 
1499
  /**
1500
  * Apply after parsed the scss to css.
1501
- *
1502
  * @since 4.1.0
1503
- *
1504
  * @param string $css Compiled CSS.
1505
  * @param int $menu_id Menu Id.
1506
  * @param array $parse_options Parsed menu settings.
@@ -1510,7 +1512,7 @@ class Style_Manager {
1510
 
1511
  return $css;
1512
  }
1513
-
1514
 
1515
  catch ( Exception $e ) {
1516
  return new \WP_Error( "Warning: Menu style scss compile failed <br/> <br />" . $e->getMessage() );
@@ -1525,7 +1527,7 @@ class Style_Manager {
1525
  public function get_common_scss_to_css() {
1526
  try {
1527
 
1528
-
1529
  $menu_adjust_for_wp_admin_bar = $this->option_manager->get_global_option( 'menu_adjust_for_wp_admin_bar' );
1530
 
1531
  $options = [
20
 
21
  /**
22
  * Class Style_Manager
23
+ *
24
  * This class is responsible for handle the styling from frontend.
25
+ *
26
  * @version 4.0.0
27
  */
28
  class Style_Manager {
29
 
30
  use Singleton;
31
+
32
  /**
33
  * Instance of option manager class.
34
+ *
35
  * @version 4.0.0
36
+ *
37
  * @var array $option_manager.
38
  */
39
  protected $option_manager;
50
  * To setup action/filter.
51
  *
52
  * @version 4.0.0
53
+ *
54
  * @return void
55
  */
56
  protected function setup_hooks() {
57
 
58
+ add_action( 'wp_enqueue_scripts', array( $this , 'enqueue_styles_as_inline' ) );
59
  add_action( 'wp_enqueue_scripts', array( $this , 'add_rmp_menu_frontend_scripts' ) );
60
  add_action( 'rmp_create_new_menu', array( $this , 'save_style_css_on_file' ), 10 , 0 );
61
  add_action( 'rmp_save_menu', array( $this , 'save_style_css_on_file' ), 10, 0 );
62
  add_action( 'rmp_update_mega_menu_item', array( $this , 'save_style_css_on_file' ), 10, 0 );
63
  add_action( 'rmp_save_global_settings', array( $this , 'save_style_css_on_file' ), 10, 0 );
64
  add_action( 'rmp_theme_apply', array( $this , 'save_style_css_on_file' ), 10, 0 );
65
+ add_action( 'rmp_migrate_menu_style', [ $this , 'save_style_css_on_file' ], 10, 0 );
66
  add_action( 'rmp_import_menu', [ $this , 'save_style_css_on_file' ], 10, 0 );
67
 
68
  // Hide adminbar.
73
 
74
  /**
75
  * Function to call the css generate for all menu one by one.
76
+ *
77
  * @return string $css
78
  */
79
  public function get_menus_scss_to_css() {
95
  $css .= $this->option_manager->get_global_option( 'rmp_custom_css' );
96
 
97
  //If minify is enable from settings then minify the style css.
98
+ if ( 'on' === $this->option_manager->get_global_option( 'rmp_minify_scripts' ) ) {
99
  $css = $this->minify( $css );
100
  }
101
 
116
 
117
  $upload_dir = wp_upload_dir();
118
 
119
+ $dir = trailingslashit( $upload_dir['basedir'] ) . 'rmp-menu/css/';
120
 
121
  if ( ! $wp_filesystem->is_dir( $dir ) ) {
122
  wp_mkdir_p( $dir );
161
 
162
  /**
163
  * Function to minify the css to reduce the file size.
164
+ *
165
  * @param string $row_css
166
+ *
167
  * @return string $minified
168
  */
169
  public function minify( $row_css ) {
184
 
185
  /**
186
  * Function to combine the options of all the menus.
187
+ *
188
  * @version 4.0.0
189
+ *
190
  * @return array $options;
191
  */
192
  public function get_all_menu_options() {
193
+ $menu_ids = get_all_rmp_menu_ids();
194
  $menu_options = [];
195
 
196
  foreach ( $menu_ids as $menu_id ) {
206
 
207
  /**
208
  * Function get the active item toggle icon.
209
+ *
210
  * @version 4.0.0
211
+ *
212
  * @param array options
213
  * @return HTML
214
  */
290
 
291
  /**
292
  * Fires after frontend scripts are enqueued.
293
+ *
294
  * @since 4.0.4
295
  */
296
  do_action( 'after_rmp_enqueue_frontend_scripts' );
298
 
299
  /**
300
  * This function enqueue inline the menu style css.
301
+ *
302
  * @version 4.0.0
303
  */
304
  public function enqueue_styles_as_inline() {
308